/* ============================================
   GTC Mobile-First Redesign
   Single column, overlays on image, FAB buttons
   ============================================ */

/* CSS Variables - consistent with main theme */
:root {
    --gtc-bg: rgba(15, 23, 42, 0.95);
    --gtc-bg-solid: rgba(15, 23, 42, 1);
    --gtc-card: rgba(30, 41, 59, 0.8);
    --gtc-glass: rgba(255, 255, 255, 0.05);
    --gtc-border: rgba(255, 255, 255, 0.08);
    --gtc-text: rgba(255, 255, 255, 0.95);
    --gtc-text-muted: rgba(255, 255, 255, 0.6);
    --gtc-accent: #6366f1;
    --gtc-accent-glow: rgba(99, 102, 241, 0.3);
    --gtc-success: #22c55e;
    --gtc-error: #ef4444;
    --gtc-warning: #f59e0b;
    --gtc-radius: 1rem;
    --gtc-radius-sm: 0.5rem;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --gtc-keyboard-offset: 0px;
    --gtc-header-offset: 0px;
}

/* Container - full viewport height */
.gtc-container {
    width: 100%;
    max-width: 100%;
    /* On desktop we keep the site header, so avoid forcing 100vh here (it creates a scrollbar). */
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: transparent;
}

@media (max-width: 899px) {
    .gtc-container {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

/* Use the global starry background on game pages for consistency */

/* Keep the site header on all viewports for consistency */

.gtc-page main {
    padding-top: 0;
}

.gtc-page footer {
    display: none;
}

/* Mini header is deprecated; use the global site header everywhere */
.gtc-mini-header {
    display: none;
}

/* Mobile title banner above the game */
.gtc-mobile-title-banner {
    display: none;
    text-align: center;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gtc-text, #fff);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, transparent 100%);
}

@media (max-width: 899px) {
    .gtc-mobile-title-banner {
        display: block;
    }
}

.gtc-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 50%;
    color: var(--gtc-text);
    text-decoration: none;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.gtc-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.gtc-mini-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gtc-text);
    letter-spacing: 0.5px;
}

.gtc-mini-score {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gtc-text);
    background: var(--gtc-glass);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--gtc-border);
}

/* ============================================
   Main Game Container
   ============================================ */
#game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    min-height: 0;
    /* Fill remaining viewport height under the sticky site header */
    height: calc(100vh - var(--gtc-header-offset));
    height: calc(100dvh - var(--gtc-header-offset));
    overflow: hidden;
}

@media (min-width: 900px) {
    #game-content {
        height: auto;
        /* Allow the start screen to center vertically under the sticky site header */
        min-height: calc(100vh - var(--gtc-header-offset));
        overflow: visible;
    }
}

/* Start Screen */
.start-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 2rem;
}

/* Simplified mode selection (single big card) */
.gtc-start-card {
    width: 100%;
    max-width: 480px;
    margin: 2.5rem auto 0 auto;
    align-self: center;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.92) 0%, rgba(20, 20, 35, 0.98) 100%);
    border: 2px solid rgba(124, 58, 237, 0.4);
    border-radius: 1.5rem;
    padding: 1.5rem 1.75rem 1.75rem 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 60px rgba(124, 58, 237, 0.12);
}

.gtc-start-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, transparent 55%);
    pointer-events: none;
}

.gtc-start-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 35%, #a78bfa 65%, #c4b5fd 100%);
    border-radius: 1.5rem 1.5rem 0 0;
    pointer-events: none;
}

.gtc-start-hub-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.20) 100%);
    border: 1px solid rgba(99, 102, 241, 0.40);
    color: #e0e7ff;
    text-decoration: none;
    font-size: 1.1rem;
    z-index: 6;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.gtc-start-hub-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(139, 92, 246, 0.30) 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.gtc-start-tutorial-btn {
    position: absolute;
    top: 1rem;
    right: 4rem;
    min-height: 44px;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    z-index: 7;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.gtc-start-tutorial-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
}

.gtc-start-leaderboard-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    min-height: 44px;
    width: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    z-index: 7;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.gtc-start-leaderboard-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

.gtc-start-image {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1.25rem 0;
    margin-top: 2.5rem;
}

.gtc-start-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 1rem;
    border: 2px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.gtc-start-image .start-screen-icon-wrapper {
    width: 96px;
    height: 96px;
}

.gtc-start-image .start-screen-icon-svg {
    width: 78px;
    height: 78px;
}

.gtc-start-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.gtc-start-ranked-btn {
    width: 100%;
    padding: 1.15rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 40%, #4f46e5 100%);
    border: none;
    border-radius: 1rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gtc-start-ranked-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 40%, #6366f1 100%);
    box-shadow: 0 14px 44px rgba(124, 58, 237, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.gtc-start-ranked-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.gtc-start-training-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 0.85rem;
    border: 1.5px solid rgba(100, 116, 139, 0.4);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
}

.gtc-start-training-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(100, 116, 139, 0.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.95);
}

.gtc-start-auth-note {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.8rem 0.9rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gtc-border);
    color: var(--gtc-text);
}

.gtc-start-auth-note i {
    color: var(--gtc-warning);
    margin-top: 0.1rem;
}

.gtc-start-auth-note-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.gtc-start-auth-note-title {
    font-weight: 800;
    color: var(--gtc-text);
}

.gtc-start-auth-note-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.12);
    color: var(--gtc-text);
    text-decoration: none;
    font-weight: 900;
    width: fit-content;
    transition: transform 0.18s ease, background 0.18s ease;
}

.gtc-start-auth-note-link:hover {
    transform: translateY(-1px);
    background: rgba(99, 102, 241, 0.18);
}

.gtc-start-note {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gtc-border);
    color: var(--gtc-text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.gtc-start-note > span {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.gtc-start-note i {
    color: var(--gtc-warning);
    margin-top: 0.1rem;
}

.gtc-view-score-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--gtc-accent) 0%, var(--gtc-accent-hover) 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.gtc-view-score-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.gtc-view-score-btn i {
    color: #fff;
    margin-top: 0;
}

/* Start screen panels: stacked on mobile, side-by-side on desktop to avoid vertical scroll */
.start-screen-panels {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 0 auto;
}

.start-screen-left,
.start-screen-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.start-screen-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

/* Icon wrapper with glow effect */
.start-screen-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-screen-icon-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: gtc-glow-pulse 3s ease-in-out infinite;
}

@keyframes gtc-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.start-screen-icon-svg {
    width: 64px;
    height: 64px;
    animation: gtc-float 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}

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

/* Title with gradient */
.start-screen-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.02em;
}

.start-screen-subtitle {
    color: var(--gtc-text-muted);
    font-size: 1rem;
    max-width: 44ch;
    line-height: 1.65;
    margin: 0;
}

/* Legacy fallback */
.start-screen-icon {
    font-size: 3.5rem;
    opacity: 0.95;
    animation: gtc-float 4.5s ease-in-out infinite;
}

