/* ============================================================================
   BBC Geldern — Liga-Onepager
   Mobile first. Everything below 640px is the real design; wider screens get
   the same column, centred, with the ambient court treatment carrying the
   extra space.
   ========================================================================= */

/* ── Tokens ───────────────────────────────────────────────────────────── */

:root {
  --brand:        #F5802B;
  --brand-lift:   #FFB04A;
  --brand-deep:   #C25710;
  --brand-ink:    #180C02;

  --win:          #34D399;
  --loss:         #FB7185;
  --neutral:      #94A3B8;

  --bg:           #09090C;
  --bg-veil:      #0E0E13;
  --surface:      rgba(255, 255, 255, .042);
  --surface-hi:   rgba(255, 255, 255, .072);
  --line:         rgba(255, 255, 255, .085);
  --line-hi:      rgba(255, 255, 255, .16);

  --text:         #F5F5F7;
  --muted:        #9C9CA9;
  --faint:        #6B6B79;

  --chip:         #FFFFFF;            /* crests sit on a light chip so the mixed
                                         source formats read consistently */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.4);
  --shadow-md:    0 8px 24px -8px rgba(0,0,0,.65);
  --shadow-lg:    0 24px 60px -20px rgba(0,0,0,.8);
  --glow:         0 0 0 1px rgba(245,128,43,.28), 0 12px 40px -12px rgba(245,128,43,.42);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --pad: clamp(1rem, 4.6vw, 1.375rem);
  --col: 600px;

  --ease: cubic-bezier(.22, .68, .32, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);

  --font: 'Archivo', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg:           #F4F2EF;
  --bg-veil:      #FFFFFF;
  --surface:      #FFFFFF;
  --surface-hi:   #FFFFFF;
  --line:         rgba(16, 16, 22, .09);
  --line-hi:      rgba(16, 16, 22, .18);

  --text:         #121218;
  --muted:        #5C5C6B;
  --faint:        #86869A;

  --brand:        #E06A13;
  --brand-lift:   #F59331;
  --win:          #0E9F6E;
  --loss:         #E11D48;

  --chip:         #FFFFFF;
  --shadow-sm:    0 1px 2px rgba(16,16,22,.06);
  --shadow-md:    0 10px 26px -12px rgba(16,16,22,.22);
  --shadow-lg:    0 26px 60px -24px rgba(16,16,22,.28);
  --glow:         0 0 0 1px rgba(224,106,19,.22), 0 14px 38px -14px rgba(224,106,19,.3);
}

/* ── Reset ────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font);
  font-variation-settings: 'wdth' 100;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* The gesture handler owns vertical overscroll at the top of the document. */
  overscroll-behavior-y: contain;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Ambient light behind everything — this is what stops a 600px column from
   looking marooned on a desktop screen. */
body::before {
  content: '';
  position: fixed;
  inset: -20vh -10vw auto;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(245,128,43,.22), transparent 70%),
    radial-gradient(40% 40% at 88% 18%, rgba(255,176,74,.10), transparent 70%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(245,128,43,.20), transparent 72%),
    radial-gradient(42% 42% at 88% 16%, rgba(255,176,74,.16), transparent 72%);
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand-lift);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skiplink {
  position: fixed; top: .5rem; left: 50%; translate: -50% -200%;
  z-index: 200; padding: .625rem 1rem; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 700; text-decoration: none;
  transition: translate .2s var(--ease);
}
.skiplink:focus { translate: -50% 0; }

/* ── Type scale ───────────────────────────────────────────────────────── */

