/* Fantasiya — design system.
   Floodlit pitch: green-biased near-black ground, gold as the single accent.
   Both themes are defined at token level; components never reference a
   colour directly, so the theme switch can never half-apply. */

:root {
  --bg: #0A130D;
  --surface: #0F1C13;
  --surface-2: #16281B;
  --raised: #1D3324;
  --line: #23392C;
  --text: #EAF0EA;
  --dim: #8FA394;
  --faint: #62786A;
  --gold: #F0B429;
  --gold-text: #F0B429;
  --gold-ink: #241900;
  --pitch-a: #12472A;
  --pitch-b: #0F3D24;
  --pitch-line: rgba(255, 255, 255, .16);
  --live: #34D399;
  --danger: #F87171;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.35);

  --font-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", "Franklin Gothic Medium", Impact, system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #EFF3ED; --surface: #FFFFFF; --surface-2: #F5F9F3; --raised: #FFFFFF;
    --line: #D9E3D7; --text: #0E1D14; --dim: #52655A; --faint: #7A8C80;
    --gold-text: #8A5A00; --pitch-a: #1F6E40; --pitch-b: #1A6138;
    --pitch-line: rgba(255,255,255,.34); --live: #0F9D6B; --danger: #C62828;
    --shadow: 0 1px 2px rgba(16,40,24,.06), 0 8px 24px rgba(16,40,24,.08);
  }
}

:root[data-theme="dark"] {
  --bg: #0A130D; --surface: #0F1C13; --surface-2: #16281B; --raised: #1D3324;
  --line: #23392C; --text: #EAF0EA; --dim: #8FA394; --faint: #62786A;
  --gold-text: #F0B429; --pitch-a: #12472A; --pitch-b: #0F3D24;
  --pitch-line: rgba(255,255,255,.16); --live: #34D399; --danger: #F87171;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.35);
}

:root[data-theme="light"] {
  --bg: #EFF3ED; --surface: #FFFFFF; --surface-2: #F5F9F3; --raised: #FFFFFF;
  --line: #D9E3D7; --text: #0E1D14; --dim: #52655A; --faint: #7A8C80;
  --gold-text: #8A5A00; --pitch-a: #1F6E40; --pitch-b: #1A6138;
  --pitch-line: rgba(255,255,255,.34); --live: #0F9D6B; --danger: #C62828;
  --shadow: 0 1px 2px rgba(16,40,24,.06), 0 8px 24px rgba(16,40,24,.08);
}

/* Royal: the logo's palette — deep purple, emerald, crown gold. Fantasiya's default. */
:root[data-theme="royal"] {
  --bg: #0E0A1C; --surface: #17112B; --surface-2: #1F1738; --raised: #271D45;
  --line: #34295C; --text: #F2EFFB; --dim: #ABA3CA; --faint: #7D74A3;
  --gold: #F5C542; --gold-text: #FFD54F; --gold-ink: #2A1A00;
  --pitch-a: #1B5E4B; --pitch-b: #164E3F; --pitch-line: rgba(255,255,255,.18);
  --live: #00E676; --danger: #FF6B81;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 28px rgba(20,8,48,.55);
}
:root[data-theme="royal"] body {
  background:
    radial-gradient(900px 520px at 0% -10%, rgba(124,77,255,.22), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(0,230,118,.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--gold-text); }

/* Nothing may push the page wider than the screen. Wide content earns its
   own scroller (.tablewrap, .bench .row) instead of dragging the body. */
img, svg, video, canvas { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; }

.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 0 20px 64px; }

/* ------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
}

.brand {
  display: flex; align-items: baseline; gap: 8px;
  text-decoration: none; color: inherit; min-width: 0;
}
.brand-mark {
  font-family: var(--font-display); font-size: clamp(21px, 5.5vw, 28px);
  font-weight: 700; letter-spacing: .02em; line-height: 1; color: var(--text);
  white-space: nowrap;
}
.brand-mark span { color: var(--gold-text); }
.brand-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--faint); font-weight: 600;
}

.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; min-width: 0; }
.nav a {
  font-size: 13px; font-weight: 600; color: var(--dim);
  text-decoration: none; padding: 7px 12px; border-radius: var(--r-sm);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); }

.deadline {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); white-space: nowrap;
}
.deadline-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); font-weight: 700;
}
.deadline-clock {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--gold-text); font-variant-numeric: tabular-nums;
}

.deadline-ball {
  width: 15px; height: 15px; flex: 0 0 auto;
  color: var(--faint);
}

/* Inside the last hour the chip stops being decoration and starts being a
   warning. Reduced-motion users get the colour without the pulse. */