.gtc-mode-grid {
    width: 100%;
    max-width: 720px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .gtc-mode-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

@media (min-width: 900px) {
    .start-screen {
        /* Keep everything above the fold on desktop */
        padding: 1.5rem;
        gap: 1.5rem;
        min-height: calc(100vh - var(--gtc-header-offset));
        box-sizing: border-box;
    }

    .gtc-start-card {
        max-width: 620px;
        padding: 1.4rem 1.4rem 1.2rem 1.4rem;
    }

    .start-screen-hero {
        gap: 0.85rem;
    }

    .start-screen-icon-wrapper {
        width: 90px;
        height: 90px;
    }

    .start-screen-icon-svg {
        width: 72px;
        height: 72px;
    }

    .start-screen-subtitle {
        font-size: 0.95rem;
        max-width: 56ch;
    }

    .start-screen-panels {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 1.25fr 0.75fr;
        align-items: start;
        gap: 1.5rem;
    }

    .start-screen-left,
    .start-screen-right {
        align-items: stretch;
    }

    .gtc-mode-grid {
        max-width: none;
    }

    .gtc-rules,
    .gtc-soon {
        max-width: none;
    }

    .gtc-rules {
        padding: 0.9rem 1rem;
    }

    .gtc-rules-title {
        margin-bottom: 0.55rem;
    }

    .gtc-rules-list {
        gap: 0.4rem;
        font-size: 0.9rem;
    }

    .gtc-soon {
        padding: 0.8rem 1rem;
    }
}

/* Extra-tight desktop heights */
@media (min-width: 900px) and (max-height: 820px) {
    .start-screen {
        padding: 1rem;
        gap: 1rem;
    }

    .start-screen-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .start-screen-icon-svg {
        width: 56px;
        height: 56px;
    }

    .start-screen-title {
        font-size: 2rem;
    }

    .gtc-mode-card {
        padding: 0.9rem 1rem;
        gap: 0.65rem;
    }

    .gtc-mode-desc {
        font-size: 0.9rem;
    }

    .gtc-mode-card .start-btn {
        padding: 0.8rem 1.1rem;
        font-size: 0.95rem;
    }
}

.gtc-mode-card {
    width: 100%;
    text-align: left;
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.7) 0%, rgba(24, 24, 36, 0.8) 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1.25rem;
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gtc-mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gtc-mode-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.gtc-mode-card:hover::before {
    opacity: 1;
}

/* Ranked card accent */
.gtc-mode-card-ranked {
    border-color: rgba(99, 102, 241, 0.2);
}

.gtc-mode-card-ranked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    border-radius: 1.25rem 1.25rem 0 0;
}

.gtc-mode-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.gtc-mode-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--gtc-text);
    letter-spacing: 0.02em;
}

.gtc-mode-title i {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-radius: 8px;
    color: #a5b4fc;
}

/* Training mode icon - green */
.gtc-mode-card[data-mode="training"] .gtc-mode-title i {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: #4ade80;
}

.gtc-mode-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.gtc-mode-badge-ranked {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

.gtc-mode-desc {
    color: var(--gtc-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.gtc-mode-cta {
    width: 100%;
}

.gtc-auth-callout {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
}

.gtc-auth-callout-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--gtc-text);
}

.gtc-auth-callout-title i {
    color: var(--gtc-warning);
}

.gtc-auth-callout-actions {
    display: flex;
    justify-content: flex-start;
}

.gtc-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--gtc-accent-glow);
    background: var(--gtc-glass);
    color: var(--gtc-text);
    text-decoration: none;
    font-weight: 900;
    transition: transform 0.18s ease;
}

.gtc-login-link:hover {
    transform: translateY(-1px);
}

.gtc-soon {
    width: 100%;
    max-width: 720px;
    text-align: left;
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.4) 0%, rgba(24, 24, 36, 0.5) 100%);
    border: 1px dashed rgba(148, 163, 184, 0.15);
    border-radius: 1.25rem;
    padding: 1rem 1.15rem;
}

.gtc-soon-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 0.875rem;
    color: var(--gtc-text);
    margin-bottom: 0.35rem;
}

.gtc-soon-title i {
    color: #fbbf24;
}

.gtc-soon-desc {
    color: var(--gtc-text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

/* Legacy h2/p styles for start-screen */
.start-screen h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--gtc-text);
    margin: 0;
}

.start-screen p {
    color: var(--gtc-text-muted);
    font-size: 1rem;
    max-width: 40ch;
    line-height: 1.6;
}

.gtc-rules {
    width: 100%;
    max-width: 520px;
    text-align: left;
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.6) 0%, rgba(24, 24, 36, 0.7) 100%);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 1.25rem;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.gtc-rules-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--gtc-text);
    margin-bottom: 0.85rem;
    justify-content: space-between;
}

.gtc-rules-title-left {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.gtc-rules-title-left i {
    color: #a5b4fc;
    font-size: 1rem;
}

.gtc-tutorial-btn {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gtc-tutorial-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

/* Mode explanation sections */
.gtc-mode-explanation {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mode-section {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.75rem;
    border-left: 3px solid rgba(99, 102, 241, 0.4);
}

.mode-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gtc-text);
    margin: 0 0 0.35rem 0;
}

.mode-section h4 i {
    color: #a5b4fc;
    font-size: 0.9rem;
}

.mode-section p {
    font-size: 0.85rem;
    color: var(--gtc-text-muted);
    margin: 0;
    line-height: 1.5;
}

.gtc-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
    color: var(--gtc-text-muted);
    font-size: 0.95rem;
}

.gtc-rules-list li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.gtc-rules-list li::before {
    content: "•";
    color: var(--gtc-accent);
    font-weight: 900;
    line-height: 1.2;
    margin-top: 0.05rem;
}

.gtc-mode-explanation {
    display: grid;
    gap: 1rem;
    margin-top: 0.75rem;
}

.mode-section {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gtc-border);
    border-radius: 0.75rem;
}

.mode-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gtc-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-section h4 i {
    color: var(--gtc-accent);
}

.mode-section p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gtc-text-muted);
    line-height: 1.5;
}

.gtc-tutorial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--gtc-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--gtc-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gtc-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    transform: translateY(-1px);
}

.start-btn {
    padding: 0.9rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    text-transform: none;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Beat global `button:not(.unstyled)` in style.css */
button.start-btn {
    border: none;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

.start-btn:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.start-btn:disabled,
.start-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(100, 116, 139, 0.3);
    box-shadow: none;
}

.gtc-mode-card .start-btn {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    width: 100%;
}

/* Training button - green variant */
.gtc-mode-card[data-mode="training"] .start-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}

.gtc-mode-card[data-mode="training"] .start-btn:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

.start-btn i {
    font-size: 0.9em;
}

/* ============================================
   Game Area - Single Column Layout
   ============================================ */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    min-height: 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

@media (min-width: 900px) {
    .game-area {
        max-width: 1100px;
        padding: 0 1.25rem;
    }
}

/* Sidebar (desktop only in this theme) */
.game-sidebar {
    display: none;
}

/* ============================================
   Game Canvas - The main view
   ============================================ */
.game-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    padding: 0;
    padding-bottom: 90px; /* Space for fixed answer section */
    gap: 0;
    min-height: 0;
    position: relative;
    overflow: visible;
}

/* Question type - hidden on mobile, visible on desktop */
#question-type {
    display: none;
}

@media (min-width: 900px) {
    /* Stack the top-center pills (variant + question type) to avoid overlaps. */
    .overlay-top-center-stack {
        position: absolute;
        top: 0.75rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        pointer-events: none;
        user-select: none;
    }

    /* Inside the stack: remove absolute positioning so they can flow vertically */
    .overlay-top-center-stack .overlay-variant {
        position: static;
        top: auto;
        left: auto;
        transform: none;
    }

    #question-type {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        font-size: 0.75rem !important;
        font-weight: 600;
        color: var(--gtc-text-muted) !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        background: var(--gtc-card);
        padding: 0.4rem 0.75rem;
        border-radius: 2rem;
        z-index: 20;
        text-shadow: none !important;
        margin: 0 !important;
        border: 1px solid var(--gtc-border);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.45rem;
    }
}

#question-type.bonus-mode {
    color: #c4b5fd !important;
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(139, 92, 246, 0.2);
    animation: gtcBonusPulse 1.2s ease-in-out infinite;
}

@keyframes gtcBonusPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(139, 92, 246, 0);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 10px 30px rgba(139, 92, 246, 0.18);
    }
}

