body { 
    background-color: #0B0E14; 
    color: white; 
    margin: 0; 
    padding: 0; 
    overscroll-behavior-y: contain; 
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
}

/* Views Management */
.view { display: none; width: 100%; height: 100%; }
.view.active { display: flex; }

/* Game Board Styles */
.game-board { 
    position: relative; 
    width: 100%; 
    height: 550px; 
    background-color: #131722; 
    border-radius: 1rem; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.6); 
    border: 1px solid #1f2937; 
    overflow: hidden; 
}
#chart-container { width: 100%; height: 100%; }
#drawing-canvas { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 10; 
    cursor: crosshair; 
    touch-action: none; 
}
#result-overlay { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(11, 14, 20, 0.85); 
    z-index: 20; 
    display: none; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(8px); 
}

/* Effects & Modals */
.premium-glow:hover { box-shadow: 0 0 25px rgba(99, 102, 241, 0.7); transform: translateY(-2px); }
.modal-bg { background-color: rgba(0,0,0,0.75); backdrop-filter: blur(5px); z-index: 50; }
.checkbox-custom:checked { background-color: #00ffcc; border-color: #00ffcc; }

/* Scrollbars */
.legal-content { max-height: 60vh; overflow-y: auto; padding-right: 10px; font-size: 0.875rem; color: #9ca3af; }
.legal-content::-webkit-scrollbar, .admin-table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.legal-content::-webkit-scrollbar-track, .admin-table-container::-webkit-scrollbar-track { background: #131722; }
.legal-content::-webkit-scrollbar-thumb, .admin-table-container::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }

/* Main Menu Background Pattern */
.bg-grid-pattern { 
    background-image: linear-gradient(to right, #1f2937 1px, transparent 1px), linear-gradient(to bottom, #1f2937 1px, transparent 1px); 
    background-size: 40px 40px; 
}

/* Timer Pulse Animation */
.timer-pulse { animation: pulse 1s infinite; }
@keyframes pulse { 
    0%, 100% { opacity: 1; transform: scale(1); } 
    50% { opacity: 0.8; transform: scale(1.05); color: #ef5350; } 
}
/* Big chart history slider */
.chart-history-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(79,70,229,0.65), rgba(0,255,204,0.85));
    outline: none;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.5), 0 0 18px rgba(0,255,204,0.12);
}
.chart-history-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #00ffcc;
    border: 5px solid #0B0E14;
    cursor: pointer;
    box-shadow: 0 0 22px rgba(0,255,204,0.75);
}
.chart-history-slider::-moz-range-thumb {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #00ffcc;
    border: 5px solid #0B0E14;
    cursor: pointer;
    box-shadow: 0 0 22px rgba(0,255,204,0.75);
}

/* Profile achievements */
.achievement-mini {
    min-height: 98px;
    background: linear-gradient(180deg, rgba(31,41,55,0.85), rgba(11,14,20,0.95));
    border: 1px solid rgba(0,255,204,0.16);
    border-radius: 14px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.25);
}
.achievement-mini img,
.achievement-mini-fallback {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
}
.achievement-mini-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,255,204,0.1);
    border: 1px solid rgba(0,255,204,0.25);
    font-size: 24px;
}
.achievement-mini span {
    color: #e5e7eb;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
}

/* Achievement unlock toast */
.achievement-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: min(420px, calc(100vw - 32px));
    z-index: 80;
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    pointer-events: none;
}
.achievement-toast-show {
    animation: achievementIn 0.45s ease forwards;
}
.achievement-toast-glow {
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(0,255,204,0.9), rgba(79,70,229,0.85), rgba(251,191,36,0.85));
    filter: blur(10px);
    opacity: 0.7;
}
.achievement-toast-content {
    position: relative;
    background: rgba(11,14,20,0.96);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
}
.achievement-toast-icon-wrap {
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(0,255,204,0.22), rgba(79,70,229,0.16));
    border: 1px solid rgba(0,255,204,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.achievement-toast-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.achievement-toast-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}