.display {
  font-variation-settings: 'wdth' 118;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: .92;
  text-transform: uppercase;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.eyebrow {
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Shell ────────────────────────────────────────────────────────────── */

main { position: relative; z-index: 1; }

.section {
  width: min(100% - calc(var(--pad) * 2), var(--col));
  margin-inline: auto;
  padding-block: clamp(2.25rem, 7vw, 3.25rem);
}
.section--tight { padding-block: 0 clamp(.5rem, 2vw, 1rem); }

.section__head { margin-bottom: 1.125rem; }
.section__head h2 {
  font-size: clamp(1.5rem, 6.4vw, 1.875rem);
  font-variation-settings: 'wdth' 112;
  font-weight: 800;
  letter-spacing: -.015em;
}
.section__hint {
  margin-top: .3125rem;
  font-size: .8125rem;
  color: var(--faint);
}

/* ── Top bar ──────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .625rem var(--pad);
  padding-top: calc(.625rem + env(safe-area-inset-top));
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom-color: var(--line);
}

.brand {
  display: flex; align-items: center; gap: .625rem;
  text-decoration: none; min-width: 0;
}
.brand__crest {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  overflow: hidden;
  flex: none;
}
.brand__crest img { width: 100%; height: 100%; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong {
  font-size: .9375rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15;
  font-variation-settings: 'wdth' 108;
}
.brand__text small {
  font-size: .6875rem; color: var(--faint); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar__actions { display: flex; gap: .375rem; flex: none; }

.iconbtn {
  display: grid; place-items: center;
  width: 2.375rem; height: 2.375rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  transition: color .2s, background .2s, scale .18s var(--spring);
}
.iconbtn:hover { color: var(--text); background: var(--surface-hi); }
.iconbtn:active { scale: .9; }
.iconbtn svg {
  width: 1.125rem; height: 1.125rem;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.iconbtn .i-moon { display: none; }
[data-theme="light"] .iconbtn .i-moon { display: block; }
[data-theme="light"] .iconbtn .i-sun { display: none; }

#refreshBtn.is-busy { color: var(--brand); }
#refreshBtn.is-busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(2rem, 9vw, 3.5rem) var(--pad) clamp(3.25rem, 11vw, 4.5rem);
  text-align: center;
  overflow: hidden;
}

.hero__court {
  position: absolute;
  inset: auto 0 -1px;
  z-index: -1;
  opacity: .5;
  mask-image: linear-gradient(to top, #000 8%, transparent 92%);
}
.hero__court svg { width: 100%; height: auto; }
.hero__court path, .hero__court circle {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.1;
  opacity: .34;
}

.hero__glow {
  position: absolute;
  left: 50%; top: 42%;
  width: 26rem; aspect-ratio: 1; translate: -50% -50%;
  z-index: -2;
  background: radial-gradient(circle, rgba(245,128,43,.3), transparent 62%);
  filter: blur(14px);
}

.hero__inner {
  width: min(100%, var(--col));
  margin-inline: auto;
  display: grid;
  gap: .875rem;
  justify-items: center;
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem .875rem .375rem .6875rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .6875rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.dot {
  width: .4375rem; height: .4375rem; border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--win) 60%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
.dot.is-stale { background: var(--brand-lift); animation-duration: 1.4s; }
.dot.is-off { background: var(--faint); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--win) 55%, transparent); }
  70%  { box-shadow: 0 0 0 .5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero__title {
  display: grid;
  font-variation-settings: 'wdth' 112;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.035em;
  line-height: .86;
  /* "GELDERN" is the widest word — sized so it always fits a 360px screen. */
  font-size: clamp(2.75rem, 13.6vw, 4.75rem);
}
.hero__title span:last-child {
  background: linear-gradient(100deg, var(--brand-lift), var(--brand) 55%, var(--brand-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub { font-size: .875rem; color: var(--muted); }

.hero__ticker {
  margin-top: .375rem;
  margin-bottom: .5rem;
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--faint);
  min-height: 1.25rem;
}

.scrollcue {
  position: absolute; left: 50%; bottom: .875rem; translate: -50% 0;
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  color: var(--faint);
  animation: bob 2.6s var(--ease) infinite;
}
.scrollcue svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bob { 0%,100% { translate: -50% 0; } 50% { translate: -50% .3rem; } }

/* ── Cards ────────────────────────────────────────────────────────────── */

.card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-md);
  padding: 1.125rem;
  overflow: hidden;
}
[data-theme="light"] .card { background: var(--surface); }

/* Next match — the centrepiece */
.card--next {
  padding: 1.25rem 1.125rem 1.375rem;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--brand) 13%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--glow), var(--shadow-lg);
}
.card--next.is-soon { animation: breathe 3.6s var(--ease) infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: var(--glow), var(--shadow-lg); }
  50% { box-shadow: 0 0 0 1px rgba(245,128,43,.5), 0 18px 54px -14px rgba(245,128,43,.55), var(--shadow-lg); }
}

