@font-face { font-family: "Jersey 10"; src: url(assets/fonts/jersey-10.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Archivo; src: url(assets/fonts/archivo-variable.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Silkscreen; src: url(assets/fonts/silkscreen-400.woff2) format("woff2"); font-display: swap; }

:root {
  --field: #1228b0;      /* arcade blue: the one dominant field */
  --field-hi: #1f45f0;
  --navy: #0a1468;
  --ink: #060a2c;
  --yellow: #ffd21f;
  --red: #c80f2a;
  --white: #f5f7ff;
  --soft: #c3cdff;       /* secondary text on blue, tinted from the field */
  --px: 4px;             /* one "screen pixel" for frames */
  --display: "Jersey 10", Silkscreen, monospace;
  --pixel: Silkscreen, monospace;
  --body: Archivo, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--yellow) var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--field); color: var(--white);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--yellow); color: var(--ink); }
img, canvas, svg { display: block; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 2px; }
h1, h2, h3, p, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--yellow); color: var(--ink); padding: 10px 14px; font-weight: 700; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons: chunky cabinet buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border: var(--px) solid var(--ink);
  font: 700 1.0625rem/1 var(--body); text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 calc(var(--px) * -1) 0 rgb(0 0 0 / .28), inset 0 var(--px) 0 rgb(255 255 255 / .35);
  transition: transform .08s steps(2);
}
.btn:active { transform: translateY(2px); }
.btn-start { background: var(--yellow); color: var(--ink); }
.btn-start:hover { background: #ffe25e; }
.btn-ghost { background: var(--navy); color: var(--white); }
.btn-ghost:hover { background: #16218a; }
.btn-ghost[data-asleep] { background: var(--white); color: var(--ink); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 1rem; }
.tri { width: 10px; height: 12px; background: currentColor; clip-path: polygon(0 0, 50% 0, 50% 17%, 75% 17%, 75% 33%, 100% 33%, 100% 67%, 75% 67%, 75% 83%, 50% 83%, 50% 100%, 0 100%); }
/* PRESS START: a stepped pulse ring, like a coin-op start button */
.btn-press { position: relative; }
.btn-press::after {
  content: ""; position: absolute; inset: -10px; border: var(--px) solid var(--yellow);
  pointer-events: none; animation: press 1.1s steps(1) 5;   /* stops after ~5s (WCAG 2.2.2) */
}
@keyframes press { 0% { opacity: 1; transform: none; } 33% { opacity: 1; transform: scale(1.05, 1.18); } 66% { opacity: 0; } }   /* transform, not inset: no layout shift */
.btn-press .tri { animation: blink 1.1s steps(1) 5; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 24px; height: 68px; padding: 0 clamp(16px, 3.4vw, 48px);
  border-bottom: var(--px) solid var(--ink); background: var(--field);
}
.brand { display: flex; align-items: center; min-height: 44px; }
.brand img { width: auto; height: 38px; }
.top > nav { margin-left: auto; }
.top > nav ul { display: flex; gap: 4px; }
.top > nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 600; text-decoration: none; color: var(--soft); }
.top > nav a:hover { color: var(--yellow); }
@media (max-width: 860px) { .top > nav { display: none; } .top .btn-small { margin-left: auto; } }
.menu { display: none; position: relative; }
.menu summary {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; list-style: none; cursor: pointer;
  border: var(--px) solid var(--ink); background: var(--ink); color: var(--white); font: 400 16px/1 var(--pixel); text-transform: uppercase;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--yellow); color: var(--ink); }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(240px, calc(100vw - 32px)); border: var(--px) solid var(--ink); background: var(--field); box-shadow: 0 8px 0 var(--ink); }
.menu ul { display: grid; }
.menu a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; font-weight: 600; text-decoration: none; color: var(--white); }
.menu a:hover, .menu a:focus-visible { background: var(--yellow); color: var(--ink); }
@media (max-width: 860px) { .menu { display: block; } }
@media (max-width: 430px) { .top { gap: 10px; } .brand img { height: 30px; } }

