/* ============================================================
   COCKROACH RUN — PREMIUM GAME UI
   All Eater font. No cards. Pure gritty neon 3D game feel.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Eater&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    --neon-green:  #39ff14;
    --neon-cyan:   #00e5ff;
    --neon-red:    #ff2244;
    --neon-gold:   #ffb700;
    --neon-orange: #ff6a00;
    --bg-void:     #04060504;
    --bg-panel:    rgba(6, 10, 7, 0.92);
    --bg-strip:    rgba(12, 20, 14, 0.96);
    --glow-green:  0 0 12px #39ff14, 0 0 30px rgba(57,255,20,0.35);
    --glow-red:    0 0 12px #ff2244, 0 0 30px rgba(255,34,68,0.35);
    --glow-gold:   0 0 12px #ffb700, 0 0 30px rgba(255,183,0,0.35);
    --glow-cyan:   0 0 12px #00e5ff, 0 0 30px rgba(0,229,255,0.35);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
input:focus,
a:focus {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Button pop animation on click */
@keyframes btnPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.13); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn-pop {
    animation: btnPop 0.28s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards !important;
}

body {
    background: #050706;
    color: #e2f0e6;
    font-family: 'Eater', cursive;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ── APP SHELL ─────────────────────────────────────────────── */
#app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #050706;
}

/* ── SCREEN SYSTEM ─────────────────────────────────────────── */
.app-screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    z-index: 10;
}

.app-screen.active {
    display: flex;
    animation: screenIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.flex-center { justify-content: center; align-items: center; }

/* ── SHARED: FULL BLEED DARK OVERLAY SCREENS ───────────────── */
.overlay-screen {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(57,255,20,0.07) 0%, transparent 65%),
        radial-gradient(ellipse at 50% 100%, rgba(0,229,255,0.05) 0%, transparent 65%),
        #06090706;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── SHARED: TITLE STRIPE ──────────────────────────────────── */
.game-title-stripe {
    width: 100%;
    text-align: center;
    padding: 24px 24px 16px;
    position: relative;
}

.game-title-stripe::before {
    content: '';
    position: absolute;
    bottom: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(57,255,20,0.4), transparent);
}

.stripe-title {
    font-family: 'Eater', cursive;
    font-size: 42px;
    letter-spacing: 3px;
    line-height: 1;
    position: relative;
    display: inline-block;
}

.stripe-title.red {
    color: var(--neon-red);
    text-shadow: var(--glow-red), 0 4px 12px rgba(0,0,0,0.9);
    animation: splat-shake 0.5s cubic-bezier(0.36,0.07,0.19,0.97) both;
}

.stripe-title.green {
    color: var(--neon-green);
    text-shadow: var(--glow-green), 0 4px 12px rgba(0,0,0,0.9);
}

.stripe-title.gold {
    color: var(--neon-gold);
    text-shadow: var(--glow-gold), 0 4px 12px rgba(0,0,0,0.9);
}

.stripe-title.cyan {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan), 0 4px 12px rgba(0,0,0,0.9);
}

@keyframes splat-shake {
    0%,100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-4deg) scale(1.12); }
    40% { transform: rotate(3deg) scale(1.08); }
    60% { transform: rotate(-2deg) scale(1.04); }
    80% { transform: rotate(1deg) scale(1.02); }
}

.stripe-sub {
    font-family: 'Eater', cursive;
    font-size: 14px;
    color: #667a6e;
    letter-spacing: 1.5px;
    margin-top: 8px;
    line-height: 1.5;
    padding: 0 24px;
}

/* ── SHARED: STAT PANEL (replaces boring .stats-summary) ───── */
.stat-panel {
    width: calc(100% - 48px);
    margin: 0 24px 20px;
    background: rgba(0,0,0,0.5);
    border-top: 2px solid rgba(57,255,20,0.2);
    border-bottom: 2px solid rgba(57,255,20,0.2);
    position: relative;
    overflow: hidden;
}