/* ============================================
   Asset Viewer - Full screen with overlays
   ============================================ */
.asset-viewer {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 200px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

@media (min-width: 900px) {
    .asset-viewer {
        padding: 1.5rem;
    }
}

.asset-stage {
    position: relative;
    display: inline-block;
    width: min(92vw, 420px);
    overflow: visible;
    border-radius: var(--gtc-radius);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(99, 102, 241, 0.10),
        0 0 44px rgba(99, 102, 241, 0.12);
}

@media (min-width: 900px) {
    .asset-stage {
        width: min(56vw, 560px);
    }
}

.asset-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--gtc-radius);
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.35), transparent 70%);
    mix-blend-mode: screen;
}

.asset-stage img {
    display: block;
    width: 100%;
    border-radius: var(--gtc-radius);
    height: auto;
}

/* Loading spinner for asset placeholder */
.asset-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    color: var(--gtc-text-muted);
}

.asset-loader {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: assetSpin 0.8s linear infinite;
}

.asset-loader-pulse {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    animation: assetPulse 1.5s ease-in-out infinite;
}

@keyframes assetSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes assetPulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.asset-stage.gtc-stage-flash::after {
    animation: gtcStageFlash 0.42s ease-out;
}

.asset-stage.gtc-hit-correct::after {
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.40), transparent 70%);
    animation: gtcStageHit 0.52s ease-out;
}

.asset-stage.gtc-hit-wrong::after {
    background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.38), transparent 70%);
    animation: gtcStageHit 0.52s ease-out;
}

@keyframes gtcStageHit {
    0% {
        opacity: 0;
        transform: scale(0.99);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.01);
    }
}

@keyframes gtcStageFlash {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.01);
    }
}

.asset-viewer img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--gtc-radius);
    /* Prevent negative max-height on very small viewports */
    max-height: calc(85vh - 250px);
    max-height: max(180px, calc(85vh - 250px));
    max-height: calc(85dvh - 250px);
    max-height: max(180px, calc(85dvh - 250px));
}

.asset-viewer img.gtc-img-enter {
    animation: gtcImageEnter 0.35s ease-out;
    will-change: transform, opacity;
}

@keyframes gtcImageEnter {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.985);
        filter: saturate(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: saturate(1);
    }
}

/* ============================================
   Overlay Elements on Image
   ============================================ */

/* Score indicator - TOP LEFT OF IMAGE */
.overlay-score {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    z-index: 20;
    display: none;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--gtc-border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.overlay-score i {
    font-size: 0.7rem;
    color: var(--gtc-accent);
}

/* Progress indicator (NB IMAGES) - TOP RIGHT OF IMAGE */
.overlay-progress {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gtc-text);
    border: 1px solid var(--gtc-border);
    z-index: 20;
    display: none;
    align-items: center;
    gap: 0.4rem;
}

.overlay-progress i {
    color: var(--gtc-accent);
    font-size: 0.7rem;
}

/* Variant label - TOP CENTER OF IMAGE (WEIRD / ICON / TEXTURE / etc.) */
.overlay-variant {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gtc-text);
    border: 1px solid var(--gtc-border);
    z-index: 20;
    display: none;
    align-items: center;
    gap: 0.45rem;
    user-select: none;
    pointer-events: none;
}

.overlay-variant i {
    color: var(--gtc-accent);
    font-size: 0.7rem;
    opacity: 0.95;
}

/* Timer indicator - BOTTOM CENTER OF IMAGE */
.overlay-timer {
    position: absolute;
    left: 50%;
    /* Lives are also bottom-centered; keep timer above hearts */
    bottom: 3.15rem;
    transform: translateX(-50%);
    z-index: 20;
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
    backdrop-filter: blur(10px);
    color: var(--gtc-text);
    font-weight: 800;
    font-size: 0.8rem;
}

.overlay-timer .timer-bar {
    width: 150px;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.overlay-timer .timer-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--gtc-accent);
    transform-origin: 0 50%;
    transform: scaleX(1);
}

.overlay-timer .timer-text {
    min-width: 2.5ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.overlay-timer.expired {
    border-color: rgba(239, 68, 68, 0.35);
}

.overlay-timer.expiring {
    animation: gtcTimerExpire 0.45s ease-out 1;
}

@keyframes gtcTimerExpire {
    0% {
        opacity: 1;
        filter: saturate(1);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    35% {
        opacity: 1;
        filter: saturate(1.15);
        box-shadow: 0 10px 26px rgba(239, 68, 68, 0.18);
    }
    100% {
        opacity: 0;
        filter: saturate(0.85) blur(1px);
        box-shadow: 0 10px 26px rgba(239, 68, 68, 0);
    }
}

.overlay-timer.urgent {
    border-color: rgba(245, 158, 11, 0.4);
    animation: gtcUrgentPulse 0.75s ease-in-out infinite;
}

.overlay-timer.urgent .timer-bar-fill {
    background: var(--gtc-warning);
}

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

.overlay-timer.expired .timer-bar-fill {
    background: var(--gtc-error);
}

/* Streak indicator - LEFT SIDE OF IMAGE */
.overlay-streak {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: var(--gtc-radius);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gtc-warning);
    border: 1px solid var(--gtc-border);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.overlay-streak i {
    font-size: 1rem;
    color: var(--gtc-warning);
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
    text-shadow: 0 0 10px var(--gtc-warning), 0 8px 18px rgba(0, 0, 0, 0.35);
    animation: gtcFlameIdle 2.4s ease-in-out infinite;
    transform-origin: 50% 65%;
}

@keyframes gtcFlameIdle {
    0% { transform: translateZ(0) scale(1) rotate(-1deg); opacity: 0.92; }
    50% { transform: translateZ(0) scale(1.04) rotate(1deg); opacity: 1; }
    100% { transform: translateZ(0) scale(1) rotate(-1deg); opacity: 0.92; }
}

@keyframes gtcFlameFlicker {
    0% { transform: translateZ(0) scale(1) rotate(-2deg); opacity: 0.9; }
    35% { transform: translateZ(0) scale(1.06) rotate(2deg); opacity: 1; }
    70% { transform: translateZ(0) scale(0.98) rotate(-1deg); opacity: 0.92; }
    100% { transform: translateZ(0) scale(1) rotate(-2deg); opacity: 0.9; }
}

.overlay-streak.streak-active i {
    animation: gtcFlameFlicker 0.8s ease-in-out 1, gtcFlameIdle 2.4s ease-in-out infinite;
    transform-origin: 50% 65%;
}

/* Desktop streak (same JS class is added on #stat-streak) */
#stat-streak.active .flame-icon {
    animation: gtcFlameFlicker 0.8s ease-in-out 1;
    transform-origin: 50% 60%;
}

@keyframes gtcScorePulse {
    0% { transform: translateZ(0) scale(1); }
    35% { transform: translateZ(0) scale(1.08); }
    100% { transform: translateZ(0) scale(1); }
}

@keyframes gtcScoreDip {
    0% { transform: translateZ(0) scale(1); }
    35% { transform: translateZ(0) scale(0.94); }
    100% { transform: translateZ(0) scale(1); }
}

/* Desktop score change (JS toggles these classes on #stat-score) */
#stat-score.score-increase {
    animation: gtcScorePulse 0.5s ease-out 1;
    color: var(--gtc-success);
}

#stat-score.score-decrease {
    animation: gtcScoreDip 0.5s ease-out 1;
    color: var(--gtc-error);
}

.overlay-streak span {
    font-size: 0.75rem;
}

/* Hints button - RIGHT SIDE OF IMAGE */
.overlay-hints-btn {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gtc-border);
    border-radius: 50%;
    color: var(--gtc-warning);
    font-size: 1.125rem;
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

