/* ==========================================================================
   DIRK DOLLAR — Arcade Cabinet Theme
   Palette taken from the key art: blood sky, sun cream, silhouette black.
   ========================================================================== */

:root {
    --blood: #a3121a;
    --crimson: #5e0a0e;
    --crimson-deep: #2a0507;
    --cream: #f3e5c0;
    --ink: #0b0706;
    --ink-2: #160c0a;
    --dirt: #3b2516;
    --gold: #f5b83d;
    --bandana: #e8322b;
    --teal: #3fd0c9;
    --amber: #ffb347;
    --muted: #c9b99a;

    --f-wordmark: 'Rye', 'Georgia', serif;
    --f-pixel: 'Press Start 2P', ui-monospace, monospace;
    --f-body: 'VT323', ui-monospace, 'Courier New', monospace;

    --glow-cream: 0 0 2px currentColor, 0 0 12px rgba(243, 229, 192, 0.35);
    --glow-gold: 0 0 2px currentColor, 0 0 14px rgba(245, 184, 61, 0.5);
    --glow-red: 0 0 2px currentColor, 0 0 16px rgba(232, 50, 43, 0.55);

    /* Driven by JS from the audio analyser (0..1) */
    --bass: 0;
    --beat: 0;
    --high: 0;

    --marquee-h: 64px;
    --hud-h: 26px;
    --header-h: calc(var(--marquee-h) + var(--hud-h));
    --step: steps(1, end);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--f-body);
    font-size: 1.375rem; /* 22px — VT323 runs small */
    line-height: 1.35;
    overflow-x: hidden;
}

img,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img,
canvas {
    image-rendering: pixelated;
}

a {
    color: var(--gold);
}

button {
    font: inherit;
    color: inherit;
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    shape-rendering: crispEdges;
    flex: none;
}

:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 200;
    background: var(--gold);
    color: var(--ink);
    padding: 10px 14px;
    font-family: var(--f-pixel);
    font-size: 0.7rem;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   CRT GLASS
   -------------------------------------------------------------------------- */
.crt {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.55) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0%, transparent 32%),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
    opacity: calc(0.85 + var(--high) * 0.15);
}

.crt-roll {
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: 120px;
    background: linear-gradient(180deg, transparent, rgba(243, 229, 192, 0.05), transparent);
    animation: crtRoll 9s linear infinite;
    will-change: transform;
}

@keyframes crtRoll {
    to { transform: translateY(calc(100vh + 120px)); }
}

@media (min-width: 1100px) {
    .crt::after {
        content: '';
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient(90deg, rgba(255, 0, 0, 0.5) 0 1px, rgba(0, 255, 0, 0.5) 1px 2px, rgba(0, 0, 255, 0.5) 2px 3px);
        opacity: 0.05;
    }
}

body.crt-off .crt {
    display: none;
}

/* --------------------------------------------------------------------------
   BOOT SEQUENCE
   -------------------------------------------------------------------------- */
.boot {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
}

.boot.is-on {
    display: flex;
}

.boot-screen {
    font-family: var(--f-pixel);
    font-size: clamp(0.6rem, 1.6vw, 0.85rem);
    color: var(--amber);
    text-shadow: var(--glow-gold);
    transform-origin: center;
    animation: bootOpen 220ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
    padding: 24px;
}

.boot-line {
    margin: 0 0 1.1em;
    opacity: 0;
    animation: bootLine 1ms var(--step) forwards;
}

.boot-line:nth-child(1) { animation-delay: 260ms; }
.boot-line:nth-child(2) { animation-delay: 460ms; }
.boot-line:nth-child(3) { animation-delay: 660ms; }
.boot-line:nth-child(4) { animation-delay: 860ms; }
.boot-line:nth-child(5) { animation-delay: 1120ms; color: var(--cream); }

.boot.is-leaving {
    animation: bootFlash 260ms ease-out forwards;
}

@keyframes bootOpen {
    from { transform: scaleY(0.004); filter: brightness(3); }
    to { transform: scaleY(1); filter: brightness(1); }
}

@keyframes bootLine {
    to { opacity: 1; }
}