.card__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1rem;
}

.tag {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .3125rem .625rem;
  border-radius: 999px;
  font-size: .625rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag--brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; box-shadow: none;
}
.tag--home { color: var(--brand-lift); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.tag--win  { color: var(--win);  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 45%, transparent); }
.tag--loss { color: var(--loss); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 40%, transparent); }
.tag--live {
  background: var(--loss); color: #fff; box-shadow: none;
  animation: pulse-live 1.6s ease-in-out infinite;
}
@keyframes pulse-live { 50% { opacity: .62; } }

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .375rem;
  margin-bottom: 1.25rem;
}
.cd {
  display: grid; justify-items: center; gap: .25rem;
  padding: .625rem .25rem .5rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-veil) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="light"] .cd { background: color-mix(in srgb, var(--brand) 6%, #fff); }
.cd__v {
  font-variation-settings: 'wdth' 112;
  font-weight: 900;
  font-size: clamp(1.5rem, 8vw, 2rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.cd--tick .cd__v { animation: roll .42s var(--ease); }
@keyframes roll {
  0%   { translate: 0 55%; opacity: 0; }
  55%  { opacity: 1; }
  100% { translate: 0 0; opacity: 1; }
}
.cd__l {
  font-size: .5625rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}

/* Matchup */
.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: .625rem;
}
.side { display: grid; justify-items: center; gap: .5rem; text-align: center; min-width: 0; }
.side__name {
  font-size: .8125rem; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.side__role { font-size: .625rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.side.is-us .side__name { color: var(--brand-lift); }

.crest {
  display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--line-hi), var(--shadow-sm);
  overflow: hidden;
  flex: none;
}
.crest img { width: 78%; height: 78%; object-fit: contain; }
.crest--sm { width: 2.125rem; height: 2.125rem; }
.crest--xs { width: 1.625rem; height: 1.625rem; }
.crest--lg { width: 4.25rem; height: 4.25rem; }
.side.is-us .crest { box-shadow: 0 0 0 2px var(--brand), 0 0 18px -4px var(--brand); }

.crest__mono {
  font-size: .6875rem; font-weight: 900; letter-spacing: -.02em;
  color: #1a1a1f;
}

.versus {
  align-self: center;
  font-variation-settings: 'wdth' 118;
  font-weight: 900; font-size: 1rem;
  color: var(--faint);
  letter-spacing: -.02em;
}

.card__foot {
  margin-top: 1.125rem; padding-top: .875rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem;
  font-size: .8125rem; color: var(--muted);
}
.card__foot .meta { display: inline-flex; align-items: center; gap: .375rem; }
.card__foot svg { width: .9375rem; height: .9375rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Last result */
.card--last {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.card--last::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--neutral));
}
.score {
  display: flex; align-items: baseline; gap: .3125rem;
  font-variation-settings: 'wdth' 112;
  font-weight: 900; font-size: 1.75rem; line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.score__sep { color: var(--faint); font-size: 1.125rem; }
.score__n.is-lo { color: var(--faint); }

/* ── Stat tiles ───────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tile {
  padding: .875rem .625rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  display: grid; gap: .1875rem;
}
.tile__v {
  font-variation-settings: 'wdth' 112;
  font-weight: 900; font-size: clamp(1.375rem, 7vw, 1.75rem);
  line-height: 1; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.tile__v sup { font-size: .5em; font-weight: 800; vertical-align: super; margin-left: .05em; }
.tile__l { font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tile--brand .tile__v { color: var(--brand-lift); }
.tile--win .tile__v { color: var(--win); }
.tile--loss .tile__v { color: var(--loss); }

/* ── Segmented control ────────────────────────────────────────────────── */

.segmented {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .25rem; padding: .25rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 1rem;
}
.segmented__btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .4375rem;
  padding: .5625rem .5rem;
  border-radius: 999px;
  font-size: .8125rem; font-weight: 700;
  color: var(--muted);
  transition: color .25s var(--ease);
  white-space: nowrap;
}
.segmented__btn img { border-radius: 50%; background: var(--chip); padding: 1px; flex: none; }
.segmented__btn.is-active { color: var(--text); }
.segmented__pill {
  position: absolute; z-index: 0;
  top: .25rem; bottom: .25rem; left: .25rem;
  width: calc(50% - .375rem);
  border-radius: 999px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line-hi), var(--shadow-sm);
  transition: translate .38s var(--spring);
}
[data-theme="light"] .segmented__pill { background: color-mix(in srgb, var(--brand) 10%, #fff); }
.segmented[data-active="day"] .segmented__pill { translate: calc(100% + .25rem) 0; }

/* ── Matchday stepper ─────────────────────────────────────────────────── */

.daynav[hidden] { display: none; }
.daynav {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: 1rem;
  padding: .375rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.daynav__btn {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 10px;
  color: var(--muted);
  transition: color .2s, background .2s, scale .18s var(--spring);
}
.daynav__btn:hover:not(:disabled) { color: var(--text); background: var(--surface-hi); }
.daynav__btn:active:not(:disabled) { scale: .88; }
.daynav__btn:disabled { opacity: .28; cursor: default; }
.daynav__btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.daynav__label { text-align: center; line-height: 1.2; }
.daynav__label strong { display: block; font-size: .875rem; font-weight: 800; }
.daynav__label small { font-size: .6875rem; color: var(--faint); }

/* ── Match list ───────────────────────────────────────────────────────── */

.matchlist { display: grid; gap: .5rem; }

.daygroup { display: grid; gap: .5rem; }
.daygroup__head {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .75rem .25rem .125rem;
  font-size: .6875rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}
.daygroup__head::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}

.match {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: center;
  gap: .625rem;
  padding: .75rem .875rem .75rem .75rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s var(--ease), scale .18s var(--spring);
}
.match:active { scale: .985; }
.match.is-ours {
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--brand) 11%, transparent), transparent 62%),
    var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 32%, transparent);
}
.match.is-ours::before {
  content: ''; position: absolute; inset: .625rem auto .625rem 0;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--brand-lift), var(--brand-deep));
}

