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

html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    padding-right: 0 !important;
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

.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;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.screen.active {
    display: flex;
}

.header-logo-container {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    z-index: 10;
}

.main-event-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

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

.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(8, 60, 20, 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 #facc15;
    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 #facc15;
    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 #facc15;
    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, #4dff00 0%, #246906 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: glowRed 2s ease-in-out infinite;
}

.btn-submit:hover {
    transform: scale(1.06);
    background: linear-gradient(180deg, #4dff00 0%, #246906 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);
}

/* 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(249, 226, 22, 0.45),
            0 0 20px rgba(249, 226, 22, 0.30),
            0 5px 15px rgba(0, 0, 0, 0.6);
    }
    50% {
        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);
    }
}

@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 #facc15;
    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(162, 197, 34, 0.45),
                    0 0 18px rgba(232, 248, 5, 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;
}
/* 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: 100%;
    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;
    }
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.18), transparent 22%),
        radial-gradient(circle at 80% 18%, rgba(56, 189, 248, 0.16), transparent 24%),
        radial-gradient(circle at 50% 78%, rgba(34, 197, 94, 0.14), transparent 26%);
    pointer-events: none;
    z-index: -1;
}

#loginScreen {
    overflow: hidden;
}

.login-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-orb,
.ambient-ring {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.7;
}

.login-orb {
    width: 220px;
    height: 220px;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-gold {
    top: 12%;
    left: 8%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.55) 0%, rgba(250, 204, 21, 0.08) 55%, transparent 72%);
}

.orb-blue {
    top: 18%;
    right: 10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.42) 0%, rgba(59, 130, 246, 0.08) 58%, transparent 74%);
    animation-duration: 15s;
    animation-delay: -4s;
}

.orb-green {
    bottom: 8%;
    left: 18%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.34) 0%, rgba(34, 197, 94, 0.06) 60%, transparent 76%);
    animation-duration: 14s;
    animation-delay: -8s;
}

.ambient-ring {
    border: 1px solid rgba(255, 255, 255, 0.14);
    filter: none;
    backdrop-filter: blur(2px);
    animation: ringSpin 20s linear infinite;
}

.ring-left {
    width: 340px;
    height: 340px;
    left: -120px;
    bottom: -120px;
}

.ring-right {
    width: 420px;
    height: 420px;
    right: -140px;
    top: -120px;
    animation-direction: reverse;
}

.header-logo-container {
    margin-bottom: 16px;
    animation: logoFloat 5.5s ease-in-out infinite;
}

.main-event-logo {
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.45));
}

.login-card {
    background: linear-gradient(180deg, rgba(6, 28, 16, 0.92) 0%, rgba(5, 18, 10, 0.97) 100%);
    border: 1px solid rgba(250, 204, 21, 0.75);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 36px rgba(250, 204, 21, 0.16);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.login-card::before,
.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-card::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent 28%, transparent 72%, rgba(255,255,255,0.08));
    opacity: 0.95;
}

.login-card::after {
    inset: auto 16px 14px 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.45), transparent);
}

.login-card.is-hovered {
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 0 46px rgba(250, 204, 21, 0.22);
}

.login-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 22%, rgba(255,255,255,0.12) 34%, transparent 46%);
    transform: translateX(-120%);
    animation: cardShine 7s ease-in-out infinite;
    pointer-events: none;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.26);
    color: #fef08a;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-title {
    margin-bottom: 10px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.5;
    margin: 0 0 24px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(250, 204, 21, 0.95);
    font-size: 1rem;
    pointer-events: none;
    transition: transform 0.25s ease, color 0.25s ease;
}

.input-group input {
    padding: 14px 18px 14px 48px;
    border-radius: 14px;
    border: 1px solid rgba(250, 204, 21, 0.55);
    background: rgba(0, 0, 0, 0.64);
}

.input-group:focus-within .input-icon {
    color: #fff7c2;
    transform: translateY(-50%) scale(1.08);
}

.input-group input:hover {
    border-color: rgba(254, 240, 138, 0.75);
}

.action-buttons {
    margin-top: 16px;
}

.btn-submit,
.btn-prize,
.btn-telegram {
    min-height: 56px;
    border-radius: 14px;
    transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
    will-change: transform;
}

.btn-submit:hover,
.btn-prize:hover,
.btn-telegram:hover {
    filter: saturate(1.08);
}

.btn-submit:active,
.btn-prize:active,
.btn-telegram:active {
    transform: translateY(1px) scale(0.98);
}

.login-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 18px;
}

.login-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
}

.choice-banner {
    margin-top: 22px;
}

.choice-banner img {
    animation: bannerPulseGlow 3.6s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -22px, 0) scale(1.06); }
}

@keyframes ringSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes cardShine {
    0%, 15% { transform: translateX(-120%); }
    35% { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

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

@media (max-width: 768px) {
    .login-orb { opacity: 0.55; }
    .ring-right { width: 300px; height: 300px; }
    .ring-left { width: 240px; height: 240px; }
    .login-card {
        padding: 34px 22px 24px;
        max-width: 420px;
    }
    .login-subtitle {
        font-size: 0.92rem;
        margin-bottom: 20px;
    }
    .btn-submit,
    .btn-prize,
    .btn-telegram {
        min-height: 52px;
    }
}


/* Telegram Claim Popup */
.telegram-swal-popup {
    width: min(560px, calc(100vw - 28px)) !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 28px !important;
    border: 1px solid rgba(130, 198, 255, 0.35) !important;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.28), transparent 35%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.18), transparent 30%),
        linear-gradient(155deg, rgba(10, 20, 45, 0.98), rgba(5, 12, 28, 0.98)) !important;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255,255,255,0.05) inset,
        0 0 40px rgba(56, 189, 248, 0.20) !important;
}

.telegram-swal-title {
    font-family: 'Bangers', cursive !important;
    font-size: clamp(2rem, 5vw, 3rem) !important;
    letter-spacing: 2px !important;
    color: #f8fbff !important;
    text-shadow: 0 6px 18px rgba(56, 189, 248, 0.35), 2px 2px 0 rgba(0, 0, 0, 0.35) !important;
    padding: 26px 24px 0 !important;
    margin: 0 !important;
}

.telegram-claim-popup {
    position: relative;
    padding: 18px 24px 8px;
}

.telegram-popup-glow {
    position: absolute;
    inset: auto auto 22px -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(34,211,238,0.28), transparent 68%);
    filter: blur(12px);
    pointer-events: none;
    animation: telegramPulseGlow 4s ease-in-out infinite;
}

.telegram-popup-hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.telegram-popup-icon-wrap {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(56,189,248,0.95), rgba(29,78,216,0.95));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.42), 0 0 0 6px rgba(255,255,255,0.05);
    transform: translateY(0);
    animation: telegramFloatIcon 3.2s ease-in-out infinite;
}

.telegram-popup-icon-wrap i {
    font-size: 2.5rem;
    color: #fff;
}

.telegram-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 1.6px;
    font-weight: 700;
    color: #dff8ff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.telegram-popup-lead {
    margin: 2px auto 0;
    max-width: 430px;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(235, 248, 255, 0.9);
}

.telegram-popup-features {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.telegram-popup-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 118px;
    padding: 16px 14px;
    text-align: center;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
}

.telegram-popup-feature i {
    font-size: 1.3rem;
    color: #7dd3fc;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.telegram-popup-feature span {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    color: #eff8ff;
}

.telegram-popup-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.65;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(240, 249, 255, 0.88);
}

.telegram-swal-confirm,
.telegram-swal-cancel {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    min-width: 180px !important;
    height: 54px !important;
    padding: 0 22px !important;
    margin: 0 6px 24px !important;
    border-radius: 999px !important;
    font-family: 'Bangers', cursive !important;
    font-size: 1.2rem !important;
    letter-spacing: 1px !important;
    border: none !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease !important;
}

