* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #020718;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #072670 0%, #01081a 100%);
    overflow: hidden;
}

/* Default / Mobile: Full screen edge-to-edge, zero empty space */
.wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
}

/* Desktop: Screen width > 550px constraint to 550px mobile preview card */
@media (min-width: 551px) {
    .container {
        align-items: center;
        justify-content: center;
    }

    .wrapper {
        width: min(550px, calc(100vh * 576 / 1024));
        width: min(550px, calc(100dvh * 576 / 1024));
        height: auto;
        aspect-ratio: 576 / 1024;
        max-height: 100vh;
        max-height: 100dvh;
        margin: auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
        border-radius: 8px;
    }

    .header-logo {
        top: 2.15%;
    }

    .event-badge {
        top: 7.03%;
    }

    .main-title {
        top: 10.94%;
    }

    .spin-btn-wrapper {
        top: 80.5%;
        width: 68%;
    }

    .bottom-features {
        top: unset;
        bottom: 0.8%;
    }

    .card-txt {
        font-size: 11.5px;
        padding-top: 2px;
    }

    .popup-logo {
        top: 2.15%;
    }

    .popup-event-badge {
        top: 7.03%;
    }

    .popup-congrats {
        top: 12.8%;
    }

    .popup-winner-badge {
        top: 20.8%;
    }

    .popup-showcase {
        top: 25.0%;
    }

    .popup-plaque {
        top: 62.5%;
    }

    .popup-claim-wrapper {
        top: 80.2%;
    }

    .popup-bottom-features {
        bottom: 0.8%;
    }
}

img {
    display: block;
    pointer-events: none;
}

/* Background */
.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* 1. Header Logo (FAFA789) */
.header-logo {
    position: absolute;
    top: max(4.2%, calc(env(safe-area-inset-top, 0px) + 6px));
    left: 50%;
    transform: translateX(-50%);
    width: 45.14%;
    z-index: 10;
}

.header-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

/* 2. Event Badge (ព្រឹត្តិការណ៍ពិសេស) */
.event-badge {
    position: absolute;
    top: 8.8%;
    left: 50%;
    transform: translateX(-50%);
    width: 39.93%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.badge-bg {
    width: 100%;
    height: auto;
}

.badge-text {
    position: absolute;
    width: 82%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 3. Main Title (បង្វិល & ឈ្នះ) */
.main-title {
    position: absolute;
    top: 13.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 71.18%;
    z-index: 10;
}

.main-title img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
}

/* 4. Ribbon Banner */
.ribbon-banner {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.ribbon-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.ribbon-text {
    position: absolute;
    width: 65%;
    height: auto;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 5. Character Layers (behind the wheel) */
.char-football {
    position: absolute;
    top: 19.50%;
    left: -1.74%;
    width: 45%;
    height: auto;
    z-index: 1;
    filter: drop-shadow(0 0 15px rgba(0, 77, 219, 0.5));
}

.char-girls {
    position: absolute;
    top: 26.86%;
    right: -0.87%;
    width: 36.11%;
    height: auto;
    z-index: 1;
    filter: drop-shadow(0 0 15px rgba(0, 77, 219, 0.4));
}

.char-phone {
    position: absolute;
    top: 40.53%;
    right: -1.74%;
    width: 36.11%;
    height: auto;
    z-index: 1;
    filter: drop-shadow(0 0 15px rgba(0, 150, 255, 0.3));
}

.char-pirate {
    position: absolute;
    top: 60.06%;
    left: -4.34%;
    width: 44.79%;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.8));
}

.char-cockfight {
    position: absolute;
    top: 63.96%;
    right: -2.60%;
    width: 39.93%;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.8));
}

/* 6. Lucky Wheel */
.wheel-container {
    position: absolute;
    top: 31.25%;
    left: 50%;
    transform: translateX(-50%);
    width: 81.94%;
    aspect-ratio: 625 / 645;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* 6.1 Spinning Disc (underneath outer frame) */
.wheel-disc-wrapper {
    position: absolute;
    top: 51.5%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.wheel-disc-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    will-change: transform;
    transform: rotate(0deg);
}

/* 6.2 Outer Bulb Frame */
.wheel-frame-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 0 25px rgba(255, 200, 0, 0.45));
}

/* 6.3 Top Pointer */
.wheel-pointer-img {
    position: absolute;
    top: 0.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 13.5%;
    height: auto;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}

/* 7. Spin Now Button */
.spin-btn-wrapper {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s ease, filter 0.2s ease;
    animation: btnPulse 1.8s infinite ease-in-out;
}

.spin-btn-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.5));
}