.stat-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(57,255,20,0.015) 0px,
        rgba(57,255,20,0.015) 1px,
        transparent 1px,
        transparent 24px
    );
    pointer-events: none;
}

.stat-row-3d {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.stat-row-3d:last-child { border-bottom: none; }

.stat-label-3d {
    font-family: 'Eater', cursive;
    font-size: 12px;
    letter-spacing: 2px;
    color: #5a7060;
    text-transform: uppercase;
}

.stat-val-3d {
    font-family: 'Eater', cursive;
    font-size: 30px;
    color: var(--neon-gold);
    text-shadow: var(--glow-gold);
    letter-spacing: 2px;
}

/* ── SHARED: SUBMIT BLOCK ───────────────────────────────────── */
.submit-block {
    width: calc(100% - 48px);
    margin: 0 24px 24px;
}

.submit-label {
    font-family: 'Eater', cursive;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(57,255,20,0.5);
    margin-bottom: 10px;
    display: block;
}

.submit-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.submit-row input {
    flex: 1;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(57,255,20,0.25);
    border-radius: 6px;
    padding: 14px 16px;
    color: #e2f0e6;
    font-family: 'Eater', cursive;
    font-size: 15px;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.submit-row input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(57,255,20,0.3);
}

.submit-row input::placeholder { color: #3a4a3e; }

.btn-save {
    background: linear-gradient(160deg, #ff2244, #aa0030);
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-family: 'Eater', cursive;
    font-size: 16px;
    letter-spacing: 2px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(255,34,68,0.5);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-save:active { transform: scale(0.94); }

.submit-status {
    font-family: 'Eater', cursive;
    font-size: 11px;
    letter-spacing: 1px;
    color: #4a6a50;
    margin-top: 8px;
    min-height: 16px;
}

.submit-status.error { color: var(--neon-red); }
.submit-status.success { color: var(--neon-green); }

/* ── SHARED: ACTION BUTTONS ROW ────────────────────────────── */
.action-floor {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-top: 1px solid rgba(57,255,20,0.1);
}

/* Primary neon CTA button (full width, flush) */
.btn-floor-primary {
    width: 100%;
    padding: 22px 24px;
    font-family: 'Eater', cursive;
    font-size: 22px;
    letter-spacing: 3px;
    color: #030a04;
    background: linear-gradient(160deg, #39ff14 0%, #17b000 100%);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter 0.15s, transform 0.1s;
    text-shadow: 0 1px 0 rgba(255,255,255,0.2);
    box-shadow: 0 -4px 20px rgba(57,255,20,0.3) inset;
}

.btn-floor-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.btn-floor-primary:active {
    filter: brightness(0.85);
    transform: scaleY(0.97);
}

/* Secondary ghost floor button */
.btn-floor-secondary {
    width: 100%;
    padding: 18px 24px;
    font-family: 'Eater', cursive;
    font-size: 16px;
    letter-spacing: 3px;
    color: #5a7060;
    background: rgba(6,10,7,0.9);
    border: none;
    border-top: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.btn-floor-secondary:active {
    color: #e2f0e6;
    background: rgba(20,30,22,0.9);
}

/* ── GRIT TEXTURE OVERLAY ──────────────────────────────────── */
.grit-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 180px;
    mix-blend-mode: overlay;
    opacity: 0.6;
}

/* ============================================================
   SCREEN 1: MAIN MENU
   ============================================================ */
#screen-menu {
    padding: 0;
    background: #040604;
    overflow: hidden;
}

.menu-fullscreen-viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.viewport-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Eater', cursive;
    font-size: 14px;
    letter-spacing: 3px;
    color: #2a4030;
}

/* Menu floating UI */
.menu-ui-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.menu-ui-overlay * { pointer-events: auto; }

/* Logo top area */
.menu-header {
    padding: 55px 24px 0;
    text-align: center;
    animation: dropIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.logo-title {
    font-family: 'Eater', cursive;
    font-size: 40px;
    line-height: 0.9;
    color: #dce8de;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95), 0 0 20px rgba(140,74,35,0.3);
    letter-spacing: 2px;
}

.logo-title .highlight {
    display: block;
    color: #9c5831;
    font-size: 60px;
    text-shadow:
        0 0 15px rgba(156,88,49,0.9),
        0 0 35px rgba(156,88,49,0.5),
        0 4px 8px rgba(0,0,0,0.95);
    letter-spacing: 4px;
    margin-top: 4px;
}

/* Bottom action cluster */
.menu-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
    animation: riseIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

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

/* PLAY button — massive glowing */
.btn-play-3d {
    font-family: 'Eater', cursive;
    font-size: 52px;
    letter-spacing: 6px;
    color: var(--neon-gold);
    background: none;
    border: none;
    cursor: pointer;
    text-shadow:
        0 0 14px rgba(255,183,0,0.8),
        0 0 35px rgba(255,183,0,0.4),
        0 4px 8px rgba(0,0,0,0.95);
    animation: pulsePLAY 1.8s infinite alternate ease-in-out;
    margin-bottom: 10px;
    transition: text-shadow 0.2s;
}

.btn-play-3d:active {
    text-shadow:
        0 0 6px rgba(255,183,0,0.5),
        0 2px 4px rgba(0,0,0,0.95);
    transform: scale(0.96);
}

@keyframes pulsePLAY {
    from { transform: scale(1.0); text-shadow: 0 0 14px rgba(255,183,0,0.8), 0 0 35px rgba(255,183,0,0.4), 0 4px 8px rgba(0,0,0,0.95); }
    to   { transform: scale(1.07); text-shadow: 0 0 22px rgba(255,183,0,1.0), 0 0 55px rgba(255,183,0,0.55), 0 4px 8px rgba(0,0,0,0.95); }
}

.menu-sub-btns {
    display: flex;
    gap: 28px;
}

.btn-menu-sub {
    font-family: 'Eater', cursive;
    font-size: 16px;
    letter-spacing: 2px;
    color: #4a6550;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s, text-shadow 0.2s;
}

.btn-menu-sub:hover, .btn-menu-sub:active {
    color: #c0d0c4;
    text-shadow: 0 0 8px rgba(192,208,196,0.4);
}

/* Sound btn top-right */
.menu-sound-btn-wrap {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
}

/* ============================================================
   SCREEN 2: GAME SCREEN & HUD
   ============================================================ */
#screen-game {
    padding: 0;
    background: #000;
}

#game-viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    pointer-events: none;
    padding: 20px 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Distance — left transparent */
.hud-dist {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: auto;
}

.hud-dist-label {
    font-family: 'Eater', cursive;
    font-size: 9px;
    letter-spacing: 3px;
    color: #3d5242;
    text-shadow: 0 2px 4px rgba(0,0,0,0.95);
    margin-bottom: 1px;
}

.hud-dist-val {
    font-family: 'Eater', cursive;
    font-size: 36px;
    color: var(--neon-gold);
    text-shadow: var(--glow-gold), 0 3px 6px rgba(0,0,0,0.95);
    letter-spacing: 2px;
    line-height: 1;
}

.hud-dist-val .unit {
    font-size: 14px;
    color: #4a6048;
    margin-left: 2px;
}

/* HUD right controls */
.hud-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: auto;
}

.hud-pause-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #4a6048;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    pointer-events: auto;
}

.hud-pause-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: transform 0.2s, filter 0.2s;
}

