* {
    font-family: 'Poppins', sans-serif;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #00ccff;
    overflow: hidden;
    position: relative;
    background-image: url(http://localhost/PANJAT%20PINANG/img/bg-17an.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.phone-container {
    width: 500px;
    height: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.image-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.phone-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
}

.hadiah {
    height: 40vh;
    margin-top: 25vh;
    margin-right: 5%;
    margin-left: 5%;
    z-index: 1;
    position: relative;
}


.music-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 24px;
    z-index: 2;
    cursor: pointer;
}

.info-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 24px;
    z-index: 2;
    cursor: pointer;
}

.button-container {
    margin-top: auto;
    margin-bottom: 5%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    z-index: 1;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}


.control-button {
    width: 100%;
    padding: 10px 20px;
    font-size: clamp(10px, 2vw, 14px);
    cursor: pointer;
    background: linear-gradient(180deg, #fff600, #ff9600);
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 5px;
}

.side-button {
    width: calc(50% - 5px);
}

.control-button:first-child {
    width: 100%;
}

.control-button:hover {
    background: linear-gradient(0deg, #fff600, #ff9600);
}


.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    margin-top: 25vh;
    position: relative;
    width: 300px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
}

.popup h2 {
    text-align: center;
    margin-bottom: 20px;
}

#kuponInput {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(180deg, #fff600, #ff9600);
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: linear-gradient(180deg, #ff9600, #fff600);
}


/* list hadiah */

.hadiah-list {
    max-height: 400px;
    overflow-y: auto;
}

.hadiah-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.hadiah-item:last-child {
    border-bottom: none;
}

.popup-content {
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
}

.message-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    width: 70%;
    max-width: 400px;
}

.prize-card {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.prize-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.prize-content button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.gift-item {
    position: absolute;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    z-index: 2;
    animation: jitter 1s infinite;
}

.gift-item.gift-selected {
    position: fixed !important;
}

@keyframes jitter {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-52%, -48%) rotate(-3deg); }
    50% { transform: translate(-50%, -52%) rotate(0deg); }
    75% { transform: translate(-48%, -48%) rotate(3deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

/* Make each gift have slightly different animation timing */
.gift-item:nth-child(2n) {
    animation-delay: 0.2s;
}
.gift-item:nth-child(3n) {
    animation-delay: 0.3s;
}
.gift-item:nth-child(4n) {
    animation-delay: 0.4s;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOutScale {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
}



@keyframes giftReveal {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(0, 0) scale(1.2) rotate(5deg);
    }
    40% {
        transform: translate(0, 0) scale(1.8) rotate(-5deg);
    }
    60% {
        transform: translate(0, 0) scale(2.2) rotate(5deg);
    }
    80% {
        transform: translate(0, 0) scale(2.8) rotate(-3deg);
    }
    90% {
        transform: translate(0, 0) scale(3.2) rotate(2deg);
    }
    100% {
        transform: translate(0, 0) scale(3.5) rotate(0deg);
        top: 50%;
        left: 50%;
    }
}

.gift-selected {
    position: fixed !important;
    z-index: 999 !important;
    animation: giftReveal 3.5s forwards, shake 0.1s infinite;
}

@keyframes shake {
    0% { transform: translate(-50%, -50%) scale(3) rotate(-5deg); }
    25% { transform: translate(-50%, -50%) scale(3) rotate(5deg); }
    50% { transform: translate(-52%, -48%) scale(3) rotate(-7deg); }
    75% { transform: translate(-48%, -52%) scale(3) rotate(7deg); }
    100% { transform: translate(-50%, -50%) scale(3) rotate(-5deg); }
}


/* Fireworks */
.fireworkss {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Panjat Pinang Animation */
.climbing-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 17%;
    width: 80px;
    height: 80px;
    z-index: 1000;
    display: none;
}

.climbing-gif {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.climbing-animation {
    animation: climbUp 5s ease-in-out forwards;
}

@keyframes climbUp {
    0% {
        bottom: 17%;
        opacity: 1;
    }
    50% {
        bottom: 42%;
        opacity: 1;
    }
    100% {
        bottom: 65%;
        opacity: 0.8;
    }
}

/* Animation overlay */
.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    display: none;
}



/* Money Animation */
.money-container {
    position: fixed;
    left: 50%;
    bottom: 65%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    z-index: 1001;
    display: none;
}

.money-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px #ffd700);
}

.money-animation {
    animation: moneySequence 4s ease-in-out forwards;
}

@keyframes moneySequence {
    0% {
        transform: translateX(-50%) translateY(0) scale(0.3) rotate(0deg);
        filter: drop-shadow(0 0 15px #ffd700);
    }
    10% {
        transform: translateX(-50%) translateY(30px) translateX(-8px) scale(0.5) rotate(-3deg);
        filter: drop-shadow(0 0 25px #ffd700);
    }
    20% {
        transform: translateX(-50%) translateY(60px) translateX(8px) scale(0.7) rotate(0deg);
        filter: drop-shadow(0 0 35px #ffd700);
    }
    30% {
        transform: translateX(-50%) translateY(90px) translateX(-6px) scale(0.9) rotate(3deg);
        filter: drop-shadow(0 0 45px #ffd700);
    }
    40% {
        transform: translateX(-50%) translateY(120px) translateX(6px) scale(1.1) rotate(0deg);
        filter: drop-shadow(0 0 55px #ffd700);
    }
    50% {
        transform: translateX(-50%) translateY(150px) translateX(-4px) scale(1.3) rotate(-3deg);
        filter: drop-shadow(0 0 65px #ffd700);
    }
    60% {
        transform: translateX(-50%) translateY(180px) translateX(4px) scale(1.5) rotate(0deg);
        filter: drop-shadow(0 0 75px #ffd700);
    }
    70% {
        transform: translateX(-50%) translateY(200px) translateX(-3px) scale(1.7) rotate(3deg);
        filter: drop-shadow(0 0 85px #ffd700);
    }
    80% {
        transform: translateX(-50%) translateY(220px) translateX(3px) scale(1.9) rotate(0deg);
        filter: drop-shadow(0 0 95px #ffd700);
    }
    90% {
        transform: translateX(-50%) translateY(240px) translateX(-2px) scale(2.1) rotate(-3deg);
        filter: drop-shadow(0 0 105px #ffd700);
    }
    100% {
        transform: translateX(-50%) translateY(260px) scale(2.3) rotate(0deg);
        filter: drop-shadow(0 0 120px #ffd700);
    }
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 10px #ffd700); }
    50% { filter: drop-shadow(0 0 30px #ffff00); }
}

@media screen and (max-width: 750px) {
    .phone-container {
        width: 100%;
        height: 100%;
    }

    .button-container {
        margin-bottom: 30px;
        width: 90%;
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    body {
        height: 100vh;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}