.spin-btn-text {
    position: absolute;
    width: 65%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spin-btn-wrapper:hover {
    transform: translateX(-50%) scale(1.04);
    filter: brightness(1.08);
}

.spin-btn-wrapper:active {
    transform: translateX(-50%) scale(0.96);
}

@keyframes btnPulse {
    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.03);
    }
}

/* 8. Bottom Features (3 cards) */
.bottom-features {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    z-index: 5;
    pointer-events: none;
}

.bottom-features img,
.bottom-bg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.bottom-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-txt {
    width: 32%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    font-family: 'Kantumruy Pro', 'Siemreap', 'Battambang', Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(8px, 1.9vw, 12px);
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    box-sizing: border-box;
}

/* Offset to right of the baked-in icons inside bottom.png */
.card-txt.card-1 {
    padding-left: 26%;
}

.card-txt.card-2 {
    padding-left: 28%;
}

.card-txt.card-3 {
    padding-left: 24%;
}

/* ========================================================
   9. WIN POPUP MODAL (iPhone 18 Pro Max Stop Screen)
   ======================================================== */
.win-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    overflow: hidden;
}

.win-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.win-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.popup-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.win-popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    transform: scale(0.9);
    transition: transform 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.25);
}

.win-popup-overlay.active .win-popup-content {
    transform: scale(1);
}

/* Close button (top right) */
.popup-close-btn {
    position: absolute;
    top: max(1.5%, calc(env(safe-area-inset-top, 0px) + 6px));
    right: 3.5%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s ease, background 0.2s ease;
    outline: none;
}

.popup-close-btn:hover {
    background: rgba(220, 38, 38, 0.8);
    transform: scale(1.1);
}

.popup-close-btn:active {
    transform: scale(0.95);
}

/* 1. Header Logo (FAFA789) */
.popup-logo {
    position: absolute;
    top: max(2.5%, calc(env(safe-area-inset-top, 0px) + 4px));
    left: 50%;
    transform: translateX(-50%);
    width: 45.14%;
    z-index: 10;
}

.popup-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

/* 2. Event Badge (ព្រឹត្តិការណ៍ពិសេស) */
.popup-event-badge {
    position: absolute;
    top: 7.2%;
    left: 50%;
    transform: translateX(-50%);
    width: 38.7%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* 3. Main Title (អបអរសាទរ) */
.popup-congrats {
    position: absolute;
    top: 13.0%;
    left: 50%;
    transform: translateX(-50%);
    width: 61.6%;
    z-index: 10;
}

.popup-congrats img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.8));
}

/* 4. Winner Sub-Badge (អ្នកបានឈ្នះ:) */
.popup-winner-badge {
    position: absolute;
    top: 21.0%;
    left: 50%;
    transform: translateX(-50%);
    width: 32.3%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.winner-badge-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.winner-badge-text {
    position: absolute;
    width: 70%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 5. Center Showcase (Laurel wreath & 2 iPhones with Crown) */
.popup-showcase {
    position: absolute;
    top: 25.2%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 8;
}

.showcase-laurel {
    position: absolute;
    width: 98%;
    height: auto;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 0 25px rgba(255, 200, 0, 0.4));
    animation: laurelGlow 3s infinite ease-in-out;
}

.showcase-phones {
    position: absolute;
    width: 73%;
    height: auto;
    top: 49%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.75));
    animation: phoneFloat 3.5s infinite ease-in-out;
}

@keyframes laurelGlow {
    0%, 100% {
        filter: drop-shadow(0 0 22px rgba(255, 200, 0, 0.35));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(255, 220, 50, 0.6));
    }
}

@keyframes phoneFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-5px);
    }
}

/* 6. Prize Plaque (IPhone 18 PRO Max) */
.popup-plaque {
    position: absolute;
    top: 62.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 82.5%;
    z-index: 12;
    display: flex;
    justify-content: center;
    align-items: center;
}

.plaque-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8));
}

.plaque-text-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2% 0;
}

.plaque-title {
    width: 66%;
    height: auto;
    margin-top: 1%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.plaque-sub {
    width: 52%;
    height: auto;
    margin-top: 1.5%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

/* 7. Claim Now Button */
.popup-claim-wrapper {
    position: absolute;
    top: 80.2%;
    left: 50%;
    transform: translateX(-50%);
    width: 72.5%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 15;
    animation: claimPulse 1.8s infinite ease-in-out;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.claim-btn-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.claim-btn-text {
    position: absolute;
    width: 72%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup-claim-wrapper:hover {
    transform: translateX(-50%) scale(1.04);
    filter: brightness(1.1);
}

.popup-claim-wrapper:active {
    transform: translateX(-50%) scale(0.96);
}

@keyframes claimPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.035);
    }
}

/* 8. Bottom Features */
.popup-bottom-features {
    position: absolute;
    bottom: 1.0%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    z-index: 10;
    pointer-events: none;
}

.popup-bottom-features img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