.telegram-swal-confirm {
    color: #ffffff !important;
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%) !important;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.35) !important;
}

.telegram-swal-cancel {
    color: #dbeafe !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
}

.telegram-swal-confirm:hover,
.telegram-swal-cancel:hover {
    transform: translateY(-2px) scale(1.02) !important;
}

.telegram-swal-close {
    color: rgba(255,255,255,0.7) !important;
}

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

@keyframes telegramPulseGlow {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 640px) {
    .telegram-claim-popup {
        padding: 14px 16px 4px;
    }

    .telegram-popup-features {
        grid-template-columns: 1fr;
    }

    .telegram-popup-feature {
        min-height: 84px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .telegram-swal-confirm,
    .telegram-swal-cancel {
        min-width: calc(50% - 10px) !important;
        height: 50px !important;
        font-size: 1.05rem !important;
        margin-bottom: 18px !important;
    }
}


@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden !important;
    }

    .screen {
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding-top: 24px;
        padding-bottom: 24px;
        touch-action: pan-y;
    }

    .swal2-container,
    .modal,
    .modal-overlay,
    .prize-modal-content,
    .modal-content {
        touch-action: pan-y;
    }
}

/* === Responsive gameScreen chest centering fix === */
#gameScreen {
    justify-content: center;
    padding-top: clamp(120px, 18dvh, 170px);
    padding-bottom: clamp(100px, 14dvh, 150px);
}

#gameScreen .instruction {
    margin-top: 0 !important;
    margin-bottom: clamp(18px, 3dvh, 32px) !important;
}

#gameScreen .instruction p {
    max-width: min(90vw, 560px);
    margin: 0 auto;
}

#gameScreen .chests-container {
    width: min(100%, 520px);
    margin: 0 auto;
    display: grid;
    justify-content: center;
    align-items: center;
}

@media (min-width: 769px) {
    #gameScreen .chests-container {
        grid-template-columns: repeat(3, minmax(110px, 130px));
        gap: clamp(24px, 3vw, 40px);
    }

    #gameScreen .chest {
        width: clamp(110px, 9vw, 130px);
        height: clamp(110px, 9vw, 130px);
    }
}

@media (max-width: 768px) {
    #gameScreen {
        padding-top: 150px;
        padding-bottom: 120px;
    }

    #gameScreen .instruction {
        width: 100%;
    }

    #gameScreen .instruction p {
        font-size: clamp(1rem, 4vw, 1.2rem);
        line-height: 1.2;
        padding: 0 56px;
    }

    #gameScreen .chests-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 18px;
        width: min(100%, 300px);
        max-width: 300px;
    }

    #gameScreen .chest {
        width: min(31vw, 112px);
        height: min(31vw, 112px);
        justify-self: center;
    }

    #gameScreen .chest:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 420px) {
    #gameScreen {
        padding-top: 145px;
        padding-bottom: 110px;
    }

    #gameScreen .chests-container {
        width: min(100%, 280px);
        max-width: 280px;
        gap: 10px 16px;
    }

    #gameScreen .chest {
        width: min(30vw, 105px);
        height: min(30vw, 105px);
    }
}

/* ===== Precise cross-device centering for game screen ===== */
#gameScreen.screen {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    justify-content: center;
    gap: clamp(16px, 2.8vh, 32px);
    padding-top: max(170px, calc(env(safe-area-inset-top, 0px) + 140px));
    padding-bottom: max(130px, calc(env(safe-area-inset-bottom, 0px) + 100px));
    padding-left: clamp(16px, 3vw, 28px);
    padding-right: clamp(16px, 3vw, 28px);
}

#gameScreen .instruction {
    margin: 0 !important;
    width: 100%;
    flex: 0 0 auto;
}

#gameScreen .instruction p {
    max-width: min(92vw, 700px);
    margin: 0 auto;
    line-height: 1.12;
    font-size: clamp(1.05rem, 2.2vw, 1.55rem);
}

#gameScreen .chests-container {
    margin: 0 !important;
    width: min(100%, 560px);
    display: grid;
    justify-content: center;
    align-content: center;
    justify-items: center;
    align-items: center;
    row-gap: clamp(12px, 2.8vh, 26px);
    column-gap: clamp(16px, 3vw, 34px);
}

#gameScreen .chest {
    width: clamp(108px, 12vw, 138px);
    height: clamp(108px, 12vw, 138px);
}

@media (min-width: 769px) {
    #gameScreen.screen {
        padding-top: max(165px, calc(env(safe-area-inset-top, 0px) + 130px));
        padding-bottom: max(120px, calc(env(safe-area-inset-bottom, 0px) + 90px));
    }

    #gameScreen .chests-container {
        grid-template-columns: repeat(3, minmax(110px, 138px));
        width: min(100%, 560px);
    }
}

@media (max-width: 768px) {
    #gameScreen.screen {
        padding-top: max(150px, calc(env(safe-area-inset-top, 0px) + 128px));
        padding-bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 112px));
        gap: clamp(14px, 2.4vh, 22px);
    }

    #gameScreen .instruction p {
        max-width: min(88vw, 340px);
        font-size: clamp(1rem, 3.9vw, 1.2rem);
        padding: 0;
    }

    #gameScreen .chests-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 300px);
        max-width: 300px;
        row-gap: clamp(8px, 1.8vh, 14px);
        column-gap: clamp(12px, 4vw, 20px);
    }

    #gameScreen .chest {
        width: clamp(96px, 29vw, 116px);
        height: clamp(96px, 29vw, 116px);
    }

    #gameScreen .chest:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 420px) {
    #gameScreen.screen {
        padding-top: max(142px, calc(env(safe-area-inset-top, 0px) + 122px));
        padding-bottom: max(138px, calc(env(safe-area-inset-bottom, 0px) + 108px));
    }

    #gameScreen .chests-container {
        width: min(100%, 282px);
        max-width: 282px;
    }

    #gameScreen .chest {
        width: clamp(92px, 28vw, 106px);
        height: clamp(92px, 28vw, 106px);
    }
}


/* === 2026 visual refresh: game screen only, no gameplay logic changed === */
:root {
    --game-panel-bg: rgba(7, 17, 36, 0.72);
    --game-panel-border: rgba(255, 221, 87, 0.42);
    --game-panel-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

body.in-game .sunburst::before,
body.in-game .sunburst::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
}

body.in-game .sunburst::before {
    width: min(42vw, 420px);
    height: min(42vw, 420px);
    top: 10%;
    left: -8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 223, 96, 0.28) 0%, rgba(255, 223, 96, 0.08) 35%, rgba(255, 223, 96, 0) 72%);
    filter: blur(6px);
}

body.in-game .sunburst::after {
    width: min(36vw, 360px);
    height: min(36vw, 360px);
    right: -6%;
    bottom: 7%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.24) 0%, rgba(34, 211, 238, 0.06) 40%, rgba(34, 211, 238, 0) 72%);
    filter: blur(10px);
}

#gameScreen {
    position: relative;
    isolation: isolate;
}

#gameScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 8, 20, 0.42) 0%, rgba(3, 8, 20, 0.16) 22%, rgba(3, 8, 20, 0.22) 100%),
        radial-gradient(circle at 50% 42%, rgba(255, 217, 77, 0.12), transparent 35%);
    pointer-events: none;
    z-index: -1;
}

#gameScreen .header {
    top: clamp(14px, 2.8vw, 24px);
    left: clamp(14px, 2.8vw, 28px);
    right: clamp(14px, 2.8vw, 28px);
    align-items: flex-start;
}