button.overlay-hints-btn {
    padding: 0;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.overlay-hints-btn:hover {
    background: var(--gtc-accent);
    border-color: var(--gtc-accent);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

/* Lives indicator - BOTTOM CENTER OF IMAGE */
.overlay-lives {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.75rem;
    border-radius: 2rem;
    font-size: 1rem;
    z-index: 20;
    display: none;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--gtc-border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.overlay-lives .heart-icon {
    color: var(--gtc-error);
    font-size: 0.9rem;
    transform: translateZ(0);
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-shadow: 0 0 10px var(--gtc-error), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.overlay-lives .heart-icon.lost {
    color: var(--gtc-text-muted);
    opacity: 0.22;
    transform: translateZ(0) scale(0.92);
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

@keyframes gtcHeartGain {
    0% { transform: translateZ(0) scale(0.6); opacity: 0; }
    55% { transform: translateZ(0) scale(1.28); opacity: 1; }
    100% { transform: translateZ(0) scale(1); opacity: 1; }
}

@keyframes gtcHeartLost {
    0% { transform: translateZ(0) scale(1.15) rotate(0deg); opacity: 1; }
    55% { transform: translateZ(0) scale(0.78) rotate(-10deg); opacity: 0.35; }
    100% { transform: translateZ(0) scale(0.92) rotate(0deg); opacity: 0.22; }
}

.overlay-lives .heart-icon.just-gained {
    animation: gtcHeartGain 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.overlay-lives .heart-icon.just-lost {
    animation: gtcHeartLost 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

@keyframes gtcHeartBeat {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes gtcShake {
    0% { transform: translateX(-50%) translateY(0); }
    20% { transform: translateX(-50%) translateY(0) translateX(-2px); }
    40% { transform: translateX(-50%) translateY(0) translateX(2px); }
    60% { transform: translateX(-50%) translateY(0) translateX(-2px); }
    80% { transform: translateX(-50%) translateY(0) translateX(2px); }
    100% { transform: translateX(-50%) translateY(0); }
}

.overlay-lives.lives-gain .heart-icon:not(.lost) {
    animation: gtcHeartBeat 0.7s ease-in-out 1;
}

.overlay-lives.lives-loss {
    animation: gtcShake 0.6s ease-in-out 1;
}

/* Desktop hearts (same classes are added in JS on #stat-lives) */
#stat-lives.lives-gain .heart-icon:not(.lost) {
    animation: gtcHeartBeat 0.7s ease-in-out 1;
}

#stat-lives.lives-loss {
    animation: gtcShake 0.6s ease-in-out 1;
}

.overlay-lives .heart-icon.lost {
    opacity: 0.2;
}

/* Score popup on image */
.score-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    pointer-events: none;
    animation: scoreFloat 1.2s ease-out forwards;
    z-index: 30;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        transform: translate(-50%, -60%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(1);
    }
}

/* Stage FX popups (life / streak) */
.stage-fx {
    position: absolute;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 31;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--gtc-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gtc-border);
    font-weight: 900;
    letter-spacing: 0.5px;
    animation: gtcStageFxFloat 1.15s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
    text-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

.stage-fx .fx-icon {
    font-size: 1.15rem;
}

.stage-fx .fx-sign,
.stage-fx .fx-value {
    font-size: 1.15rem;
    line-height: 1;
}

.stage-fx .fx-mult {
    font-size: 0.95rem;
    opacity: 0.9;
}

.stage-fx.life .fx-icon {
    color: var(--gtc-error);
}

.stage-fx.life.pos .fx-sign,
.stage-fx.life.pos .fx-mult {
    color: var(--gtc-success);
}

.stage-fx.life.neg .fx-sign,
.stage-fx.life.neg .fx-mult {
    color: var(--gtc-error);
}

.stage-fx.streak .fx-icon {
    color: var(--gtc-warning);
}

.stage-fx.streak.pos .fx-value {
    color: var(--gtc-warning);
}

.stage-fx.streak.neg .fx-value {
    color: var(--gtc-error);
}

.stage-fx.speed .fx-icon {
    color: var(--gtc-accent);
}

.stage-fx.speed .fx-value {
    color: var(--gtc-accent);
}

@keyframes gtcStageFxFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -35%) scale(0.75) rotate(-4deg);
        filter: saturate(1.1) blur(0px);
    }
    22% {
        opacity: 1;
        transform: translate(-50%, -52%) scale(1.05) rotate(0deg);
        filter: saturate(1.2) blur(0px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(1.05) rotate(2deg);
        filter: saturate(1.05) blur(0.2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage-fx {
        animation: none;
    }
}

/* Feedback message - centered on image */
.feedback-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 1.25rem;
    border-radius: var(--gtc-radius);
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.2px;
    display: none;
    z-index: 32;
    backdrop-filter: blur(10px);
    border: 1px solid var(--gtc-border);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.38);
    overflow: hidden;
    isolation: isolate;
    max-width: min(92vw, 420px);
    width: max-content;
    pointer-events: none;
}

/* Mini timer shown during 2s reveal holds */
.gtc-mini-timer {
    margin-top: 0.45rem;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.gtc-mini-timer-fill {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    background: var(--gtc-accent);
    animation: gtcMiniTimer linear forwards;
    animation-duration: var(--gtc-mini-timer-ms, 2000ms);
}

@keyframes gtcMiniTimer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.feedback-message.toast-in {
    animation: gtcToastIn 0.26s cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

.feedback-message.toast-out {
    animation: gtcToastOut 0.18s ease-in forwards;
}

.feedback-message i {
    margin-right: 0.55rem;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.feedback-message::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, transparent 70%);
    transform: translateX(-60%);
    opacity: 0;
    pointer-events: none;
}

@keyframes gtcFeedbackShine {
    0% { opacity: 0; transform: translateX(-60%); }
    25% { opacity: 0.55; }
    100% { opacity: 0; transform: translateX(60%); }
}

@keyframes gtcToastIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
}

@keyframes gtcToastOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-6px) scale(0.985);
    }
}

.feedback-message::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    opacity: 0.75;
    transform-origin: 0 50%;
    transform: scaleX(1);
    background: rgba(255, 255, 255, 0.25);
    animation: gtcToastLife var(--gtc-feedback-life, 2000ms) linear forwards;
    pointer-events: none;
}

@keyframes gtcToastLife {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

.feedback-message.correct {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.92), rgba(99, 102, 241, 0.55));
    color: white;
    border-color: rgba(34, 197, 94, 0.35);
}

.feedback-message.correct::after {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(99, 102, 241, 0.9));
}

.feedback-message.correct::before {
    animation: gtcFeedbackShine 0.75s ease-out 1;
}

.feedback-message.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(99, 102, 241, 0.45));
    color: white;
    border-color: rgba(239, 68, 68, 0.35);
}

.feedback-message.wrong.toast-in {
    animation: gtcToastIn 0.26s cubic-bezier(0.2, 0.9, 0.2, 1) 1, gtcFeedbackShake 0.45s ease-in-out;
}

.feedback-message.wrong::after {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(99, 102, 241, 0.85));
}

.feedback-message.wrong::before {
    animation: gtcFeedbackShine 0.65s ease-out 1;
}

@keyframes gtcFeedbackShake {
    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0) translateX(0);
    }
    18% {
        transform: translate(-50%, -50%) translateY(0) translateX(-6px);
    }
    36% {
        transform: translate(-50%, -50%) translateY(0) translateX(6px);
    }
    54% {
        transform: translate(-50%, -50%) translateY(0) translateX(-4px);
    }
    72% {
        transform: translate(-50%, -50%) translateY(0) translateX(4px);
    }
}