.hud-pause-btn:hover img,
.hud-pause-btn:active img {
    filter: drop-shadow(0 0 8px var(--neon-green)) brightness(1.3);
    transform: scale(1.15);
}

/* Turn prompt */
.turn-prompt {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    font-family: 'Eater', cursive;
    font-size: 38px;
    color: var(--neon-red);
    text-shadow: var(--glow-red), 0 3px 5px rgba(0,0,0,0.95);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    letter-spacing: 2px;
}

.turn-prompt.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.0);
    animation: flashPrompt 0.6s infinite alternate ease-in-out;
}

.turn-prompt.active.success {
    color: var(--neon-green);
    text-shadow: var(--glow-green), 0 3px 5px rgba(0,0,0,0.95);
    animation: none;
    transform: translate(-50%, -50%) scale(1.15);
}

@keyframes flashPrompt {
    from { opacity: 0.3; transform: translate(-50%, -50%) scale(0.95); }
    to   { opacity: 1.0; transform: translate(-50%, -50%) scale(1.05); }
}

/* ── PAUSE OVERLAY ─────────────────────────────────────────── */
.game-hud-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(4, 6, 5, 0.35);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-hud-overlay.active { display: flex; }

/* Pause panel — full-width bottom drawer style */
.pause-panel {
    width: 100%;
    max-width: 400px;
    background: none;
    border: none;
    padding: 48px 32px max(40px, env(safe-area-inset-bottom, 40px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: absolute;
    bottom: 0;
}

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

.pause-title {
    font-family: 'Eater', cursive;
    font-size: 44px;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    letter-spacing: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Countdown */
.countdown-text {
    font-family: 'Eater', cursive;
    font-size: 160px;
    color: var(--neon-gold);
    text-shadow: var(--glow-gold), 0 8px 20px rgba(0,0,0,0.95);
    animation: pulseCountdown 1.0s infinite ease-out;
    letter-spacing: 4px;
}

@keyframes pulseCountdown {
    0%   { transform: scale(1.8); opacity: 0; }
    15%  { transform: scale(1.0); opacity: 1; }
    85%  { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(0.6); opacity: 0; }
}

/* ============================================================
   SCREEN 3: GAME OVER
   ============================================================ */
#screen-gameover {
    background:
        radial-gradient(ellipse at 50% 20%, rgba(255,34,68,0.12) 0%, transparent 60%),
        #050706;
    justify-content: flex-end;
}

.gameover-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 0 12px;
}

/* ============================================================
   SCREEN 4: WIN
   ============================================================ */
#screen-win {
    background:
        radial-gradient(ellipse at 50% 20%, rgba(57,255,20,0.1) 0%, transparent 60%),
        #050706;
    justify-content: flex-end;
}

