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

body {
    font-family: 'Poppins', sans-serif;
    overflow: hidden !important;
    width: 100vw;
    height: 100vh;
    position: relative;
    padding-right: 0 !important;
}

.sunburst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bgdesktop.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

@media (max-width: 768px) {
    .sunburst {
        background-image: url('assets/bgmobile.jpg');
    }
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

.header-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-event-logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    display: block;
    transform-origin: center;

    animation: logoLuxuryFloat 5s ease-in-out infinite;
    filter:
        drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45))
        drop-shadow(0 0 12px rgba(255, 215, 0, 0.30));
}

@keyframes logoLuxuryFloat {
    0% {
        transform: translateY(0px) scale(1);
        filter:
            drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45))
            drop-shadow(0 0 10px rgba(255, 215, 0, 0.25));
    }
    25% {
        transform: translateY(-6px) scale(1.02);
        filter:
            drop-shadow(0 12px 22px rgba(0, 0, 0, 0.48))
            drop-shadow(0 0 16px rgba(255, 215, 0, 0.35));
    }
    50% {
        transform: translateY(-12px) scale(1.05);
        filter:
            drop-shadow(0 14px 26px rgba(0, 0, 0, 0.52))
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.50));
    }
    75% {
        transform: translateY(-6px) scale(1.02);
        filter:
            drop-shadow(0 12px 22px rgba(0, 0, 0, 0.48))
            drop-shadow(0 0 16px rgba(255, 215, 0, 0.35));
    }
    100% {
        transform: translateY(0px) scale(1);
        filter:
            drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45))
            drop-shadow(0 0 10px rgba(255, 215, 0, 0.25));
    }
}

.main-title {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow:
        4px 4px 0px #003366,
        6px 6px 0px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 153, 255, 0.5);
    letter-spacing: 3px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.subtitle {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: #FFD700;
    text-shadow:
        2px 2px 0px #0066cc,
        3px 3px 0px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.login-card {
    background: linear-gradient(180deg, rgba(131, 14, 14, 0.95) 0%, rgba(4, 30, 10, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px 30px 30px;
    width: 95%;
    max-width: 450px;
    box-shadow:
        0 0 30px rgba(250, 204, 21, 0.4),
        0 20px 50px rgba(126, 202, 126, 0.8);
    border: 3px solid #ffffff;
    position: relative;
    z-index: 10;
}

.login-title {
    color: #ffffff;
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 25px;
    text-shadow:
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        0 5px 10px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #ffffff;
    border-radius: 10px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-weight: 300;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.input-group input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.95);
    border-color: #fef08a;
    box-shadow:
        0 0 0 2px rgba(250, 204, 21, 0.5),
        inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    font-style: italic;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 1px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}



.btn-submit, .btn-prize {
    flex: 1;
    padding: 12px 10px;
    border-radius: 8px;
    border: 2px solid #ffffff;
    color: #fff;
    font-size: 1.2rem;
    font-family: 'Bangers', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;

    text-shadow:
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        0 3px 5px rgba(0,0,0,0.8);
}

/* BUTTON MASUK */
.btn-submit {
    background: linear-gradient(180deg, #ff0000 0%, #6d0a0ad2 100%);
    box-shadow:
        0 0 10px rgba(255, 0, 0, 0.45),
        0 0 20px rgba(255, 0, 0, 0.30),
        0 5px 15px rgba(0, 0, 0, 0.6);
    animation: glowRed 2s ease-in-out infinite;
}

.btn-submit:hover {
    transform: scale(1.06);
    background: linear-gradient(180deg, #ff3b3b 0%, #a30000 100%);
    box-shadow:
        0 0 15px rgba(255, 59, 59, 0.7),
        0 0 30px rgba(255, 59, 59, 0.45),
        0 0 45px rgba(255, 59, 59, 0.25),
        0 8px 20px rgba(0, 0, 0, 0.65);
}

/* BUTTON HADIAH */
.btn-prize {
    background: linear-gradient(180deg, #f9e216 0%, #9a9112 100%);
    box-shadow:
        0 0 10px rgba(249, 226, 22, 0.45),
        0 0 20px rgba(249, 226, 22, 0.30),
        0 5px 15px rgba(0, 0, 0, 0.6);
    animation: glowGold 2s ease-in-out infinite;
}

.btn-prize:hover {
    transform: scale(1.06);
    background: linear-gradient(180deg, #ffe95e 0%, #c7a900 100%);
    box-shadow:
        0 0 15px rgba(255, 233, 94, 0.75),
        0 0 30px rgba(255, 233, 94, 0.5),
        0 0 45px rgba(255, 233, 94, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.65);
}

/* EFEK KILAU BERGERAK */
.btn-submit::before,
.btn-prize::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 45%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-25deg);
    animation: shineMove 3s infinite;
}

/* ANIMASI GLOW */
@keyframes glowRed {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(255, 0, 0, 0.40),
            0 0 20px rgba(255, 0, 0, 0.25),
            0 5px 15px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow:
            0 0 18px rgba(255, 0, 0, 0.65),
            0 0 30px rgba(255, 0, 0, 0.40),
            0 5px 15px rgba(0, 0, 0, 0.6);
    }
}

@keyframes glowGold {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(249, 226, 22, 0.40),
            0 0 20px rgba(249, 226, 22, 0.25),
            0 5px 15px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow:
            0 0 18px rgba(249, 226, 22, 0.65),
            0 0 30px rgba(249, 226, 22, 0.40),
            0 5px 15px rgba(0, 0, 0, 0.6);
    }
}

@keyframes shineMove {
    0% {
        left: -75%;
    }
    100% {
        left: 130%;
    }
}

.btn-telegram {
    flex: 1;
    padding: 12px 10px;
    border-radius: 8px;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 1.7rem;
    font-family: 'Bangers', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow:
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        0 3px 5px rgba(0,0,0,0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

.btn-telegram {
    background: linear-gradient(180deg, #3b9cf7 0%, #066ccc 100%);
}

.btn-telegram {
    position: relative;
    overflow: hidden;
    animation: telegramFloat 2s ease-in-out infinite, telegramGlow 1.8s ease-in-out infinite;
}

/* efek bergerak naik turun */
@keyframes telegramFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* efek glow */
@keyframes telegramGlow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6),
                    0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        box-shadow: 0 8px 20px rgba(243, 243, 241, 0.45),
                    0 0 18px rgba(255, 255, 255, 0.6);
    }
}

/* efek kilau bergerak */
.btn-telegram::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.45),
        transparent
    );
    transform: skewX(-20deg);
    animation: telegramShine 2.5s linear infinite;
}

