/* MWR Arcade Leaderboard — FINAL CSS (PART 1 of 2) */

:root { --cabinet-max: 700px; --cab-bg: #1a1a1a; --font-arcade: 'Press Start 2P', system-ui, monospace; }
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; padding: 0; min-height: 100vh; font-family: var(--font-arcade); color: #fff; background: #0d0d12; background-image: radial-gradient(ellipse at 50% 0%, rgba(60, 70, 120, 0.4) 0%, transparent 55%), radial-gradient(circle at 15% 80%, rgba(40, 20, 60, 0.35) 0%, transparent 40%), radial-gradient(circle at 85% 70%, rgba(20, 40, 80, 0.3) 0%, transparent 40%); display: flex; justify-content: center; align-items: flex-start; overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.05) transparent; }
body::-webkit-scrollbar { width: 12px; }
body::-webkit-scrollbar-track { background: transparent; } 
body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.1); }

.video-bg-container { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
#arcade-room-video { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; filter: brightness(0.95); }
.ambient-vignette { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,0.85) 100%); pointer-events: none; }
.cabinet-center-container { position: relative; z-index: 10; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 100vh; }
.environment { width: 100%; max-width: var(--cabinet-max); display: flex; flex-direction: column; align-items: center; position: relative; padding: 48px 20px 32px; }

.back-link, .audio-control { position: absolute; top: -8px; z-index: 20; font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; text-decoration: none; color: rgba(255, 255, 255, 0.45); background: rgba(0, 0, 0, 0.35); padding: 8px 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.2); transition: all 0.2s; cursor: pointer; }
.back-link { left: 0; } .audio-control { right: 0; padding: 8px; }
.back-link:hover, .audio-control:hover { color: #fff; background: rgba(0, 0, 0, 0.55); border-color: rgba(255, 255, 255, 0.55); }
.audio-control svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.overhead-light { position: absolute; top: -120px; left: 50%; width: 320px; height: 280px; margin-left: -160px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 240, 200, 0.28) 0%, transparent 62%); pointer-events: none; animation: light-flicker 12s infinite alternate ease-in-out; z-index: 0; }
.arcade-cabinet-wrapper { position: relative; width: 100%; z-index: 1; }
.arcade-cabinet { width: 100%; background: var(--cab-bg); border-radius: 15px; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.08), inset 0 -2px 4px rgba(0, 0, 0, 0.35); background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px); background-size: 18px 18px; }

/* Quiet cabinet trim: static reflected light, kept outside the CRT and controls. */
.arcade-cabinet-wrapper { isolation: isolate; }
.arcade-cabinet-wrapper::before {
    content: ''; position: absolute; inset: 18px -1px 8px; z-index: -1;
    border-radius: 17px; pointer-events: none;
    box-shadow: -5px 0 18px rgba(73,151,148,.12), 5px 0 18px rgba(73,151,148,.09), 0 -5px 18px rgba(188,148,76,.09);
}
.arcade-cabinet-wrapper::after {
    content: ''; position: absolute; left: 12%; right: 12%; bottom: -12px;
    height: 34px; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse, rgba(69,143,141,.13), transparent 70%);
    filter: blur(9px);
}
.arcade-cabinet { position: relative; }
.arcade-cabinet::before {
    content: ''; position: absolute; inset: 7px; border: 1px solid rgba(110,161,157,.15);
    border-radius: 10px; pointer-events: none;
}
.arcade-cabinet::after {
    content: ''; position: absolute; inset: 30px 2px 24px; border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(199,164,100,.23), rgba(90,163,159,.26) 27%, rgba(90,163,159,.08) 78%, transparent) left / 1px 100% no-repeat,
        linear-gradient(180deg, rgba(199,164,100,.16), rgba(90,163,159,.2) 27%, rgba(90,163,159,.06) 78%, transparent) right / 1px 100% no-repeat;
    pointer-events: none;
}