#gameScreen .key-counter,
#gameScreen .history-btn,
#gameScreen .user-info,
#gameScreen .btn-logout {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#gameScreen .key-counter {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.72));
    border: 1px solid rgba(255, 215, 73, 0.7);
    box-shadow: var(--game-panel-shadow), inset 0 1px 0 rgba(255,255,255,0.08);
    padding: 12px 20px 12px 16px;
    gap: 12px;
}

#gameScreen .key-counter::after {
    content: "Kunci Aktif";
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.7);
    position: absolute;
    top: -10px;
    right: 18px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(10, 16, 28, 0.85);
    border: 1px solid rgba(255, 215, 73, 0.35);
}

#gameScreen .key-icon {
    font-size: 1.7rem;
    filter: drop-shadow(0 3px 8px rgba(255, 213, 79, 0.45));
}

#gameScreen .key-count {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    color: #fff4b3;
    text-shadow: 0 2px 10px rgba(255, 213, 79, 0.28);
}

#gameScreen .history-btn {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    background: linear-gradient(135deg, rgba(12, 24, 45, 0.82), rgba(28, 53, 94, 0.78));
    border: 1px solid rgba(125, 211, 252, 0.38);
    border-radius: 18px;
    padding: 12px 18px;
    color: #eff6ff;
    font-size: 1rem;
    box-shadow: var(--game-panel-shadow);
}

#gameScreen .history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(8, 47, 73, 0.28);
}

#gameScreen .user-info {
    position: fixed;
    top: 28px;
    right: 34px;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px;
    min-width: min(320px, calc(100vw - 32px));
    background: linear-gradient(145deg, rgba(7, 18, 38, 0.78), rgba(21, 37, 70, 0.68));
    border: 1px solid var(--game-panel-border);
    border-radius: 24px;
    box-shadow: var(--game-panel-shadow);
}

#gameScreen .user-info > span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.2;
    color: #e5eefc;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

#gameScreen .user-info > span::before {
    content: "Player";
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.6);
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}

#gameScreen #usernameDisplay {
    color: #ffe082;
    font-family: 'Bangers', cursive;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    letter-spacing: 0.05em;
    text-shadow: 0 4px 12px rgba(0,0,0,0.45);
}

#gameScreen .btn-logout {
    position: relative;
    inset: auto;
    width: 100%;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    font-size: 1.05rem;
    box-shadow: 0 16px 28px rgba(127, 29, 29, 0.3), inset 0 1px 0 rgba(255,255,255,0.14);
}

#gameScreen .instruction {
    position: relative;
}

#gameScreen .instruction p {
    background: var(--game-panel-bg);
    border: 1px solid rgba(255, 226, 122, 0.34);
    border-radius: 999px;
    padding: 16px 24px;
    color: #fff8d6;
    box-shadow: var(--game-panel-shadow), inset 0 1px 0 rgba(255,255,255,0.05);
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

#gameScreen .chests-container {
    position: relative;
    padding: clamp(18px, 2.6vw, 24px);
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(8, 18, 40, 0.38), rgba(8, 18, 40, 0.14));
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 25px 55px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

#gameScreen .chests-container::before {
    content: "Pilih salah satu ketupat keberuntungan";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.78);
    background: rgba(5, 10, 20, 0.56);
    border: 1px solid rgba(255,255,255,0.08);
}

#gameScreen .chest {
    border-radius: 28px;
    background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.2), rgba(255,255,255,0.02) 55%, rgba(255,255,255,0) 72%);
    box-shadow: 0 18px 26px rgba(0,0,0,0.18);
    transition: transform 0.28s ease, filter 0.28s ease, box-shadow 0.28s ease;
}

#gameScreen .chest::before {
    content: "";
    position: absolute;
    inset: auto 14% -2px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.36), rgba(0,0,0,0));
    filter: blur(6px);
    z-index: -1;
}

#gameScreen .chest:hover:not(.disabled):not(.opening) {
    transform: translateY(-10px) scale(1.05);
    filter: drop-shadow(0 8px 20px rgba(255, 213, 79, 0.38));
}

#gameScreen .chest.disabled {
    opacity: 0.58;
    filter: grayscale(0.08);
}

#gameScreen .chest-img {
    filter: drop-shadow(0 12px 18px rgba(0,0,0,0.28));
}

@media (max-width: 768px) {
    #gameScreen .header {
        gap: 12px;
    }

    #gameScreen .user-info {
        top: auto;
        right: 14px;
        left: 14px;
        bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 10px));
        min-width: 0;
        padding: 14px;
        border-radius: 20px;
    }

    #gameScreen .user-info > span {
        justify-content: center;
        flex-wrap: wrap;
        text-align: center;
    }

    #gameScreen .key-counter {
        top: 14px;
        left: 14px;
        padding: 10px 16px 10px 14px;
    }

    #gameScreen .history-btn {
        top: 14px;
        right: 14px;
        padding: 10px 14px;
        border-radius: 14px;
        font-size: 0.92rem;
    }

    #gameScreen .instruction p {
        padding: 14px 18px;
        border-radius: 22px;
    }

    #gameScreen .chests-container {
        border-radius: 24px;
        padding: 14px;
    }

    #gameScreen .chests-container::before {
        display: none;
    }
}

/* === 2026.03 UI polish patch: fix Kunci Aktif bug + richer game HUD (visual only) === */
#gameScreen .header {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
        "keys user"
        "history user";
    align-items: start;
    gap: 14px 16px;
}

#gameScreen .key-counter {
    grid-area: keys;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "label label"
        "icon count";
    align-items: center;
    column-gap: 12px;
    row-gap: 4px;
    min-width: 170px;
    padding: 12px 18px 14px;
    border-radius: 22px;
    overflow: hidden;
}

#gameScreen .key-counter::after {
    grid-area: label;
    position: static;
    top: auto;
    right: auto;
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin: 0 0 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(255, 246, 200, 0.88);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1.1;
    white-space: nowrap;
    text-transform: uppercase;
}

#gameScreen .key-icon {
    grid-area: icon;
    align-self: center;
    justify-self: start;
}

#gameScreen .key-count {
    grid-area: count;
    align-self: center;
    justify-self: start;
    line-height: 1;
}

#gameScreen .history-btn {
    grid-area: history;
    min-height: 52px;
    font-family: 'Bangers', cursive;
    letter-spacing: 0.06em;
}

#gameScreen .history-btn::before {
    content: "Riwayat";
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.75);
    margin-bottom: 2px;
}

#gameScreen .user-info {
    grid-area: user;
    position: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: min(360px, calc(100vw - 32px));
    overflow: hidden;
}

#gameScreen .user-info > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#gameScreen #usernameDisplay {
    max-width: 100%;
    overflow-wrap: anywhere;
}

#gameScreen .instruction {
    margin-top: clamp(126px, 18vh, 172px);
}

#gameScreen .instruction p {
    position: relative;
    overflow: hidden;
}

#gameScreen .instruction p::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.08) 35%, transparent 65%);
    transform: translateX(-120%);
    animation: gameInstructionShine 4s linear infinite;
    pointer-events: none;
}

#gameScreen .chests-container {
    max-width: min(920px, calc(100vw - 36px));
    margin-inline: auto;
}

#gameScreen .chest {
    overflow: visible;
}

#gameScreen .chest::after {
    content: "Tap untuk buka";
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(8, 15, 28, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.78);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

#gameScreen .chest:hover:not(.disabled):not(.opening)::after {
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
}

#gameScreen .chest.disabled::after,
#gameScreen .chest.opening::after {
    display: none;
}