@keyframes bootFlash {
    0% { background: #fff; }
    100% { background: #fff; opacity: 0; }
}

/* --------------------------------------------------------------------------
   MARQUEE (header) + HUD STRIP
   -------------------------------------------------------------------------- */
.marquee {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--ink);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 0 0 1px #000, 0 6px 24px rgba(0, 0, 0, 0.6);
}

.marquee-inner {
    height: var(--marquee-h);
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background:
        radial-gradient(ellipse 60% 140% at 50% 120%, rgba(163, 18, 26, 0.55), transparent 70%);
}

.marquee-logo {
    font-family: var(--f-wordmark);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--cream);
    text-decoration: none;
    letter-spacing: 0.04em;
    text-shadow: 0 0 2px var(--cream), 0 0 18px rgba(232, 50, 43, calc(0.55 + var(--beat) * 0.45)), 3px 3px 0 var(--blood);
    animation: tubeIgnite 900ms var(--step) both 0.2s;
}

@keyframes tubeIgnite {
    0% { opacity: 0; }
    15% { opacity: 0.8; }
    25% { opacity: 0.1; }
    45% { opacity: 1; }
    60% { opacity: 0.4; }
    75%, 100% { opacity: 1; }
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    position: relative;
    display: block;
    padding: 10px 12px 10px 22px;
    font-family: var(--f-pixel);
    font-size: 0.62rem;
    text-transform: uppercase;
    color: var(--cream);
    text-decoration: none;
}

.nav-menu a::before {
    content: '▶';
    position: absolute;
    left: 6px;
    color: var(--gold);
    opacity: 0;
}

.nav-menu a:hover,
.nav-menu a:focus-visible,
.nav-menu a.is-active {
    color: var(--gold);
    text-shadow: var(--glow-gold);
}

.nav-menu a:hover::before,
.nav-menu a:focus-visible::before,
.nav-menu a.is-active::before {
    opacity: 1;
    animation: cursorBlink 0.5s var(--step) infinite;
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}

.nav-toggle {
    display: none;
    background: var(--crimson);
    border: 2px solid var(--gold);
    padding: 10px 12px;
    font-family: var(--f-pixel);
    font-size: 0.6rem;
    color: var(--cream);
    cursor: pointer;
    box-shadow: 0 4px 0 #000;
}

.nav-toggle:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #000;
}

.hud-strip {
    height: var(--hud-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    color: var(--bandana);
    border-top: 1px solid rgba(245, 184, 61, 0.25);
    white-space: nowrap;
    overflow: hidden;
}

.hud-strip b {
    color: var(--cream);
    font-weight: normal;
}

.hud-hi b:last-child {
    color: var(--gold);
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    font-family: var(--f-pixel);
    font-size: 0.72rem;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    border: 3px solid currentColor;
    cursor: pointer;
    transition: transform 60ms linear, box-shadow 60ms linear;
}

.btn-start {
    color: var(--ink);
    background: var(--gold);
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--gold), 0 6px 0 3px #7a4f0d, 0 10px 24px rgba(245, 184, 61, 0.3);
}

.btn-start:hover,
.btn-start:focus-visible {
    background: var(--cream);
}

.btn-ghost {
    color: var(--cream);
    background: rgba(11, 7, 6, 0.65);
    box-shadow: 0 6px 0 #000;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    color: var(--gold);
    text-shadow: var(--glow-gold);
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #000;
}

.btn-start:active {
    box-shadow: 0 0 0 3px var(--gold), 0 2px 0 3px #7a4f0d;
}

.btn-small {
    padding: 12px 16px;
    font-size: 0.6rem;
}

