/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00f0ff;
    --secondary: #ff3366;
    --accent: #ffcc00;
    --bg-dark: #0a0a1a;
    --bg-card: #1a1a2e;
    --text: #ffffff;
    --text-dim: #8888aa;
    --success: #00ff88;
    --danger: #ff4444;
    --gradient-1: linear-gradient(135deg, #00f0ff, #0066ff);
    --gradient-2: linear-gradient(135deg, #ff3366, #ff6600);
    --gradient-3: linear-gradient(135deg, #ffcc00, #ff6600);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.3);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
}

/* ===== SCREENS ===== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
}

/* ===== ATTRACT SCREEN ===== */
.attract-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(255, 51, 102, 0.08) 0%, transparent 50%),
        var(--bg-dark);
    animation: bgPulse 4s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.attract-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.logo-container {
    margin-bottom: 20px;
}

.game-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.5);
}

.title-accent {
    color: var(--primary);
    display: block;
    font-size: 0.6em;
    letter-spacing: 8px;
}

.title-underline {
    width: 200px;
    height: 3px;
    background: var(--gradient-1);
    margin: 15px auto;
    border-radius: 2px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-dim);
    letter-spacing: 6px;
    margin-bottom: 40px;
    font-weight: 300;
}

.attract-hands {
    font-size: 4rem;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 60px;
}

.hand-icon {
    animation: punchBounce 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.5));
}

.hand-icon.left {
    animation-delay: 0s;
}

.hand-icon.right {
    animation-delay: 0.75s;
}

@keyframes punchBounce {
    0%, 100% { transform: translateY(0) scaleX(var(--sx, 1)); }
    50% { transform: translateY(-15px) scaleX(var(--sx, 1)) scale(1.1); }
}

.hand-icon.left { --sx: 1; }
.hand-icon.right { --sx: 1; }

.instructions-hint {
    margin-top: 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Leaderboard Preview */
.leaderboard-preview {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    min-width: 250px;
    backdrop-filter: blur(10px);
}

.leaderboard-preview h3 {
    color: var(--primary);
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

#top-scores .lb-entry {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

#top-scores .lb-entry:last-child {
    border-bottom: none;
}

#top-scores .lb-rank {
    color: var(--accent);
    width: 25px;
}

#top-scores .lb-name {
    flex: 1;
    color: var(--text);
}

#top-scores .lb-score {
    color: var(--primary);
    font-weight: 700;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--gradient-1);
    color: var(--bg-dark);
    border: none;
    padding: 18px 48px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.5);
}

.btn-primary.pulse {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.3); }
    50% { box-shadow: 0 0 60px rgba(0, 240, 255, 0.6); }
}

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== MODE SELECT ===== */
.screen-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 40px;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    padding: 0 20px;
}

.mode-card {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mode-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.2);
}

.mode-card .mode-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.mode-card h3 {
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.mode-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.mode-difficulty {
    font-size: 0.7rem;
    letter-spacing: 3px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.mode-card:nth-child(1) .mode-difficulty {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
}

.mode-card:nth-child(2) .mode-difficulty {
    background: rgba(255, 204, 0, 0.15);
    color: var(--accent);
}

.mode-card:nth-child(3) .mode-difficulty {
    background: rgba(255, 68, 68, 0.15);
    color: var(--danger);
}

/* ===== COUNTDOWN ===== */
#countdown-screen {
    background: rgba(10, 10, 26, 0.95);
}

.countdown-number {
    font-size: 15rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 80px rgba(0, 240, 255, 0.8);
    animation: countPop 1s ease-out;
}

@keyframes countPop {
    0% { transform: scale(2); opacity: 0; }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.countdown-text {
    font-size: 1.5rem;
    letter-spacing: 8px;
    color: var(--text-dim);
    margin-top: 20px;
}

/* ===== GAME SCREEN ===== */
#game-screen {
    background: #000;
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0.6;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 30px;
    z-index: 10;
    pointer-events: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hud-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    display: block;
}

.hud-value {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.timer-value {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    font-size: 3rem;
}

.timer-value.timer-danger {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    animation: timerBlink 0.5s ease-in-out infinite;
}

@keyframes timerBlink {
    50% { opacity: 0.5; }
}

.hud-combo {
    background: rgba(255, 51, 102, 0.2);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 6px 14px;
    animation: comboFlash 0.3s ease;
}

@keyframes comboFlash {
    0% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.combo-text {
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.hud-multiplier {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    font-weight: 900;
}

.hud-lives span {
    font-size: 1.8rem;
}

/* Boss Health */
.boss-health-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 600px;
    z-index: 10;
    text-align: center;
}

.boss-name {
    font-size: 1rem;
    letter-spacing: 4px;
    color: var(--danger);
    margin-bottom: 8px;
    font-weight: 700;
}

.boss-health-bar {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 68, 68, 0.5);
}

.boss-health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6600);
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* Punch Indicator */
.punch-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 4px;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.1s;
    text-shadow: 0 0 20px currentColor;
}