@keyframes gameInstructionShine {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@media (max-width: 768px) {
    #gameScreen .header {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "keys history"
            "user user";
        gap: 10px;
    }

    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-width: 0;
        width: 100%;
    }

    #gameScreen .key-counter {
        top: 14px;
        left: 14px;
        padding: 10px 14px 12px;
        border-radius: 18px;
        column-gap: 10px;
    }

    #gameScreen .key-counter::after {
        font-size: 0.6rem;
        letter-spacing: 0.16em;
        white-space: normal;
        line-height: 1.2;
    }

    #gameScreen .key-icon {
        font-size: 1.2rem;
        display: block;
    }

    #gameScreen .key-count {
        font-size: 1.35rem;
    }

    #gameScreen .history-btn {
        top: 14px;
        right: 14px;
        min-height: 50px;
        padding: 8px 12px 10px;
        border-radius: 16px;
        font-size: 0.96rem;
        line-height: 1.05;
        text-align: left;
    }

    #gameScreen .history-btn::before {
        font-size: 0.58rem;
        margin-bottom: 1px;
    }

    #gameScreen .instruction {
        margin-top: 112px;
        padding-inline: 14px;
    }

    #gameScreen .instruction p {
        font-size: 0.98rem;
        line-height: 1.3;
        border-radius: 18px;
    }

    #gameScreen .user-info {
        right: 14px;
        left: 14px;
        bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 10px));
        padding: 12px 14px;
        border-radius: 18px;
        gap: 10px;
    }

    #gameScreen .user-info > span {
        justify-content: center;
        text-align: center;
        font-size: 0.96rem;
    }

    #gameScreen .user-info > span::before {
        font-size: 0.58rem;
        padding: 5px 8px;
    }

    #gameScreen #usernameDisplay {
        font-size: 1.12rem;
    }

    #gameScreen .btn-logout {
        font-size: 0.95rem;
        padding: 10px 14px;
        border-radius: 14px;
    }

    #gameScreen .chests-container {
        max-width: min(360px, calc(100vw - 28px));
        padding: 14px 10px 18px;
    }

    #gameScreen .chest::after {
        display: none;
    }
}

/* === 2026.03 layout refinement patch: cleaner mobile/desktop game HUD, visual only === */
#gameScreen {
    padding-top: clamp(88px, 12vw, 124px);
    padding-bottom: clamp(120px, 16vw, 160px);
}

#gameScreen .header {
    position: fixed;
    top: clamp(12px, 2vw, 22px);
    left: clamp(12px, 2.2vw, 24px);
    right: clamp(12px, 2.2vw, 24px);
    display: grid !important;
    grid-template-columns: minmax(180px, 230px) minmax(170px, 210px) minmax(240px, 340px);
    grid-template-areas: "keys history user";
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    z-index: 120;
    pointer-events: none;
}

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

#gameScreen .key-counter,
#gameScreen .history-btn,
#gameScreen .user-info {
    margin: 0 !important;
}

#gameScreen .key-counter {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100%;
    min-width: 0;
    min-height: 74px;
    padding: 12px 16px 14px;
    border-radius: 20px;
    overflow: hidden;
    align-content: center;
}

#gameScreen .key-counter::after {
    display: block;
    margin-bottom: 4px;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

#gameScreen .key-icon {
    font-size: 1.35rem;
}

#gameScreen .key-count {
    font-size: clamp(1.5rem, 2vw, 1.85rem);
    margin-top: 0;
}

#gameScreen .history-btn {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    min-width: 0;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 16px 14px;
    border-radius: 20px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

#gameScreen .history-btn::before {
    margin-bottom: 6px;
    font-size: 0.64rem;
    letter-spacing: 0.16em;
}

#gameScreen .user-info {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    justify-self: end;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 340px;
    min-height: 74px;
    padding: 12px 14px;
    border-radius: 20px;
    gap: 10px;
}

#gameScreen .user-info > span {
    justify-content: flex-start;
    font-size: 1rem;
}

#gameScreen .user-info > span::before {
    padding: 6px 10px;
}

#gameScreen #usernameDisplay {
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
}

#gameScreen .btn-logout {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.98rem;
    border-radius: 14px;
}

#gameScreen .instruction {
    margin-top: 0 !important;
    padding-inline: clamp(16px, 3vw, 28px);
}

#gameScreen .instruction p {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 26px;
}

#gameScreen .chests-container {
    margin-top: 22px;
    margin-bottom: 0;
    padding: clamp(18px, 2.4vw, 24px);
}

#gameScreen .chests-container::before {
    display: none;
}

#gameScreen .chest {
    width: clamp(120px, 14vw, 152px);
    height: clamp(120px, 14vw, 152px);
}

@media (max-width: 1024px) {
    #gameScreen .header {
        grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr);
        grid-template-areas:
            "keys history"
            "user user";
        align-items: start;
    }

    #gameScreen .user-info {
        justify-self: stretch;
        max-width: none;
    }
}

@media (max-width: 768px) {
    #gameScreen {
        padding-top: 96px;
        padding-bottom: 132px;
    }

    #gameScreen .header {
        top: max(10px, env(safe-area-inset-top, 0px));
        left: 10px;
        right: 10px;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "keys history"
            ". .";
        gap: 10px;
    }

    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-height: 68px;
        border-radius: 18px;
        padding: 10px 12px 12px;
    }

    #gameScreen .key-counter {
        grid-template-columns: auto 1fr;
        column-gap: 8px;
    }

    #gameScreen .key-counter::after,
    #gameScreen .history-btn::before {
        font-size: 0.58rem;
        letter-spacing: 0.14em;
        white-space: nowrap;
        margin-bottom: 4px;
    }

    #gameScreen .key-icon {
        display: inline-block !important;
        font-size: 1.1rem;
    }

    #gameScreen .key-count {
        font-size: 1.25rem;
    }

    #gameScreen .history-btn {
        align-items: flex-start;
        font-size: 0.92rem;
    }

    #gameScreen .instruction {
        padding-inline: 10px;
    }

    #gameScreen .instruction p {
        font-size: 0.92rem;
        line-height: 1.25;
        border-radius: 18px;
        padding: 14px 16px;
    }

    #gameScreen .chests-container {
        max-width: min(350px, calc(100vw - 20px));
        margin-top: 18px;
        padding: 12px 8px 14px;
        border-radius: 22px;
        gap: 8px;
    }

    #gameScreen .chest {
        width: 118px;
        height: 118px;
    }

    #gameScreen .user-info {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px)) !important;
        top: auto !important;
        border-radius: 18px;
        padding: 12px;
        min-height: unset;
        z-index: 121;
    }

    #gameScreen .user-info > span {
        justify-content: center;
        text-align: center;
        font-size: 0.95rem;
    }

    #gameScreen .user-info > span::before {
        font-size: 0.56rem;
        padding: 5px 8px;
    }

    #gameScreen #usernameDisplay {
        font-size: 1.08rem;
    }

    #gameScreen .btn-logout {
        min-height: 42px;
        font-size: 0.92rem;
    }
}

@media (min-width: 769px) {
    #gameScreen .user-info {
        position: relative !important;
    }
}


/* ===== 2026-03 viewport-fit hotfix: login screen only ===== */
#loginScreen.screen {
    justify-content: flex-start;
    gap: clamp(12px, 1.8vh, 18px);
    padding-top: clamp(16px, 3vh, 34px);
    padding-bottom: clamp(20px, 4vh, 36px);
}

#loginScreen .header-logo-container {
    margin-bottom: 0;
    max-width: min(500px, 78vw);
    flex: 0 0 auto;
}

#loginScreen .main-event-logo {
    max-height: min(24vh, 220px);
    width: auto;
    max-width: 100%;
}

#loginScreen .login-card {
    width: min(95%, 450px);
    max-height: none;
    flex: 0 1 auto;
}

#loginScreen .choice-banner {
    margin-top: clamp(10px, 1.8vh, 18px);
    flex: 0 0 auto;
}

#loginScreen .choice-banner img {
    display: block;
    width: min(100%, 420px);
    max-height: min(12vh, 92px);
    object-fit: contain;
}