/* ============================================
   Answer Section - Bottom fixed centered
   ============================================ */
.answer-section {
    position: fixed;
    bottom: calc(0px + var(--safe-area-bottom) + var(--gtc-keyboard-offset));
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(92vw, 960px);
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 0.75rem;
    z-index: 100;
    backdrop-filter: blur(20px);
}

@media (min-width: 900px) {
    .answer-section {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 999px;
        margin-bottom: 1rem;
        box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
    }
}

input.answer-input,
select.answer-input {
    flex: 1;
    padding: 1rem 1.25rem;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 3rem;
    color: var(--gtc-text);
    font-size: 1rem;
    font-weight: 500;
    min-width: 0;
    transition: all 0.2s ease;
}

/* Make native select/options readable on Windows browsers */
#skin-selector {
    color-scheme: dark;
}

#skin-selector option,
#skin-selector optgroup {
    background: rgba(15, 23, 42, 0.98);
    color: rgba(255, 255, 255, 0.95);
}

input.answer-input::placeholder {
    color: var(--gtc-text-muted);
}

input.answer-input:focus,
select.answer-input:focus {
    outline: none;
    border-color: var(--gtc-accent);
    box-shadow: 0 0 0 3px var(--gtc-accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

button.submit-btn {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gtc-accent), rgba(99, 102, 241, 0.70));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 22px rgba(99, 102, 241, 0.18);
}

button.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.40), 0 0 30px rgba(99, 102, 241, 0.22);
}

button.submit-btn:active:not(:disabled) {
    transform: translateY(0px);
}

button.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Skip button for bonus rounds */
button#skip-btn {
    background: linear-gradient(135deg, var(--gtc-warning), #d97706);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

/* ============================================
   Floating Action Buttons (FAB) - Bottom Right
   ============================================ */
.fab-container {
    position: fixed;
    bottom: calc(90px + var(--safe-area-bottom) + var(--gtc-keyboard-offset));
    right: 1rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 60;
}

@media (min-width: 768px) {
    .fab-container {
        bottom: calc(100px + var(--safe-area-bottom) + var(--gtc-keyboard-offset));
        right: calc(50% - 300px + 1rem);
    }
}

button.fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fab:hover {
    transform: scale(1.1);
}

.fab-restart {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.fab-restart:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
    color: rgba(255, 255, 255, 0.92);
}

.fab-rules {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.fab-rules:hover {
    background: var(--gtc-accent);
    border-color: var(--gtc-accent);
    color: rgba(255, 255, 255, 0.92);
}

.fab-home {
    background: var(--gtc-glass);
    color: var(--gtc-text);
    border: 1px solid var(--gtc-border);
}

.fab-home:hover {
    background: var(--gtc-accent);
    border-color: var(--gtc-accent);
}

/* ============================================
   Hints Panel (Slide up drawer)
   ============================================ */
.hints-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gtc-bg);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--safe-area-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
    z-index: 100;
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
    will-change: transform;
}

.hints-drawer.open {
    transform: translateY(0);
}

.hints-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 99;
}

.hints-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.hints-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hints-drawer-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gtc-text);
}

.hints-drawer-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 50%;
    color: var(--gtc-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

button.hints-drawer-close {
    padding: 0;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.hints-drawer-close:hover {
    background: var(--gtc-error);
    border-color: var(--gtc-error);
}

/* ============================================
   Rules Modal
   ============================================ */
.gtc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 200;
    backdrop-filter: blur(4px);
    display: none;
}

.gtc-modal-backdrop.active {
    display: block;
}

.gtc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--gtc-bg-solid);
    border: 1px solid var(--gtc-border);
    border-radius: var(--gtc-radius);
    z-index: 201;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.gtc-modal.active {
    display: flex;
}

.gtc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gtc-border);
    background: var(--gtc-card);
}

.gtc-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gtc-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gtc-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 50%;
    color: var(--gtc-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.gtc-modal-close:hover {
    background: var(--gtc-error);
    border-color: var(--gtc-error);
}

.gtc-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.gtc-rules-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gtc-border);
}

.gtc-rules-details h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gtc-text);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gtc-rules-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gtc-rules-details li {
    padding: 0.75rem 0;
    color: var(--gtc-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.gtc-rules-details li i {
    color: var(--gtc-accent);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.gtc-rules-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gtc-border);
    text-align: center;
    color: var(--gtc-text-muted);
    font-size: 0.9rem;
}

.gtc-rules-footer a {
    color: var(--gtc-accent);
    text-decoration: none;
    font-weight: 600;
}

.gtc-rules-footer a:hover {
    text-decoration: underline;
}

.hints-drawer-close:active {
    transform: scale(0.96);
}

.hint-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: var(--gtc-radius);
    color: var(--gtc-text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

/* Beat global `button:not(.unstyled)` which otherwise makes these cyan/cheap */
button.hint-btn {
    position: relative;
    overflow: visible;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    letter-spacing: 0.02em;
    text-transform: none;
}

button.hint-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

button.hint-btn:active:not(:disabled) {
    transform: translateY(0px);
}

.hint-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gtc-accent);
}

.hint-btn:active:not(:disabled) {
    transform: scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
    .asset-viewer img.gtc-img-enter,
    .asset-stage.gtc-stage-flash::after,
    .asset-stage.gtc-hit-correct::after,
    .asset-stage.gtc-hit-wrong::after,
    .overlay-timer.urgent,
    .feedback-message.wrong,
    .feedback-message.toast-in,
    .feedback-message.toast-out {
        animation: none !important;
    }

    .overlay-timer.expiring {
        animation: none !important;
    }

    .overlay-streak i,
    .overlay-lives .heart-icon.just-gained,
    .overlay-lives .heart-icon.just-lost,
    .feedback-message::before,
    .feedback-message::after {
        animation: none !important;
    }

    .hints-drawer,
    .hints-drawer-backdrop {
        transition: none !important;
    }
}

.hint-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hint-btn i {
    margin-right: 0.5rem;
    color: var(--gtc-accent);
}

.hint-cost {
    font-size: 0.875rem;
    color: var(--gtc-text-muted);
    font-weight: 500;
}

/* Abandon button - distinct style */
#abandon-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--gtc-error);
    margin-top: 0.5rem;
}

#abandon-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--gtc-error);
}

#abandon-btn i {
    color: var(--gtc-error);
}

/* ============================================
   Progress/Stats Cards - Mobile hides them
   (desktop uses the sidebar)
   ============================================ */
@media (max-width: 899px) {
    .progress-card,
    .stats-card,
    .hints-card {
        display: none;
    }
}

/* ============================================
   Autocomplete - Mobile optimized
   ============================================ */
.autocomplete-results {
    /* The JS Autocomplete component positions this element using fixed coords.
       Don't override its top/left/width calculations on mobile. */
    position: fixed !important;
    background: var(--gtc-bg);
    border: 1px solid var(--gtc-border);
    border-radius: var(--gtc-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 200000 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gtc-border);
    color: var(--gtc-text);
    font-weight: 500;
    transition: background 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: rgba(99, 102, 241, 0.2);
}

/* ============================================
   Game Over Screen
   ============================================ */