.achievement-toast-kicker {
    color: #00ffcc;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    font-weight: 900;
    margin: 0 0 4px 0;
}
.achievement-toast-title {
    color: white;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 900;
    margin: 0 0 5px 0;
}
.achievement-toast-description {
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}
@keyframes achievementIn {
    0% { opacity: 0; transform: translateY(24px) scale(0.96); }
    70% { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}


/* Mobile Game UX: keep the important actions reachable while drawing */
@media (max-width: 640px) {
    #view-game {
        padding-bottom: 110px !important;
    }

    .game-board {
        height: 62vh;
        min-height: 420px;
        max-height: 620px;
    }

    .mobile-game-actions {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 65;
        display: grid !important;
        grid-template-columns: 1fr 104px;
        gap: 10px !important;
        padding: 10px !important;
        border-radius: 18px !important;
        background: rgba(19, 23, 34, 0.96) !important;
        border: 1px solid rgba(0,255,204,0.22) !important;
        box-shadow: 0 -10px 35px rgba(0,0,0,0.55), 0 0 22px rgba(0,255,204,0.08);
        backdrop-filter: blur(14px);
    }

    #btn-submit {
        order: 1;
        width: 100% !important;
        min-height: 58px;
        padding: 14px 16px !important;
        font-size: 16px !important;
        border-radius: 14px !important;
    }

    #btn-clear {
        order: 2;
        width: 100% !important;
        min-height: 58px;
        padding: 14px 10px !important;
        font-size: 13px !important;
        border-radius: 14px !important;
    }

    #btn-clear svg,
    #btn-submit svg {
        width: 18px;
        height: 18px;
    }
}

/* V2 progression / profiles / feedback */
.achievement-card-full {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(11, 14, 20, 0.75);
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 16px;
}
.achievement-card-emoji {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.achievement-card-full h4 {
    color: #fff;
    font-weight: 900;
    margin: 0 0 4px 0;
}
.achievement-card-full p {
    color: #9ca3af;
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.35;
}
.achievement-card-full span {
    color: #00ffcc;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.profile-stat {
    background: #0B0E14;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}
.profile-stat span {
    display: block;
    color: #6b7280;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}
.profile-stat b {
    color: #fff;
    font-size: 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.daily-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 10px;
    background: #0B0E14;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 10px 12px;
}
.daily-row b, .daily-row button { color: #fff; font-weight: 900; text-align: left; }
.daily-row button:hover { color: #00ffcc; }
.daily-row em { color: #00ffcc; font-style: normal; font-weight: 900; }
.smart-feedback {
    margin-top: 18px;
    text-align: left;
    background: rgba(11, 14, 20, 0.88);
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 16px 18px;
    max-width: 620px;
}
.smart-feedback p {
    color: #00ffcc;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 8px 0;
}
.smart-feedback ul {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.5;
}


/* Mobile result overlay: compact, scrollable, with visible action buttons */
@media (max-width: 640px) {
    #result-overlay {
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
        padding: 18px 12px calc(18px + env(safe-area-inset-bottom)) 12px;
        gap: 10px;
    }
    #result-title {
        font-size: 2.05rem !important;
        line-height: 1.05 !important;
        margin-bottom: 8px !important;
        margin-top: 2px !important;
    }
    #result-points {
        width: 100%;
        margin-bottom: 10px !important;
        padding: 14px 12px !important;
        border-radius: 18px !important;
    }
    #result-points .text-5xl,
    #result-points .md\:text-6xl {
        font-size: 2.25rem !important;
        line-height: 1.05 !important;
    }
    #result-points .text-2xl {
        font-size: 1rem !important;
        padding: 9px 14px !important;
        margin-top: 8px !important;
    }
    .smart-feedback {
        margin-top: 10px !important;
        padding: 10px 12px !important;
        max-width: none !important;
    }
    .smart-feedback p {
        font-size: 10px !important;
        margin-bottom: 5px !important;
    }
    .smart-feedback ul {
        font-size: 12px !important;
        line-height: 1.35 !important;
    }
    #result-overlay > .flex {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px !important;
        padding-bottom: 2px;
    }
    #result-overlay button {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }
}