@keyframes telegramShine {
    0% {
        left: -75%;
    }
    100% {
        left: 130%;
    }
}

.btn-telegram:hover {
    transform: scale(1.06);
    animation-play-state: paused;
}

.btn-daftar {
    flex: 1;
    padding: 3px 6px;
    border-radius: 8px;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Bangers', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow:
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        0 3px 5px rgba(0,0,0,0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

.btn-daftar {
    background: linear-gradient(180deg, #f18b05 0%, #dfc571 100%);
}

.btn-daftar {
    position: relative;
    overflow: hidden;
    animation: daftarFloat 2s ease-in-out infinite, daftarGlow 1.8s ease-in-out infinite;
}

/* efek bergerak naik turun */
@keyframes daftarFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* efek glow */
@keyframes daftarGlow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6),
                    0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        box-shadow: 0 8px 20px rgba(243, 243, 241, 0.45),
                    0 0 18px rgba(255, 255, 255, 0.6);
    }
}

/* efek kilau bergerak */
.btn-daftar::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.45),
        transparent
    );
    transform: skewX(-20deg);
    animation: daftarShine 2.5s linear infinite;
}

@keyframes daftarShine {
    0% {
        left: -75%;
    }
    100% {
        left: 130%;
    }
}

.btn-daftar:hover {
    transform: scale(1.06);
    animation-play-state: paused;
}

/* Base Sponsor and Ribbons */
.choice-banner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    animation: bannerFloat 3s ease-in-out infinite;
}

.choice-banner img {
    max-width: 70%;
    height: auto;
    display: block;
    animation: bannerPulseGlow 3s ease-in-out infinite;
}

.choice-banner::before {
    content: "";
    position: absolute;
    width: 70%;
    height: 20px;
    bottom: -8px;
    background: rgba(255, 215, 0, 0.18);
    filter: blur(12px);
    border-radius: 50%;
    z-index: 0;
}

.choice-banner img {
    position: relative;
    z-index: 1;
}

@keyframes bannerFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bannerPulseGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
    }
    50% {
        transform: scale(1.04);
        filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
    }
}

.sponsor-logo {
    margin-top: 15px;
    width: 100%;
    max-width: 250px;
    text-align: center;
    z-index: 10;
}

.sponsor-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

/* --- Base Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 1), rgba(15, 23, 42, 1));
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(251, 191, 36, 0.1);
    color: white;
    text-align: center;
    animation: zoomIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #fbbf24;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #ef4444;
    transform: scale(1.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Prize Grid Styles --- */