.deadline.is-urgent {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
}
.deadline.is-urgent .deadline-ball { color: var(--gold); animation: nudge 2.4s ease-in-out infinite; }
.deadline.is-locked .deadline-clock { color: var(--dim); }

@keyframes nudge {
  0%, 82%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-18deg); }
  94% { transform: rotate(14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .deadline.is-urgent .deadline-ball { animation: none; }
}

/* ------------------------------------------------------------- banner */

/* The banner keeps its floodlit night palette in both themes — it reads as
   a photograph would, and inverting it would just make it grey. */
.banner {
  --banner-sky-top: #061A10;
  --banner-sky-bottom: #2A6B41;
  --banner-struct: #04100A;
  --banner-gold: #F0B429;
  --crowd-back: #163D26;
  --crowd-mid: #0C2717;
  --crowd-front: #04120B;
  --crowd-arm: #071A10;
  --crowd-scarf: #4E7A5E;

  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 20px;
  isolation: isolate;
  background: var(--banner-sky-top);
}

/* The artwork is the backdrop; the copy decides how tall the banner is.
   Sizing it the other way round clipped the buttons off the bottom. */
.banner-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.banner-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: clamp(300px, 32vw, 400px);
  padding: 40px clamp(20px, 5vw, 52px);
  /* Enough shade to keep the headline legible, and no more — the earlier
     version was heavy enough to black out the whole left half. */
  background: linear-gradient(
    100deg,
    rgba(3, 10, 6, .82) 0%,
    rgba(3, 10, 6, .58) 38%,
    rgba(3, 10, 6, .12) 72%,
    rgba(3, 10, 6, 0) 100%
  );
}

.banner-copy .eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 700;
  color: var(--banner-gold);
  margin: 0 0 2px;
  line-height: 1.5;
  max-width: 34ch;
}

.banner-copy h1 {
  font-size: clamp(26px, 5.2vw, 50px);
  line-height: 1.02;
  color: #F3F7F2;
  margin: 0;
  max-width: 18ch;
}

.banner-copy p {
  margin: 0;
  color: #C3D2C6;
  font-size: clamp(13px, 1.6vw, 16px);
  max-width: 44ch;
}

.banner-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

@media (max-width: 620px) {
  /* On a phone the artwork becomes a strip above the words — text overlaid
     on artwork at this width is unreadable however it is shaded. */
  .banner { display: flex; flex-direction: column; }
  .banner-svg { position: static; height: 128px; flex: 0 0 auto; }
  .banner-copy {
    min-height: 0;
    background: linear-gradient(180deg, rgba(4, 14, 8, .97), rgba(4, 14, 8, 1));
    padding: 20px 16px 24px;
  }
  .banner-copy h1 { max-width: none; }
}

/* ------------------------------------------------------------- charts */

/* One hue for every bar. Polarity is carried by position — a negative
   gameweek hangs below the baseline — because position is a stronger
   encoding than colour and survives every kind of colour blindness.
   Value validated against both surfaces; the history table below the chart
   is the required relief for its sub-3:1 contrast in light mode. */