/* --------------------------------------------------------------------------
   HERO / ATTRACT MODE
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 24px) 16px 64px;
    overflow: hidden;
    background: var(--blood);
    isolation: isolate;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero-kicker {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 10px;
    background: rgba(11, 7, 6, 0.55);
    font-family: var(--f-pixel);
    font-size: clamp(0.55rem, 1.4vw, 0.8rem);
    letter-spacing: 0.3em;
    color: var(--cream);
    text-shadow: 2px 2px 0 var(--ink);
}

.wordmark {
    margin: 0;
    font-family: var(--f-wordmark);
    font-weight: 400;
    font-size: clamp(3rem, min(13vw, 17vh), 9.5rem);
    line-height: 0.92;
    color: var(--cream);
    letter-spacing: 0.02em;
    text-shadow:
        0 0 2px var(--cream),
        0 0 calc(18px + var(--bass) * 30px) rgba(255, 179, 71, 0.55),
        5px 5px 0 var(--ink),
        10px 10px 0 rgba(11, 7, 6, 0.4);
}

.wordmark span {
    display: inline-block;
    animation: logoDrop 400ms steps(8, end) both;
}

.wordmark span:nth-child(2) {
    animation-delay: 140ms;
}

@keyframes logoDrop {
    from { transform: translateY(-120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hero-tag {
    display: inline-block;
    margin: 20px auto 26px;
    max-width: 36ch;
    padding: 6px 14px;
    font-size: clamp(1.3rem, 2.4vw, 1.65rem);
    line-height: 1.25;
    color: var(--cream);
    background: rgba(11, 7, 6, 0.78);
    box-shadow: 0 0 0 2px rgba(11, 7, 6, 0.78);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

.insert-coin {
    margin: 42px 0 0;
    font-family: var(--f-pixel);
    font-size: clamp(0.7rem, 1.6vw, 0.95rem);
    color: var(--gold);
    text-shadow: var(--glow-gold), 3px 3px 0 var(--ink);
    animation: coinBlink 1s var(--step) infinite;
}

@keyframes coinBlink {
    50% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   STAGES (sections as CRT screens)
   -------------------------------------------------------------------------- */
main {
    background:
        radial-gradient(ellipse 120% 60% at 50% 0%, rgba(94, 10, 14, 0.55), transparent 60%),
        var(--ink);
}

.stage {
    padding: 72px 16px;
}

.screen {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 56px);
    background:
        radial-gradient(ellipse at 50% 40%, rgba(94, 10, 14, 0.35), transparent 75%),
        var(--ink-2);
    border-radius: 28px;
    box-shadow:
        inset 0 0 0 2px rgba(243, 229, 192, 0.06),
        inset 0 0 80px rgba(0, 0, 0, 0.9),
        0 0 0 10px #1c1210,
        0 0 0 13px #000,
        0 0 0 16px var(--dirt),
        0 20px 50px rgba(0, 0, 0, 0.7);
}

.screen.is-wiping {
    animation: stageWipe 360ms steps(12, end) both;
}

@keyframes stageWipe {
    from { clip-path: inset(0 0 100% 0); }
    to { clip-path: inset(0 0 0 0); }
}

.stage-no {
    margin: 0 0 10px;
    font-family: var(--f-pixel);
    font-size: 0.62rem;
    color: var(--bandana);
    letter-spacing: 0.2em;
}

.stage-title {
    margin: 0 0 28px;
    font-family: var(--f-pixel);
    font-weight: 400;
    font-size: clamp(1.1rem, 3.4vw, 2rem);
    line-height: 1.3;
    color: var(--cream);
    text-shadow: var(--glow-cream), 4px 4px 0 var(--blood);
    min-height: 1.3em;
}

.stage-title.is-glitching {
    animation: rgbSplit 120ms steps(2, end) 2;
}

@keyframes rgbSplit {
    50% { text-shadow: -2px 0 var(--bandana), 2px 0 var(--teal), 4px 4px 0 var(--blood); }
}

.copy {
    margin: 0 0 18px;
    color: var(--muted);
    max-width: 62ch;
}

.copy.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.sub {
    margin: 0 0 16px;
    font-family: var(--f-pixel);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--gold);
    text-shadow: var(--glow-gold);
}

.gold {
    color: var(--gold);
}

/* ---- Stage 1: Musik ---- */
.music-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.embed-frame {
    padding: 8px;
    background: #000;
    box-shadow: 0 0 0 3px var(--dirt), 0 0 0 6px #000;
}

.embed-frame iframe {
    display: block;
    border: 0;
}

.platforms {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.platform {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    font-family: var(--f-pixel);
    font-size: 0.68rem;
    color: var(--cream);
    text-decoration: none;
    background: #000;
    border: 2px solid rgba(243, 229, 192, 0.2);
    position: relative;
}

.platform .icon {
    width: 24px;
    height: 24px;
    color: var(--gold);
}

.platform::after {
    content: '▶';
    margin-left: auto;
    color: var(--gold);
    opacity: 0;
}

.platform:hover,
.platform:focus-visible {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--crimson-deep);
}

.platform:hover::after,
.platform:focus-visible::after {
    opacity: 1;
    animation: cursorBlink 0.5s var(--step) infinite;
}