.punch-indicator.show {
    opacity: 1;
    animation: punchLabel 0.6s ease-out forwards;
}

@keyframes punchLabel {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -60%) scale(1); opacity: 0; }
}

/* Screen Effects */
.screen-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.05s;
}

.screen-flash.flash-hit {
    background: radial-gradient(circle, rgba(0, 240, 255, 0.4), transparent 70%);
    opacity: 1;
    animation: flashOut 0.2s ease-out forwards;
}

.screen-flash.flash-critical {
    background: radial-gradient(circle, rgba(255, 204, 0, 0.5), transparent 70%);
    opacity: 1;
    animation: flashOut 0.3s ease-out forwards;
}

.screen-flash.flash-miss {
    background: rgba(255, 0, 0, 0.2);
    opacity: 1;
    animation: flashOut 0.4s ease-out forwards;
}

@keyframes flashOut {
    to { opacity: 0; }
}

#game-screen.shake {
    animation: screenShake 0.3s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-5px, -3px); }
    20% { transform: translate(5px, 3px); }
    30% { transform: translate(-3px, 5px); }
    40% { transform: translate(3px, -5px); }
    50% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
}

#game-screen.slow-mo #game-canvas {
    transition: filter 0.1s;
    filter: saturate(1.5) contrast(1.2);
}

/* ===== RESULTS SCREEN ===== */
#results-screen {
    background: rgba(10, 10, 26, 0.98);
}

.results-container {
    text-align: center;
    max-width: 700px;
    padding: 20px;
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.results-title {
    font-size: 3.5rem;
    font-weight: 900;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    animation: resultsPop 0.5s ease-out;
}

@keyframes resultsPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.final-score {
    margin-bottom: 30px;
}

.final-score-label {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.final-score-value {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.6);
    animation: scoreCount 1s ease-out;
}

@keyframes scoreCount {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.name-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

#player-name {
    background: var(--bg-card);
    border: 2px solid rgba(0, 240, 255, 0.3);
    color: var(--text);
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 50px;
    text-transform: uppercase;
    width: 250px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

#player-name:focus {
    border-color: var(--primary);
}

#player-name::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

/* ===== KIRO PROMO ===== */
.kiro-promo {
    margin-top: 30px;
    margin-bottom: 24px;
    animation: kiroFadeIn 1s ease-out 1.5s both;
    width: 100%;
}

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

.kiro-divider {
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 0 auto 24px;
}

.kiro-hero {
    text-align: center;
    margin-bottom: 24px;
}

.kiro-badge-large {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 4px;
    padding: 6px 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(102, 255, 204, 0.1));
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.4);
    margin-bottom: 16px;
    font-weight: 800;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.4); }
}

.kiro-title-large {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
    line-height: 1.3;
}