/* Language menu & first-run onboarding */
#language-menu button { white-space: nowrap; }
.onboarding-card {
    background: #0B0E14;
    border: 1px solid #1f2937;
    border-radius: 1.25rem;
    padding: 1.25rem;
    text-align: center;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}
.onboarding-icon { font-size: 2.25rem; }
.onboarding-card h3 { color: #fff; font-weight: 900; font-size: 1.05rem; }
.onboarding-card p { color: #9ca3af; font-size: 0.92rem; line-height: 1.45; }
@media (max-width: 640px) {
    #language-switcher { order: 2; }
    #auth-buttons { order: 4; }
    .onboarding-card { min-height: auto; padding: 1rem; }
}

/* Mobile onboarding overlay: keep first-run tutorial inside the screen */
#onboarding-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
}

#onboarding-modal > div {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

@supports not (height: 100dvh) {
    #onboarding-modal > div {
        max-height: calc(100vh - 32px);
    }
}

@media (max-width: 640px) {
    #onboarding-modal {
        align-items: flex-start;
        justify-content: center;
        padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) 10px !important;
    }

    #onboarding-modal > div {
        max-width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 16px 14px 14px 14px !important;
        border-radius: 20px !important;
    }

    #onboarding-modal button[onclick="finishOnboarding()"].absolute {
        top: 8px !important;
        right: 12px !important;
        font-size: 28px !important;
        line-height: 1 !important;
        z-index: 2;
    }

    #onboarding-modal h2 {
        font-size: 1.65rem !important;
        line-height: 1.1 !important;
        margin: 0 34px 12px 34px !important;
    }

    #onboarding-modal .grid {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    #onboarding-modal .onboarding-card {
        padding: 10px 12px !important;
        border-radius: 14px !important;
        gap: 5px !important;
    }

    #onboarding-modal .onboarding-icon {
        font-size: 1.55rem !important;
        line-height: 1 !important;
    }

    #onboarding-modal .onboarding-card h3 {
        font-size: 0.95rem !important;
        line-height: 1.15 !important;
    }

    #onboarding-modal .onboarding-card p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }

    #onboarding-modal > div > button:last-child {
        min-height: 46px;
        padding: 11px 12px !important;
        font-size: 0.95rem !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 640px) and (max-height: 680px) {
    #onboarding-modal > div {
        padding: 12px 12px 12px 12px !important;
    }

    #onboarding-modal h2 {
        font-size: 1.45rem !important;
        margin-bottom: 8px !important;
    }

    #onboarding-modal .grid {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    #onboarding-modal .onboarding-card {
        padding: 8px 10px !important;
    }

    #onboarding-modal .onboarding-icon {
        font-size: 1.35rem !important;
    }

    #onboarding-modal .onboarding-card h3 {
        font-size: 0.88rem !important;
    }

    #onboarding-modal .onboarding-card p {
        font-size: 0.74rem !important;
        line-height: 1.25 !important;
    }

    #onboarding-modal > div > button:last-child {
        min-height: 42px;
        padding: 9px 10px !important;
        font-size: 0.88rem !important;
    }
}