/* ---- Stage 2: Jukebox ---- */
.jukebox {
    max-width: 760px;
    margin: 0 auto;
    padding: 22px;
    background: linear-gradient(180deg, #2b1a10, #170d08);
    border: 3px solid #000;
    box-shadow: inset 0 0 0 3px var(--dirt), inset 0 0 0 6px #000, 0 12px 0 #000;
}

.jb-display {
    position: relative;
    padding: 18px;
    background: #050302;
    border: 3px solid #000;
    box-shadow: inset 0 0 30px rgba(245, 184, 61, 0.08);
    overflow: hidden;
}

.jb-viz {
    width: 100%;
    height: auto;
    aspect-ratio: 96 / 30;
    margin-bottom: 14px;
}

.jb-now {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.jb-label {
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    color: var(--bandana);
}

.jb-title {
    font-family: var(--f-pixel);
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    line-height: 1.5;
    color: var(--amber);
    text-shadow: var(--glow-gold);
}

.jb-progress {
    position: relative;
    height: 14px;
    background: #1a0f0a;
    border: 2px solid var(--dirt);
    cursor: pointer;
}

.jb-progress-fill {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 8px);
    transform-origin: left;
    transform: scaleX(0);
}

.jb-time {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    color: var(--muted);
}

.jb-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 20px 0;
}

.key {
    min-width: 64px;
    padding: 14px 16px;
    font-family: var(--f-pixel);
    font-size: 0.65rem;
    color: var(--cream);
    background: var(--crimson);
    border: 3px solid #000;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15), 0 6px 0 #000;
    cursor: pointer;
}

.key:hover {
    background: var(--blood);
}

.key:active {
    transform: translateY(4px);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15), 0 2px 0 #000;
}

.key-play {
    min-width: 132px;
    background: var(--gold);
    color: var(--ink);
}

.key-play:hover {
    background: var(--cream);
}

.jb-versions {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0 0 16px;
}

.jb-ver {
    min-width: 120px;
    padding: 10px 14px;
    font-family: var(--f-pixel);
    font-size: 0.6rem;
    color: var(--muted);
    background: #000;
    border: 2px solid var(--dirt);
    cursor: pointer;
}

.jb-ver[aria-pressed='true'] {
    color: var(--ink);
    background: var(--gold);
    border-color: var(--gold);
}

.jb-ver:hover {
    color: var(--gold);
}

.jb-ver[aria-pressed='true']:hover {
    color: var(--ink);
}

.jb-list small {
    font-size: 0.85em;
    color: var(--muted);
}

.jb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.jb-list button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    text-align: left;
    font-family: var(--f-body);
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid transparent;
    cursor: pointer;
}

.jb-lv {
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    color: var(--bandana);
}

.jb-list button:hover,
.jb-list button:focus-visible {
    border-color: rgba(245, 184, 61, 0.5);
}

.jb-list button[aria-current='true'] {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--crimson-deep);
}

.jb-list button[aria-current='true']::after {
    content: '♪';
    margin-left: auto;
    animation: cursorBlink 0.5s var(--step) infinite;
}

/* ---- Stage 3: Band ---- */
.band-figure {
    margin: 0 0 32px;
    position: relative;
    box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--dirt), 0 0 0 9px #000;
    background: #000;
}

.band-figure img {
    width: 100%;
    height: auto;
}

/* name tags floating above each band member on the pixel photo */
.lineup {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lineup .tag {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 9px 7px;
    font-size: clamp(0.9rem, 1.8vw, 1.25rem);
    line-height: 1;
    color: var(--cream);
    background: rgba(11, 7, 6, 0.86);
    border: 2px solid currentColor;
    box-shadow: 0 3px 0 #000;
    white-space: nowrap;
}

.lineup .tag::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: currentColor;
    border-bottom: 0;
}

.lineup b {
    font-family: var(--f-pixel);
    font-weight: 400;
    font-size: clamp(0.55rem, 1.4vw, 0.85rem);
}

.tag-toby { left: 23%; top: 33%; color: var(--bandana); }
.tag-shmu { left: 45%; top: 38%; color: var(--teal); }
.tag-birk { left: 72.5%; top: 31%; color: var(--gold); }

.tag-toby b { color: var(--cream); }
.tag-shmu b { color: var(--cream); }
.tag-birk b { color: var(--cream); }

.bio {
    columns: 2 320px;
    column-gap: 40px;
}

.bio p {
    margin: 0 0 16px;
    color: var(--muted);
    break-inside: avoid;
}

