/* Arcade Night: the Heart of a Lion Games style kit.
   Neon on navy, scanlines, a starfield, pixel headings. Shared by the studio site,
   the Space Plumbers site and later game pages. See kit/README.md for the parts. */

@font-face { font-family: "Press Start 2P"; src: url(fonts/PressStart2P.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Bungee"; src: url(fonts/Bungee.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Rubik"; src: url(fonts/Rubik.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #0b0820; --panel: #160f38; --track: #2a1f66; --edge: #4a3d8f;
  --mag: #ff2bd6; --cyan: #22e4ff; --yel: #ffe14d; --yel-deep: #b39a00; --lime: #8cff4f;
  --txt: #efeaff; --soft: #cfc6ff; --dim: #9d92e0;
  --px: "Press Start 2P", ui-monospace, monospace;
  --display: "Bungee", "Arial Black", sans-serif;
  --body: "Rubik", system-ui, sans-serif;
  --wrap: 1200px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The navy is on html only: a body background would paint over the starfield (z-index -1). */
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--txt); font: 400 18px/1.6 var(--body); overflow-x: hidden; }
img, video, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yel); outline-offset: 3px; }
.px { font-family: var(--px); letter-spacing: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.05; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--yel); color: var(--bg); font: 12px var(--px); padding: 12px; }
.skip:focus { top: 12px; }

/* Scanlines over everything, and the starfield canvas behind it. */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px); }
.starfield { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }

/* Nav: logo on the left, score and the motion button on the right. */
.nav .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 76px; }
.logo { display: flex; gap: 12px; align-items: center; text-decoration: none; font: 400 20px var(--display); color: var(--yel); text-shadow: 0 0 12px rgba(255,225,77,.6); }
.logo svg { width: 42px; height: 42px; flex: none; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.score { font: 12px var(--px); color: var(--cyan); display: flex; gap: 24px; }
.score b { color: #fff; font-weight: 400; }
@media (max-width: 720px) { .score .hi { display: none; } .logo { font-size: 16px; } .logo svg { width: 34px; height: 34px; } }
@media (max-width: 420px) { .score { display: none; } }

/* The motion button: pauses the starfield, any hero video and the CSS loops. */
.motion-toggle { font: 11px var(--px); text-transform: uppercase; color: var(--cyan); background: transparent; border: 2px solid var(--cyan); padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.motion-toggle:hover { background: rgba(34,228,255,.12); }
.motion-toggle .icon { width: 12px; height: 12px; display: inline-block; background: currentColor; clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.motion-toggle[aria-pressed="true"] .icon { clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* Buttons. */
.start { font: 16px var(--px); color: var(--bg); background: var(--yel); border: 0; padding: 20px 28px; box-shadow: 0 6px 0 var(--yel-deep), 0 0 30px rgba(255,225,77,.5); text-decoration: none; display: inline-block; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.start:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--yel-deep), 0 0 44px rgba(255,225,77,.8); }
.start:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--yel-deep); }
.start[disabled] { background: #6d60b8; box-shadow: none; cursor: wait; }
.blink { display: block; margin-top: 30px; font: 13px/1.6 var(--px); color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Hero. */
.hero { min-height: 82vh; display: grid; place-items: center; text-align: center; padding: 40px 0 80px; }
.hero .lion { width: min(220px, 50vw); height: auto; display: block; margin: 0 auto 26px; filter: drop-shadow(0 0 18px var(--mag)) drop-shadow(0 0 40px rgba(255,43,214,.5)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.hero h1 { font-size: clamp(40px, 8.4vw, 118px); color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--mag), 0 0 42px var(--mag), 5px 5px 0 var(--cyan); overflow-wrap: anywhere; }
.hero p { max-width: 40ch; margin: 22px auto 34px; font-size: 20px; color: var(--soft); }

/* Sections. */
section { padding: 100px 0; }
@media (max-width: 720px) { section { padding: 72px 0; } }
.title { font-size: clamp(32px, 5vw, 60px); color: var(--cyan); text-shadow: 0 0 20px rgba(34,228,255,.6); margin-bottom: 16px; }
.title.mag { color: var(--mag); text-shadow: 0 0 20px rgba(255,43,214,.7); }
.lede { max-width: 52ch; color: var(--soft); margin: 0 0 42px; font-size: 19px; }

/* Stat panels with bars that fill when seen. */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { background: var(--panel); border: 2px solid var(--mag); padding: 26px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(255,43,214,.35), 0 0 30px rgba(255,43,214,.25); }
.stat .px { color: var(--yel); font-size: 12px; display: block; margin-bottom: 14px; }
.stat h3 { font-size: 26px; margin-bottom: 8px; }
.stat p { margin: 0; color: var(--soft); }
.bar { height: 12px; background: var(--track); margin-top: 18px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mag), var(--yel)); width: 0; transition: width 1.4s steps(12); }
.seen .bar i, .still .bar i { width: var(--w); }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } }

/* Game cabinets. */
.cabinet { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.game { background: var(--panel); border: 3px solid var(--cyan); text-decoration: none; display: block; transition: transform .15s, box-shadow .15s; box-shadow: 0 0 30px rgba(34,228,255,.25); }
a.game:hover { transform: translateY(-6px); box-shadow: 0 0 50px rgba(34,228,255,.55); }
.game .screen { aspect-ratio: 16/9; background: #000; position: relative; border-bottom: 3px solid var(--cyan); overflow: hidden; }
.game .screen img, .game .screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.game .screen::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55)); }
.game .screen .tag { position: absolute; top: 14px; left: 14px; z-index: 1; background: var(--lime); color: #000; font: 11px var(--px); padding: 8px 10px; }
.game .info { padding: 24px; }
.game h3 { font-size: 32px; color: var(--yel); }
.game p { color: var(--soft); }
.game .meta { font: 11px/1.6 var(--px); color: var(--cyan); }
.game.locked { border-color: var(--edge); box-shadow: none; }
.game.locked .screen { display: grid; place-items: center; border-bottom-color: var(--edge); background: repeating-linear-gradient(45deg, #120c30 0 12px, #1a1245 12px 24px); }
.game.locked .screen span { font: 18px var(--px); color: var(--dim); }
.game.locked h3 { color: #a99ff0; }
@media (max-width: 860px) { .cabinet { grid-template-columns: 1fr; } }

/* High-score signup. */
.hiscore { max-width: 760px; margin: 0 auto; text-align: center; }
.hiscore .lede { margin-inline: auto; }
.entry { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.entry input[type=email] { font: 14px var(--px); background: #000; color: var(--lime); border: 3px solid var(--lime); padding: 18px; width: min(440px, 100%); border-radius: 0; }
.entry input::placeholder { color: #5e9c3d; }
.entry input:focus { outline: none; box-shadow: 0 0 24px rgba(140,255,79,.6); }
.entry .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { font-size: 15px; color: var(--dim); margin: 18px auto 0; max-width: 56ch; }
.notice a { color: var(--soft); }
.form-msg { font: 14px/1.8 var(--px); margin-top: 30px; }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--yel); }
.form-msg.err { color: var(--mag); }
.sent .entry, .sent .notice { display: none; }

/* Plain prose pages (privacy). */
.prose { max-width: 70ch; padding: 40px 0 80px; }
.prose h1 { font-size: clamp(32px, 6vw, 56px); color: var(--cyan); text-shadow: 0 0 20px rgba(34,228,255,.6); margin-bottom: 24px; }
.prose h2 { font-size: 24px; color: var(--yel); margin: 36px 0 8px; }
.prose p, .prose li { color: var(--soft); }

.footer { padding: 50px 0 70px; text-align: center; font: 11px/2 var(--px); color: var(--dim); }
.footer a { color: var(--soft); }

/* Still mode: the motion button's paused state, and the default under reduced motion.
   CSS loops stop; arcade.js stops the starfield and videos. */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* Reduced motion: no starfield, no scanlines, posters only (arcade.js never autoplays).
   Pressing play opts back in for this visit (html.motion-opt-in). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html:not(.motion-opt-in) *, html:not(.motion-opt-in) *::before, html:not(.motion-opt-in) *::after { animation: none !important; transition: none !important; }
  html:not(.motion-opt-in) body::after { display: none; }
  html:not(.motion-opt-in) .starfield { display: none; }
  html:not(.motion-opt-in) .bar i { width: var(--w); }
}