.match__time {
  display: grid; gap: .0625rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
.match__time b { font-size: .8125rem; font-weight: 800; letter-spacing: -.01em; }
.match__time span { font-size: .5625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

.match__teams { display: grid; gap: .375rem; min-width: 0; }
.match__row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.match__name {
  font-size: .8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match__row.is-us .match__name { font-weight: 800; }
.match__row.is-lo .match__name, .match__row.is-lo .match__pts { color: var(--faint); }
.match__pts {
  margin-left: auto; padding-left: .5rem;
  font-size: .9375rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.match__row.is-hi .match__pts { color: var(--text); }

.match__end { display: grid; justify-items: end; gap: .25rem; }
.match__badge {
  font-size: .5625rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  padding: .1875rem .4375rem; border-radius: 6px;
  background: var(--surface-hi); color: var(--faint);
}
.match__badge.is-win  { color: var(--win);  background: color-mix(in srgb, var(--win) 14%, transparent); }
.match__badge.is-loss { color: var(--loss); background: color-mix(in srgb, var(--loss) 14%, transparent); }
.match__badge.is-next { color: var(--brand-lift); background: color-mix(in srgb, var(--brand) 16%, transparent); }

.empty {
  padding: 2.25rem 1rem; text-align: center;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--faint); font-size: .875rem;
}
.empty b { display: block; color: var(--muted); font-size: 1rem; margin-bottom: .25rem; }

.more {
  margin-top: .25rem; padding: .75rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .8125rem; font-weight: 700; color: var(--muted);
  text-align: center;
  transition: color .2s, background .2s;
}
.more:hover { color: var(--text); background: var(--surface-hi); }

/* ── Table ────────────────────────────────────────────────────────────── */

.table {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-md);
  overflow: hidden;
}

.table__head, .row__main {
  display: grid;
  /* Phones drop the "Sp" column — it is just wins + losses — so full club
     names fit without truncating. It returns from 560px up. */
  grid-template-columns: 1.625rem minmax(0, 1fr) 2.375rem 2.75rem 2.125rem;
  align-items: center;
  gap: .375rem;
}
.c-games { display: none; }
.table__head {
  padding: .625rem .875rem;
  border-bottom: 1px solid var(--line);
  font-size: .5625rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint);
}
.table__head .c-num, .row__main .c-num { text-align: right; font-variant-numeric: tabular-nums; }
.table__head .c-pts { color: var(--brand-lift); }

.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }

.row__main {
  width: 100%;
  padding: .625rem .875rem;
  text-align: left;
  transition: background .2s var(--ease);
}
.row__main:hover { background: var(--surface-hi); }
.row.is-us {
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%);
  box-shadow: inset 3px 0 0 var(--brand);
}

.c-rank {
  display: grid; place-items: center;
  width: 1.625rem; height: 1.625rem; border-radius: 8px;
  font-size: .75rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--surface-hi);
  color: var(--muted);
}
.row.is-podium .c-rank { color: var(--brand-lift); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.row.is-us .c-rank { background: var(--brand); color: var(--brand-ink); }

.c-team { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.c-team .name {
  font-size: .8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row.is-us .c-team .name { font-weight: 800; }

.c-num { font-size: .75rem; color: var(--muted); font-weight: 600; }
.c-pts { font-size: .875rem; font-weight: 800; color: var(--text); }
.c-diff.is-pos { color: var(--win); }
.c-diff.is-neg { color: var(--loss); }

.row__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s var(--ease);
}
.row.is-open .row__detail { grid-template-rows: 1fr; }
.row__detail > div { overflow: hidden; }
.row__inner {
  display: grid; gap: .625rem;
  padding: .125rem .875rem .875rem 3.125rem;
}
.row__fullname { font-size: .75rem; color: var(--muted); }
.row__facts { display: flex; flex-wrap: wrap; gap: .375rem; }
.fact {
  padding: .3125rem .5rem; border-radius: 8px;
  background: var(--surface-hi);
  font-size: .6875rem; color: var(--muted);
}
.fact b { color: var(--text); font-variant-numeric: tabular-nums; }

.form { display: flex; align-items: center; gap: .3125rem; }
.form__l { font-size: .625rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-right: .125rem; }
.lg, .form i {
  width: .5rem; height: .5rem; border-radius: 50%;
  display: inline-block; flex: none;
  background: var(--line-hi);
}
.lg--win, .form i.w { background: var(--win); }
.lg--loss, .form i.l { background: var(--loss); }
.lg--none { background: var(--line-hi); }

.table__legend {
  display: flex; flex-wrap: wrap; gap: .875rem;
  margin-top: .75rem; padding-inline: .25rem;
  font-size: .6875rem; color: var(--faint);
}
.table__legend span { display: inline-flex; align-items: center; gap: .375rem; }

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  position: relative; z-index: 1;
  width: min(100% - calc(var(--pad) * 2), var(--col));
  margin: clamp(1.5rem, 5vw, 2.5rem) auto 0;
  padding: clamp(2rem, 7vw, 2.75rem) 0 clamp(2.5rem, 8vw, 3.5rem);
  border-top: 1px solid var(--line);
  text-align: center;
  display: grid; gap: .5rem; justify-items: center;
}
.footer__crest {
  display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--chip); box-shadow: 0 0 0 1px var(--line);
  overflow: hidden; margin-bottom: .25rem;
}
.footer__crest img { width: 80%; height: 80%; object-fit: contain; }
.footer__claim { font-size: .875rem; font-weight: 700; }
.footer__src, .footer__stamp { font-size: .75rem; color: var(--faint); max-width: 30ch; }
.footer__src a { color: var(--muted); text-underline-offset: 3px; }
.footer__src a:hover { color: var(--brand-lift); }

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; z-index: 150;
  left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom));
  translate: -50% 1.5rem;
  padding: .625rem 1rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-veil) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--line-hi), var(--shadow-lg);
  font-size: .8125rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), translate .4s var(--spring);
  max-width: calc(100vw - 2rem);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ── Pull to refresh ──────────────────────────────────────────────────── */

.ptr {
  position: fixed; z-index: 90;
  left: 50%; top: calc(.5rem + env(safe-area-inset-top));
  translate: -50% -140%;
  opacity: 0;
  display: grid; place-items: center;
}
.ptr__ball {
  position: relative;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: linear-gradient(150deg, var(--brand-lift), var(--brand-deep));
  box-shadow: var(--shadow-md);
}
.ptr__seam, .ptr__ball::before, .ptr__ball::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.34);
}
.ptr__ball::before { inset: 0 45%; border-radius: 50%; border-width: 0 1.5px; }
.ptr__ball::after  { inset: 45% 0; border-radius: 50%; border-width: 1.5px 0; }
.ptr.is-armed .ptr__ball { animation: spin .7s linear infinite; }