/* ---------- select screen (hero) ---------- */
.select-screen {
  display: grid; gap: 40px 56px; align-items: start;
  padding: 36px clamp(16px, 3.4vw, 48px) 64px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
}
.title { padding-top: 8px; }
.collide {
  font: 400 120px/.74 var(--display); text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap;
  text-shadow: 0 6px 0 var(--ink), 6px 6px 0 var(--ink);
}
.collide span { display: block; }
.collide .l2 { color: var(--field); -webkit-text-stroke: 4px var(--white); paint-order: stroke fill; padding-left: .32em; text-shadow: none; }
.collide .l3 { color: var(--yellow); }
.lede { margin-top: 32px; max-width: 36ch; font-size: 1.1875rem; line-height: 1.5; color: var(--white); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 18px; margin-top: 30px; }
.copy-status { flex-basis: 100%; min-height: 1.5em; font-size: .9375rem; color: var(--soft); }
.copy-status:empty { min-height: 0; margin-top: -20px; }

.roster-head { display: grid; gap: 8px; margin-bottom: 34px; }
.roster-head h2 { font: 400 40px/1 var(--display); text-transform: uppercase; color: var(--yellow); }
.hint { font-size: .9375rem; color: var(--soft); }
.roster-body { display: grid; gap: 20px; }

.grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-content: start; }
.tile {
  display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 150px; padding: 14px 6px 12px;
  background: var(--tile); color: var(--white); border: var(--px) solid var(--ink); cursor: pointer;
  box-shadow: inset 0 calc(var(--px) * -1) 0 rgb(0 0 0 / .3);
}
.tile:focus-visible { outline: none; }
.tile[aria-selected="false"] .portrait { filter: saturate(.55) brightness(.85); }
.portrait { width: 96px; height: 96px; image-rendering: pixelated; }
.tile-name { font: 400 30px/.9 var(--display); text-transform: uppercase; text-align: center; }
.cursor {
  position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none;
  border: var(--px) solid var(--yellow); box-shadow: 0 0 0 var(--px) var(--ink), inset 0 0 0 var(--px) var(--ink);
  transition: transform .16s steps(4), width .16s steps(4), height .16s steps(4);
}
.cursor .p1 {
  position: absolute; left: -4px; top: -26px; padding: 3px 6px 2px; background: var(--yellow); color: var(--ink);
  font: 400 16px/1 var(--pixel); animation: blink 1s steps(1) 5;
}
.grid:has(.tile:focus-visible) .cursor { border-color: var(--white); }
.grid:has(.tile:focus-visible) .p1 { background: var(--white); }