.prize-modal-content {
    max-width: 360px !important;
    /* Extremely tight portrait bounding box, forcing override */
    width: 90% !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    /* Tighter gap */
    padding: 10px 0;
    /* Remove horizontal padding for more room inside */
    overflow-y: auto;
    margin-top: 15px;
    justify-items: center;
}

.prize-item {
    background: rgba(30, 41, 59, 0.8);
    border: 1.5px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    padding: 10px 4px;
    /* Less side padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.prize-item:hover {
    transform: translateY(-5px);
    border-color: #fbbf24;
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.2);
}

.prize-image {
    width: 65px;
    height: 65px;
    object-fit: contain;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

.prize-name {
    font-family: 'Bangers', cursive;
    color: #fff;
    font-size: 0.85rem;
    /* Smaller text */
    letter-spacing: 0.5px;
    line-height: 1.1;
    word-break: break-word;
}

.header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
    pointer-events: none;
}

.header>* {
    pointer-events: auto;
}

.game-title {
    display: none;
}

.user-info {
    position: fixed;
    top: 30px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 100;
}

.user-info span {
    color: #fff;
    font-family: 'Bangers', cursive;
    font-weight: 400;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .user-info {
        top: 20px;
        right: 15px;
    }
    
    .user-info > span {
        font-size: 1.5rem; /* Make ID slightly smaller on mobile */
    }

    /* Hide the "Hi " prefix explicitly if possible, or we let it scale.
       For this case, the user's screenshot shows just "ID: MORRISJEPE",
       Assuming the JS sets it, we just style it. */
    .btn-logout {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: auto;
    }
}

.btn-logout {
    position: fixed;
    bottom: 30px;
    right: 40px;
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); /* Red gradient like screenshot */
    border: 2px solid #fca5a5;
    color: #fff;
    padding: 10px 30px;
    border-radius: 12px;
    font-size: 1.4rem;
    font-family: 'Bangers', cursive;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #FF7B7B 0%, #FF6A62 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.5);
}

.key-counter {
    position: fixed;
    top: 30px;
    left: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50px;
    padding: 5px 40px 5px 20px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid #fcd34d;
    z-index: 100;
}

.key-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.key-count {
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    letter-spacing: 1px;
    letter-spacing: 1px;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .key-counter {
        top: 20px;
        left: 20px;
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #fcd34d;
        padding: 5px 30px;
        border-radius: 50px;
    }
    .key-count {
        font-size: 2rem;
    }
    .key-icon {
        display: none; /* Icon isn't in screenshot */
    }
}

.history-btn {
    position: fixed;
    top: 100px;
    left: 40px;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    border-radius: 50px;
    padding: 8px 30px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid #fdba74;
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(0, 71, 142, 0.95) 0%, rgba(0, 54, 108, 0.95) 100%);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
}

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

@media (max-width: 768px) {
    .history-btn {
        top: 85px;
        left: 20px;
        width: auto;
        /* Increase padding/font to match screenshot proportionally */
        padding: 5px 30px;
        background: linear-gradient(180deg, #f97316 0%, #ea580c 100%); /* Orange gradient like screenshot */
        border: 2px solid #fdba74;
        border-radius: 50px;
    }
    .history-btn .history-icon {
        display: none; /* Hide icon on mobile per screenshot */
    }
    .history-btn .history-label {
        font-size: 1.6rem;
        text-shadow: 1px 1px 0 #000;
    }
}

.history-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.history-label {
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 1.6rem;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    letter-spacing: 1px;
    margin-top: 2px;
}

.instruction {
    margin-top: 150px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .instruction {
        margin-top: 20px;
        margin-bottom: 20px;
    }
}

.instruction p {
    color: #fff;
    font-size: 1.3rem;
    font-family: 'Bangers', cursive;
    font-weight: 400;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.chests-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .chests-container {
        flex-direction: row;
        padding: 0;
        gap: 10px;
        max-width: 320px; /* Constrain width to force wrap to 2-1 layout */
        margin: 0 auto;
        justify-content: center;
    }
}

.chest {
    width: 110px;
    height: 110px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
    .chest {
        width: 140px; /* Make chests slightly bigger on mobile */
        height: 140px;
    }
}

@media (min-width: 768px) {
    .chest {
        width: 130px;
        height: 130px;
    }

    .chests-container {
        flex-direction: row;
        gap: 40px;
    }
}

.chest:hover:not(.disabled):not(.opening) {
    transform: translateY(-15px) scale(1.08);
    filter: drop-shadow(0 15px 30px rgba(0, 191, 255, 0.6));
}

.chest:active:not(.disabled) {
    transform: translateY(-8px) scale(1.04);
}

.chest.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(70%) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.chest-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.chest-closed {
    opacity: 1;
    z-index: 2;
}

.chest-open {
    opacity: 0;
    z-index: 1;
    transform: scale(0.95);
}

.chest.opening .chest-closed {
    opacity: 0;
    transform: scale(1.05);
}

.chest.opening .chest-open {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px) rotate(-2deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px) rotate(2deg);
    }
}