.kiro-highlight-large {
    background: linear-gradient(135deg, #00f0ff, #66ffcc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 2rem;
}

.kiro-subtitle-large {
    color: var(--text-dim);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Stats Row */
.kiro-stats-row-large {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kiro-stat-large {
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kiro-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.kiro-stat-value-large {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.kiro-stat-label-large {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Prompt Section */
.kiro-prompt-section {
    margin-bottom: 24px;
}

.kiro-prompt-header {
    text-align: center;
    margin-bottom: 12px;
}

.kiro-prompt-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--accent);
    font-weight: 700;
}

.kiro-prompt-arrow {
    display: block;
    font-size: 1.2rem;
    color: var(--accent);
    animation: arrowBounce 1.5s ease-in-out infinite;
}

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

.kiro-prompt-box {
    background: #0d1117;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
}

.kiro-prompt-terminal-bar {
    background: #161b22;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kiro-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.kiro-dot.red { background: #ff5f57; }
.kiro-dot.yellow { background: #febc2e; }
.kiro-dot.green { background: #28c840; }

.kiro-terminal-title {
    margin-left: 10px;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    font-weight: 600;
}

.kiro-prompt-text {
    padding: 16px 20px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #c9d1d9;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}

.kiro-prompt-text p {
    margin-bottom: 8px;
    color: #8b949e;
}

.kiro-prompt-text p:first-child {
    color: #58a6ff;
}

/* Bottom CTA */
.kiro-bottom {
    text-align: center;
    padding-top: 8px;
}

.kiro-cta-large {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 10px;
}

.kiro-url-large {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #00f0ff, #66ffcc, #00f0ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineUrl 3s linear infinite;
    margin-bottom: 6px;
}

@keyframes shineUrl {
    to { background-position: 200% center; }
}

.kiro-tagline {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .kiro-stats-row-large {
        grid-template-columns: repeat(2, 1fr);
    }

    .kiro-title-large {
        font-size: 1.2rem;
    }

    .kiro-highlight-large {
        font-size: 1.5rem;
    }

    .kiro-url-large {
        font-size: 1.5rem;
    }
}

.results-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== LEADERBOARD SCREEN ===== */
.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.lb-tab {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.lb-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 240, 255, 0.1);
}

.leaderboard-table {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    min-width: 500px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.lb-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lb-row.top-1 { background: rgba(255, 204, 0, 0.08); }
.lb-row.top-2 { background: rgba(192, 192, 192, 0.05); }
.lb-row.top-3 { background: rgba(205, 127, 50, 0.05); }

.lb-row .rank {
    width: 40px;
    font-weight: 900;
    font-size: 1.1rem;
}

.lb-row.top-1 .rank { color: #ffd700; }
.lb-row.top-2 .rank { color: #c0c0c0; }
.lb-row.top-3 .rank { color: #cd7f32; }

.lb-row .name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.lb-row .score {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--primary);
}

.lb-row .mode-badge {
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    margin-left: 12px;
}

/* ===== OVERLAYS ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay-content {
    text-align: center;
}

.overlay-content h2 {
    font-size: 1.8rem;
    margin: 20px 0 10px;
    letter-spacing: 3px;
}

.overlay-content p {
    color: var(--text-dim);
    margin-bottom: 20px;
}

.camera-icon {
    font-size: 4rem;
    animation: camPulse 2s ease-in-out infinite;
}

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

/* Loader */
.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 240, 255, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-title {
        font-size: 3rem;
    }

    .hud-value {
        font-size: 1.8rem;
    }

    .leaderboard-preview {
        display: none;
    }

    .leaderboard-table {
        min-width: unset;
        width: 90vw;
    }
}

/* ===== SCORE POPUP ANIMATION (used by canvas overlay) ===== */
.score-popup {
    position: absolute;
    pointer-events: none;
    z-index: 25;
    font-weight: 900;
    font-size: 2rem;
    text-shadow: 0 0 10px currentColor;
    animation: scorePopup 0.8s ease-out forwards;
}

@keyframes scorePopup {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-60px) scale(1); opacity: 0; }
}
