/* ============================================================
   BTV JAM 2026 — arcade chrome
   Palette, fonts, cabinet stage, marquee, CRT overlay.
   All chrome is pure CSS: no image assets anywhere in here.
   ============================================================ */

/* ── Self-hosted fonts ─────────────────────────────────────
   Vendored locally on purpose: no request to fonts.googleapis.com,
   so the page contacts no font CDN. Both are OFL licensed.
   Latin subset (U+0000–00FF) — covers ä ö ü ß for the German
   team and venue names. */
/* font-display: block, not swap — a pixel font swapping in from a proportional
   fallback causes a very visible reflow. These files are 4–5 KB and local, so
   the "invisible text" window is imperceptible. unicode-range matches the
   downloaded subset so the browser won't reach for these fonts for glyphs
   they don't contain. */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../assets/fonts/PressStart2P-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('../assets/fonts/Silkscreen-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

:root {
  /* Cabinet palette, lifted from the NBA Jam team-select screen. */
  --jam-gold:      #ffd23f;
  --jam-gold-deep: #f0a416;
  --jam-magenta:   #ff3ce0;
  --jam-cyan:      #22e7ff;
  --jam-green:     #48ff62;
  --jam-red:       #e8202a;
  --jam-cream:     #fdf3d8;
  --jam-black:     #07070d;
  --jam-navy:      #101a4d;
  --jam-maroon:    #3a0c14;

  /* Wood-grain frame. Two directions so grain runs along each band. */
  --wood-h:
    repeating-linear-gradient(0deg,
      rgba(0,0,0,.26) 0 2px, rgba(0,0,0,0) 2px 5px,
      rgba(255,255,255,.13) 5px 6px, rgba(0,0,0,0) 6px 12px),
    linear-gradient(180deg, #ffcf5a 0%, #e29c1c 42%, #a9660c 78%, #7b4708 100%);
  --wood-v:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,.26) 0 2px, rgba(0,0,0,0) 2px 5px,
      rgba(255,255,255,.13) 5px 6px, rgba(0,0,0,0) 6px 12px),
    linear-gradient(90deg, #ffcf5a 0%, #e29c1c 42%, #a9660c 78%, #7b4708 100%);

  /* Heavy 8-direction black outline. A text-shadow stack rather than
     -webkit-text-stroke, which thins out at pixel-font corners and
     renders inconsistently between engines. */
  --outline:
    2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000,
    2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
  --outline-thin:
    1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000,
    1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'Silkscreen', 'Press Start 2P', 'Courier New', monospace;
}

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

/* The ideal outline: a stroke painted *behind* the fill. -webkit-text-stroke on
   its own draws a centred stroke, which at these sizes eats inward and closes
   up the counters of A, B, R and 0. paint-order fixes that, so where it is
   supported we use the real stroke; the text-shadow stack above is the floor. */
@supports (paint-order: stroke) {
  .marquee__title,
  .game__venue,
  .board__edge span,
  .cta,
  .credit {
    paint-order: stroke fill;
    -webkit-text-stroke: 2px #000;
    text-shadow: none;
  }
  .marquee__title { text-shadow: 0 0 18px rgba(255, 190, 40, .45); }
}

body {
  margin: 0;
  padding: clamp(8px, 2vw, 28px) clamp(8px, 2vw, 24px);
  background:
    radial-gradient(ellipse at 50% 0%, #1b1b2e 0%, #07070d 60%, #000 100%);
  color: var(--jam-cream);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

/* ── Cabinet stage ─────────────────────────────────────────
   The reference is a 4:3 arcade screen, so on wide viewports we hold
   that aspect and let everything inside scale with the stage using
   container units. No transform: scale() on the cabinet — it blurs
   pixel type and wrecks the map iframe's hit testing. */
.cabinet {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  container-type: inline-size;
  display: grid;
  /* The schedule is the reason the page exists, so it gets the larger share —
     enough for ~11 games before scrolling. */
  grid-template-rows: auto minmax(0, 53fr) minmax(0, 43fr);
  gap: clamp(4px, 0.7cqw, 10px);
  padding: clamp(6px, 1cqw, 14px);
  background: var(--jam-black);
  border: clamp(6px, 1.1cqw, 15px) solid transparent;
  border-image: var(--wood-v) 1 / clamp(6px, 1.1cqw, 15px) / 0 stretch;
  border-radius: 6px;
  box-shadow:
    0 0 0 clamp(3px, 0.5cqw, 7px) #2b2b34,
    0 0 0 clamp(5px, 0.8cqw, 11px) #14141c,
    0 24px 70px rgba(0,0,0,.85);
  overflow: hidden;
}

/* ── Marquee ─────────────────────────────────────────────── */
.marquee {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(4px, 0.8cqw, 12px);
  padding: clamp(3px, 0.5cqw, 7px) clamp(5px, 0.9cqw, 12px);
  background: var(--wood-h);
  border: 2px solid #5b3406;
  border-radius: 3px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -3px 0 rgba(0,0,0,.4);
}

.marquee__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(13px, 3.1cqw, 40px);
  line-height: 1.15;
  letter-spacing: .04em;
  white-space: nowrap;
  /* On phones the title's grid column is 1fr — wider than the text — so
     without this the heading sits left of centre. */
  text-align: center;
  color: var(--jam-gold);
  text-shadow: var(--outline), 0 0 18px rgba(255, 190, 40, .5);
  animation: marquee-flicker 3.4s steps(1, end) infinite;
}

/* Diagonal speed stripes flanking the title, as on the original. */
.marquee__stripes {
  height: clamp(9px, 1.9cqw, 24px);
  border: 2px solid #3d2204;
  border-radius: 2px;
  background: repeating-linear-gradient(115deg,
    #fdfdff 0 6px, #c8c8d6 6px 11px, #6f7183 11px 15px, #24242e 15px 20px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.marquee__stripes--flip { transform: scaleX(-1); }

@keyframes marquee-flicker {
  0%, 92%, 100% { color: var(--jam-gold); }
  94%           { color: #fff6c2; }
  96%           { color: var(--jam-gold-deep); }
}

/* ── CRT overlay ───────────────────────────────────────────
   Scanlines plus a vignette. Deliberately faint: pixel fonts under
   heavy scanlines become unreadable, which defeats the point of the
   page (telling you when the next game is). */
.crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.crt::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,.34) 0 1px, rgba(0,0,0,0) 1px 3px);
  opacity: .5;
}
.crt::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 130% 118% at 50% 50%,
      rgba(255,255,255,.05) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%);
}