.game-over-container {
    flex: 1;
    width: 100%;
    grid-column: 1 / -1;
    justify-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    text-align: left;
    gap: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fullscreen end-screen overlay: never center so far that the top gets clipped.
   Also account for the sticky site header and safe-area inset. */
#gtc-end-screen .game-over-container {
    justify-content: flex-start;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.game-over-hero {
    width: 100%;
    max-width: 520px;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 1.25rem;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-over-hero-main {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.game-over-hero-text {
    flex: 1;
}

.game-over-hero-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.game-over-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* Training end-screen polish: make CTAs look centered and consistent */
.gtc-training-hero-actions .game-over-btn,
.gtc-training-competitive-cta .game-over-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.gtc-training-competitive-cta {
    width: 100%;
    display: flex;
    justify-content: center;
}

.game-over-section {
    width: 100%;
    max-width: 520px;
}

/* ============================================
   Recap modern chart + animations
   ============================================ */
.game-over-section {
    animation: gtcFadeUp 240ms ease-out;
}

.game-over-stat,
.game-over-hero,
.game-over-hero-actions .game-over-btn {
    animation: gtcFadeUp 260ms ease-out;
}

/* Game over summary (tabs) */
.gtc-summary {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 1.25rem;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.gtc-tabs {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.35rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.9rem;
}

.gtc-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--gtc-text-muted);
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.gtc-tab.active {
    color: var(--gtc-text);
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
}

.gtc-tab:active {
    transform: scale(0.98);
}

.gtc-tab-panel {
    width: 100%;
}

.gtc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.gtc-summary-card {
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
    border-radius: 1rem;
    padding: 0.9rem;
    text-align: center;
}

.gtc-summary-card-wide {
    grid-column: 1 / -1;
}

.gtc-summary-card-label {
    font-size: 0.72rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    padding: 0.52rem 0.7rem;
}

.gtc-summary-card-value {
    margin-top: 0.35rem;
    font-size: 1.6rem;
    font-weight: 900;
    flex: 1 1 9.5rem;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gtc-text);
    font-variant-numeric: tabular-nums;
}

.gtc-tab i {
    font-size: 0.95rem;
}

.gtc-summary-card-sub {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--gtc-text-muted);
    font-weight: 700;
}

.gtc-summary-hearts {
    margin-top: 0.55rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
}

.gtc-summary-hearts .heart-icon {
    font-size: 1.15rem;
    color: var(--gtc-error);
}

.stage-fx.heartflame {
    background: color-mix(in srgb, var(--gtc-card) 82%, var(--gtc-warning) 18%);
    border-color: color-mix(in srgb, var(--gtc-border) 70%, var(--gtc-warning) 30%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}
.stage-fx.heartflame .fx-emoji {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.stage-fx.heartflame .fx-mult {
    color: var(--gtc-warning);
}

.gtc-summary-hearts .heart-icon.lost {
    opacity: 0.25;
}

/* Recap panel */
.gtc-recap {
    margin-top: 1rem;
    background: var(--gtc-glass);
    border: 1px solid var(--gtc-border);
    border-radius: 1.25rem;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.gtc-recap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.gtc-recap-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--gtc-text);
}

.gtc-recap-title i {
    color: var(--gtc-accent);
}

.gtc-recap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.gtc-recap-card {
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
    border-radius: 1rem;
    padding: 0.85rem 0.9rem;
    text-align: left;
}

.gtc-recap-card-value {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--gtc-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.gtc-recap-card-label {
    font-size: 0.72rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    font-weight: 800;
}

.gtc-recap-card-sub {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--gtc-text-muted);
    line-height: 1.25;
}

.gtc-recap-hints-list {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.15rem;
}

.gtc-recap-hints-list li {
    margin: 0;
}

.gtc-recap-hints-list strong {
    color: rgba(232, 232, 255, 0.9);
    font-weight: 700;
}

.gtc-recap-card-pos .gtc-recap-card-value {
    color: var(--gtc-success);
}

.gtc-recap-card-neg .gtc-recap-card-value {
    color: var(--gtc-error);
}

.gtc-recap-card-bonus .gtc-recap-card-value {
    color: var(--gtc-accent);
}

.gtc-recap-chart {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border-radius: 1rem;
    border: 1px solid var(--gtc-border, rgba(255,255,255,0.12));
    background: var(--gtc-card);
}

.gtc-recap-chart-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
}

.gtc-recap-chart-row + .gtc-recap-chart-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gtc-recap-chart-label {
    font-size: 0.9rem;
    color: var(--gtc-text-muted, rgba(255,255,255,0.7));
    font-weight: 600;
}

.gtc-recap-chart-value {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--gtc-text, rgba(255,255,255,0.92));
}

.gtc-recap-chart-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.gtc-recap-chart-fill {
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    transform-origin: left;
    animation: gtcBarIn 520ms cubic-bezier(.2,.9,.2,1);
}

.gtc-recap-chart-fill-gain {
    background: var(--gtc-success, #22c55e);
}

.gtc-recap-chart-fill-loss {
    background: var(--gtc-error, #ef4444);
}

.gtc-recap-chart-fill-bonus {
    background: var(--gtc-accent, #6366f1);
}

@keyframes gtcFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gtcBarIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .game-over-section,
    .game-over-stat,
    .game-over-hero,
    .game-over-hero-actions .game-over-btn,
    .gtc-recap-chart-fill {
        animation: none !important;
    }
}

.game-over-icon {
    font-size: 2.75rem;
    line-height: 1;
}

.game-over-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--gtc-text);
    margin: 0;
}

.game-over-subtitle {
    font-size: 1rem;
    color: var(--gtc-text-muted);
    margin: 0;
}

.game-over-score,
.game-over-rank,
.game-over-countdown {
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
}

/* Neon score ring */
.game-over-score {
    position: relative;
    margin: 0 auto;
    width: min(240px, 82vw);
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at 50% 40%, var(--gtc-card), var(--gtc-bg));
    border: 1px solid var(--gtc-border);
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.game-over-score::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    /* Fallback for browsers that don't support color-mix() */
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 295deg,
        var(--gtc-accent-glow) 320deg,
        var(--gtc-accent) 334deg,
        var(--gtc-accent-glow) 350deg,
        transparent 360deg
    );
    background:
        conic-gradient(
            from 0deg,
            transparent 0deg,
            transparent 295deg,
            color-mix(in srgb, var(--gtc-accent) 55%, transparent) 320deg,
            var(--gtc-accent) 334deg,
            color-mix(in srgb, var(--gtc-accent) 35%, transparent) 350deg,
            transparent 360deg
        );
    filter: drop-shadow(0 0 14px var(--gtc-accent-glow));
    transform: rotate(0deg);
    animation: gtcScoreRingSpin 2.6s linear infinite;

    -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%);
    mask: radial-gradient(circle, transparent 62%, #000 64%);
}

.game-over-score::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gtc-accent) 12%, transparent), transparent);
    border: 1px solid color-mix(in srgb, var(--gtc-border) 70%, transparent);
}

.game-over-score > * {
    position: relative;
    z-index: 1;
}

.game-over-score-value {
    font-size: clamp(2.2rem, 7vw, 3rem);
    font-weight: 950;
    color: var(--gtc-text);
    line-height: 1.05;
    letter-spacing: 0.5px;
    text-shadow: 0 0 22px var(--gtc-accent-glow), 0 8px 30px rgba(0, 0, 0, 0.45);
}

.game-over-score-label {
    font-size: 0.75rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-top: 0.45rem;
    font-weight: 900;
}

@keyframes gtcScoreRingSpin {
    to { transform: rotate(360deg); }
}

.game-over-rank-label,
.game-over-countdown-label {
    font-size: 0.75rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-over-rank-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gtc-text);
    margin-top: 0.25rem;
}

.game-over-rank-total {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gtc-text-muted);
}

.game-over-countdown-time {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gtc-accent);
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.game-over-cta-status {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--gtc-text);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.game-over-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 520px;
    margin: 0;
}

.game-over-stat {
    background: var(--gtc-card);
    border: 1px solid var(--gtc-border);
    border-radius: var(--gtc-radius);
    padding: 1rem;
    text-align: center;
}