.movelist { position: relative; background: var(--navy); border: var(--px) solid var(--ink); box-shadow: inset 0 0 0 var(--px) #2a39b8; }
.move { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; padding: 22px 22px 24px; height: 100%; align-content: start; }
.move[hidden] { display: none; }
.move:focus-visible { outline-offset: -8px; }
.big { width: 128px; height: 128px; image-rendering: pixelated; background: var(--tile); border: var(--px) solid var(--ink); }
.move-copy { display: grid; gap: 14px; align-content: start; }
.move h3 { font: 400 40px/.95 var(--display); text-transform: uppercase; color: var(--yellow); }
.plain { font-size: 1.0625rem; }
.special { font-size: 1rem; color: var(--soft); }
.special span { display: inline-block; margin-right: 6px; padding: 3px 6px 2px; background: var(--red); color: var(--white); font: 400 16px/1 var(--pixel); vertical-align: 1px; }
.moves { display: flex; flex-wrap: wrap; gap: 8px; }
.moves li { padding: 6px 10px; border: 2px solid #3e4fd6; font-size: .9375rem; font-weight: 600; }
.wipe { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

@media (min-width: 1181px) and (max-width: 1360px) { .collide { font-size: 100px; } }
@media (min-width: 1181px) { .tile-name { font-size: 20px; } }
@media (min-width: 1500px) { .tile-name { font-size: 30px; } }
@media (max-width: 1180px) { .select-screen { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .select-screen { padding-top: 24px; gap: 44px; }
  .collide { font-size: 70px; text-shadow: 0 4px 0 var(--ink), 4px 4px 0 var(--ink); }
  .collide .l2 { -webkit-text-stroke-width: 3px; }
  .lede { margin-top: 22px; font-size: 1.0625rem; }
  .actions { gap: 18px 14px; margin-top: 24px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 124px; }
  .portrait { width: 64px; height: 64px; }
  .tile-name { font-size: 30px; }
  .move { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; padding: 18px 16px 20px; }
  .big { width: 80px; height: 80px; }
  .move-copy { display: contents; }
  .move h3 { align-self: center; font-size: 30px; }
  .move .plain, .move .special, .move .moves { grid-column: 1 / -1; }
}

/* ---------- VS: the fight poster ---------- */
.vs { border-top: var(--px) solid var(--ink); border-bottom: var(--px) solid var(--ink); }
.vs-title {
  padding: 40px 16px 32px; text-align: center; background: var(--ink); color: var(--white);
  font: 400 50px/1 var(--display); text-transform: uppercase;
}
.vs-split { display: grid; grid-template-columns: 1fr 0 1fr; }
.side { padding: 56px clamp(24px, 6vw, 112px) 64px; }
.side-you { background: var(--red); text-align: right; padding-right: calc(98px + 40px); }
.side-pyxel { background: var(--field-hi); padding-left: calc(98px + 40px); }
.corner { font: 400 100px/.8 var(--display); text-transform: uppercase; text-shadow: 0 6px 0 var(--ink); }
.side-pyxel .corner { color: var(--yellow); }
.rounds { display: grid; gap: 30px; margin-top: 40px; }
.rounds li { display: grid; gap: 4px; }
.side-you .rounds li { justify-items: end; }
.round { font: 400 16px/1 var(--pixel); color: var(--yellow); }
.side-you .round { color: #ffe680; }
.rounds strong { font: 400 50px/1 var(--display); text-transform: uppercase; font-weight: 400; }
.rounds p { max-width: 34ch; }
.hinge { position: relative; z-index: 2; }
.vs-mark { position: absolute; left: 50%; top: 50%; width: 196px; height: auto; transform: translate(-50%, -50%); }
@media (max-width: 900px) {
  .vs-title { font-size: 40px; padding: 32px 16px 26px; }
  .vs-split { grid-template-columns: 1fr; }
  .side { padding: 40px 16px 48px; }
  .side-you { padding: 40px 16px 72px; }
  .side-pyxel { padding: 72px 16px 48px; }
  .corner { font-size: 70px; }
  .rounds { margin-top: 28px; gap: 24px; }
  .rounds strong { font-size: 40px; }
  .hinge { height: 0; }
  .vs-mark { width: 126px; }
}

/* ---------- bonus stage ---------- */
.bonus {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 32px 48px; align-items: start;
  padding: 80px clamp(16px, 3.4vw, 48px);
}
.bonus h2, .extra h2 { font: 400 70px/.85 var(--display); text-transform: uppercase; color: var(--yellow); text-shadow: 0 5px 0 var(--ink); }
.bonus-copy p, .extra-head p { margin-top: 18px; max-width: 40ch; color: var(--white); }
.cabinet { border: var(--px) solid var(--ink); background: var(--ink); }
.hud { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding: 10px 16px; }
.hud-face { width: 72px; height: 64px; image-rendering: pixelated; margin: -6px 0 -8px -6px; }
.hud-name, .hud-stat { display: grid; gap: 2px; }
.hud-label { font: 400 16px/1 var(--pixel); color: var(--soft); }
.hud-val { font: 400 40px/.9 var(--display); text-transform: uppercase; color: var(--white); font-variant-numeric: tabular-nums; }
[data-combo] { color: var(--yellow); }
.field {
  position: relative; height: 330px; color: var(--ink); overflow: hidden;
  background:
    linear-gradient(var(--ink), var(--ink)) bottom 24px left 0 / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, #f3c414 0 16px, #d9a90a 16px 32px) bottom / 100% 24px no-repeat,
    linear-gradient(#7cc4ff 0 22%, #9cd3ff 22% 44%, #bde2ff 44% 66%, #dcf0ff 66%);
}
.burst {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 400 80px/1 var(--display); text-transform: uppercase; color: var(--yellow);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink);
  opacity: 0;
}
.burst.on { animation: burst 1.1s steps(6) forwards; }
@keyframes burst {
  0% { opacity: 1; transform: translateX(-50%) scale(1.6); }
  25% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}
.controls { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px 14px; }
@media (max-width: 960px) { .bonus { grid-template-columns: 1fr; padding: 64px 16px; } }
@media (max-width: 760px) {
  .bonus h2, .extra h2 { font-size: 60px; }
  .field { height: 270px; }
  .hud { gap: 8px 20px; padding: 10px 12px; flex-wrap: nowrap; }
  .hud-val { font-size: 30px; }
  .burst { font-size: 60px; }
  .controls { padding: 12px; }
  .controls .btn { flex: 1 1 140px; }
}
@media (max-width: 420px) { .hud-name { display: none; } }

/* ---------- extra modes (Lab, secondary) ---------- */
.extra {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 28px 48px; align-items: start;
  padding: 72px clamp(16px, 3.4vw, 48px); background: var(--navy); border-top: var(--px) solid var(--ink);
}
.extra h2 { font-size: 60px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modes li { display: grid; gap: 10px; align-content: start; padding: 22px; border: var(--px) solid var(--ink); background: var(--field); }
.modes h3 { font: 400 30px/1 var(--display); text-transform: uppercase; }
.modes p { color: var(--soft); }
.mode-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--yellow); }
.mode-link:hover { color: var(--white); }
@media (max-width: 960px) { .extra { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .modes { grid-template-columns: 1fr; } .extra { padding: 56px 16px; } }

/* ---------- insert coin ---------- */
.coin { padding: 96px clamp(16px, 3.4vw, 48px) 104px; text-align: center; border-top: var(--px) solid var(--ink); }
.coin h2 { display: grid; justify-items: center; gap: 14px; }
.coin-big { font: 400 160px/.78 var(--display); text-transform: uppercase; color: var(--yellow); text-shadow: 0 8px 0 var(--ink), 8px 8px 0 var(--ink); }
.coin-line { font: 400 50px/1 var(--display); text-transform: uppercase; text-wrap: balance; }
.coin > p { max-width: 46ch; margin: 24px auto 0; }
.coin .actions { justify-content: center; }
.coin .copy-status { text-align: center; }
.addr { margin-top: 18px !important; font-weight: 600; color: var(--soft); user-select: all; }
@media (max-width: 760px) {
  .coin { padding: 72px 16px 80px; }
  .coin-big { font-size: 80px; text-shadow: 0 5px 0 var(--ink), 5px 5px 0 var(--ink); }
  .coin-line { font-size: 40px; }
}

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px clamp(16px, 3.4vw, 48px) 28px; background: var(--ink); color: var(--soft); font-size: .9375rem;
}
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn-press::after { opacity: 1; }
  .burst.on { opacity: 1; }
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Player 2: Pyxel in the first viewport ---------- */
.p2 { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.p2-face { flex: none; padding: 4px; border: var(--px) solid var(--ink); background: var(--field-hi); cursor: pointer; box-shadow: 0 var(--px) 0 var(--ink); }
.p2-face canvas { display: block; width: 144px; height: 128px; image-rendering: pixelated; }
.p2-face:active { transform: translateY(2px); box-shadow: none; }
.p2-text { display: grid; gap: 2px; max-width: 28ch; color: var(--soft); }
.p2-tag { font: 400 16px/1 var(--pixel); text-transform: uppercase; color: var(--yellow); }
.p2-text strong { font: 400 30px/1 var(--display); text-transform: uppercase; color: var(--white); }
.p2-text a { color: var(--white); text-underline-offset: .2em; }
.p2-text a:hover { color: var(--yellow); }
@media (max-width: 760px) { .p2-face canvas { width: 108px; height: 96px; } }

/* ---------- legal pages (privacy) ---------- */
.top .brand + .btn-small { margin-left: auto; }
.legal { max-width: 72ch; margin: 0 auto; padding: 48px 16px 88px; }
.legal-back { font: 400 16px/1 var(--pixel); text-transform: uppercase; }
.legal-back a { display: inline-flex; align-items: center; min-height: 44px; color: var(--yellow); text-decoration: none; }
.legal-back a:hover { text-decoration: underline; }
.legal h1 { margin: 16px 0 12px; font: 400 64px/.9 var(--display); text-transform: uppercase; color: var(--yellow); text-shadow: 0 6px 0 var(--ink); }
.legal-date { font: 400 16px/1.4 var(--pixel); color: var(--soft); }
.legal h2 { margin: 48px 0 12px; font: 400 32px/1 var(--display); text-transform: uppercase; color: var(--white); }
.legal p + p { margin-top: 14px; }
.legal p, .legal li { color: var(--soft); }
.legal ul { display: grid; gap: 8px; margin: 14px 0; padding-left: 1.2em; list-style: square; }
.legal a { color: var(--white); }
.legal a:hover { color: var(--yellow); }
@media (max-width: 760px) { .legal h1 { font-size: 48px; } .legal h2 { font-size: 30px; } }

/* Until the roster script runs, show only the first fighter (no layout shift); without JS all four stay visible. */
.js:not(.js-ready) .move:not(#move-web) { display: none; }