/* ── Credit readout ────────────────────────────────────────
   Sits in the gap between the two lower panels, as in the reference. */
.credit {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: clamp(2px, .35cqw, 5px) clamp(5px, .9cqw, 12px);
  font-family: var(--font-display);
  font-size: clamp(7px, 1.05cqw, 13px);
  white-space: nowrap;
  color: var(--jam-cream);
  background: #0c0c14;
  border: 2px solid #6e6e86;
  border-radius: 2px;
  text-shadow: var(--outline-thin);
}

/* ── Utilities ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 20;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--jam-black);
  background: var(--jam-gold);
  border: 2px solid #000;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:where(a, button):focus-visible {
  outline: 3px solid var(--jam-cyan);
  outline-offset: 2px;
}

/* ── Responsive: release the 4:3 lock ──────────────────────
   Letterboxing a 4:3 stage on a phone would leave the schedule
   unreadably small, so below 900px the cabinet grows vertically
   and the panels stack (see schedule.css / panels.css). */
@media (max-width: 900px) {
  .screen {
    aspect-ratio: auto;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }
  .marquee__title { font-size: clamp(15px, 4.4vw, 30px); }
  .marquee__stripes { height: clamp(10px, 3vw, 20px); }
  .credit {
    position: static;
    transform: none;
    justify-self: center;
    font-size: 11px;
    padding: 4px 10px;
  }
  .crt::before { opacity: .3; }
}

@media (max-width: 620px) {
  body { padding: 6px; }
  .screen { padding: 7px; border-width: 5px; }
  .marquee { grid-template-columns: auto 1fr auto; }
  .marquee__stripes { width: 22px; }
}

/* ── High contrast ─────────────────────────────────────────
   Drop the decorative textures and the CRT layer, which are the two things
   that reduce effective contrast the most. */
@media (prefers-contrast: more) {
  .crt { display: none; }
  .panel--ig .panel__frame,
  .panel--map .panel__frame { background-image: none; }
  .marquee { background-image: none; background-color: #c9860f; }
}

/* ── Reduced motion ────────────────────────────────────────
   Kill every blink, pulse and transform. Colour-only hover states
   survive so the page still feels responsive to input. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