/* ── Skeletons ────────────────────────────────────────────────────────── */

.skel {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skel--line { height: .75rem; }
.skel--block { border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { box-shadow: inset 0 0 0 1px var(--line); }

/* ── Reveal on scroll ─────────────────────────────────────────────────── */

.reveal { opacity: 0; translate: 0 1rem; }
.reveal.is-in {
  opacity: 1; translate: 0 0;
  transition: opacity .55s var(--ease), translate .55s var(--ease);
  transition-delay: var(--d, 0ms);
}

/* ── Wider screens ────────────────────────────────────────────────────── */

@media (min-width: 560px) {
  .countdown { gap: .5rem; }
  .crest { width: 4rem; height: 4rem; }
  .side__name { font-size: .875rem; }
  .match { grid-template-columns: 3.25rem 1fr auto; padding-inline: 1rem .875rem; }
  .c-games { display: block; }
  .table__head, .row__main { grid-template-columns: 1.75rem minmax(0,1fr) 2.25rem 3rem 3.25rem 2.75rem; padding-inline: 1.125rem; }
  .row__inner { padding-left: 3.75rem; }
}

/* Keep the bar's own background full-bleed, but line its contents up with
   the content column instead of the window edge. */
@media (min-width: 680px) {
  .topbar { padding-inline: max(var(--pad), calc((100vw - var(--col)) / 2)); }
}

@media (min-width: 900px) {
  :root { --col: 640px; }
  .hero { padding-block: 4.5rem 5rem; }
}

/* ── Choreography ─────────────────────────────────────────────────────────
   View Transitions animate the match list when the visitor switches views or
   pages through matchdays. Browsers without the API simply swap, as before.
   ────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  #matchSlot { view-transition-name: matchlist; }
  #dayLabel  { view-transition-name: daylabel; }
}

::view-transition-group(matchlist),
::view-transition-group(daylabel) { animation-duration: .36s; }

::view-transition-old(matchlist), ::view-transition-new(matchlist),
::view-transition-old(daylabel),  ::view-transition-new(daylabel) {
  animation-duration: .36s;
  animation-timing-function: var(--ease);
  animation-fill-mode: both;
  /* Keep the snapshots from stretching when the two lists differ in height. */
  height: 100%;
  object-fit: none;
  object-position: top center;
}

:root[data-vt="fade"]::view-transition-old(matchlist) { animation-name: vt-fade-out; }
:root[data-vt="fade"]::view-transition-new(matchlist) { animation-name: vt-fade-in; }

:root[data-vt="next"]::view-transition-old(matchlist),
:root[data-vt="next"]::view-transition-old(daylabel)  { animation-name: vt-exit-left; }
:root[data-vt="next"]::view-transition-new(matchlist),
:root[data-vt="next"]::view-transition-new(daylabel)  { animation-name: vt-enter-right; }

:root[data-vt="prev"]::view-transition-old(matchlist),
:root[data-vt="prev"]::view-transition-old(daylabel)  { animation-name: vt-exit-right; }
:root[data-vt="prev"]::view-transition-new(matchlist),
:root[data-vt="prev"]::view-transition-new(daylabel)  { animation-name: vt-enter-left; }

@keyframes vt-fade-out    { to   { opacity: 0; scale: .99; } }
@keyframes vt-fade-in     { from { opacity: 0; scale: .99; } }
@keyframes vt-exit-left   { to   { opacity: 0; translate: -14% 0; } }
@keyframes vt-enter-right { from { opacity: 0; translate:  14% 0; } }
@keyframes vt-exit-right  { to   { opacity: 0; translate:  14% 0; } }
@keyframes vt-enter-left  { from { opacity: 0; translate: -14% 0; } }

/* Rows arrive in sequence. The class is only applied on a plain render —
   during a View Transition the swap already carries the motion. */
.is-in-row {
  animation: row-in .44s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes row-in { from { opacity: 0; translate: 0 .625rem; } }

/* ── Scroll progress ──────────────────────────────────────────────────── */

.topbar::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; transform-origin: left center;
  scale: var(--progress, 0) 1;
  background: linear-gradient(90deg, var(--brand-lift), var(--brand));
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.topbar.is-stuck::after { opacity: 1; }

.hero__court { transition: translate .1s linear; will-change: translate; }

/* ── Club colour ──────────────────────────────────────────────────────── */

.crest { --club: transparent; }

/* The opponent's crest is ringed in their own colours; ours keeps the brand
   glow set further up. */
.card--next .side:not(.is-us) .crest,
.card--last .crest {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--club) 60%, transparent),
    0 0 0 3px color-mix(in srgb, var(--club) 16%, transparent),
    var(--shadow-sm);
}