@media (max-height: 900px) {
    #loginScreen.screen {
        gap: 12px;
        padding-top: 16px;
        padding-bottom: 18px;
    }

    #loginScreen .header-logo-container {
        max-width: min(450px, 74vw);
    }

    #loginScreen .main-event-logo {
        max-height: 21vh;
    }

    #loginScreen .login-card {
        padding: 28px 24px 22px;
    }

    #loginScreen .login-title {
        font-size: clamp(2rem, 4.6vh, 2.35rem);
        margin-bottom: 8px;
    }

    #loginScreen .login-subtitle {
        font-size: 0.92rem;
        line-height: 1.4;
        margin-bottom: 16px;
    }

    #loginScreen .input-group {
        margin-bottom: 12px;
    }

    #loginScreen .input-group input {
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 1.05rem;
    }

    #loginScreen .action-buttons {
        gap: 12px;
        margin-top: 14px;
    }

    #loginScreen .btn-submit,
    #loginScreen .btn-prize,
    #loginScreen .btn-telegram {
        min-height: 50px;
        font-size: 1.08rem;
    }

    #loginScreen .login-meta-row {
        margin-top: 14px;
    }

    #loginScreen .login-meta-pill {
        padding: 7px 10px;
        font-size: 0.76rem;
    }
}

@media (max-height: 760px) {
    #loginScreen.screen {
        gap: 10px;
        padding-top: 12px;
        padding-bottom: 14px;
    }

    #loginScreen .header-logo-container {
        max-width: min(390px, 70vw);
    }

    #loginScreen .main-event-logo {
        max-height: 18vh;
    }

    #loginScreen .login-card {
        padding: 22px 20px 18px;
        border-radius: 18px;
    }

    #loginScreen .login-title {
        font-size: clamp(1.8rem, 4.2vh, 2.1rem);
        margin-bottom: 6px;
    }

    #loginScreen .login-subtitle {
        font-size: 0.86rem;
        line-height: 1.35;
        margin-bottom: 12px;
    }

    #loginScreen .input-group {
        margin-bottom: 10px;
    }

    #loginScreen .input-group input {
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 44px;
        font-size: 1rem;
        border-radius: 12px;
    }

    #loginScreen .input-icon {
        left: 14px;
        font-size: 0.95rem;
    }

    #loginScreen .action-buttons {
        gap: 10px;
        margin-top: 12px;
    }

    #loginScreen .btn-submit,
    #loginScreen .btn-prize,
    #loginScreen .btn-telegram {
        min-height: 46px;
        font-size: 1rem;
        border-radius: 12px;
    }

    #loginScreen .login-meta-row {
        display: none;
    }

    #loginScreen .choice-banner {
        margin-top: 8px;
    }

    #loginScreen .choice-banner img {
        max-height: 72px;
    }
}

@media (max-width: 768px) {
    #loginScreen.screen {
        justify-content: center;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    #loginScreen .header-logo-container {
        max-width: min(420px, 86vw);
    }

    #loginScreen .main-event-logo {
        max-height: none;
        width: 100%;
    }

    #loginScreen .login-card {
        width: min(100%, 420px);
    }

    #loginScreen .choice-banner img {
        width: min(100%, 360px);
        max-height: none;
    }
}

/* === 2026.03 game screen spacing polish patch (visual only, no logic changed) === */
#gameScreen {
    padding-top: clamp(100px, 12vw, 132px);
    padding-bottom: clamp(136px, 16vw, 182px);
}

#gameScreen::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: min(28vh, 220px);
    pointer-events: none;
    background: linear-gradient(180deg, rgba(1, 10, 24, 0) 0%, rgba(2, 10, 24, 0.34) 44%, rgba(4, 10, 18, 0.72) 100%);
    z-index: 0;
}

#gameScreen .header {
    gap: 16px;
}

#gameScreen .key-counter,
#gameScreen .history-btn,
#gameScreen .user-info {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

#gameScreen .instruction {
    position: relative;
    z-index: 2;
    margin-top: clamp(10px, 1.8vw, 18px) !important;
}

#gameScreen .instruction p {
    max-width: min(760px, calc(100vw - 40px));
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 24, 48, 0.92) 0%, rgba(22, 30, 58, 0.8) 100%);
    border: 1px solid rgba(244, 193, 49, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.08);
}

#gameScreen .chests-container {
    position: relative;
    z-index: 2;
    max-width: min(640px, calc(100vw - 36px));
    margin-inline: auto;
    margin-top: clamp(22px, 2.8vw, 30px);
    padding: clamp(18px, 2.8vw, 28px);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(18, 26, 45, 0.28) 0%, rgba(22, 28, 40, 0.16) 100%);
    border: 1px solid rgba(245, 195, 51, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 42px rgba(0,0,0,0.18);
}

#gameScreen .chest {
    border-radius: 24px;
}

#gameScreen .user-info {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.08);
}

#gameScreen .user-info > span {
    line-height: 1.2;
    gap: 8px;
}

#gameScreen .btn-logout {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
    #gameScreen {
        padding-top: max(104px, calc(env(safe-area-inset-top, 0px) + 94px));
        padding-bottom: max(168px, calc(env(safe-area-inset-bottom, 0px) + 146px));
    }

    #gameScreen .header {
        top: max(12px, calc(env(safe-area-inset-top, 0px) + 4px));
        left: 12px;
        right: 12px;
        gap: 12px;
    }

    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-height: 72px;
        padding: 12px 13px 13px;
        border-radius: 19px;
    }

    #gameScreen .key-counter {
        box-shadow: 0 12px 24px rgba(0,0,0,0.22);
    }

    #gameScreen .history-btn {
        box-shadow: 0 12px 24px rgba(0,0,0,0.22);
    }

    #gameScreen .instruction {
        padding-inline: 12px;
        margin-top: 8px !important;
    }

    #gameScreen .instruction p {
        max-width: min(380px, calc(100vw - 24px));
        padding: 15px 18px;
        border-radius: 20px;
        letter-spacing: 0.04em;
    }

    #gameScreen .chests-container {
        max-width: min(350px, calc(100vw - 28px));
        margin-top: 20px;
        padding: 16px 12px 18px;
        border-radius: 26px;
        gap: 10px;
    }

    #gameScreen .user-info {
        left: 12px !important;
        right: 12px !important;
        bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 10px)) !important;
        padding: 14px 12px 12px;
        border-radius: 20px;
        gap: 12px;
    }

    #gameScreen .user-info > span {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 6px;
        column-gap: 8px;
        text-align: center;
        padding-inline: 6px;
    }

    #gameScreen .user-info > span::before {
        margin-right: 0;
    }

    #gameScreen #usernameDisplay {
        display: inline-block;
        max-width: 100%;
        word-break: break-word;
    }

    #gameScreen .btn-logout {
        width: 100%;
        min-height: 44px;
        border-radius: 15px;
        margin-top: 2px;
    }
}

@media (max-width: 430px) {
    #gameScreen {
        padding-top: max(112px, calc(env(safe-area-inset-top, 0px) + 102px));
        padding-bottom: max(176px, calc(env(safe-area-inset-bottom, 0px) + 154px));
    }

    #gameScreen .header {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-height: 74px;
        padding-inline: 12px;
    }

    #gameScreen .key-count {
        font-size: 1.18rem;
    }

    #gameScreen .history-btn {
        font-size: 0.88rem;
    }

    #gameScreen .instruction p {
        font-size: 0.88rem;
    }

    #gameScreen .chests-container {
        max-width: min(336px, calc(100vw - 24px));
        padding: 14px 10px 18px;
    }

    #gameScreen .chest {
        width: 110px;
        height: 110px;
    }

    #gameScreen .user-info {
        padding: 14px 10px 12px;
    }

    #gameScreen .user-info > span {
        font-size: 0.92rem;
    }

    #gameScreen #usernameDisplay {
        font-size: 1.02rem;
    }
}