.win-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 0 12px;
}

/* ============================================================
   SCREEN 5: LEADERBOARD
   ============================================================ */
#screen-leaderboard {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.07) 0%, transparent 55%),
        #050706;
    justify-content: flex-end;
}

.leaderboard-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leaderboard-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,0.25) transparent;
}

.leaderboard-scroll::-webkit-scrollbar { width: 3px; }
.leaderboard-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,0.25);
    border-radius: 2px;
}

/* Leaderboard header row */
.lb-header {
    display: grid;
    grid-template-columns: 36px 1fr 72px 72px;
    padding: 12px 24px;
    font-family: 'Eater', cursive;
    font-size: 10px;
    letter-spacing: 2px;
    color: #2a4030;
    border-bottom: 1px solid rgba(0,229,255,0.1);
    position: sticky;
    top: 0;
    background: rgba(4,6,5,0.97);
    z-index: 2;
}

/* Each leaderboard row */
.lb-row {
    display: grid;
    grid-template-columns: 36px 1fr 72px 72px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-family: 'Eater', cursive;
    font-size: 14px;
    letter-spacing: 1px;
    color: #5a7060;
    transition: background 0.15s;
}

.lb-row:active { background: rgba(0,229,255,0.04); }

/* Top 3 special styling */
.lb-row:nth-child(1) { color: var(--neon-gold); font-size: 16px; }
.lb-row:nth-child(1) .lb-rank::before { content: '🥇 '; }
.lb-row:nth-child(2) { color: #c0c8cc; }
.lb-row:nth-child(2) .lb-rank::before { content: '🥈 '; }
.lb-row:nth-child(3) { color: #cd7f32; }
.lb-row:nth-child(3) .lb-rank::before { content: '🥉 '; }

.lb-rank { font-size: 11px; }
.lb-name { font-size: 15px; }
.lb-score { text-align: right; color: var(--neon-green); }
.lb-date { text-align: right; font-size: 10px; }

/* ============================================================
   SCREEN 6: INSTRUCTIONS
   ============================================================ */
#screen-instructions {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(57,255,20,0.06) 0%, transparent 55%),
        #050706;
    justify-content: flex-end;
}

.instructions-content {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.instr-list {
    padding: 8px 0;
    flex: 1;
}

/* Each instruction row */
.instr-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.instr-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(57,255,20,0.06);
    border-radius: 10px;
    border: 1px solid rgba(57,255,20,0.12);
}

.instr-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.instr-heading {
    font-family: 'Eater', cursive;
    font-size: 15px;
    letter-spacing: 1.5px;
    color: #c0d0c4;
}

.instr-heading.danger { color: var(--neon-red); text-shadow: 0 0 8px rgba(255,34,68,0.4); }

.instr-desc {
    font-family: 'Eater', cursive;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #3d5242;
    line-height: 1.5;
}

/* ── UNIVERSAL WIDE FLOOR BUTTON (reusable across all screens) ── */
.floor-btn-wrap {
    width: 100%;
    flex-shrink: 0;
}

/* ── ACCENT SAVE BUTTON (used inside submit block) ─────────── */
.btn-accent-save {
    background: linear-gradient(160deg, #ff2244 0%, #990022 100%);
    border: none;
    border-radius: 6px;
    padding: 0 22px;
    height: 50px;
    font-family: 'Eater', cursive;
    font-size: 16px;
    letter-spacing: 2px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(255,34,68,0.45);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-accent-save:active { transform: scale(0.93); filter: brightness(0.85); }

/* ── LEADERBOARD TABLE (fallback for dynamic render) ──────── */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    font-family: 'Eater', cursive;
    font-size: 10px;
    letter-spacing: 2px;
    color: #2a4030;
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(0,229,255,0.1);
    background: rgba(4,6,5,0.97);
    position: sticky;
    top: 0;
}

.leaderboard-table td {
    font-family: 'Eater', cursive;
    font-size: 14px;
    letter-spacing: 1px;
    color: #5a7060;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.leaderboard-table tr:nth-child(1) td { color: var(--neon-gold); font-size: 16px; }
.leaderboard-table tr:nth-child(2) td { color: #c0c8cc; }
.leaderboard-table tr:nth-child(3) td { color: #cd7f32; }

/* ── CARD CLASSES (kept for backward compat but unstyled as cards) */
.card { background: none; border: none; padding: 0; border-radius: 0; box-shadow: none; width: 100%; text-align: inherit; }
.card::before, .card::after { display: none; }
.card-title {
    font-family: 'Eater', cursive;
    font-size: 32px;
    letter-spacing: 3px;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    padding: 28px 24px 0;
    display: block;
}

/* ── BACKWARD COMPAT: old .btn class ──────────────────────── */
.btn {
    font-family: 'Eater', cursive;
    letter-spacing: 2px;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(160deg, #39ff14, #17b000);
    color: #030a04;
    font-size: 22px;
    padding: 22px 24px;
    box-shadow: 0 -4px 20px rgba(57,255,20,0.3) inset;
}

.btn-primary:active { filter: brightness(0.85); transform: scaleY(0.97); }

.btn-secondary {
    background: rgba(6,10,7,0.9);
    color: #5a7060;
    font-size: 16px;
    padding: 18px 24px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.btn-secondary:active { color: #c0d0c4; }

.btn-accent {
    background: linear-gradient(160deg, #ff2244, #990022);
    color: #fff;
    font-size: 16px;
    padding: 0 22px;
    height: 50px;
    box-shadow: 0 0 14px rgba(255,34,68,0.45);
    width: auto;
}

.btn-accent:active { transform: scale(0.93); }

.btn-eater {
    font-family: 'Eater', cursive;
    letter-spacing: 3px;
}

.w-full { width: 100%; }

/* Action buttons wrapper */
.action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Stats summary backward compat */
.stats-summary {
    width: calc(100% - 48px);
    margin: 0 24px 20px;
    background: rgba(0,0,0,0.5);
    border-top: 2px solid rgba(57,255,20,0.2);
    border-bottom: 2px solid rgba(57,255,20,0.2);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    font-family: 'Eater', cursive;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: #5a7060;
}

.stat-val {
    font-family: 'Eater', cursive;
    font-size: 28px;
    color: var(--neon-gold);
    text-shadow: var(--glow-gold);
    letter-spacing: 2px;
}

/* Leaderboard submission backward compat */
.leaderboard-submission {
    width: calc(100% - 48px);
    margin: 0 24px 24px;
}

.leaderboard-submission .sub-heading {
    font-family: 'Eater', cursive;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(57,255,20,0.5);
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group input {
    flex: 1;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(57,255,20,0.25);
    border-radius: 6px;
    padding: 14px 16px;
    color: #e2f0e6;
    font-family: 'Eater', cursive;
    font-size: 15px;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(57,255,20,0.3);
}

.input-group input::placeholder { color: #3a4a3e; }

.input-group .btn {
    width: auto;
    margin: 0;
    padding: 0 20px;
    font-size: 16px;
    letter-spacing: 2px;
    height: 50px;
}

.submission-status {
    font-family: 'Eater', cursive;
    font-size: 11px;
    letter-spacing: 1px;
    color: #4a6a50;
    margin-top: 8px;
    min-height: 16px;
}

/* ── HUD OVERLAYS (pause/countdown) ─────────────────────────── */
.w-full-container { height: 85%; display: flex; flex-direction: column; }

/* ── FONT HELPERS ─────────────────────────────────────────────── */
.font-eater { font-family: 'Eater', cursive !important; letter-spacing: 1px; }
.text-neon   { color: var(--neon-green); text-shadow: var(--glow-green); }
.text-danger { color: var(--neon-red);   text-shadow: var(--glow-red); }
.text-success{ color: var(--neon-green); text-shadow: var(--glow-green); }
.text-center { text-align: center; }

/* ── LEADERBOARD LIST CONTAINER backward compat ─────────────── */
.leaderboard-list-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,0.25) transparent;
}

.leaderboard-list-container::-webkit-scrollbar { width: 3px; }
.leaderboard-list-container::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,0.25);
    border-radius: 2px;
}

/* ── INSTRUCTION screen backward compat ────────────────────── */
.instruction-content {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}
.instruction-content::-webkit-scrollbar { width: 3px; }
.instruction-content::-webkit-scrollbar-thumb {
    background: rgba(57,255,20,0.25);
    border-radius: 2px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.instruction-item .icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(57,255,20,0.06);
    border-radius: 8px;
    border: 1px solid rgba(57,255,20,0.12);
    overflow: hidden;
    padding: 0;
}

.instruction-item .icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.instruction-item p {
    flex: 1;
    font-family: 'Eater', cursive;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #3d5242;
    line-height: 1.6;
}

.instruction-item p strong {
    color: #c0d0c4;
    font-weight: normal;
}

.instruction-item.danger p strong {
    color: var(--neon-red);
    text-shadow: 0 0 8px rgba(255,34,68,0.4);
}

/* ============================================================
   ROUND BANNER OVERLAY
   ============================================================ */
#game-round-overlay {
    background: rgba(5,7,6,0.85);
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 1001;
}

#round-banner {
    font-size: 48px;
    color: #39ff14;
    text-shadow: 0 0 15px rgba(57,255,20,0.8);
    text-align: center;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