.game-over-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gtc-accent);
    display: block;
}

.game-over-stat-label {
    font-size: 0.75rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 520px;
}

.game-over-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.game-over-btn-primary {
    background: linear-gradient(135deg, var(--gtc-accent), rgba(99, 102, 241, 0.70));
    color: white;
    border: none;
    box-shadow: 0 4px 16px var(--gtc-accent-glow);
}

.game-over-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--gtc-accent-glow);
}

.game-over-btn-secondary {
    background: transparent;
    color: var(--gtc-text);
    border: 1px solid var(--gtc-border);
}

.game-over-btn-secondary:hover {
    background: var(--gtc-glass);
    border-color: var(--gtc-accent);
}

/* ============================================
   Daily Lock Screen
   ============================================ */
.daily-lock-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 1.5rem;
}

.daily-lock-icon {
    font-size: 4rem;
    color: var(--gtc-warning);
}

.daily-lock-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gtc-text);
}

.daily-lock-countdown {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gtc-accent);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (min-width: 768px) {
    .gtc-page header {
        display: block;
    }
    
    .gtc-mini-header {
        display: none;
    }
    
    #game-content {
        padding-top: 0;
        height: auto;
        flex: 1;
    }
    
    .asset-viewer {
        padding: 2rem;
    }
    
    .overlay-progress,
    .overlay-lives,
    .overlay-score {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .fab-container {
        bottom: calc(100px + var(--safe-area-bottom) + var(--gtc-keyboard-offset));
        right: 2rem;
    }
    
    .answer-section {
        padding: 1.5rem;
        max-width: 700px;
    }
}

/* Desktop - show desktop header */
.gtc-desktop-only {
    display: none;
}

@media (min-width: 900px) {
    .gtc-desktop-only {
        display: block;
    }
    
    /* Legacy desktop header */
    .gtc-header {
        text-align: center;
        padding: 0.75rem 1rem 0.25rem;
    }
    
    .gtc-header h1 {
        font-size: 1.6rem;
        color: var(--gtc-text);
        margin: 0;
    }

    .gtc-header h1 i {
        display: none;
    }
    
    .game-area {
        max-width: 1200px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 1.25rem;
        align-items: start;
    }

    /* Desktop: use the sidebar instead of floating overlays */
    .overlay-score,
    .overlay-progress,
    .overlay-lives,
    .overlay-streak,
    .overlay-hints-btn {
        display: none !important;
    }

    .asset-viewer {
        padding: 1rem 0.25rem;
        align-items: center;
    }

    .asset-stage {
        width: 100%;
        max-width: 760px;
        margin: 0 auto;
    }

    .asset-viewer img {
        max-height: calc(78vh - 170px);
        max-height: calc(78dvh - 170px);
    }

    .game-canvas {
        padding-bottom: 0;
    }

    /* Answer bar: not a floating mobile pill on desktop */
    .answer-section {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 760px;
        margin: 0.85rem auto 1rem;
        border-radius: 1.25rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(15, 23, 42, 0.55);
        box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
        z-index: 10;
    }

    /* Enable and style the desktop sidebar */
    .game-sidebar {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-self: start;
        position: sticky;
        top: 6.5rem;
    }

    .progress-card,
    .stats-card,
    .hints-card {
        display: block;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 1.25rem;
        padding: 1rem;
        box-shadow: 0 16px 46px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(14px);
    }

    .card-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 900;
        font-size: 0.95rem;
        color: var(--gtc-text);
        margin-bottom: 0.75rem;
        letter-spacing: 0.2px;
    }

    .card-title i {
        color: var(--gtc-accent);
    }

    .progress-row,
    .stat-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
    }

    .stat-label {
        color: var(--gtc-text-muted);
        font-weight: 650;
        font-size: 0.9rem;
    }

    .stat-value {
        color: var(--gtc-text);
        font-weight: 900;
        font-variant-numeric: tabular-nums;
    }

    .progress-bar {
        height: 10px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .progress-fill {
        height: 100%;
        width: 0;
        background: linear-gradient(135deg, var(--gtc-accent), rgba(99, 102, 241, 0.55));
        border-radius: 999px;
        transition: width 0.25s ease;
    }

    #stat-lives .heart-icon {
        color: var(--gtc-error);
        font-size: 0.95rem;
        margin-right: 0.15rem;
        text-shadow: none;
        opacity: 0.9;
    }

    #stat-lives .heart-icon.lost {
        color: var(--gtc-text-muted);
        opacity: 0.22;
    }

    .hints-card .hint-btn {
        margin-bottom: 0.5rem;
    }

    .hints-card .hint-btn:last-child {
        margin-bottom: 0;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .answer-section {
        padding: 0.75rem;
    }
    
    .answer-input {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
    
    .submit-btn {
        width: 50px;
        height: 50px;
        font-size: 1.125rem;
    }
    
    .overlay-progress,
    .overlay-lives {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .asset-viewer {
        min-height: 60vh;
        padding: 1rem;
    }
    
    .asset-viewer img {
        max-height: 50vh;
    }
    
    .gtc-mini-header {
        height: 44px;
    }
    
    #game-content {
        padding-top: 44px;
        height: calc(100vh - 44px);
        height: calc(100dvh - 44px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Hide old sidebar elements on mobile
   ============================================ */
@media (max-width: 767px) {
    .game-area {
        flex-direction: column;
    }
    
    .game-sidebar {
        display: none !important;
    }
}

/* ============================================
   NEW GAMEOVER MODAL REDESIGN
   Professional, immersive game-over experience
   ============================================ */

/* Modal Overlay with animated background */
.gameover-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal Container */
.gameover-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: auto;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(99, 102, 241, 0.15);
    animation: gameoverSlideUp 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gameoverSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animated Background */
.gameover-modal-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    z-index: 0;
}

.gameover-modal-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Modal Content */
.gameover-modal-content {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header Section */
.gameover-header {
    text-align: center;
    padding-bottom: 0.5rem;
}

.gameover-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    animation: gameoverIconPulse 2s ease-in-out infinite;
}

.gameover-icon-win {
    filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.4));
}

.gameover-icon-loss {
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.3));
}

@keyframes gameoverIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.gameover-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--gtc-text);
    margin: 0 0 0.25rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.gameover-subtitle {
    font-size: 1rem;
    color: var(--gtc-text-muted);
    margin: 0;
    font-weight: 500;
}

/* Score Ring */
.gameover-score-ring {
    position: relative;
    width: min(200px, 55vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 50%;
    background: 
        conic-gradient(
            from 220deg,
            transparent 0deg,
            rgba(99, 102, 241, 0.15) 60deg,
            var(--gtc-accent) 120deg,
            rgba(139, 92, 246, 0.8) 180deg,
            var(--gtc-accent) 240deg,
            rgba(99, 102, 241, 0.15) 300deg,
            transparent 360deg
        );
    padding: 3px;
    box-shadow: 
        0 0 40px rgba(99, 102, 241, 0.2),
        inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.gameover-score-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.gameover-score-value {
    font-size: clamp(2rem, 8vw, 2.75rem);
    font-weight: 950;
    color: var(--gtc-text);
    line-height: 1;
    text-shadow: 0 0 30px var(--gtc-accent-glow);
    font-variant-numeric: tabular-nums;
}

.gameover-score-label {
    font-size: 0.7rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.35rem;
    font-weight: 800;
}

/* Rank Section - Dual rank display */
.gameover-rank-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
}

.gameover-rank-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.gameover-rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 140px;
}

.gameover-rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.gameover-rank-badge-daily {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.gameover-rank-badge-alltime {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.gameover-rank-info {
    text-align: left;
}

.gameover-rank-label {
    font-size: 0.7rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.gameover-rank-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gtc-text);
    line-height: 1;
}

.gameover-rank-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gtc-text-muted);
}