:root { --bar: #B5820F; --bar-dim: #8A6A2E; }
:root[data-theme="dark"] { --bar: #B5820F; --bar-dim: #6E5A2C; }

/* Fixture difficulty is diverging: easy and hard are opposite poles with a
   genuine neutral in the middle. Every cell also prints its number, so the
   colour is never the only signal. */
:root {
  --fdr-1: #1B7F4B; --fdr-1-ink: #FFFFFF;
  --fdr-2: #7FBE93; --fdr-2-ink: #0B2415;
  --fdr-3: #B9C2BB; --fdr-3-ink: #17231B;
  --fdr-4: #E08B7A; --fdr-4-ink: #2A0E08;
  --fdr-5: #B23A26; --fdr-5-ink: #FFFFFF;
}
:root[data-theme="dark"] {
  --fdr-1: #1E6B43; --fdr-1-ink: #EAF6EE;
  --fdr-2: #3E7F58; --fdr-2-ink: #EAF6EE;
  --fdr-3: #495A4E; --fdr-3-ink: #E4EBE5;
  --fdr-4: #8E4A3B; --fdr-4-ink: #FBE9E4;
  --fdr-5: #A33526; --fdr-5-ink: #FFF0EC;
}

.fdr {
  display: inline-grid; place-items: center;
  min-width: 40px; padding: 4px 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.fdr small { display: block; font-size: 9px; opacity: .8; font-weight: 600; }
.fdr-1 { background: var(--fdr-1); color: var(--fdr-1-ink); }
.fdr-2 { background: var(--fdr-2); color: var(--fdr-2-ink); }
.fdr-3 { background: var(--fdr-3); color: var(--fdr-3-ink); }
.fdr-4 { background: var(--fdr-4); color: var(--fdr-4-ink); }
.fdr-5 { background: var(--fdr-5); color: var(--fdr-5-ink); }
.fdr-blank {
  background: transparent; border: 1px dashed var(--line);
  color: var(--faint); font-weight: 600;
}

.chart { width: 100%; overflow-x: auto; padding: 16px 18px 6px; }
.chart svg { display: block; }
.chart .bar { fill: var(--bar); }
.chart .bar:hover { fill: var(--gold); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--faint); stroke-width: 1; }
.chart .tick { fill: var(--faint); font-size: 9px; font-family: var(--font-body); }
.chart .peak { fill: var(--text); font-size: 10px; font-weight: 700; font-family: var(--font-display); }

/* ------------------------------------------------------------- teaser */

/* Deliberately the darkest thing on a light page — this is the one claim
   nobody else in the market can make, so it should not read as a footnote. */
.teaser {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  background:
    radial-gradient(120% 160% at 88% 20%, rgba(240, 180, 41, .16), transparent 62%),
    linear-gradient(100deg, #061A10, #0C2717 62%, #123421);
  color: #EAF0EA;
  padding: 26px clamp(20px, 4vw, 34px);
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.teaser-badge {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.teaser-body { flex: 1 1 320px; min-width: 0; }

.teaser h2 {
  font-size: clamp(19px, 3vw, 25px);
  color: #F3F7F2;
  margin: 0 0 6px;
}

.teaser p { margin: 0; color: #B6C9BB; font-size: 14.5px; max-width: 58ch; }
.teaser .sw { color: #8FA795; }

/* Stripes lifted from a pitch, not from anyone's badge. */
.teaser-flag {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, #14472A 0 9px, #0E3620 9px 18px);
  border: 1px solid rgba(240, 180, 41, .35);
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .04em;
  color: var(--gold);
}

@media (max-width: 560px) {
  .teaser { padding: 20px 16px; gap: 14px; }
  .teaser-flag { width: 54px; height: 54px; font-size: 16px; border-radius: 11px; }
}

/* ------------------------------------------------------------- controls */

.btn {
  appearance: none; font-family: var(--font-body); font-size: 13px;
  font-weight: 700; border-radius: var(--r-sm); padding: 9px 14px;
  cursor: pointer; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  text-decoration: none; display: inline-block; text-align: center;
}
.btn:hover { border-color: var(--faint); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { font-size: 15px; padding: 13px 22px; width: 100%; }
.btn.icon {
  width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  font-size: 16px; line-height: 1; color: var(--gold-text); flex: 0 0 auto;
}

label.field { display: block; margin-bottom: 16px; }
label.field .lbl {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .13em; color: var(--faint); font-weight: 700; margin-bottom: 6px;
}
label.field .hint { display: block; font-size: 12px; color: var(--dim); margin-top: 6px; }

input[type="text"], input[type="tel"], input[type="search"], select {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  padding: 11px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold);
}
input.otp {
  font-family: var(--font-mono); font-size: 26px; letter-spacing: .5em;
  text-align: center; padding: 14px 13px;
}

/* ------------------------------------------------------------- panels */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 18px; }

.pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
  background: var(--surface-2); white-space: nowrap;
}
.pill.live {
  color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent);
  background: color-mix(in srgb, var(--live) 12%, transparent);
}
.pill.warn {
  color: var(--gold-text); border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}

.note {
  padding: 12px 18px; font-size: 12px; color: var(--dim);
  background: var(--surface-2); border-top: 1px solid var(--line);
}

.alert {
  padding: 12px 15px; border-radius: var(--r-md); font-size: 14px;
  margin-bottom: 18px; border: 1px solid var(--line); background: var(--surface-2);
}
.alert.bad {
  color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.alert.good {
  color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent);
  background: color-mix(in srgb, var(--live) 10%, transparent);
}

/* ------------------------------------------------------------- pitch */

.pitch {
  position: relative;
  background: repeating-linear-gradient(180deg, var(--pitch-a) 0 46px, var(--pitch-b) 46px 92px);
  padding: 22px 12px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.pitch::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid var(--pitch-line); border-radius: 3px; pointer-events: none;
}
.pitch::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 108px; height: 108px; margin: -54px 0 0 -54px;
  border: 1px solid var(--pitch-line); border-radius: 50%; pointer-events: none;
}

.row {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
}

.plr {
  width: 88px; background: color-mix(in srgb, #06120B 55%, transparent);
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-md);
  padding: 8px 6px 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.plr:hover, .plr:focus-visible { transform: translateY(-2px); border-color: var(--gold); outline: none; }

.kit {
  position: relative; width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; font-size: 9px; font-weight: 800;
  letter-spacing: .06em; color: rgba(255,255,255,.92);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.armband {
  position: absolute; top: -6px; right: -6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--gold); color: var(--gold-ink);
  font-size: 9px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #06120B;
}
.plr-name {
  font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.plr-pts {
  width: 100%; background: rgba(0,0,0,.42);
  border-top: 1px solid rgba(255,255,255,.12); border-radius: 0 0 9px 9px;
  margin-top: auto; padding: 3px 0; font-family: var(--font-display);
  font-size: 15px; color: #fff; font-variant-numeric: tabular-nums;
}
.plr.haul .plr-pts { background: var(--gold); color: var(--gold-ink); }
.plr.blank .plr-pts { color: rgba(255,255,255,.55); }
.plr.empty { border-style: dashed; opacity: .6; }

.bench { background: var(--surface-2); border-top: 1px solid var(--line); padding: 14px 16px; }
.bench-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--faint); font-weight: 700; margin-bottom: 10px;
}
.bench .row { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.bench .plr { background: var(--raised); border-color: var(--line); flex: 0 0 auto; }
.bench .plr-name { color: var(--text); }
.bench .plr-pts { color: var(--text); background: color-mix(in srgb, var(--line) 60%, transparent); }

/* ------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--faint); font-weight: 700;
  padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td {
  padding: 10px 18px; white-space: nowrap;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
tbody tr:last-child td { border-bottom: 0; }
.c-rank { width: 52px; font-variant-numeric: tabular-nums; color: var(--dim); font-weight: 700; }
.c-pts {
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 700;
  font-family: var(--font-display); font-size: 16px;
}
.team { font-weight: 600; }
.mgr { font-size: 12px; color: var(--dim); }
tr.you { background: color-mix(in srgb, var(--gold) 11%, transparent); }
tr.you .c-rank { color: var(--gold-text); }
tr.you td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.medal { color: var(--gold-text); }

/* ------------------------------------------------------------- misc */

.code {
  font-family: var(--font-mono); font-size: 17px; font-weight: 700;
  letter-spacing: .14em; color: var(--gold-text); background: var(--surface-2);
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: var(--r-sm); padding: 6px 12px;
}

.foot {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--faint); line-height: 1.65; max-width: 68ch;
}

.sw { color: var(--dim); font-style: italic; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--dim); }
.empty-state h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  .wrap, .wrap-narrow { padding-left: 14px; padding-right: 14px; }
  .panel-head, .panel-body, .note, .invite { padding-left: 14px; padding-right: 14px; }
  th, td { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 560px) {
  /* The nav collapses into a scrollable strip under the brand rather than
     disappearing — on a phone these are the only way to move around. */
  .topbar-inner { gap: 8px 12px; padding: 10px 14px; }
  .brand-tag { display: none; }

  .nav {
    order: 3; width: 100%; margin-left: 0;
    flex-wrap: nowrap; overflow-x: auto; gap: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }

  .deadline { margin-left: auto; padding: 5px 10px 5px 11px; gap: 7px; }
  .deadline-label { font-size: 9px; letter-spacing: .1em; }
  .deadline-clock { font-size: 12px; }

  .btn.icon { width: 32px; height: 32px; font-size: 14px; }

  .plr { width: 66px; padding: 6px 4px 0; }
  .plr-name { font-size: 11px; }
  .plr-pts { font-size: 13px; }
  .kit { width: 26px; height: 26px; font-size: 8px; }
  .pitch { padding: 16px 6px 18px; gap: 14px; }
  .row { gap: 6px; }

  .code { font-size: 15px; letter-spacing: .1em; }
  input.otp { font-size: 22px; letter-spacing: .35em; }
}

/* Very narrow handsets: five defenders must still fit a row without the
   page itself scrolling sideways. */
@media (max-width: 380px) {
  .plr { width: 58px; }
  .plr-name { font-size: 10px; }
  .kit { width: 22px; height: 22px; }
}

/* Fantasiya: Kenyan-red full stop in the wordmark, and the EN/SW switch. */
.brand-mark span { color: #E03A3A; }
.lang-switch {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.lang-switch:hover { color: var(--text); border-color: var(--gold); }

/* Fantasiya crowned-F logo beside the wordmark */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }

/* ---------------------------------------------- phone shell (2026-11-13)
   Phones get an app layout: one slim top row (logo, deadline, menu), the five
   main tabs in a bottom bar, and everything else in a slide-in menu. Wider
   screens keep the full top bar, so these pieces are hidden there. */
.menu-btn, .tabbar, .deadline-gw { display: none; }
.drawer[hidden] { display: none; }

@media (max-width: 760px) {
  :root { --tabbar-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: var(--tabbar-h); }

  .topbar-inner { flex-wrap: nowrap; gap: 10px; padding: 8px 14px; }
  .brand { gap: 8px; }
  .brand-logo { width: 30px; height: 30px; border-radius: 8px; }
  .brand-mark { font-size: 21px; }
  .brand-tag, .topbar .nav, .topbar .lang-switch, .topbar #theme { display: none; }

  .deadline { margin-left: auto; padding: 6px 11px; gap: 7px; }
  .deadline-label { display: none; }
  .deadline-gw { display: inline; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--dim); }
  .deadline-clock { font-size: 12.5px; }
  .deadline-ball { width: 14px; height: 14px; }

  .menu-btn {
    display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; padding: 0;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer;
  }
  .menu-btn svg { width: 20px; height: 20px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 62px; color: var(--faint); text-decoration: none; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  }
  .tabbar a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--gold-text); }
  .tabbar a.on::before {
    content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
  }
  .tabbar a:active { background: var(--surface-2); }
  .tabbar .tab-badge {
    position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 10px; font-weight: 800;
    line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg);
  }

  .drawer { position: fixed; inset: 0; z-index: 40; }
  .drawer-scrim { position: absolute; inset: 0; background: rgba(4, 2, 10, .55); animation: fade .18s ease-out; }
  .drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--line);
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; animation: slidein .2s ease-out;
  }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
  .menu-close { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
  .drawer-links { display: flex; flex-direction: column; gap: 2px; }
  .drawer-links a { padding: 13px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 600; }
  .drawer-links a.on { background: var(--surface-2); color: var(--gold-text); }
  .drawer-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
  .drawer-foot .btn { font-size: 14px; }
  html.drawer-open, html.drawer-open body { overflow: hidden; }
}
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer-panel, .drawer-scrim { animation: none; } }
/* Bars that stick to the bottom of a page sit just above the phone tab bar. */
@media (max-width: 760px) { .cmpbar, .status { bottom: var(--tabbar-h) !important; } }