/* The two crests breathe gently, out of step with each other. */
@media (prefers-reduced-motion: no-preference) {
  .card--next .matchup > .side:first-child .crest { animation: hover-a 5.5s var(--ease) infinite; }
  .card--next .matchup > .side:last-child  .crest { animation: hover-b 5.5s var(--ease) infinite; }
}
@keyframes hover-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.25rem; } }
@keyframes hover-b { 0%, 100% { translate: 0 -.25rem; } 50% { translate: 0 0; } }

/* Final hour before tip-off. */
.card--next.is-imminent { animation-duration: 1.8s; }
.card--next.is-imminent .cd__v { color: var(--brand-lift); }

/* ── Crest easter egg ─────────────────────────────────────────────────── */

.brand__crest.is-spin img { animation: crest-spin .85s var(--spring); }
@keyframes crest-spin { from { rotate: 0deg; } to { rotate: 360deg; } }

/* ── Kickoff hint on upcoming matches ─────────────────────────────────── */

.match__when {
  font-size: .625rem;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Form dots pop in when a table row opens ──────────────────────────── */

.row.is-open .form i {
  animation: dot-in .34s var(--spring) backwards;
  animation-delay: calc(140ms + var(--i, 0) * 55ms);
}
@keyframes dot-in { from { scale: 0; opacity: 0; } }

.row__main { transition: background .2s var(--ease), scale .18s var(--spring); }
.row__main:active { scale: .995; }

/* ── Win confetti ─────────────────────────────────────────────────────── */

.confetti {
  position: fixed;
  z-index: 120;
  width: 0; height: 0;
  pointer-events: none;
}
.confetti i {
  position: absolute; top: 0; left: 0;
  width: .4375rem; height: .625rem; border-radius: 2px;
  opacity: 0;
  animation: confetti 1.6s var(--ease) var(--d, 0s) forwards;
}
@keyframes confetti {
  0%   { opacity: 1; translate: 0 0; rotate: 0deg; scale: .4; }
  28%  { opacity: 1; translate: calc(var(--x) * 5.5rem) calc(var(--y) * -3.4rem); scale: var(--s, 1); }
  100% { opacity: 0; translate: calc(var(--x) * 12rem) calc(var(--y) * 9rem); rotate: var(--r); scale: var(--s, 1); }
}

/* ── Opening sequence ─────────────────────────────────────────────────────
   The page arrives rather than appears: the court draws itself, the wordmark
   wipes up line by line, the rest settles behind it. Under half a second in
   total, and it never repeats.
   ────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .hero__court path, .hero__court circle {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 2s var(--ease) both;
  }
  .hero__court :nth-child(1) { animation-delay: .15s; }
  .hero__court :nth-child(2) { animation-delay: .35s; }
  .hero__court :nth-child(3) { animation-delay: .5s; }
  .hero__court :nth-child(4) { animation-delay: .62s; }

  .hero__glow            { animation: glow-in 1.6s var(--ease) both; }
  .hero__eyebrow         { animation: settle .7s var(--ease) .06s both; }
  .hero__title span      { animation: wipe-up .85s var(--ease) both; }
  .hero__title span:nth-child(1) { animation-delay: .16s; }
  .hero__title span:nth-child(2) { animation-delay: .28s; }
  .hero__sub             { animation: settle .7s var(--ease) .5s both; }
  .hero__ticker          { animation: settle .7s var(--ease) .6s both; }
  .scrollcue             { opacity: 0; animation: bob 2.6s var(--ease) infinite, cue-in .5s var(--ease) .95s forwards; }
  #nextSlot              { animation: settle .8s var(--ease) .42s both; }
}

@keyframes draw    { to { stroke-dashoffset: 0; } }
@keyframes glow-in { from { opacity: 0; scale: .7; } }
@keyframes settle  { from { opacity: 0; translate: 0 .875rem; } }
@keyframes cue-in  { to { opacity: 1; } }
@keyframes wipe-up {
  from { clip-path: inset(0 0 112% 0); translate: 0 .18em; }
  to   { clip-path: inset(0 0 -18% 0); translate: 0 0; }
}

/* ── Scroll-driven reveals ────────────────────────────────────────────────
   Where the browser supports it, sections rise in step with the scrollbar
   instead of being flipped on by an observer. The JS observer stands down.
   ────────────────────────────────────────────────────────────────────── */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 1;
      translate: none;
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 2% cover 26%;
    }
    /* The hero card has its own entrance; it must not also ride the scroll. */
    #nextSlot .reveal { animation: none; }

    .tiles > .tile {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 30%;
    }
    .tiles > .tile:nth-child(2) { animation-range: entry 0% cover 32%; }
    .tiles > .tile:nth-child(3) { animation-range: entry -4% cover 34%; }
  }
}