.gameover-rank-loading {
    font-size: 0.9rem;
    color: var(--gtc-text-muted);
    font-weight: 600;
    padding: 1rem 0;
}

.gameover-rank-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.gameover-rank-status-submitted {
    background: rgba(34, 197, 94, 0.15);
    color: var(--gtc-success);
}

/* Countdown Section */
.gameover-countdown-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    text-align: center;
}

.gameover-countdown-label {
    font-size: 0.7rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gameover-countdown-time {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--gtc-accent);
    font-variant-numeric: tabular-nums;
    margin-top: 0.25rem;
}

/* Action Buttons */
.gameover-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gameover-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 0.85rem;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gameover-btn-primary {
    background: linear-gradient(135deg, var(--gtc-accent) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.gameover-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
}

.gameover-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gtc-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gameover-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gtc-accent);
}

.gameover-btn-ghost {
    background: transparent;
    color: var(--gtc-text-muted);
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
}

.gameover-btn-ghost:hover {
    color: var(--gtc-text);
    background: rgba(255, 255, 255, 0.05);
}

/* Status Badges */
.gameover-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.gameover-status-submitted {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--gtc-success);
}

.gameover-status-info {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--gtc-text-muted);
}

/* Tabs Wrapper */
.gameover-tabs-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    padding: 0.85rem;
}

/* Tabs Navigation */
.gameover-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.85rem;
    margin-bottom: 0.85rem;
}

.gameover-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.65rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.65rem;
    color: var(--gtc-text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 150ms ease;
}

.gameover-tab i {
    font-size: 1rem;
}

.gameover-tab:hover {
    color: var(--gtc-text);
    background: rgba(255, 255, 255, 0.05);
}

.gameover-tab.active {
    color: var(--gtc-text);
    background: var(--gtc-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tab Panels */
.gameover-tab-panel {
    display: none;
    animation: gameoverTabFade 200ms ease;
}

.gameover-tab-panel.active {
    display: block;
}

@keyframes gameoverTabFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid (Tab 1) */
.gameover-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.gameover-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.85rem;
    padding: 0.85rem;
    text-align: center;
}

.gameover-stat-card-full {
    grid-column: 1 / -1;
}

.gameover-stat-icon {
    font-size: 1.1rem;
    color: var(--gtc-accent);
    margin-bottom: 0.3rem;
}

.gameover-stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gtc-text);
    font-variant-numeric: tabular-nums;
}

.gameover-stat-label {
    font-size: 0.65rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
    font-weight: 700;
}

.gameover-stat-sub {
    font-size: 0.8rem;
    color: var(--gtc-text-muted);
    margin-top: 0.3rem;
    font-weight: 700;
}

.gameover-hearts {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.gameover-hearts .heart-icon {
    font-size: 1.25rem;
    color: var(--gtc-error);
}

.gameover-hearts .heart-icon.lost {
    opacity: 0.25;
}

/* Details Section (Tab 2) */
.gameover-details-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.gameover-detail-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.85rem;
    padding: 0.85rem;
}

.gameover-detail-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--gtc-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gameover-detail-group-title i {
    color: var(--gtc-accent);
}

.gameover-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
}

.gameover-detail-item + .gameover-detail-item {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gameover-detail-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gtc-text-muted);
    font-weight: 600;
}

.gameover-detail-label i {
    width: 1rem;
    text-align: center;
}

.gameover-detail-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gtc-text);
    font-variant-numeric: tabular-nums;
}

/* Points Section (Tab 3) */
.gameover-points-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gameover-points-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.6rem 0;
}

.gameover-points-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gtc-text-muted);
    font-weight: 600;
}

.gameover-points-info i {
    font-size: 0.9rem;
}

.gameover-points-gained .gameover-points-info i {
    color: var(--gtc-success);
}

.gameover-points-lost .gameover-points-info i {
    color: var(--gtc-error);
}

.gameover-points-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.gameover-points-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gameover-points-bar-gain {
    background: linear-gradient(90deg, var(--gtc-success), #4ade80);
}

.gameover-points-bar-loss {
    background: linear-gradient(90deg, var(--gtc-error), #f87171);
}

.gameover-points-value {
    font-size: 0.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: right;
}

.gameover-points-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.25rem 0;
}

/* Bonus Grid */
.gameover-bonus-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.gameover-bonus-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.gameover-bonus-icon {
    font-size: 1rem;
    color: var(--gtc-accent);
    margin-bottom: 0.25rem;
}

.gameover-bonus-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--gtc-text);
    font-variant-numeric: tabular-nums;
}

.gameover-bonus-label {
    font-size: 0.6rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.15rem;
    font-weight: 700;
}

/* Points Total */
.gameover-points-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    margin-top: 0.25rem;
}

.gameover-points-total span:first-child {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gtc-text);
}

.gameover-points-total-value {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--gtc-accent);
    font-variant-numeric: tabular-nums;
}

/* Navigation Actions */
.gameover-nav-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Text Color Utilities */
.text-success {
    color: var(--gtc-success) !important;
}

.text-error {
    color: var(--gtc-error) !important;
}

/* Responsive Adjustments for Gameover Modal */
@media (max-width: 400px) {
    .gameover-modal-content {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .gameover-score-ring {
        width: min(160px, 50vw);
    }
    
    .gameover-title {
        font-size: 1.5rem;
    }
    
    .gameover-bonus-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .gameover-bonus-item {
        padding: 0.6rem 0.35rem;
    }
    
    .gameover-bonus-value {
        font-size: 0.95rem;
    }
    
    .gameover-bonus-label {
        font-size: 0.55rem;
    }
}

@media (min-width: 768px) {
    .gameover-modal {
        max-width: 520px;
    }
    
    .gameover-modal-content {
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .gameover-score-ring {
        width: 220px;
    }
    
    .gameover-title {
        font-size: 2rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gameover-modal {
        animation: none;
    }
    
    .gameover-icon {
        animation: none;
    }
    
    .gameover-score-ring {
        animation: none;
    }
    
    .gameover-tab-panel {
        animation: none;
    }
    
    .gameover-points-bar {
        transition: none;
    }
}

/* ============================================
   TRAINING GAMEOVER SPECIFIC STYLES
   ============================================ */

.gameover-modal-training .gameover-modal-bg {
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 197, 94, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.gameover-icon-training {
    filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.35));
}

.gameover-score-ring-training {
    background: 
        conic-gradient(
            from 220deg,
            transparent 0deg,
            rgba(34, 197, 94, 0.15) 60deg,
            var(--gtc-success) 120deg,
            rgba(16, 185, 129, 0.8) 180deg,
            var(--gtc-success) 240deg,
            rgba(34, 197, 94, 0.15) 300deg,
            transparent 360deg
        );
    box-shadow: 
        0 0 40px rgba(34, 197, 94, 0.2),
        inset 0 0 20px rgba(34, 197, 94, 0.1);
}

.gameover-score-ring-training .gameover-score-value {
    text-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

/* Training Quick Stats */
.gameover-training-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.gameover-training-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.gameover-training-stat i {
    font-size: 1.1rem;
    color: var(--gtc-success);
    margin-bottom: 0.15rem;
}

.gameover-training-stat-value {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--gtc-text);
    font-variant-numeric: tabular-nums;
}

.gameover-training-stat-label {
    font-size: 0.65rem;
    color: var(--gtc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Training CTA */
.gameover-training-cta {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 0.85rem;
    padding: 0.75rem 1rem;
}

.gameover-training-cta-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gtc-text-muted);
}

.gameover-training-cta-text i {
    color: var(--gtc-accent);
}