.bio .bio-lead {
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--cream);
}

/* ---- Stage 4: Game teaser + highscores ---- */
.teaser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.controls-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    display: grid;
    gap: 8px;
    color: var(--muted);
}

kbd {
    display: inline-block;
    min-width: 2.2em;
    padding: 4px 8px;
    margin-right: 6px;
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    text-align: center;
    color: var(--ink);
    background: var(--cream);
    box-shadow: 0 3px 0 #7d6d50;
}

.hiscore {
    padding: 22px 20px;
    background: #000;
    border: 3px solid var(--dirt);
}

.hiscore-title {
    margin: 0 0 18px;
    text-align: center;
    font-family: var(--f-pixel);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--bandana);
    text-shadow: var(--glow-red);
}

.hiscore-list {
    list-style: none;
    counter-reset: rank;
    margin: 0;
    padding: 0;
    font-family: var(--f-pixel);
    font-size: 0.62rem;
}

.hiscore-list li {
    counter-increment: rank;
    display: grid;
    grid-template-columns: 4.2em 1fr auto;
    gap: 8px;
    padding: 9px 0;
    color: var(--teal);
    opacity: 0;
    animation: bootLine 1ms var(--step) forwards;
}

.hiscore-list li::before {
    content: counter(rank) 'TH';
}

.hiscore-list li:nth-child(1)::before { content: '1ST'; }
.hiscore-list li:nth-child(2)::before { content: '2ND'; }
.hiscore-list li:nth-child(3)::before { content: '3RD'; }
.hiscore-list li:nth-child(1) { color: var(--cream); }
.hiscore-list li:nth-child(2) { color: var(--gold); }
.hiscore-list li:nth-child(3) { color: var(--bandana); }

.hiscore-list li.hiscore-empty {
    display: block;
    text-align: center;
    color: var(--muted);
}

.hiscore-list li.hiscore-empty::before {
    content: none;
}

.hs-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Stage 5: Booking ---- */
.booking-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 40px;
}

.show-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.show-list li {
    padding: 14px 0;
    border-bottom: 2px dashed rgba(243, 229, 192, 0.15);
}

.show-empty {
    color: var(--muted);
}

.press-start {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 26px;
    font-family: var(--f-pixel);
    font-size: clamp(0.72rem, 2.2vw, 1.05rem);
    color: var(--gold);
    text-decoration: none;
    text-shadow: var(--glow-gold);
    word-break: break-all;
}

.press-start .icon {
    width: 28px;
    height: 28px;
}

.press-start:hover,
.press-start:focus-visible {
    color: var(--cream);
}

.press-start:hover::after {
    content: '◀';
    animation: cursorBlink 0.5s var(--step) infinite;
}

/* --------------------------------------------------------------------------
   CONTROL PANEL (footer)
   -------------------------------------------------------------------------- */
.control-panel {
    position: relative;
    padding: 40px 16px 48px;
    background:
        linear-gradient(180deg, #2a1810 0%, #120a07 100%);
    border-top: 6px solid #000;
    box-shadow: inset 0 6px 0 var(--dirt);
}

.control-panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 12px;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--bandana) 0 40px, var(--gold) 40px 80px);
    opacity: 0.85;
}

.panel-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        'socials buttons coin'
        'meta meta meta';
    gap: 28px;
    align-items: center;
}

.socials {
    grid-area: socials;
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.socials a {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--cream);
    background: #000;
    border: 2px solid var(--dirt);
}

.socials a:hover,
.socials a:focus-visible {
    color: var(--gold);
    border-color: var(--gold);
}

.socials .icon {
    width: 24px;
    height: 24px;
}

.panel-buttons {
    grid-area: buttons;
    display: flex;
    gap: 22px;
}

.arcade-btn {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
    font-family: var(--f-pixel);
    font-size: 0.55rem;
    color: var(--cream);
    border: 4px solid #000;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.35), inset 0 6px 0 rgba(255, 255, 255, 0.3), 0 8px 0 #000;
    transition: transform 60ms linear, box-shadow 60ms linear;
}

.arcade-btn span {
    text-shadow: 1px 1px 0 #000;
}

.arcade-red { background: var(--bandana); }
.arcade-gold { background: var(--gold); color: var(--ink); }
.arcade-gold span { text-shadow: none; }

.arcade-btn:hover {
    filter: brightness(1.15);
}