@keyframes rise { from { opacity: 0; translate: 0 1.5rem; scale: .985; } }

/* ── A slow sheen across the next match ───────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .card--next::after {
    content: '';
    position: absolute; inset: -50% -70%;
    pointer-events: none;
    background: linear-gradient(
      104deg,
      transparent 44%,
      color-mix(in srgb, var(--brand-lift) 16%, transparent) 50%,
      transparent 56%);
    animation: sheen 9s var(--ease) 2.4s infinite;
  }
}
@keyframes sheen {
  0%       { translate: -60% 0; opacity: 0; }
  6%, 16%  { opacity: 1; }
  22%, 100% { translate: 60% 0; opacity: 0; }
}

/* ── Pointer tilt ─────────────────────────────────────────────────────── */

.card--next {
  transform: perspective(900px)
             rotateX(var(--tilt-x, 0deg))
             rotateY(var(--tilt-y, 0deg));
  transition: transform .55s var(--ease);
}
.card--next.is-tilting { transition: transform .1s linear; }

/* ── Baskets, drawn to scale ──────────────────────────────────────────── */

.bars { display: grid; gap: .375rem; }
.bar {
  display: grid;
  grid-template-columns: 3.25rem 1fr 2.25rem;
  align-items: center;
  gap: .5rem;
}
.bar__l { font-size: .625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.bar__track {
  height: .4375rem;
  border-radius: 999px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.bar__fill {
  display: block; height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  scale: 0 1;
}
.bar__fill.is-for     { background: linear-gradient(90deg, var(--brand), var(--brand-lift)); }
.bar__fill.is-against { background: color-mix(in srgb, var(--loss) 62%, transparent); }
.bar__v { font-size: .6875rem; font-weight: 700; text-align: right; color: var(--muted); }

.row.is-open .bar__fill { animation: bar-grow .75s var(--ease) .16s forwards; }
@keyframes bar-grow { to { scale: var(--w, 0) 1; } }

/* ── Motion & contrast preferences ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; translate: none; }
  .skel { animation: none; }
  .is-in-row { animation: none; }
  .hero__court { translate: none !important; }
  .topbar::after { display: none; }
  .hero__court path, .hero__court circle { stroke-dasharray: none; stroke-dashoffset: 0; }
  .hero__title span { clip-path: none; }
  .scrollcue { opacity: 1; }
  .card--next { transform: none; }
  .bar__fill { scale: var(--w, 0) 1; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(255,255,255,.22); --muted: #C3C3CE; --faint: #9A9AA8; }
  [data-theme="light"] { --line: rgba(16,16,22,.24); --muted: #3B3B48; --faint: #55555F; }
}

@media print {
  .topbar, .scrollcue, .ptr, .toast, .segmented, .daynav, .hero__glow { display: none !important; }
  body { background: #fff; color: #000; }
}