/* Cash contests / prize pool UI */
.prize-hub-card {
    background: linear-gradient(180deg, rgba(251,191,36,0.12), rgba(19,23,34,0.94));
    border: 1px solid rgba(251,191,36,0.32);
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 18px 70px rgba(0,0,0,0.42), inset 0 0 24px rgba(251,191,36,0.04);
}
.prize-kicker {
    color: #facc15;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.16em;
    font-weight: 900;
    margin-bottom: 3px;
}
.prize-countdown {
    background: rgba(11,14,20,0.7);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 12px 14px;
    color: #e5e7eb;
    font-size: 14px;
}
.prize-countdown strong { color: #facc15; }
.prize-row em { color: #facc15 !important; font-weight: 900; }
.prize-subtitle {
    color: #9ca3af;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
    margin: 12px 0 8px;
}
.prize-legal, .prize-rules {
    margin-top: 14px;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.45;
}
.prize-rules { color: #6b7280; }
.wallet-settings-box {
    background: rgba(11,14,20,0.88);
    border: 1px solid rgba(0,255,204,0.18);
    border-radius: 18px;
    padding: 14px;
}
.wallet-input, .admin-input, .admin-textarea {
    width: 100%;
    background: #0B0E14;
    border: 1px solid #374151;
    color: #fff;
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
}
.wallet-input:focus, .admin-input:focus, .admin-textarea:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 0 3px rgba(0,255,204,0.08);
}
.wallet-save-btn, .admin-green-btn, .admin-dark-btn, .admin-red-btn {
    border-radius: 12px;
    padding: 11px 14px;
    font-weight: 900;
    transition: transform .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.wallet-save-btn, .admin-green-btn { background: #00ffcc; color: #06110f; }
.admin-dark-btn { background: #1f2937; color: #fff; border: 1px solid #374151; }
.admin-red-btn { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.wallet-save-btn:hover, .admin-green-btn:hover, .admin-dark-btn:hover, .admin-red-btn:hover { transform: translateY(-1px); }
.admin-prize-panel {
    width: 100%;
    margin: 24px 0;
    background: rgba(19,23,34,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    padding: 20px;
}
.admin-prize-card {
    background: rgba(11,14,20,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 16px;
}
.admin-label {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
    margin: 12px 0 7px;
}
.admin-textarea { min-height: 92px; resize: vertical; }
.admin-winners-list { display: flex; flex-direction: column; gap: 10px; }
.admin-winner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(19,23,34,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px;
}
.admin-winner-row p { color: #9ca3af; font-size: 12px; margin-top: 3px; word-break: break-all; }
.stream-live-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 18px;
    padding: 12px;
}
.stream-live-box p { color: #fca5a5; font-size: 12px; margin-top: 2px; }
.stream-live-box button {
    background: #facc15;
    color: #111827;
    border-radius: 12px;
    font-weight: 900;
    padding: 10px 14px;
}
.stream-live-box-wait { background: rgba(250,204,21,0.10); border-color: rgba(250,204,21,0.28); }
.stream-winner {
    margin-top: 12px;
    background: rgba(250,204,21,0.12);
    border: 1px solid rgba(250,204,21,0.28);
    border-radius: 16px;
    padding: 12px;
    color: #fde68a;
    font-weight: 800;
}

@media (max-width: 640px) {
    .prize-hub-card { padding: 16px; border-radius: 22px; }
    .prize-hub-card h3 { font-size: 20px !important; }
    .prize-countdown { font-size: 12px; }
    .wallet-settings-box { padding: 12px; }
    .wallet-save-btn { width: 100%; }
    .admin-prize-panel { padding: 14px; border-radius: 20px; }
    .admin-winner-row, .stream-live-box { align-items: stretch; flex-direction: column; }
    .stream-live-box button { width: 100%; }
}


/* Cash contest stream modal */
.stream-modal-card {
    width: min(560px, calc(100vw - 28px));
    max-height: min(720px, calc(100vh - 32px));
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, rgba(19,23,34,0.98), rgba(11,14,20,0.98));
    border: 1px solid rgba(0,255,204,0.22);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 24px 90px rgba(0,0,0,0.7), 0 0 28px rgba(0,255,204,0.12);
}
.stream-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 24px;
    line-height: 1;
}
.stream-join-main {
    flex: 1;
    background: linear-gradient(135deg, #00ffcc, #facc15);
    color: #0B0E14;
    font-weight: 900;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: 0 0 22px rgba(0,255,204,0.24);
}
.stream-later-btn {
    background: rgba(255,255,255,0.06);
    color: #d1d5db;
    font-weight: 800;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
}
@media (max-width: 640px) {
    .stream-modal-card { padding: 18px; border-radius: 22px; }
    .prize-hub-card { margin-top: 18px; }
}

.wallet-display-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(11,14,20,0.7);
    border: 1px solid rgba(0,255,204,0.18);
    border-radius: 12px;
    padding: 10px 12px;
}
.wallet-masked {
    color: #00ffcc;
    font-weight: 900;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}
.wallet-change-btn {
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
}
.wallet-change-btn:hover { background: rgba(255,255,255,0.1); }
.admin-user-link {
    color: #00ffcc;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 900;
}

.admin-wallet-full { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; word-break: break-all; color: #00ffcc; }


/* Stream challenge results inside game result overlay: keep it compact and safe on mobile */
#result-points {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
}
#stream-live-result-list {
    width: min(620px, 100%);
    margin: 12px auto 0 auto;
}
.stream-result-compact .stream-winner {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.25;
}
.stream-result-compact .daily-row {
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    margin-top: 6px;
    font-size: 13px;
}
.stream-result-compact .daily-row span {
    font-size: 16px;
}
.stream-result-compact .daily-row button {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stream-more-row {
    margin-top: 6px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
}
@media (max-width: 640px) {
    #result-points {
        max-height: none;
        overflow: visible;
    }
    #stream-live-result-list {
        margin-top: 8px;
    }
    .stream-result-compact .stream-winner {
        font-size: 12px;
        padding: 8px 10px;
    }
    .stream-result-compact .daily-row {
        grid-template-columns: 28px 1fr auto;
        padding: 6px 8px;
        font-size: 12px;
    }
}


/* Desktop stream result overlay fix:
   Keep the title and action buttons visible while the middle result panel scrolls.
   This only activates for Stream Challenge results and does not change normal rounds. */
#result-overlay.stream-result-mode {
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    padding: 12px 16px;
    gap: 8px;
}

#result-overlay.stream-result-mode #result-title {
    flex: 0 0 auto;
    font-size: clamp(2rem, 5vh, 3.25rem) !important;
    line-height: 1.02 !important;
    margin: 0 0 4px 0 !important;
}

#result-overlay.stream-result-mode #result-points {
    flex: 1 1 auto;
    min-height: 0;
    width: min(720px, 100%);
    max-height: none;
    overflow-y: auto;
    margin: 0 auto 6px auto !important;
    padding: 10px 12px !important;
    border-radius: 18px;
    scrollbar-width: thin;
}

#result-overlay.stream-result-mode #result-points .text-5xl,
#result-overlay.stream-result-mode #result-points .md\:text-6xl {
    font-size: clamp(2rem, 5.2vh, 3rem) !important;
    line-height: 1.02 !important;
}

#result-overlay.stream-result-mode #result-points .text-2xl {
    font-size: 0.9rem !important;
    padding: 7px 11px !important;
    margin-top: 7px !important;
}