.marquee { background: linear-gradient(180deg, #f9edcc, #c7a464 65%, #b88b39); padding: 7px; border-radius: 9px; box-shadow: 0 0 20px rgba(211,175,101,.2), inset 0 0 8px rgba(0,0,0,.25); margin-bottom: 16px; }
.marquee-art { isolation: isolate; border: 3px solid #050a10; border-radius: 4px; background: radial-gradient(ellipse at 50% 40%, #1b3036, #080f18 80%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 10px; min-height: 142px; overflow: hidden; position: relative; animation: marquee-tube-dip 22s linear infinite; }
.marquee-art::before { content: ''; position: absolute; inset: 9px 18px; z-index: 0; border-top: 1px solid rgba(191,163,103,.38); border-bottom: 1px solid rgba(191,163,103,.38); transform: skew(-22deg); pointer-events: none; }
.marquee-art::after { content: ''; position: absolute; inset: 0; z-index: 4; background: linear-gradient(170deg, rgba(225,250,255,.05), transparent 45%); pointer-events: none; }
.mwr-logo { display: none; }
.marquee-text { font-family: 'Russo One', system-ui, sans-serif; font-weight: 400; font-size: clamp(23px, 6.1vw, 48px); line-height: 1.55; letter-spacing: .045em; white-space: nowrap; z-index: 2; position: relative; color: #f4e3b9; text-shadow: 0 2px 0 #b23140, 0 3px 0 #b23140, 0 5px 0 #03070b, 0 0 12px rgba(239,206,134,.2); -webkit-text-stroke: .4px #ffe7b7; }
.marquee-kicker, .marquee-caption { position: relative; z-index: 2; color: #cbbfa5; font: 400 9px/1.4 system-ui, sans-serif; letter-spacing: .22em; text-align: center; }
.marquee-caption { font-size: 8px; letter-spacing: .14em; }
.marquee-lamp { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 10%, rgba(252,227,166,.14), transparent 75%); animation: marquee-backlight 22s linear infinite; }
.marquee.is-paused .marquee-art, .marquee.is-paused .marquee-lamp { animation-play-state: paused; }
@keyframes marquee-tube-dip { 0%, 43%, 49%, 100% { opacity: 1; } 44%, 46% { opacity: .9; } 45%, 47.5% { opacity: .98; } }
@keyframes marquee-backlight { 0%, 43%, 49%, 100% { opacity: 1; } 44%, 46% { opacity: .55; } 45%, 47.5% { opacity: .85; } }
@media (max-width: 480px) { .marquee-art { min-height: 126px; padding: 14px 8px; } .marquee-kicker { font-size: 7px; letter-spacing: .13em; } .marquee-caption { font-size: 6px; } }

.screen-area { background: #050505; border-radius: 10px; padding: 14px; border: 2px solid #151515; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.9); }
.crt { position: relative; background: #060610; overflow: hidden; min-height: 420px; height: clamp(380px, 62vh, 520px); border-radius: 28px / 36px; box-shadow: 0 0 12px rgba(80, 120, 255, 0.12); transform: scale(1.02); }
.crt::before { content: ""; position: absolute; inset: 0; z-index: 10; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%); background-size: 100% 3px; animation: scanline 0.2s linear infinite; pointer-events: none; }
.crt::after { content: ""; position: absolute; inset: 0; z-index: 11; border-radius: inherit; background: radial-gradient(ellipse at 50% 120%, rgba(90, 140, 255, 0.12), transparent 55%); box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.85), inset 0 0 24px rgba(100, 180, 255, 0.2); pointer-events: none; }
.crt.glitch::after { z-index: 100; content: ''; position: absolute; inset: 0; background: #060610; opacity: 0.8; animation: glitch-fade 0.3s; }
/* MWR Arcade Leaderboard — FINAL CSS (PART 2 of 2) */

.crt-content-wrapper { position: absolute; inset: 0; z-index: 1; padding: 22px 20px 16px; display: flex; flex-direction: column; font-family: var(--font-arcade); transform-origin: center center; }

.leaderboard-container, .credits-container { display: flex; flex-direction: column; height: 100%; width: 100%; }
.leaderboard-title { text-align: center; flex-shrink: 0; margin-bottom: 16px; opacity: 1; }
.leaderboard-title h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 0 0 8px; text-transform: uppercase; color: #ffff00; text-shadow: 0 0 2px #fff, 0 0 8px #ff0, 0 0 15px #f80, 0 0 20px #f00; }
.leaderboard-title h3 { font-size: clamp(0.8rem, 2vw, 1rem); margin: 0; color: #00ff00; text-shadow: 0 0 2px #fff, 0 0 10px #0f0; }

.leaderboard-standings { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; }
.standing-row { display: flex; align-items: baseline; justify-content: space-between; font-size: clamp(0.9rem, 2.2vw, 1.2rem); color: #f0f0f0; text-shadow: 0 0 1px #fff, 0 0 5px rgba(180,220,255,0.7); opacity: 1; }
.standing-row .place { color: #ff9a2e; flex-basis: 70px; text-align: right; margin-right: 20px; }
.standing-row .name { flex-grow: 1; text-align: left; }
.standing-row.is-first { color: #ffdd77; font-size: 1.1em; text-shadow: 0 0 2px #fff, 0 0 12px #ff8c00, 0 0 25px #f00; }

.error-text { text-align: center; font-size: clamp(1rem, 2vw, 1.5rem); color: #f00; text-shadow: -1px 0 #f00, 1px 0 #00f; margin-top: 20%; line-height: 1.6; }

.credits-header { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 2px solid rgba(255,0,0,0.5); position: absolute; top: 22px; left: 20px; right: 20px; z-index: 2; font-size: clamp(0.7rem, 2vw, 0.9rem); opacity: 1; }
.credit-name-left, .credit-name-right { color: #ffaa00; text-shadow: 0 0 2px #fff, 0 0 8px #fa0; }
.credit-title { color: #ff4444; text-shadow: 0 0 2px #fff, 0 0 10px #f33; }
.credits-body { flex-grow: 1; position: relative; overflow: hidden; margin-top: 50px; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); }
.scrolling-content { position: absolute; width: 100%; top: 0; left: 0; }
.credits-body p { text-align: center; font-size: clamp(1.1rem, 2.5vw, 1.5rem); color: #00ffff; text-shadow: 0 0 2px #fff, 0 0 8px #0ff, 0 0 15px #08f; margin: 0 0 1em; }
/* A separate closing scene keeps the shipmate roll intact and the final name clear. */
.credits-finale { position: absolute; inset: 0; overflow: hidden; opacity: 0; background: #07111e; }
.credits-finale-scenery { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.credits-finale-name { position: absolute; top: 50%; left: 0; right: 0; margin: 0; padding: 0 8px; text-align: center; white-space: nowrap; font: 400 clamp(13px, 3.5vw, 24px)/1.6 var(--font-arcade); color: #ffe1a0; text-shadow: 2px 2px 0 #5d351e, 0 4px 0 #07111e; }
.credits-container.is-reduced .credits-body { mask-image: none; -webkit-mask-image: none; }
.credits-container.is-reduced .credits-finale { position: relative; height: 260px; margin-top: 24px; opacity: 1; }
.credits-container.is-reduced .credits-finale-name { transform: translateY(-50%); }
.debug-footer { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 0.6rem; color: #ff0055; letter-spacing: 2px; display: block; }

/* Two-player MVS-style deck: original artwork is painted edge-to-edge. */
.control-panel {
    --button-size: clamp(20px, 5.2vw, 38px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(12px, 3vw, 28px);
    align-items: center;
    margin-top: 16px;
    padding: 18px clamp(8px, 2.4vw, 20px) 22px;
    min-height: 154px;
    border: 2px solid #424748;
    border-radius: 10px;
    background: #0b1318 url('arcade-control-panel.png') center / 100% 100% no-repeat border-box;
    box-shadow: inset 0 2px 1px rgba(238,247,244,.3), inset 0 -7px 8px rgba(0,0,0,.78), 0 4px 0 #060708, 0 9px 12px rgba(0,0,0,.45);
    isolation: isolate;
}
.control-panel::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(220,231,231,.08);
    border-radius: 6px;
    pointer-events: none;
}
.player-station { position: relative; min-width: 0; }
.station-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 20px;
    margin-bottom: 10px;
    color: #d1c8a8;
    font: 800 clamp(6px, 1.1vw, 9px) 'Orbitron', system-ui, sans-serif;
    letter-spacing: .12em;
    text-shadow: 0 1px 2px #000;
}
.start-button {
    display: inline-block;
    width: 15px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #666865;
    background: radial-gradient(ellipse at 45% 70%, #fffbe9 0%, #b6b5a7 66%, #f5f2df 90%);
    box-shadow: 0 2px 0 #353735, 0 3px 3px #000;
}
.station-controls {
    display: grid;
    grid-template-columns: minmax(30px, .78fr) minmax(0, 2.3fr);
    align-items: end;
    gap: clamp(5px, 1.3vw, 13px);
    min-height: 76px;
}
.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(3px, .9vw, 7px);
    align-items: start;
    padding: 3px 0 15px;
}
.arcade-button {
    --cap: #be2623;
    --cap-light: #ec7060;
    --cap-dark: #5c0a0c;
    appearance: none;
    display: block;
    position: relative;
    width: 100%;
    max-width: var(--button-size);
    aspect-ratio: 1;
    padding: 0;
    margin: 0;
    border: 1px solid #090b0b;
    border-radius: 50%;
    background: linear-gradient(150deg, #45433e 0%, #0b0c0c 36%, #030505 70%, #56534b 100%);
    box-shadow: 0 3px 0 #030404, 1px 5px 5px rgba(0,0,0,.85), -1px -1px 0 rgba(255,255,255,.14);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.arcade-button::before {
    content: '';
    position: absolute;
    inset: 9%;
    border-radius: inherit;
    border: 1px solid var(--cap-dark);
    background: radial-gradient(ellipse at 50% 67%, var(--cap) 12%, var(--cap-dark) 70%, var(--cap-light) 100%);
    box-shadow: inset 0 3px 4px rgba(0,0,0,.6), inset 0 -2px 2px rgba(255,255,255,.45), 0 0 0 2px var(--cap), 0 1px 1px 2px var(--cap-dark);
    transition: transform .08s ease, box-shadow .08s ease;
}
/* The empty hit area makes the two wired buttons easier to tap on phones. */
button.arcade-button::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
button.arcade-button:active::before { transform: translateY(2px); box-shadow: inset 0 4px 5px rgba(0,0,0,.8), inset 0 -1px 2px rgba(255,255,255,.3), 0 0 0 2px var(--cap); }
button.arcade-button:focus-visible { outline: 2px solid #f9dfa1; outline-offset: 5px; }
.action-buttons > :nth-child(1) { margin-top: 15px; }
.action-buttons > :nth-child(2) { margin-top: 4px; }
.action-buttons > :nth-child(3) { margin-top: 0; }
.action-buttons > :nth-child(4) { margin-top: 5px; }
.button-yellow { --cap: #d8aa24; --cap-light: #ffed91; --cap-dark: #77600b; }
.button-green { --cap: #34884e; --cap-light: #95d5a0; --cap-dark: #123c22; }
.button-blue { --cap: #2977b6; --cap-light: #91c6e8; --cap-dark: #0a284c; }
.arcade-lever { position: relative; height: 76px; min-width: 0; }
.lever-washer {
    position: absolute;
    left: 50%; bottom: 7px;
    width: clamp(28px, 7.5vw, 56px); height: clamp(17px, 4.2vw, 30px);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, #040505 0 21%, #292c2c 25%, #0a0d0d 40%, #262a2a 65%, #080a0b 72%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,.2), 0 3px 4px #000;
}
.lever-assembly { position: absolute; width: clamp(18px, 4.3vw, 31px); height: clamp(57px, 11vw, 84px); left: 50%; bottom: 14px; margin-left: calc(clamp(18px, 4.3vw, 31px) / -2); transform-origin: 50% 96%; }
.lever-shaft {
    position: absolute; left: 38%; right: 38%; top: 48%; bottom: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #20252a, #999f9e 28%, #e2e4dd 45%, #5d6669 61%, #141b20);
    box-shadow: 2px 1px 2px rgba(0,0,0,.65);
}
.lever-bat {
    position: absolute; inset: 0 0 30%;
    border-radius: 47% 47% 33% 33% / 20% 20% 65% 65%;
    background: radial-gradient(ellipse at 28% 16%, rgba(255,255,255,.48), transparent 27%), linear-gradient(95deg, #430a0e, #ac2630 27%, #d14446 43%, #79121c 73%, #280408);
    box-shadow: inset 2px 0 2px rgba(255,191,164,.25), inset -3px -4px 5px rgba(0,0,0,.55), 3px 4px 4px rgba(0,0,0,.65);
}
.lever-bat::after { content: ''; position: absolute; left: 18%; right: 18%; top: 7%; height: 7%; border-radius: 50%; background: rgba(255,210,180,.12); box-shadow: 0 1px 1px rgba(0,0,0,.2); }
@media (max-width: 480px) {
    .control-panel { min-height: 126px; padding-top: 12px; padding-bottom: 15px; gap: 12px; }
    .station-header { gap: 5px; margin-bottom: 6px; }
    .start-button { width: 11px; height: 9px; border-width: 1px; }
    .station-controls { min-height: 66px; }
    .arcade-lever { height: 66px; }
    .action-buttons { padding-bottom: 12px; }
    .action-buttons > :nth-child(1) { margin-top: 10px; }
}
.cabinet-base { height: clamp(10px, 2.4vw, 18px); background: linear-gradient(180deg, #1a1a1a, #101010); margin-top: -6px; border-radius: 0 0 10px 10px; box-shadow: inset 0 8px 12px rgba(0, 0, 0, 0.35); }

@keyframes scanline { to { background-position: 0 3px; } }
@keyframes light-flicker { 0%,100%{opacity:0.85} 50%{opacity:0.92} 80%{opacity:0.88} 80.1%{opacity:0.72} 80.2%{opacity:0.9} 95%{opacity:0.88} 95.1%{opacity:0.78} 95.3%{opacity:0.9} }
@keyframes glitch-fade { from{opacity:0.8} to{opacity:0} }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
@media (max-width: 720px) { .environment { padding-top: 48px; } .back-link, .audio-control { top: -40px; } .arcade-cabinet { padding: 14px; } .crt { min-height: 340px; height: clamp(320px, 58vh, 480px); } }
@media (max-width: 480px) { .standing-row { font-size: 0.8rem; } .leaderboard-title h2 { font-size: 1rem; } }

/* Keep the original controls reachable and long names inside the CRT. */
.back-link, .audio-control { top: 8px; }
.back-link { left: 20px; }
.audio-control { right: 20px; }
.standing-row .name { min-width: 0; overflow-wrap: anywhere; }
.leaderboard-title h2 { overflow-wrap: anywhere; }

/* A persistent attract-mode prompt stays outside the animated standings/credits. */
.crt-content-wrapper { padding-bottom: 42px; }
.debug-footer { bottom: 34px; font-size: .5rem; }
.coin-prompt {
    position: absolute;
    z-index: 2;
    left: 12px;
    right: 12px;
    bottom: 15px;
    text-align: center;
    pointer-events: none;
    font: clamp(8px, 1.8vw, 12px) 'Press Start 2P', monospace;
    letter-spacing: .12em;
    color: #ffe39a;
    text-shadow: 0 0 2px #fff5d3, 0 0 8px rgba(255,173,59,.5);
    animation: insert-coin-blink 1.3s steps(1, end) infinite;
}
@keyframes insert-coin-blink {
    0%, 59% { opacity: 1; }
    60%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .coin-prompt { animation: none; opacity: 1; }
}

/* Keep full shipmate names on one line inside narrow CRTs. */
@media (max-width: 480px) {
    .credits-body p { font-size: clamp(10px, 3.6vw, 16px); }
    .credits-header { font-size: clamp(6px, 1.5vw, 7px); gap: 8px; line-height: 1.6; }
    .credit-name-left, .credit-name-right, .credit-title { white-space: nowrap; }
}

/* Crisp phosphor lettering: restrained glow keeps longer event names legible. */
#arcade-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.leaderboard-title { margin-bottom: 18px; }
.leaderboard-title h2 { font-size: clamp(11px, 2.3vw, 17px); line-height: 1.65; color: #ffe4a3; text-shadow: 0 1px 0 #000; text-wrap: balance; overflow-wrap: break-word; }
.leaderboard-title h3 { font: 700 clamp(9px, 1.7vw, 11px)/1.5 system-ui, sans-serif; letter-spacing: .12em; color: #9ec8c8; text-shadow: none; margin-top: 6px; }
.standing-row { font-size: clamp(10px, 2.1vw, 15px); line-height: 1.45; text-shadow: 0 1px 1px #000; }
.standing-row .place { flex: 0 0 4ch; margin-right: clamp(10px, 2.5vw, 20px); }
.standing-row.is-first { font-size: clamp(10px, 2.1vw, 15px); color: #ffe1a0; text-shadow: 0 1px 1px #000; }
.crt::before { opacity: .5; }