/* === 2026.03 elegant login refresh patch (visual only, no logic changed) === */
#loginScreen {
    position: relative;
    isolation: isolate;
}

#loginScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 214, 102, 0.16), transparent 28%),
        radial-gradient(circle at 82% 24%, rgba(110, 231, 255, 0.14), transparent 26%),
        radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(3, 10, 20, 0.38) 0%, rgba(5, 10, 22, 0.56) 100%);
    pointer-events: none;
    z-index: 0;
}

#loginScreen > * {
    position: relative;
    z-index: 1;
}

#loginScreen .header-logo-container {
    margin-bottom: 24px;
}

#loginScreen .main-event-logo {
    filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.42));
}

#loginScreen .login-card {
    width: min(100%, 460px);
    padding: 30px 28px 26px;
    border-radius: 28px;
    background:
        linear-gradient(160deg, rgba(9, 18, 34, 0.92) 0%, rgba(8, 17, 31, 0.88) 52%, rgba(7, 14, 27, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.44),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 34px rgba(255, 209, 102, 0.12);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    overflow: hidden;
}

#loginScreen .login-card::before {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 24%, transparent 70%, rgba(255, 214, 102, 0.08));
}

#loginScreen .login-card::after {
    inset: auto 22px 18px 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 214, 102, 0.45), transparent);
}

#loginScreen .login-card.is-hovered {
    border-color: rgba(255, 219, 128, 0.26);
    box-shadow:
        0 30px 82px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 42px rgba(96, 165, 250, 0.12);
}

#loginScreen .login-card-shine {
    background: linear-gradient(115deg, transparent 26%, rgba(255,255,255,0.1) 38%, transparent 50%);
    animation-duration: 8.5s;
}

#loginScreen .login-title {
    margin-bottom: 8px;
    font-size: clamp(2.05rem, 3.3vw, 2.6rem);
    letter-spacing: 1.8px;
    color: #f8fafc;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

#loginScreen .login-subtitle {
    margin: 0 0 22px;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.96rem;
    line-height: 1.65;
}

#loginScreen .input-group {
    margin-bottom: 14px;
}

#loginScreen .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 224, 138, 0.88);
    font-size: 0.98rem;
    z-index: 2;
    transition: color 0.25s ease, transform 0.25s ease;
}

#loginScreen .input-group input {
    min-height: 56px;
    padding: 15px 18px 15px 46px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.04) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    color: #f8fafc;
    font-size: 0.98rem;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.08em;
}

#loginScreen .input-group input::placeholder {
    color: rgba(203, 213, 225, 0.74);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.14em;
}

#loginScreen .input-group:focus-within .input-icon {
    color: #fde68a;
    transform: translateY(-50%) scale(1.08);
}

#loginScreen .input-group:focus-within input {
    border-color: rgba(125, 211, 252, 0.4);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#loginScreen .action-buttons {
    gap: 12px;
    margin-top: 18px;
}

#loginScreen .btn-submit,
#loginScreen .btn-prize,
#loginScreen .btn-telegram {
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.02rem;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: none;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

#loginScreen .btn-submit {
    background: linear-gradient(135deg, #f6d365 0%, #f59e0b 100%);
    color: #111827;
    animation: none;
}

#loginScreen .btn-prize {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #f8fafc;
    border-color: rgba(125, 211, 252, 0.22);
    animation: none;
}

#loginScreen .btn-telegram {
    background: linear-gradient(135deg, #0f766e 0%, #0ea5a4 100%);
    color: #ecfeff;
    font-size: 1rem;
    animation: none;
}

#loginScreen .btn-submit::before,
#loginScreen .btn-prize::before,
#loginScreen .btn-telegram::before {
    opacity: 0.72;
    animation-duration: 3.8s;
}

#loginScreen .btn-submit:hover,
#loginScreen .btn-prize:hover,
#loginScreen .btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

#loginScreen .choice-banner {
    margin-top: 16px;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

#loginScreen .choice-banner img {
    max-width: min(100%, 360px);
}

@media (max-width: 768px) {
    #loginScreen .header-logo-container {
        margin-bottom: 18px;
        max-width: min(420px, 84vw);
    }

    #loginScreen .login-card {
        width: min(100%, 420px);
        padding: 26px 18px 20px;
        border-radius: 22px;
    }

    #loginScreen .login-title {
        font-size: 1.85rem;
    }

    #loginScreen .login-subtitle {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }

    #loginScreen .input-group input {
        min-height: 52px;
        padding-left: 44px;
        border-radius: 14px;
        font-size: 0.94rem;
    }

    #loginScreen .btn-submit,
    #loginScreen .btn-prize,
    #loginScreen .btn-telegram {
        min-height: 50px;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    #loginScreen .choice-banner {
        margin-top: 12px;
    }

    #loginScreen .choice-banner img {
        max-width: min(100%, 300px);
    }
}

@media (max-width: 430px) {
    #loginScreen .action-buttons {
        gap: 10px;
    }

    #loginScreen .btn-submit,
    #loginScreen .btn-prize {
        flex: 1 1 0;
    }
}

/* === 2026.03 premium elegant login card polish (visual only) === */
#loginScreen .login-card {
    position: relative;
    background:
        radial-gradient(circle at 14% 14%, rgba(255, 222, 124, 0.14), transparent 26%),
        radial-gradient(circle at 86% 18%, rgba(34, 197, 94, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(10, 16, 27, 0.96) 0%, rgba(8, 14, 24, 0.95) 54%, rgba(6, 11, 20, 0.98) 100%);
    border: 1px solid rgba(245, 203, 82, 0.24);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 42px rgba(245, 203, 82, 0.12),
        0 0 56px rgba(34, 197, 94, 0.08);
}

#loginScreen .login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 231, 150, 0.96) 0%,
        rgba(242, 199, 80, 0.84) 28%,
        rgba(28, 181, 116, 0.62) 62%,
        rgba(255, 221, 126, 0.92) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.92;
}

#loginScreen .login-card::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 226, 138, 0.92), rgba(16, 185, 129, 0.55), transparent);
    box-shadow: 0 0 14px rgba(255, 214, 102, 0.42);
}

#loginScreen .login-card-shine {
    background: linear-gradient(
        115deg,
        transparent 18%,
        rgba(255, 245, 214, 0.05) 30%,
        rgba(255, 224, 138, 0.18) 40%,
        rgba(16, 185, 129, 0.08) 46%,
        transparent 58%
    );
    animation-duration: 7.6s;
}

#loginScreen .login-title {
    background: linear-gradient(180deg, #fffdf4 0%, #ffe6a3 52%, #ffd36a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

#loginScreen .login-subtitle {
    color: rgba(226, 232, 240, 0.82);
}

#loginScreen .input-group input {
    border-color: rgba(245, 203, 82, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.04) 100%),
        linear-gradient(90deg, rgba(245, 203, 82, 0.03), rgba(16, 185, 129, 0.035));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(255, 255, 255, 0.015);
}

#loginScreen .input-icon {
    color: rgba(255, 221, 126, 0.9);
}

#loginScreen .input-group:focus-within input {
    border-color: rgba(74, 222, 128, 0.38);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.06) 100%),
        linear-gradient(90deg, rgba(255, 223, 128, 0.06), rgba(16, 185, 129, 0.08));
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.10),
        0 0 24px rgba(245, 203, 82, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#loginScreen .input-group:focus-within .input-icon {
    color: #fef3c7;
}

#loginScreen .btn-submit,
#loginScreen .btn-prize,
#loginScreen .btn-telegram {
    border-color: rgba(255, 226, 138, 0.18);
    box-shadow:
        0 14px 24px rgba(0, 0, 0, 0.26),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