#result-overlay.stream-result-mode .smart-feedback {
    margin-top: 8px !important;
    padding: 8px 10px !important;
    max-width: 620px !important;
}

#result-overlay.stream-result-mode .smart-feedback p {
    font-size: 10px !important;
    margin-bottom: 4px !important;
}

#result-overlay.stream-result-mode .smart-feedback ul {
    font-size: 12px !important;
    line-height: 1.28 !important;
}

#result-overlay.stream-result-mode #stream-live-result-list {
    margin-top: 7px;
    width: min(520px, 100%);
}

#result-overlay.stream-result-mode .stream-result-compact .stream-winner {
    margin-top: 6px;
    padding: 7px 10px;
    font-size: 12px;
}

#result-overlay.stream-result-mode .stream-result-compact .daily-row {
    grid-template-columns: 28px 1fr auto;
    gap: 7px;
    padding: 5px 8px;
    margin-top: 4px;
    font-size: 12px;
}

#result-overlay.stream-result-mode .stream-result-compact .daily-row span {
    font-size: 15px;
}

#result-overlay.stream-result-mode .stream-more-row {
    font-size: 11px;
    margin-top: 4px;
}

#result-overlay.stream-result-mode > .flex {
    flex: 0 0 auto;
    width: min(620px, 100%);
    margin-top: 0 !important;
    gap: 10px !important;
}