.chest.shaking {
    animation: shake 0.5s ease-in-out;
}

.floating-reward {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.2) 0%, transparent 70%);
    padding: 20px;
    border-radius: 50%;
}

.floating-reward::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    transform: translate(-50%, -50%);
}

.floating-icon {
    font-size: 5rem;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

.floating-text {
    font-family: 'Bangers', cursive;
    color: #FFD700;
    font-size: 2rem;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    white-space: nowrap;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite reverse;
}

.reward-prize-img,
.floating-reward-img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px gold);
    animation: rewardFloat 2.6s ease-in-out infinite,
               rewardGlow 1.8s ease-in-out infinite;
    transform-origin: center;
}

@keyframes rewardFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) scale(1.02) rotate(-2deg);
    }
    50% {
        transform: translateY(-14px) scale(1.04) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) scale(1.02) rotate(2deg);
    }
}

@keyframes rewardGlow {
    0%, 100% {
        filter: drop-shadow(0 0 15px gold);
    }
    50% {
        filter: drop-shadow(0 0 25px #ffd700)
                drop-shadow(0 0 40px rgba(255, 215, 0, 0.45));
    }
}

@media (max-width: 768px) {
    .reward-prize-img,
    .floating-reward-img {
        width: 180px;
        height: 180px;
    }
}

.floating-title {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.title-success {
    color: #fff;
    text-shadow: 0 0 15px #00aaff, 2px 2px 0 #000;
}

.title-error {
    color: #ff4757;
    text-shadow: 0 0 15px #ff0000, 2px 2px 0 #000;
}

.floating-prize-name {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: gold;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
}

.screenshot-text {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 5px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.screenshot-subtext {
    font-size: 0.9rem;
    color: #f1c40f;
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.keycode-box {
    font-size: 1.6rem;
    color: #10b981;
    background: rgba(0,0,0,0.8);
    padding: 8px 25px;
    border-radius: 8px;
    font-family: monospace;
    border: 2px solid #10b981;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px #000;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .floating-reward {
        width: 90%;
        padding: 15px;
    }
    .reward-prize-img {
        width: 180px;
        height: 180px;
    }
    .floating-title {
        font-size: 2.5rem;
    }
    .floating-prize-name {
        font-size: 2.2rem;
    }
    .screenshot-text {
        font-size: 1rem;
    }
    .screenshot-subtext {
        font-size: 0.8rem;
    }
    .keycode-box {
        font-size: 1.3rem;
        padding: 6px 15px;
        margin-bottom: 15px;
    }
}

.btn-claim {
    background: linear-gradient(135deg, #00BFFF 0%, #0099ff 100%);
    border: none;
    border-radius: 50px;
    padding: 10px 30px;
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}

.btn-claim:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.6);
}

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

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}





/* Sparkle Effect */
.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 40;
    animation: sparkleAnim 0.8s ease-out forwards;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}