#loginScreen .btn-submit {
    background: linear-gradient(135deg, #ffe398 0%, #f3b43a 52%, #dd8f11 100%);
    color: #1f2937;
}

#loginScreen .btn-prize {
    background: linear-gradient(135deg, #103424 0%, #0f5e49 54%, #10a37f 100%);
    color: #f8fafc;
    border-color: rgba(52, 211, 153, 0.26);
}

#loginScreen .btn-telegram {
    background: linear-gradient(135deg, #0f172a 0%, #164e63 55%, #0ea5a4 100%);
    border-color: rgba(103, 232, 249, 0.22);
}

#loginScreen .btn-submit:hover,
#loginScreen .btn-prize:hover,
#loginScreen .btn-telegram:hover {
    box-shadow:
        0 18px 30px rgba(0, 0, 0, 0.32),
        0 0 26px rgba(255, 221, 126, 0.12);
}

@media (max-width: 768px) {
    #loginScreen .login-card {
        box-shadow:
            0 20px 52px rgba(0, 0, 0, 0.46),
            0 0 0 1px rgba(255, 255, 255, 0.025) inset,
            0 0 30px rgba(245, 203, 82, 0.10);
    }

    #loginScreen .login-card::after {
        left: 18px;
        right: 18px;
    }
}


/* === 2026.03 premium elegant prize modal polish (visual only) === */
#prizeModal {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 220, 120, 0.12), transparent 30%),
        radial-gradient(circle at 82% 16%, rgba(34, 197, 94, 0.14), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(15, 118, 110, 0.18), transparent 42%),
        rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(12px) saturate(140%);
}

#prizeModal .prize-modal-content {
    position: relative;
    isolation: isolate;
    width: min(92vw, 430px) !important;
    max-width: 430px !important;
    max-height: min(84vh, 760px);
    padding: 26px 22px 20px;
    border: 1px solid rgba(245, 203, 82, 0.22);
    border-radius: 28px;
    background:
        radial-gradient(circle at 14% 14%, rgba(255, 222, 124, 0.16), transparent 24%),
        radial-gradient(circle at 86% 18%, rgba(34, 197, 94, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(11, 17, 29, 0.98) 0%, rgba(7, 12, 22, 0.97) 52%, rgba(5, 10, 18, 0.99) 100%);
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 42px rgba(245, 203, 82, 0.12),
        0 0 56px rgba(16, 185, 129, 0.08);
    overflow: hidden;
}

#prizeModal .prize-modal-content::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 231, 150, 0.95) 0%,
        rgba(242, 199, 80, 0.82) 28%,
        rgba(28, 181, 116, 0.58) 62%,
        rgba(255, 221, 126, 0.9) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.95;
    pointer-events: none;
}

#prizeModal .prize-modal-content::after {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 229, 141, 0.96), rgba(16, 185, 129, 0.58), transparent);
    box-shadow: 0 0 16px rgba(255, 214, 102, 0.4);
    pointer-events: none;
}

#prizeModal .modal-title {
    position: relative;
    z-index: 1;
    margin: 0 52px 14px;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    letter-spacing: 1.8px;
    line-height: 1.05;
    background: linear-gradient(180deg, #fffdf4 0%, #ffe4a3 54%, #ffd36a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none !important;
}

#prizeModal .close-btn {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 227, 138, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.26),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    color: #ffe7a8;
    font-size: 1.85rem;
    line-height: 1;
    z-index: 2;
}

#prizeModal .close-btn:hover {
    color: #fff7dc;
    transform: translateY(-2px) scale(1.06);
    border-color: rgba(255, 228, 145, 0.34);
    box-shadow:
        0 14px 26px rgba(0, 0, 0, 0.32),
        0 0 18px rgba(245, 203, 82, 0.12);
}

#prizeModal .prize-grid {
    position: relative;
    z-index: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 2px 4px;
    margin-top: 10px;
    overflow-y: auto;
}

#prizeModal .prize-item {
    position: relative;
    min-height: 126px;
    padding: 14px 8px 12px;
    border: 1px solid rgba(255, 226, 138, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.03) 100%),
        linear-gradient(145deg, rgba(18, 28, 44, 0.96) 0%, rgba(11, 19, 32, 0.96) 58%, rgba(9, 17, 28, 0.98) 100%);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

#prizeModal .prize-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 225, 133, 0.14), transparent 42%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.04), transparent 45%);
    opacity: 0.95;
    pointer-events: none;
}

#prizeModal .prize-item:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(255, 227, 138, 0.34);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.34),
        0 0 24px rgba(245, 203, 82, 0.1),
        0 0 18px rgba(16, 185, 129, 0.06);
}

#prizeModal .prize-image {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    object-fit: contain;
    filter:
        drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35))
        drop-shadow(0 0 8px rgba(255, 215, 0, 0.22));
}

#prizeModal .prize-name {
    position: relative;
    z-index: 1;
    color: #f8fafc;
    font-size: 0.92rem;
    line-height: 1.15;
    letter-spacing: 0.55px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

#prizeModal .prize-grid::-webkit-scrollbar {
    width: 8px;
}

#prizeModal .prize-grid::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.44);
    border-radius: 999px;
}

#prizeModal .prize-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 222, 124, 0.9), rgba(16, 185, 129, 0.85));
    border-radius: 999px;
}

#prizeModal .prize-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 229, 143, 0.98), rgba(20, 184, 166, 0.95));
}

@media (max-width: 768px) {
    #prizeModal .prize-modal-content {
        width: min(94vw, 400px) !important;
        max-height: 82vh;
        padding: 22px 16px 16px;
        border-radius: 24px;
        box-shadow:
            0 22px 54px rgba(0, 0, 0, 0.52),
            0 0 0 1px rgba(255, 255, 255, 0.025) inset,
            0 0 26px rgba(245, 203, 82, 0.1);
    }

    #prizeModal .prize-modal-content::after {
        left: 18px;
        right: 18px;
    }

    #prizeModal .modal-title {
        margin: 0 46px 12px;
        letter-spacing: 1.35px;
    }

    #prizeModal .prize-grid {
        gap: 10px;
    }

    #prizeModal .prize-item {
        min-height: 116px;
        padding: 12px 6px 10px;
        border-radius: 16px;
    }

    #prizeModal .prize-image {
        width: 64px;
        height: 64px;
    }

    #prizeModal .prize-name {
        font-size: 0.84rem;
    }
}

@media (max-width: 420px) {
    #prizeModal .prize-modal-content {
        width: calc(100vw - 18px) !important;
        padding: 20px 12px 14px;
        border-radius: 22px;
    }

    #prizeModal .modal-title {
        margin: 0 40px 12px;
        font-size: 1.32rem;
    }

    #prizeModal .close-btn {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 1.6rem;
    }

    #prizeModal .prize-grid {
        gap: 8px;
    }

    #prizeModal .prize-item {
        min-height: 108px;
        padding: 10px 4px 9px;
        border-radius: 14px;
    }

    #prizeModal .prize-image {
        width: 58px;
        height: 58px;
        margin-bottom: 6px;
    }

    #prizeModal .prize-name {
        font-size: 0.78rem;
        letter-spacing: 0.3px;
    }
}

/* === 2026.03 premium elegant gamescreen HUD patch (visual only, no logic changed) === */
#gameScreen {
    --hud-gold-1: #f7df8a;
    --hud-gold-2: #c89b33;
    --hud-emerald-1: #64f0ba;
    --hud-emerald-2: #0ea976;
    --hud-ink-1: rgba(7, 16, 30, 0.88);
    --hud-ink-2: rgba(9, 22, 38, 0.82);
    --hud-ink-3: rgba(4, 12, 22, 0.72);
}

#gameScreen .header {
    gap: clamp(14px, 1.7vw, 18px);
}