#result-overlay.stream-result-mode > .flex button {
    min-height: 42px;
    padding: 10px 16px !important;
}

@media (max-width: 640px) {
    #result-overlay.stream-result-mode {
        overflow: hidden;
        padding: 12px 10px calc(12px + env(safe-area-inset-bottom)) 10px;
    }

    #result-overlay.stream-result-mode #result-title {
        font-size: 1.85rem !important;
    }

    #result-overlay.stream-result-mode #result-points {
        overflow-y: auto;
        max-height: none;
        padding: 9px 10px !important;
    }

    #result-overlay.stream-result-mode > .flex {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 7px !important;
    }

    #result-overlay.stream-result-mode > .flex button {
        min-height: 44px;
    }
}


/* Hero live stats: fills desktop whitespace without touching the core mobile layout */
.hero-live-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: -10px;
}

.hero-live-card {
    min-height: 92px;
    border-radius: 20px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(19,23,34,0.92), rgba(11,14,20,0.96));
    border: 1px solid rgba(0,255,204,0.13);
    box-shadow: inset 0 0 18px rgba(0,0,0,0.24), 0 12px 34px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.hero-live-card span {
    font-size: 22px;
    line-height: 1;
}

.hero-live-card strong {
    color: white;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.02em;
}

.hero-live-card small {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 1024px) {
    .hero-live-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .hero-live-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .hero-live-card {
        min-height: 78px;
        padding: 12px;
        border-radius: 16px;
    }

    .hero-live-card strong {
        font-size: 20px;
    }

    .hero-live-card small {
        font-size: 9px;
    }
}


/* Daily prize info tooltip */
.prize-info-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: #9ca3af;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    vertical-align: middle;
    transition: all .18s ease;
}
.prize-info-btn:hover,
.prize-info-btn.active {
    color: #fff;
    border-color: rgba(0,255,204,0.4);
    background: rgba(0,255,204,0.08);
}
.prize-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(280px, 70vw);
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(10,14,20,0.97);
    border: 1px solid rgba(0,255,204,0.18);
    color: #d1d5db;
    font-size: 11px;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: all .18s ease;
    z-index: 90;
    font-style: normal;
    font-weight: 700;
}
.prize-info-btn:hover .prize-tooltip,
.prize-info-btn.active .prize-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
@media (max-width: 640px) {
    .prize-tooltip {
        width: min(240px, 82vw);
        font-size: 10px;
        right: -8px;
    }
}


/* Prize amount explanation tooltip */
.prize-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 5px;
}

.prize-info-btn {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 204, 0.34);
    background: rgba(0, 255, 204, 0.08);
    color: #00ffcc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 10px rgba(0,255,204,0.08);
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.prize-info-btn:hover,
.prize-info-wrap.active .prize-info-btn {
    transform: translateY(-1px);
    background: rgba(0, 255, 204, 0.16);
    border-color: rgba(0, 255, 204, 0.65);
    color: #ffffff;
}

.prize-tooltip {
    position: absolute;
    right: -6px;
    bottom: calc(100% + 9px);
    width: min(310px, 76vw);
    padding: 11px 13px;
    border-radius: 14px;
    background: rgba(11, 14, 20, 0.98);
    border: 1px solid rgba(0,255,204,0.22);
    color: #d1d5db;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.42;
    text-align: left;
    white-space: normal;
    box-shadow: 0 18px 48px rgba(0,0,0,0.55), 0 0 22px rgba(0,255,204,0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px) scale(0.98);
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
    z-index: 90;
}

.prize-tooltip::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 100%;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(11,14,20,0.98) transparent transparent transparent;
}

.prize-info-wrap:hover .prize-tooltip,
.prize-info-wrap.active .prize-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
    .prize-info-wrap {
        margin-left: 4px;
    }

    .prize-info-btn {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        font-size: 13px;
    }

    .prize-tooltip {
        right: -12px;
        width: min(270px, 84vw);
        font-size: 11px;
        padding: 10px 12px;
    }
}
