/* ==========================================================================
   Broadcast theme — shared by every game on games.all22football.com
   Styled after sports broadcast graphics: near-black field, gold primary,
   one accent per unit, condensed labels. Every colour is a token; no component
   may hardcode one. Contrast is enforced by tools/check-contrast.mjs.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #080b0f;
  --panel: #0e1319;
  --sheet: #0b1016;
  --tag: #090d11;
  --hover: #141a22;

  /* Lines */
  --line: rgb(255 255 255 / 9%);
  --line-strong: rgb(255 255 255 / 36%);
  --line-hover: rgb(255 255 255 / 30%);

  /* Text */
  --text: #f3f5f8;
  --muted: #9aa3af;
  --subtle: #7d8794;

  /* Primary accent: broadcast gold */
  --gold: #f2c230;
  --gold-hover: #f7d35c;
  --on-gold: #1c1303;

  /* Unit accents */
  --off: #f2c230;
  --def: #5bc0f8;
  --st: #c4b5fd;

  /* State */
  --win: #4ade80;
  --win-soft: #86efac;
  --loss: #f87171;
  --danger: #b91c1c;        /* label --text on this is 5.9:1 */
  --danger-hover: #a51d1d;

  /* Typewriter targets */
  --focus: #5bc0f8;

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rc: "Roboto Condensed", "Arial Narrow", ui-sans-serif, sans-serif;

  /* 4px grid, radius scale mirrors the broadcast overlay look */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --shadow: 0 18px 40px -24px rgb(0 0 0 / 85%);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, canvas, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

:where(a, button, [tabindex], input, select, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Layout -------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--s4); }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.grid { display: grid; gap: var(--s3); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.spacer { margin-left: auto; }

/* ---- Type ---------------------------------------------------------------- */
h1, h2, h3 {
  margin: 0 0 var(--s3);
  font-family: var(--rc);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-transform: uppercase;
}
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--s3); color: var(--muted); }
a { color: var(--gold); text-underline-offset: 3px; }
strong { color: var(--text); }

.kicker {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--rc); font-size: 0.8125rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}

/* ---- Chrome -------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__inner { display: flex; align-items: center; gap: var(--s4); min-height: 56px; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--rc); font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
}
.brand__mark { width: 26px; height: 26px; flex: none; }
.top nav { display: flex; gap: var(--s4); flex-wrap: wrap; }
.top nav a {
  color: var(--muted); text-decoration: none; font-size: 0.875rem;
  font-family: var(--rc); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--gold); }

footer.site {
  border-top: 1px solid var(--line); margin-top: var(--s7);
  padding-block: var(--s5); color: var(--subtle); font-size: 0.8125rem;
}

/* ---- Panels and tags ----------------------------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s4);
}
.sheet {
  background: var(--sheet); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s3);
}
.tag {
  display: inline-flex; align-items: center; gap: var(--s1);
  background: var(--tag); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 2px var(--s2);
  font-family: var(--rc); font-size: 0.6875rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.tag--gold { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.tag--off { color: var(--off); border-color: color-mix(in srgb, var(--off) 45%, transparent); }
.tag--def { color: var(--def); border-color: color-mix(in srgb, var(--def) 45%, transparent); }
.tag--st { color: var(--st); border-color: color-mix(in srgb, var(--st) 45%, transparent); }
.tag--win { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.tag--loss { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border-radius: var(--r-sm); border: 1px solid transparent;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  font-family: var(--rc); font-size: 0.875rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn--primary { background: var(--gold); color: var(--on-gold); }
.btn--primary:hover { background: var(--gold-hover); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--line-hover); background: var(--hover); }
.btn--danger { background: var(--danger); color: var(--text); }
.btn--danger:hover { background: var(--danger-hover); }
.btn--sm { padding: 6px 12px; font-size: 0.75rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* ---- Data display -------------------------------------------------------- */
.statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: var(--s2); }
.stat { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2) var(--s3); }
.stat b { display: block; font-family: var(--rc); font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); font-family: var(--rc); font-weight: 700; }

.bar { height: 6px; border-radius: 3px; background: var(--tag); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); }
.bar--def > i { background: var(--def); }
.bar--win > i { background: var(--win); }

textarea, input[type="search"], input[type="text"] {
  background: var(--sheet); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 8px 10px; width: 100%; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; font-family: var(--font); }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 8px var(--s3); border-bottom: 1px solid var(--line); }
th {
  font-family: var(--rc); font-size: 0.6875rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--subtle); background: var(--sheet);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