#gameScreen .key-counter,
#gameScreen .history-btn,
#gameScreen .user-info {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(247, 223, 138, 0.24) !important;
    background:
        radial-gradient(circle at top right, rgba(100, 240, 186, 0.15), transparent 34%),
        radial-gradient(circle at top left, rgba(247, 223, 138, 0.16), transparent 42%),
        linear-gradient(150deg, rgba(9, 20, 36, 0.96) 0%, rgba(11, 24, 40, 0.92) 58%, rgba(5, 14, 24, 0.94) 100%) !important;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        inset 0 1px 0 rgba(255, 247, 215, 0.09),
        inset 0 -14px 28px rgba(0, 0, 0, 0.16),
        0 0 22px rgba(200, 155, 51, 0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#gameScreen .key-counter::before,
#gameScreen .history-btn::after,
#gameScreen .user-info::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.15), rgba(255,255,255,0.02) 24%, transparent 42%),
        radial-gradient(circle at 82% 16%, rgba(247, 223, 138, 0.18), transparent 26%);
    pointer-events: none;
    opacity: 0.9;
    z-index: -1;
}

#gameScreen .key-counter {
    border-radius: 24px;
    padding: 14px 18px 16px;
}

#gameScreen .key-counter::after {
    content: "Kunci Aktif";
    color: rgba(255, 247, 215, 0.9);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.36);
    letter-spacing: 0.22em;
}

#gameScreen .key-icon {
    font-size: 1.4rem;
    filter:
        drop-shadow(0 4px 10px rgba(255, 205, 74, 0.28))
        drop-shadow(0 0 12px rgba(100, 240, 186, 0.16));
}

#gameScreen .key-count {
    color: #fff0b7;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.45),
        0 0 14px rgba(247, 223, 138, 0.14);
}

#gameScreen .history-btn {
    align-items: flex-start;
    justify-content: center;
    border-radius: 24px;
    padding: 14px 18px 16px;
    color: #f8fbff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

#gameScreen .history-btn::before {
    content: "Treasury Log";
    color: rgba(180, 245, 220, 0.86);
    letter-spacing: 0.24em;
    margin-bottom: 7px;
}

#gameScreen .history-btn:hover {
    transform: translateY(-3px);
    border-color: rgba(247, 223, 138, 0.44) !important;
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(200, 155, 51, 0.12),
        0 0 18px rgba(14, 169, 118, 0.07);
}

#gameScreen .history-btn:active {
    transform: translateY(-1px) scale(0.99);
}

#gameScreen .user-info {
    border-radius: 26px;
    padding: 14px 16px 16px;
    gap: 12px;
}

#gameScreen .user-info > span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eef8f4;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#gameScreen .user-info > span::before {
    content: "VIP Player";
    color: rgba(255, 246, 213, 0.88);
    border: 1px solid rgba(247, 223, 138, 0.22);
    background: linear-gradient(180deg, rgba(247, 223, 138, 0.12), rgba(255,255,255,0.03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

#gameScreen #usernameDisplay {
    display: inline-block;
    padding: 3px 0;
    color: #ffe7a1;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.4),
        0 0 12px rgba(247, 223, 138, 0.14);
}

#gameScreen .btn-logout {
    position: relative;
    z-index: 1;
    width: 100%;
    border: 1px solid rgba(247, 223, 138, 0.35) !important;
    background:
        linear-gradient(180deg, rgba(255, 230, 154, 0.2) 0%, rgba(200, 155, 51, 0.18) 8%, rgba(14, 169, 118, 0.16) 100%),
        linear-gradient(145deg, rgba(16, 34, 28, 0.88) 0%, rgba(10, 24, 20, 0.94) 100%) !important;
    color: #fff6d2 !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    letter-spacing: 0.18em;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 0 18px rgba(14, 169, 118, 0.08);
}

#gameScreen .btn-logout:hover {
    transform: translateY(-2px);
    border-color: rgba(247, 223, 138, 0.5) !important;
    box-shadow:
        0 16px 28px rgba(0, 0, 0, 0.3),
        0 0 18px rgba(247, 223, 138, 0.12),
        0 0 18px rgba(14, 169, 118, 0.1);
}

#gameScreen .instruction {
    margin-top: clamp(12px, 2.2vw, 22px) !important;
}

#gameScreen .instruction p {
    position: relative;
    padding: 16px 26px 17px;
    border-radius: 22px;
    border: 1px solid rgba(247, 223, 138, 0.28);
    background:
        linear-gradient(180deg, rgba(17, 26, 45, 0.92) 0%, rgba(8, 18, 32, 0.88) 100%),
        linear-gradient(90deg, rgba(100, 240, 186, 0.08), transparent 30%, rgba(247, 223, 138, 0.08) 100%);
    color: #fff6d5;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.96rem, 1.45vw, 1.08rem);
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255,255,255,0.07),
        0 0 20px rgba(200, 155, 51, 0.08);
}

#gameScreen .instruction p::before {
    content: "✦";
    display: inline-block;
    margin-right: 10px;
    color: var(--hud-gold-1);
    text-shadow: 0 0 12px rgba(247, 223, 138, 0.2);
}

#gameScreen .instruction p::after {
    content: "✦";
    display: inline-block;
    margin-left: 10px;
    color: var(--hud-emerald-1);
    text-shadow: 0 0 12px rgba(100, 240, 186, 0.22);
}

@media (max-width: 1024px) {
    #gameScreen .user-info {
        max-width: none;
    }
}

@media (max-width: 768px) {
    #gameScreen .header {
        gap: 10px;
    }

    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-height: 74px;
        border-radius: 20px;
        padding: 12px 13px 14px;
    }

    #gameScreen .key-counter::after,
    #gameScreen .history-btn::before {
        font-size: 0.56rem;
        letter-spacing: 0.18em;
        margin-bottom: 6px;
    }

    #gameScreen .history-btn {
        font-size: 0.9rem;
    }

    #gameScreen .user-info {
        border-radius: 22px;
        padding: 14px 12px 13px;
        box-shadow:
            0 20px 32px rgba(0, 0, 0, 0.34),
            0 0 0 1px rgba(255,255,255,0.03) inset,
            inset 0 1px 0 rgba(255,255,255,0.08);
    }

    #gameScreen .user-info > span {
        justify-content: center;
        text-align: center;
        gap: 8px;
        line-height: 1.3;
    }

    #gameScreen .user-info > span::before {
        font-size: 0.54rem;
        letter-spacing: 0.18em;
        padding: 5px 8px;
    }

    #gameScreen #usernameDisplay {
        font-size: 1.04rem;
    }

    #gameScreen .btn-logout {
        min-height: 44px;
        border-radius: 15px;
        font-size: 0.84rem;
        letter-spacing: 0.16em;
    }

    #gameScreen .instruction {
        padding-inline: 12px;
        margin-top: 10px !important;
    }

    #gameScreen .instruction p {
        max-width: min(390px, calc(100vw - 24px));
        padding: 14px 16px 15px;
        border-radius: 18px;
        font-size: 0.82rem;
        letter-spacing: 0.12em;
        line-height: 1.35;
    }

    #gameScreen .instruction p::before,
    #gameScreen .instruction p::after {
        margin-inline: 6px;
    }
}

@media (max-width: 430px) {
    #gameScreen .key-counter,
    #gameScreen .history-btn {
        min-height: 72px;
        padding-inline: 12px;
    }

    #gameScreen .key-count {
        font-size: 1.22rem;
    }

    #gameScreen .history-btn {
        font-size: 0.84rem;
    }

    #gameScreen .user-info {
        padding: 13px 10px 12px;
    }

    #gameScreen .user-info > span {
        font-size: 0.9rem;
    }

    #gameScreen .instruction p {
        font-size: 0.78rem;
        letter-spacing: 0.1em;
    }
}