.arcade-btn:active {
    transform: translateY(6px);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), inset 0 6px 0 rgba(255, 255, 255, 0.3), 0 2px 0 #000;
}

.coin-door {
    grid-area: coin;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #0d0806;
    border: 3px solid #3a3a3a;
    box-shadow: inset 0 0 0 2px #000;
    font-family: var(--f-pixel);
    font-size: 0.5rem;
    color: var(--bandana);
}

.coin-slot {
    width: 8px;
    height: 30px;
    background: #000;
    border: 2px solid #777;
    box-shadow: 0 0 10px rgba(232, 50, 43, calc(0.4 + var(--beat) * 0.6));
}

.panel-meta {
    grid-area: meta;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 18px;
    border-top: 2px solid rgba(0, 0, 0, 0.6);
    font-family: var(--f-pixel);
    font-size: 0.5rem;
    color: var(--muted);
}

.panel-meta p {
    margin: 0;
}

.dip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.dip input {
    appearance: none;
    width: 34px;
    height: 18px;
    margin: 0;
    background: #000;
    border: 2px solid var(--muted);
    position: relative;
    cursor: pointer;
}

.dip input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: var(--muted);
}

.dip input:checked {
    border-color: var(--teal);
}

.dip input:checked::after {
    left: 18px;
    background: var(--teal);
}

/* --------------------------------------------------------------------------
   CRT POWER-OFF (exit to game)
   -------------------------------------------------------------------------- */
.power-off {
    position: fixed;
    inset: 0;
    z-index: 160;
    pointer-events: none;
    display: none;
    background: #000;
}

.power-off.is-on {
    display: block;
}

.power-off::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 100vh;
    margin-top: -50vh;
    background: var(--cream);
    animation: powerOff 320ms ease-in forwards;
}

@keyframes powerOff {
    0% { transform: scale(1, 1); opacity: 0.25; }
    55% { transform: scale(1, 0.004); opacity: 1; }
    100% { transform: scale(0, 0.004); opacity: 1; }
}

/* --------------------------------------------------------------------------
   KONAMI — Night Surf palette swap
   -------------------------------------------------------------------------- */
body.night-surf {
    --blood: #0f5c63;
    --crimson: #0a3a40;
    --crimson-deep: #062226;
    --bandana: #3fd0c9;
    --gold: #f3e5c0;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .music-grid,
    .teaser-grid,
    .booking-grid {
        grid-template-columns: 1fr;
    }

    .panel-inner {
        grid-template-columns: 1fr;
        grid-template-areas: 'buttons' 'socials' 'coin' 'meta';
        justify-items: center;
    }

    .coin-door {
        justify-self: center;
    }
}

@media (max-width: 760px) {
    :root {
        --marquee-h: 58px;
    }

    body {
        font-size: 1.3rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ink);
        border-bottom: 3px solid var(--gold);
        visibility: hidden;
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 160ms steps(6, end), visibility 0s 160ms;
    }

    .nav.is-open {
        visibility: visible;
        transform: scaleY(1);
        transition: transform 160ms steps(6, end);
    }

    .nav-menu {
        flex-direction: column;
        padding: 8px 16px 16px;
    }

    .nav-menu a {
        padding: 16px 12px 16px 26px;
        font-size: 0.75rem;
    }

    .hud-strip {
        font-size: 0.45rem;
    }

    .hud-credit {
        display: none;
    }

    .stage {
        padding: 48px 12px;
    }

    .screen {
        border-radius: 18px;
        box-shadow:
            inset 0 0 0 2px rgba(243, 229, 192, 0.06),
            inset 0 0 60px rgba(0, 0, 0, 0.9),
            0 0 0 6px #1c1210,
            0 0 0 8px #000,
            0 0 0 10px var(--dirt);
    }

    .lineup .tag small {
        display: none;
    }

    .lineup .tag {
        padding: 5px 6px;
    }

    .btn {
        padding: 15px 16px;
        font-size: 0.62rem;
    }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION — no boot, flicker, roll or blinking
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .crt-roll,
    .boot {
        display: none !important;
    }

    .insert-coin,
    .nav-menu a::before,
    .jb-list button[aria-current='true']::after {
        animation: none !important;
    }

    .wordmark {
        transform: none;
    }
}

/* arrow glyphs are missing in Press Start 2P → render them in the system font */
kbd.arrows {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 1px 8px;
}