/* Responsive Design */
@media (max-width: 480px) {
    .main-title {
        font-size: 2.8rem;
    }

    .login-card {
        padding: 40px 30px;
        max-width: 90%;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .input-group input {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .btn-submit {
        padding: 16px;
        font-size: 1.1rem;
    }



    .chests-container {
        gap: 10px;
    }
}

/* History Button */
.history-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: 2px solid #fff;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-top: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.history-btn:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    /* Dark Blue Theme */
    border: 3px solid #3b82f6;
    /* Blue Border */
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 90%;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease-out;
    color: #fff;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #ef4444;
}

/* Table Styles */
.history-table th {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    border-bottom: 2px solid #334155;
}

.history-table td {
    padding: 10px 12px;
    /* More compact */
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.modal-content ::-webkit-scrollbar {
    width: 8px;
}

.modal-content ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.modal-content ::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.modal-content ::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

.maintenance-screen {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.maintenance-screen.active {
    display: flex !important;
}

.maintenance-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.maintenance-content .icon-container {
    position: relative;
    height: 100px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-content .fa-gear {
    font-size: 5rem;
    color: #3b82f6;
    opacity: 0.2;
    position: absolute;
}

.maintenance-content .static-icon {
    font-size: 3rem;
    color: #fbbf24;
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.maintenance-content h1 {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.maintenance-content p {
    font-family: 'Poppins', sans-serif;
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.maintenance-content .sub-text {
    font-size: 0.9rem;
    color: #64748b;
}

.maintenance-footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #475569;
    letter-spacing: 1px;
    text-transform: uppercase;
}


.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    min-width: 280px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-family: 'Poppins', sans-serif;
    pointer-events: auto;
    cursor: pointer;
    animation: slideInRight 0.3s ease-out forwards;
}

.toast-item.hide {
    animation: slideOutRight 0.3s ease-in forwards;
}

.toast-success {
    border-left: 4px solid #fbbf24;
}

.toast-error {
    border-left: 4px solid #f87171;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-card {
    background: #1e293b;
    width: 90%;
    max-width: 380px;
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    text-align: center;
    animation: zoomIn 0.3s forwards;
}

.confirm-icon {
    font-size: 3rem;
    color: #fbbf24;
    margin-bottom: 15px;
}

.confirm-title {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
}

.confirm-body {
    color: #94a3b8;
    margin-bottom: 25px;
}

.confirm-footer {
    display: flex;
    gap: 10px;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-family: 'Bangers', cursive;
    cursor: pointer;
    transform: translateY(0);
    transition: 0.2s;
}

.btn-confirm:active {
    transform: translateY(2px);
}

.btn-yes {
    background: #fbbf24;
    color: #000;
}

.btn-no {
    background: #334155;
    color: #fff;
}

.swal2-container {
    z-index: 999999 !important;
}

/* SweetAlert2 Stacking Fixes */
.swal2-container {
    z-index: 999999 !important;
    /* Force SweetAlert above all game chests and overlays */
}

/* Custom SweetAlert Theme for Treasure Chest */
.custom-swal-popup {
    background: linear-gradient(135deg, rgba(15, 25, 50, 0.95), rgba(10, 20, 42, 0.95)) !important;
    backdrop-filter: blur(10px);
    border: 3px solid #f59e0b !important;
    border-radius: 15px !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4) !important;
    color: #fff !important;
}

.custom-swal-title {
    font-family: 'Bangers', cursive !important;
    color: #fcd34d !important;
    font-size: 2.5rem !important;
    letter-spacing: 2px !important;
    text-shadow: 2px 2px 0px #000 !important;
}

.custom-swal-btn {
    font-family: 'Bangers', cursive !important;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    border-radius: 50px !important;
    font-size: 1.5rem !important;
    padding: 10px 40px !important;
    letter-spacing: 2px !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5) !important;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease !important;
}

.custom-swal-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.7) !important;
}

/* Snow / floating particles background */
.snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -15%;
    object-fit: contain;
    animation: snowFall linear infinite, snowSwing ease-in-out infinite;
    opacity: 0.95;
}

.snowflake:nth-child(1) { left: 5%;  width: 50px; height: 24px; animation-duration: 10s, 3s; animation-delay: 0s, 0s; }
.snowflake:nth-child(2) { left: 15%; width: 50px; height: 50px; animation-duration: 13s, 4s; animation-delay: 1s, 0.5s; }
.snowflake:nth-child(3) { left: 28%; width: 22px; height: 22px; animation-duration: 11s, 2.5s; animation-delay: 2s, 1s; }
.snowflake:nth-child(4) { left: 40%; width: 70px; height: 40px; animation-duration: 15s, 5s; animation-delay: 0.5s, 0.2s; }
.snowflake:nth-child(5) { left: 52%; width: 50px; height: 50px; animation-duration: 12s, 3.5s; animation-delay: 3s, 0.7s; }
.snowflake:nth-child(6) { left: 64%; width: 20px; height: 20px; animation-duration: 9s, 2.8s; animation-delay: 1.8s, 0.4s; }
.snowflake:nth-child(7) { left: 75%; width: 50px; height: 50px; animation-duration: 14s, 4.5s; animation-delay: 2.5s, 0.9s; }
.snowflake:nth-child(8) { left: 86%; width: 24px; height: 24px; animation-duration: 10s, 3s; animation-delay: 1.2s, 0.6s; }
.snowflake:nth-child(9) { left: 94%; width: 28px; height: 28px; animation-duration: 16s, 5s; animation-delay: 0.8s, 1s; }

@keyframes snowFall {
    0% {
        transform: translateY(-15vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(115vh) rotate(360deg);
        opacity: 0.2;
    }
}

@keyframes snowSwing {
    0% {
        margin-left: 0;
    }
    50% {
        margin-left: 20px;
    }
    100% {
        margin-left: -20px;
    }
}