/* ---- Stats page + player of the week card ---- */
.potw { display:flex; align-items:center; gap:14px; padding:14px 16px; margin-bottom:18px;
  border:1px solid var(--line); border-radius:var(--r-lg); color:var(--text); text-decoration:none;
  background:linear-gradient(120deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 60%); }
a.potw:hover { border-color:var(--gold); }
.potw-kit { width:46px; height:46px; border-radius:12px; flex:none; display:grid; place-items:center; }
.potw-kit span { font-size:11px; font-weight:800; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.6); }
.potw-main { flex:1; min-width:0; }
.potw-k { font-size:10.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--gold-text); font-weight:700; display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.potw-name { font-size:19px; font-weight:800; margin-top:2px; }
.potw-sub { font-size:12.5px; color:var(--dim); }
.potw-pts { text-align:center; flex:none; }
.potw-pts strong { display:block; font-size:28px; line-height:1; color:var(--gold-text); }
.potw-pts span { font-size:11px; color:var(--dim); text-transform:uppercase; letter-spacing:.1em; }
.potw-lg { padding:20px; }
.potw-lg .potw-kit { width:64px; height:64px; border-radius:16px; }
.potw-lg .potw-name { font-size:26px; }
.potw-lg .potw-pts strong { font-size:40px; }
.potw-tag { font-size:9.5px; letter-spacing:.08em; padding:2px 6px; border-radius:6px; border:1px solid var(--line); color:var(--dim); text-transform:uppercase; font-weight:700; }
.potw-tag.gold { border-color:var(--gold); color:var(--gold-text); }
.potw-runners { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:-8px 0 20px; font-size:13px; }
.potw-runners .k { color:var(--faint); font-size:11px; text-transform:uppercase; letter-spacing:.12em; font-weight:700; }
.potw-runner { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--line); border-radius:999px; color:var(--text); text-decoration:none; }
.st-dot { width:16px; height:16px; border-radius:4px; flex:none; display:inline-block; }
.stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width: 760px) { .stats-grid { grid-template-columns:1fr; } .potw-lg .potw-name { font-size:21px; } }
/* ---- AFCON 2027 teaser + nav badge ---- */
.soon-dot { font-size:8.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:1px 5px; border-radius:5px; background:var(--gold); color:var(--gold-ink); vertical-align:2px; margin-left:3px; }
.af-teaser { display:flex; align-items:center; gap:12px; padding:12px 16px; margin-bottom:18px; border:1px dashed color-mix(in srgb, var(--gold) 55%, var(--line)); border-radius:var(--r-lg); color:var(--text); text-decoration:none; background:var(--surface); }
.af-teaser:hover { border-style:solid; }
.af-teaser-flags { display:flex; flex-direction:column; gap:2px; flex:none; }
.af-teaser-flags i { display:block; width:22px; height:6px; border-radius:2px; }
.af-teaser-flags .ke { background:linear-gradient(#000 0 33%, #BB0000 33% 66%, #006600 66%); }
.af-teaser-flags .ug { background:linear-gradient(90deg, #000 0 33%, #FCDC04 33% 66%, #D90000 66%); }
.af-teaser-flags .tz { background:linear-gradient(153deg, #1EB53A 0 45%, #000 45% 55%, #00A3DD 55%); }
.af-teaser-txt { flex:1; min-width:0; font-size:13.5px; }
.af-teaser-txt strong { color:var(--gold-text); margin-right:4px; }
.af-teaser-txt span { color:var(--dim); }
.af-teaser-go { color:var(--gold-text); font-weight:800; }
/* ---- Predict card (home) ---- */
.pr-card { display:flex; align-items:center; gap:14px; padding:14px 16px; margin-bottom:18px; border-radius:var(--r-lg); text-decoration:none; color:var(--text);
  border:1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background:linear-gradient(120deg, color-mix(in srgb, var(--gold) 20%, var(--surface)), var(--surface) 70%); }
.pr-card:hover { border-color:var(--gold); }
.pr-ic { width:44px; height:44px; border-radius:12px; flex:none; display:grid; place-items:center; background:var(--gold); color:var(--gold-ink); }
.pr-ic svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.pr-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.pr-k { font-size:10.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--gold-text); font-weight:800; }
.pr-h { font-size:17px; font-weight:800; margin-top:2px; }
.pr-s { font-size:12px; color:var(--dim); margin-top:2px; }
.pr-go { flex:none; font-weight:800; color:var(--gold-text); white-space:nowrap; }
/* ---- iPhone "Add to Home Screen" banner (public/js/pwa.js) ---- */
.ios-install { position:fixed; left:10px; right:10px; bottom:calc(var(--tabbar-h, 0px) + 10px + env(safe-area-inset-bottom, 0px)); z-index:40;
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:14px;
  background:var(--surface); border:1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  box-shadow:0 10px 30px rgba(0,0,0,.35); font-size:13px; line-height:1.35; color:var(--text); }
.ios-install img { border-radius:9px; flex:none; }
.ios-install span { flex:1; min-width:0; }
.ios-install button { flex:none; background:none; border:0; color:var(--dim); font-size:22px; line-height:1; padding:4px 6px; cursor:pointer; }
.ios-share svg { width:15px; height:15px; vertical-align:-2px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; color:#0A84FF; }
@media (max-width:760px) { .ios-install { bottom:calc(72px + env(safe-area-inset-bottom, 0px)); } }
/* ---- chips (Team page) ---- */
.chip-list { display:grid; gap:8px; padding:12px 14px 4px; }
.chip-card { display:flex; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--surface-2); }
.chip-card.on { border-color:var(--gold); background:color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.chip-card.used { opacity:.6; }
.chip-txt { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.chip-txt span { font-size:12.5px; color:var(--dim); }
.chip-act form { margin:0; display:flex; gap:8px; align-items:center; }
.chip-state { font-size:12px; font-weight:700; color:var(--gold-text); white-space:nowrap; }
.chip-state.muted { color:var(--faint); }