/* ============================================================================
   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);
}

/* ── Typeface ─────────────────────────────────────────────────────────────
   Archivo, served from here rather than from Google Fonts: loading it from
   there would tell Google the address of everyone who opens the page.
   One variable file per alphabet covers every weight and width used.
   ────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url(assets/fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url(assets/fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

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

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

/* Take away double-tap-to-zoom, which fires by accident when someone taps two
   match rows in quick succession. "manipulation" removes exactly that gesture
   and the old 300 ms tap delay with it — panning and pinch-to-zoom stay, so
   anyone who needs to magnify the page still can. */
html, body { touch-action: manipulation; }

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;
  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, a, summary, [role="button"] { touch-action: manipulation; }
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); }

/* The table continues what the season tiles begin — rank, record, baskets —
   so the two sit closer together than two unrelated sections would. */
#bilanz { padding-bottom: 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: border-color .3s var(--ease);
}

/* The frosted panel is a layer of its own, sitting behind the bar's contents.
   Put the backdrop-filter on the bar itself and iOS re-rasterises the whole
   element — including the crest and the wordmark, which then render soft. */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.topbar.is-stuck::before { opacity: 1; }
.topbar.is-stuck { 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; }

@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;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  transition: background .2s var(--ease), box-shadow .25s var(--ease);
}

.match__main, .row__main {
  touch-action: manipulation;
}

.match__main {
  position: relative;      /* the chevron centres on the row, not the open card */
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: center;
  gap: .625rem;
  width: 100%;
  padding: .75rem .875rem .75rem .75rem;
  text-align: left;
  transition: scale .18s var(--spring);
}
.match__main.is-tappable { cursor: pointer; padding-right: 2.125rem; }
.match__main.is-tappable:active { scale: .985; }

/* The chevron is the only hint that a row has more to show. */
.match__chev {
  position: absolute; right: .625rem; top: 50%;
  translate: 0 -50%;
  display: grid; place-items: center;
  width: 1.125rem; height: 1.125rem;
  color: var(--faint);
  transition: rotate .32s var(--spring), color .2s;
}
.match__chev svg { width: 100%; height: 100%; }
.match.is-open .match__chev { rotate: 180deg; color: var(--brand-lift); }
.match__main.is-tappable:hover .match__chev { color: var(--muted); }

.match__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .36s var(--ease);
}
.match.is-open .match__detail { grid-template-rows: 1fr; }
.match__detail > div { overflow: hidden; }
.match.is-open { box-shadow: inset 0 0 0 1px var(--line-hi); }
.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));
  z-index: 1;
}
.match.is-ours.is-open::before { inset: .625rem auto .5rem 0; }

.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__teams:has(.place) { gap: .5rem; }
.match__name {
  display: grid;
  min-width: 0;
  font-size: .8125rem; font-weight: 600;
  line-height: 1.2;
}
.match__name .name__main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match__name .place { margin-left: 0; font-size: .6875rem; line-height: 1.15; }
.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; }
/* The standings column is the narrowest place a team name appears, so the
   location goes on its own line there rather than being cut off. */
.c-team .name {
  display: grid;
  min-width: 0;
  font-size: .8125rem; font-weight: 600;
  line-height: 1.2;
}
.c-team .name__main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-team .place { margin-left: 0; font-size: .6875rem; line-height: 1.15; }
.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; }

/* ── 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; }
}

/* ── Where the game is played ─────────────────────────────────────────── */

.venue {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: .625rem;
  margin: .125rem .75rem .75rem;
  padding: .75rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-veil) 55%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="light"] .venue { background: color-mix(in srgb, var(--brand) 6%, #fff); }

.venue__pin {
  display: grid; place-items: center;
  width: 1.875rem; height: 1.875rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand-lift);
  flex: none;
}
.venue__pin svg { width: 1.0625rem; height: 1.0625rem; }

.venue__text { display: grid; gap: .1875rem; min-width: 0; }
.venue__text strong {
  font-size: .8125rem; font-weight: 700; line-height: 1.3;
  overflow-wrap: anywhere;
}
.venue__text span { font-size: .75rem; color: var(--muted); line-height: 1.35; }

.venue__route {
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; justify-content: center; gap: .4375rem;
  margin-top: .125rem;
  padding: .5625rem .875rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-lift), var(--brand-deep));
  color: #fff;
  font-size: .8125rem; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 85%, transparent);
  transition: scale .18s var(--spring), box-shadow .25s var(--ease);
}
.venue__route svg { width: .9375rem; height: .9375rem; }
.venue__route:hover { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand) 95%, transparent); }
.venue__route:active { scale: .96; }

/* The venue slides in just behind the row opening, so the two read as one move. */
.match.is-open .venue { animation: venue-in .4s var(--ease) .06s backwards; }
@keyframes venue-in { from { opacity: 0; translate: 0 -.375rem; } }

/* ── "(Moers)" behind a team name ─────────────────────────────────────── */

.place {
  font-style: normal;
  font-weight: 500;
  font-size: .82em;
  color: var(--faint);
  margin-left: .25em;
  white-space: nowrap;
}
.side__name .place { display: block; margin-left: 0; font-size: .75em; }

/* ── Lineup grid ──────────────────────────────────────────────────────────
   On paper the coach's sheet has players across the top. At 375px that leaves
   each name about forty pixels, so the grid is turned here: players down the
   side, the eight quarters across. Same sheet, readable names.
   ────────────────────────────────────────────────────────────────────── */

.card--lineup { padding: .875rem .75rem .75rem; }

.grid {
  display: grid;
  grid-template-columns: minmax(3.5rem, 1fr) repeat(var(--quarters, 8), minmax(1.625rem, 1.9rem)) 1.5rem;
  gap: .1875rem;
  align-items: center;
}

.grid__corner, .grid__q, .grid__sum {
  font-size: .5625rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
  padding-bottom: .1875rem;
}
.grid__q, .grid__sum { text-align: center; }
.grid__sum { color: var(--brand-lift); }
.grid__corner--foot {
  padding-top: .375rem;
  border-top: 1px solid var(--line);
  grid-column: 1;
}

.grid__name { min-width: 0; padding-right: .25rem; }
.grid__nametext {
  display: block;
  font-size: .8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cell {
  position: relative;
  height: 1.75rem;
  border-radius: 7px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .18s var(--ease), box-shadow .18s var(--ease), scale .16s var(--spring);
}
.cell.is-on {
  background: linear-gradient(140deg, var(--brand-lift), var(--brand-deep));
  box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--brand) 80%, transparent);
}
/* A tick, drawn rather than typed, so it stays crisp at this size. */
.cell.is-on::after {
  content: '';
  position: absolute; inset: 0;
  margin: auto;
  width: .4375rem; height: .75rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
  translate: 0 -.0625rem;
}
.grid.is-editable .cell { cursor: pointer; }
.grid.is-editable .cell:active { scale: .88; }
.grid.is-editable .cell:hover:not(.is-on) { background: var(--line-hi); }

.grid__total {
  text-align: center;
  font-size: .75rem; font-weight: 800;
  color: var(--brand-lift);
}

.grid__count {
  text-align: center;
  padding-top: .375rem;
  border-top: 1px solid var(--line);
  font-size: .6875rem; font-weight: 800;
  color: var(--loss);
}
.grid__count.is-ok { color: var(--win); }
.grid__count.is-over { color: var(--brand-lift); }
.grid__sum.num {
  padding-top: .375rem;
  border-top: 1px solid var(--line);
  font-size: .6875rem; font-weight: 800;
}

/* ── The way into a lineup, from inside a match ───────────────────────── */

.detailacts { margin: 0 .75rem .75rem; }
.detailacts__btn {
  width: 100%;
  justify-content: center;
  padding-block: .6875rem;
}
.detailacts__btn svg { width: 1rem; height: 1rem; flex: none; }
.detailacts__n {
  display: inline-grid; place-items: center;
  min-width: 1.25rem; height: 1.25rem;
  padding-inline: .3125rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  color: var(--brand-lift);
  font-size: .6875rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Inside the sheet the card frame would be a frame within a frame. */
.sheet .card--lineup {
  background: none;
  box-shadow: none;
  padding: 0;
}

/* ── Who is in, for everyone else ─────────────────────────────────────── */

.callup__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem; margin-bottom: .625rem;
  font-size: .625rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint);
}
.callup__count { color: var(--brand-lift); }

.callup__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: .375rem;
}
.callup__chip {
  padding: .5625rem .75rem;
  border-radius: 12px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .8125rem; font-weight: 600;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Same treatment inside a match, where the chips carry only a name. */
.recap__list.is-plain { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); }
.recap__chip.is-plain {
  display: block;
  font-size: .75rem; font-weight: 600;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Lineup tools ─────────────────────────────────────────────────────── */

.lineup__tools, .lineup__foot {
  margin-top: .875rem; padding-top: .75rem;
  border-top: 1px solid var(--line);
  display: grid; gap: .625rem;
}
.lineup__foot { font-size: .75rem; color: var(--faint); }
.lineup__note { color: var(--muted); }

.lineup__status { font-size: .75rem; color: var(--muted); }
.lineup__status.is-ok { color: var(--win); }

.lineup__btns { display: flex; flex-wrap: wrap; gap: .375rem; }
.lineup__btns .btn { flex: 1 1 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .625rem .875rem;
  border-radius: 999px;
  font-size: .8125rem; font-weight: 700;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s, scale .16s var(--spring), opacity .2s;
}
.btn:active { scale: .96; }
.btn--ghost {
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}
.btn--ghost:hover { color: var(--text); }
.btn--brand {
  background: linear-gradient(135deg, var(--brand-lift), var(--brand-deep));
  color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 85%, transparent);
}
.btn:disabled { opacity: .45; cursor: default; scale: 1; box-shadow: none; }
.btn--brand.is-dirty { animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 92%, 100% { scale: 1; } 96% { scale: 1.035; } }

/* ── Past lineup, inside a match ──────────────────────────────────────── */

.recap { margin: 0 .75rem .75rem; }
.recap__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem; margin-bottom: .5rem;
  font-size: .625rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint);
}
/* Equal columns rather than content-width pills: six names of different
   lengths otherwise leave a ragged edge down the middle of the card. */
.recap__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: .3125rem;
}
.recap__chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .0625rem .375rem;
  padding: .4375rem .5625rem;
  border-radius: 10px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .6875rem;
}
.recap__chip b {
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recap__chip i { font-style: normal; font-weight: 800; color: var(--brand-lift); }
.recap__q {
  grid-column: 1 / -1;          /* the quarters get their own line */
  color: var(--faint); font-size: .625rem;
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recap__note { margin-top: .5rem; font-size: .75rem; color: var(--muted); }

/* ── Sheets (login, squad) ────────────────────────────────────────────── */

/* The lineup grid needs more room than a login form. Two classes, so it wins
   over the base .sheet width declared below it. */
.sheet.sheet--wide { width: min(100% - 1.5rem, 30rem); }

.sheet {
  /* The global "* { margin: 0 }" reset strips the margin:auto a modal dialog
     relies on to sit in the middle — without this every sheet pins itself to
     the top-left corner. */
  position: fixed;
  /* Centred in what the keyboard leaves visible, not in the whole screen —
     the two values come from initKeyboardRoom() and are zero without one. */
  inset: var(--view-top, 0px) 0 var(--keyboard, 0px) 0;
  margin: auto;
  height: fit-content;
  width: min(100% - 2rem, 26rem);
  max-height: min(84dvh, 40rem, 100dvh - var(--keyboard, 0px) - 1rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--bg-veil);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-hi), var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
/* While a sheet is open the page behind it stays put. Scrolling it would move
   the browser's toolbars, the viewport would change height, and the sheet —
   which is sized by that height — would twitch. The gutter is kept so the page
   does not shift sideways when the scrollbar goes. */
html { scrollbar-gutter: stable; }
html:has(dialog[open]), html:has(dialog[open]) body { overflow: hidden; }

.sheet::backdrop {
  background: rgba(4, 4, 8, .62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.sheet[open] { animation: sheet-in .34s var(--ease); }
/* The heading takes the focus when a sheet opens, so that no field does. */
.sheet__title:focus { outline: none; }
@keyframes sheet-in { from { opacity: 0; translate: 0 1.25rem; scale: .97; } }

.sheet__inner {
  display: grid; gap: .875rem;
  padding: 1.25rem 1.125rem calc(1.125rem + env(safe-area-inset-bottom));
}
.sheet__title {
  font-size: 1.25rem; font-weight: 800;
  font-variation-settings: 'wdth' 110;
  letter-spacing: -.015em;
}
.sheet__lead { margin-top: -.5rem; font-size: .8125rem; color: var(--faint); }
.sheet__error {
  padding: .625rem .75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--loss) 14%, transparent);
  color: var(--loss);
  font-size: .8125rem;
}
.sheet__actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .25rem; }
.sheet__actions .btn { flex: 1 1 auto; }

.field { display: grid; gap: .3125rem; }
.field > span {
  font-size: .6875rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
}
.field > span i { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.field input {
  width: 100%;
  padding: .6875rem .75rem;
  border: 0; border-radius: 12px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit; font-size: 1rem;      /* 16px keeps iOS from zooming the field */
  transition: box-shadow .2s var(--ease);
}
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }

/* ── Squad list ───────────────────────────────────────────────────────── */

.squadadd { display: grid; gap: .625rem; }
.squadlist { display: grid; gap: .375rem; max-height: 17rem; overflow: auto; }
.squadlist__empty { font-size: .8125rem; color: var(--faint); text-align: center; padding: 1rem; }

.squadrow {
  display: flex; align-items: center; gap: .625rem;
  padding: .5625rem .75rem;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.squadrow.is-archived { opacity: .55; }
.squadrow__text { display: grid; gap: .0625rem; min-width: 0; flex: 1; }
.squadrow__text strong { font-size: .8125rem; font-weight: 700; }
.squadrow__text span { font-size: .6875rem; color: var(--faint); }
.squadrow__act {
  flex: none;
  padding: .3125rem .5625rem;
  border-radius: 8px;
  background: var(--surface-hi);
  font-size: .6875rem; font-weight: 700;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.squadrow__act:hover { color: var(--text); }
.squadrow__act.is-danger:hover { color: var(--loss); background: color-mix(in srgb, var(--loss) 14%, transparent); }

/* ── Changing the password ────────────────────────────────────────────── */

.pwform__ok {
  padding: .5rem .75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--win) 14%, transparent);
  color: var(--win);
  font-size: .8125rem;
}

/* ── Coach entrance ───────────────────────────────────────────────────── */

/* The footer ends in two rows. First the plain links everyone gets —
   settings and the legal notices — then, only for whoever is signed in, a
   framed strip with their tools. Keeping them apart is the point: a visitor
   never has to read past coaching buttons to find the imprint. */
.footer__links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .125rem .25rem;
  margin-top: .875rem;
}
.footer__link {
  padding: .375rem .5rem;
  font-size: .75rem; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.footer__link:hover { color: var(--text); background: var(--surface); }
.footer__link[hidden] { display: none; }

.footer__team {
  display: grid; gap: .5rem; justify-items: center;
  width: 100%;
  margin-top: .875rem; padding: .875rem .75rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 28%, transparent);
}
.footer__team[hidden] { display: none; }
.footer__who {
  font-size: .625rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand-lift);
}
.footer__tools { display: flex; flex-wrap: wrap; gap: .375rem; justify-content: center; }
.footer__login {
  padding: .4375rem .875rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .6875rem; font-weight: 700;
  color: var(--faint);
  transition: color .2s, background .2s;
}
.footer__login:hover { color: var(--muted); background: var(--surface-hi); }
.footer__login:disabled { opacity: .6; cursor: default; }

/* A quiet marker that the page is in coaching mode. */
.is-coach .card--lineup { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 32%, transparent), var(--shadow-md); }

/* ── 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; } }

/* ── Game day ─────────────────────────────────────────────────────────────
   The card at the top follows a game through its day: countdown, the running
   score, the result. Everything below belongs to the hours in between.
   ────────────────────────────────────────────────────────────────────── */

.tag__dot {
  width: .375rem; height: .375rem; border-radius: 50%;
  background: currentColor;
}

/* The headline where the countdown was: "Spiel läuft", "Sieg!", … */
.phase {
  margin: .25rem 0 1.25rem;
  text-align: center;
  font-variation-settings: 'wdth' 114;
  font-weight: 900;
  font-size: clamp(1.5rem, 7.5vw, 2rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.phase.is-win  { color: var(--win); }
.phase.is-loss { color: var(--loss); }
.phase--live {
  color: var(--brand-lift);
  animation: pulse-live 1.8s ease-in-out infinite;
}
.phase__note {
  max-width: 34ch;
  margin: 1rem auto 0;
  text-align: center;
  font-size: .75rem; line-height: 1.45;
  color: var(--faint);
}

.card__score { width: 100%; margin-top: 1rem; padding-block: .75rem; }

.card--next.is-live { animation: live-glow 2.4s var(--ease) infinite; }
@keyframes live-glow {
  0%, 100% { box-shadow: var(--glow), var(--shadow-lg); }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--loss) 62%, transparent),
      0 18px 54px -14px color-mix(in srgb, var(--loss) 58%, transparent),
      var(--shadow-lg);
  }
}

/* The score between the two crests */
.board {
  position: relative;
  align-self: center;
  display: flex; align-items: baseline; gap: .1875rem;
  font-variation-settings: 'wdth' 112;
  font-weight: 900;
  font-size: clamp(2rem, 10.5vw, 2.75rem);
  line-height: 1;
  letter-spacing: -.03em;
}
.board__n { display: inline-block; min-width: 1ch; text-align: center; }
.board__sep { color: var(--faint); font-size: .6em; translate: 0 -.14em; }
.board.home-won .board__n[data-side="away"],
.board.away-won .board__n[data-side="home"] { color: var(--faint); }

/* Two rings leaving the score, out of step — the page's pulse while it counts. */
.board.is-live::before, .board.is-live::after {
  content: '';
  position: absolute; inset: -.875rem -1rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--brand) 60%, transparent);
  pointer-events: none;
  animation: ring 2.4s var(--ease) infinite;
}
.board.is-live::after { animation-delay: 1.2s; }
@keyframes ring {
  from { opacity: .9; scale: .82; }
  to   { opacity: 0;  scale: 1.38; }
}

.board__n.is-roll { animation: roll .42s var(--ease); }
.board__n.is-bump { animation: bump .7s var(--spring); }
@keyframes bump {
  0%   { scale: 1; }
  30%  { scale: 1.5; color: var(--brand-lift); }
  100% { scale: 1; }
}

/* Which quarter */
.periods {
  display: grid; justify-items: center; gap: .5rem;
  margin: .25rem 0 1.25rem;
}
.periods__pips { display: flex; gap: .25rem; }
.periods__pips i {
  width: 1.375rem; height: .3125rem; border-radius: 999px;
  background: var(--line-hi);
}
.periods__pips i.is-half { margin-right: .5rem; }
.periods__pips i.is-done { background: var(--brand); }
.periods__pips i.is-now {
  background: var(--brand-lift);
  animation: pulse-live 1.2s ease-in-out infinite;
}
.periods__label {
  font-size: .8125rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-lift);
}

/* A basketball, wherever one is needed */
.ball {
  position: relative;
  display: block;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: linear-gradient(150deg, var(--brand-lift), var(--brand-deep));
  box-shadow: inset -2px -3px 6px rgba(0, 0, 0, .28);
}
.ball::before, .ball::after {
  content: ''; position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, .36);
}
.ball::before { inset: 0 44%; border-width: 0 1.5px; }
.ball::after  { inset: 44% 0; border-width: 1.5px 0; }

/* Nobody is counting: a ball being dribbled stands in for the score. */
.dribble {
  position: relative;
  align-self: center;
  display: grid; justify-items: center; align-content: start;
  width: 3rem; height: 4.25rem;
}
.dribble .ball { animation: dribble .58s cubic-bezier(.55, 0, .9, .55) infinite alternate; }
.dribble__shadow {
  position: absolute; bottom: 0;
  width: 1.5rem; height: .3125rem; border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  animation: dribble-shadow .58s cubic-bezier(.55, 0, .9, .55) infinite alternate;
}
[data-theme="light"] .dribble__shadow { background: rgba(16, 16, 22, .28); }
@keyframes dribble {
  0%   { translate: 0 0; scale: 1 1; }
  88%  { scale: 1 1; }
  100% { translate: 0 2.25rem; scale: 1.14 .86; }
}
@keyframes dribble-shadow {
  from { scale: .45; opacity: .25; }
  to   { scale: 1;   opacity: .8; }
}

/* ── One of ours goes in ──────────────────────────────────────────────────
   The ball travels sideways at a steady pace and up and down on its own
   curve; the two together make the arc. It reaches the rim at .76s, which is
   when the script changes the number.
   ────────────────────────────────────────────────────────────────────── */

.swish {
  position: absolute; inset: 0; z-index: 4;
  pointer-events: none;
  background: radial-gradient(80% 62% at 50% 34%, color-mix(in srgb, var(--bg) 86%, transparent), transparent 78%);
  animation: swish-veil 1.9s var(--ease) both;
}
@keyframes swish-veil {
  0% { opacity: 0; }
  10%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

.swish__hoop {
  position: absolute; left: 50%; top: 2.75rem;
  width: 6rem; translate: -50% 0;
  color: var(--text);
}
.swish__hoop svg { width: 100%; height: auto; overflow: visible; }
.swish__net {
  transform-origin: 48px 48px;
  animation: net .5s .76s var(--spring) both;
}
@keyframes net {
  0%   { transform: none; }
  35%  { transform: scale(.88, 1.24); }
  100% { transform: none; }
}

/* The rim sits 46 of the hoop's 80 units down — 2.875rem at this width. */
.swish__flight {
  position: absolute; left: 50%; top: calc(2.75rem + 2.875rem);
  width: 0; height: 0;
  animation: fly-x .76s linear both;
}
.swish.is-home .swish__flight { --from: -8.5rem; }
.swish.is-away .swish__flight { --from: 8.5rem; }
@keyframes fly-x { from { translate: var(--from) 0; } to { translate: 0 0; } }

.swish__drop {
  position: absolute; left: -.875rem; top: -.875rem;
  animation: fly-y 1.25s both;
}
.swish__drop .ball { animation: spin .8s linear infinite; }
@keyframes fly-y {
  0%   { translate: 0 9rem;     animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  38%  { translate: 0 -4.25rem; animation-timing-function: cubic-bezier(.6, 0, .9, .5); }
  61%  { translate: 0 0;        animation-timing-function: linear; }
  84%  { translate: 0 2.125rem; opacity: 1; }
  100% { translate: 0 3.25rem;  opacity: 0; }
}

.swish__pts {
  position: absolute; left: calc(50% + 3.25rem); top: 3.5rem;
  font-variation-settings: 'wdth' 114;
  font-weight: 900; font-size: 1.875rem; line-height: 1;
  color: var(--brand-lift);
  text-shadow: 0 2px 14px color-mix(in srgb, var(--brand) 70%, transparent);
  animation: pts 1.1s .76s var(--spring) both;
}
.swish__pts.is-three { font-size: 2.5rem; color: var(--win); text-shadow: 0 2px 16px color-mix(in srgb, var(--win) 60%, transparent); }
@keyframes pts {
  0%   { opacity: 0; scale: .3; translate: 0 .5rem; }
  22%  { opacity: 1; scale: 1.18; translate: 0 0; }
  70%  { opacity: 1; scale: 1; }
  100% { opacity: 0; translate: 0 -1.25rem; }
}

/* Confetti inside the tilted card: pinned to the card, not the viewport. */
.confetti--in { position: absolute; z-index: 5; }

/* A game being played, in the list */
.match__badge.is-live {
  color: #fff; background: var(--loss);
  animation: pulse-live 1.6s ease-in-out infinite;
}
.match.is-counting .match__pts { color: var(--brand-lift); }

/* ── The scorer's counter ─────────────────────────────────────────────────
   Thumb-sized, and nothing on it can be selected or long-pressed: in a loud
   hall the buttons are hit hard and fast.
   ────────────────────────────────────────────────────────────────────── */

.sheet.scorer { width: min(100% - 1rem, 30rem); max-height: calc(96dvh - var(--keyboard, 0px)); }
.scorer .sheet__inner { gap: .75rem; padding: 1rem .875rem calc(1rem + env(safe-area-inset-bottom)); }
.scorer, .scorer * {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

.scorer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.scorer__sync { margin-top: .125rem; font-size: .75rem; font-weight: 700; color: var(--faint); }
.scorer__sync.is-ok      { color: var(--win); }
.scorer__sync.is-waiting { color: var(--brand-lift); }
.scorer__sync.is-error   { color: var(--loss); }

.scorer__state {
  text-align: center;
  font-size: .75rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-lift);
}
.scorer__state.is-over { color: var(--muted); }

.scorer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; }
.scorer__col {
  display: grid; gap: .5rem;
  min-width: 0;
  padding: .75rem .625rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.scorer__col.is-us {
  background:
    linear-gradient(170deg, color-mix(in srgb, var(--brand) 13%, transparent), transparent 60%),
    var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent);
}
.scorer__team {
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  font-size: .8125rem; font-weight: 800;
}
.scorer__team > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer__n {
  text-align: center;
  font-variation-settings: 'wdth' 112;
  font-weight: 900;
  font-size: clamp(2.5rem, 14vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.03em;
}

.scorer__plus {
  height: clamp(3.25rem, 8.5dvh, 4.75rem);
  border-radius: var(--r-md);
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  font-variation-settings: 'wdth' 112;
  font-size: 1.625rem; font-weight: 900;
  transition: scale .12s var(--spring);
}
.scorer__col.is-us .scorer__plus {
  background: linear-gradient(135deg, var(--brand-lift), var(--brand-deep));
  color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 85%, transparent);
}
.scorer__plus:active { scale: .94; }

.scorer__minus { display: grid; grid-template-columns: repeat(3, 1fr); gap: .375rem; }
.scorer__minus button {
  height: 2.5rem;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .9375rem; font-weight: 800;
  color: var(--muted);
}
.scorer__minus button:disabled { opacity: .35; cursor: default; }

.scorer__periods { display: grid; grid-template-columns: repeat(var(--n, 9), 1fr); gap: .25rem; }
.scorer__p {
  height: 2.75rem;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .9375rem; font-weight: 800;
  color: var(--muted);
}
.scorer__p.is-break { font-size: .6875rem; letter-spacing: .04em; }
.scorer__p.is-on { background: var(--brand); color: #fff; box-shadow: none; }

.scorer__acts { display: flex; gap: .5rem; }
.scorer__acts .btn { flex: 1 1 0; padding-block: .75rem; }

.scorer__confirm {
  display: grid; gap: .375rem;
  padding: .875rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent);
  font-size: .8125rem; color: var(--muted);
}
.scorer__confirm strong { font-size: 1rem; color: var(--text); }
.scorer__confirmline { font-weight: 800; color: var(--text); }
.scorer__confirm .scorer__acts { margin-top: .375rem; }

.scorer__start { display: grid; gap: .875rem; padding: 1rem 0 .5rem; text-align: center; }
.scorer__names { font-weight: 800; }
.scorer__go { padding-block: 1.125rem; font-size: 1rem; }
.scorer__hint { font-size: .75rem; line-height: 1.45; color: var(--faint); }

/* ── Legal notice ─────────────────────────────────────────────────────── */

.legal { gap: .5rem; }
.legal h3 {
  margin-top: .5rem;
  font-size: .6875rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
}
.legal p { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.legal a { color: var(--brand-lift); text-underline-offset: 3px; }

/* ── Statistics ───────────────────────────────────────────────────────── */

#statsSlot { display: grid; gap: .75rem; }
/* The page's tiles rise in as they scroll into view; in a sheet they just stand. */
#statsSlot .tile { animation: none; }
.stats { display: grid; font-size: .8125rem; }
.stats__row {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: .25rem; align-items: baseline;
  padding: .4375rem .125rem;
  border-top: 1px solid var(--line);
  text-align: right;
}
.stats__row > :first-child { text-align: left; color: var(--muted); }
.stats__row--head {
  border-top: 0;
  font-size: .5625rem; font-weight: 800; line-height: 1.2;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
}
.stats__note { font-size: .75rem; line-height: 1.45; color: var(--faint); }

/* ── Notifications ────────────────────────────────────────────────────── */

.pushbody { display: grid; gap: .625rem; }

/* Switched on: the sheet becomes one line, holds, and fades away. */
.sheet.is-done .sheet__title,
.sheet.is-done .sheet__lead,
.sheet.is-done .sheet__actions { display: none; }
.sheet.is-done .sheet__inner { padding-block: 1.75rem; }
.pushdone {
  display: grid; justify-items: center; gap: .75rem;
  text-align: center;
  font-size: 1.0625rem; font-weight: 800;
  animation: done-in .4s var(--ease) both;
}
.pushdone__tick {
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: color-mix(in srgb, var(--win) 18%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--win) 55%, transparent);
  color: var(--win);
  animation: tick-pop .5s var(--spring) both;
}
.pushdone__tick svg { width: 1.75rem; height: 1.75rem; }
.pushdone__tick path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: draw .38s .18s var(--ease) forwards;
}
@keyframes done-in  { from { opacity: 0; translate: 0 .375rem; } }
@keyframes tick-pop { from { scale: .5; opacity: 0; } }

.sheet.is-leaving { animation: sheet-out .36s var(--ease) forwards; }
.sheet.is-leaving::backdrop { animation: backdrop-out .36s var(--ease) forwards; }
@keyframes sheet-out    { to { opacity: 0; translate: 0 .75rem; scale: .96; } }
@keyframes backdrop-out { to { opacity: 0; } }
.pushnote { font-size: .875rem; color: var(--muted); }
.pushnote.is-on { color: var(--win); font-weight: 700; }

/* How to put the page on the home screen: three steps, each with a drawing of
   the bit of screen to tap. The one thing to tap carries the brand colour. */
.guide { display: grid; gap: .75rem; padding: 0; list-style: none; }
.guide__step { display: grid; gap: .375rem; }
.guide__text { display: flex; gap: .5rem; align-items: flex-start; font-size: .8125rem; line-height: 1.35; color: var(--muted); }

/* The guide has to be taken in at a glance, so its sheet may use the whole
   height of the screen and everything in it is set a little tighter — a guide
   that has to be scrolled hides its last step. */
.sheet.is-guide { max-height: calc(100dvh - var(--keyboard, 0px) - 1rem); }
.sheet.is-guide .sheet__inner { gap: .75rem; padding-top: 1rem; }
.guide__text b { color: var(--text); }
.guide__n {
  flex: none;
  display: grid; place-items: center;
  width: 1.375rem; height: 1.375rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-lift), var(--brand-deep));
  color: #fff !important;
  font-size: .75rem; font-weight: 900;
}

.guide__pic {
  display: grid; place-items: center;
  padding: .5rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="light"] .guide__pic { background: color-mix(in srgb, var(--brand) 5%, #fff); }

.guide__i {
  width: 1.375rem; height: 1.375rem;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.guide__i.is-solid { fill: currentColor; stroke: none; }
.guide__url .guide__i { flex: none; width: 1rem; height: 1rem; }
.guide__bar > .guide__i, .guide__hot { flex: none; }

/* A browser toolbar, reduced to its icons */
.guide__bar {
  display: flex; align-items: center; justify-content: space-between;
  width: min(100%, 17rem);
  padding: .1875rem .875rem;
  border-radius: 999px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  color: var(--faint);
}
.guide__bar--top { gap: .5rem; padding-left: .5rem; }
.guide__url {
  display: flex; align-items: center; gap: .375rem;
  flex: 1; min-width: 0;
  padding: .3125rem .75rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: .75rem; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The one to tap */
.guide__hot {
  position: relative;
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  color: var(--brand-lift);
}
.guide__hot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--brand);
  animation: ring 1.8s var(--ease) infinite;
}

/* A menu, with one row lit */
.guide__list {
  display: grid;
  width: min(100%, 17rem);
  border-radius: 12px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  overflow: hidden;
}
.guide__row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .375rem .75rem;
  font-size: .8125rem; color: var(--faint);
}
.guide__row + .guide__row { border-top: 1px solid var(--line); }
.guide__row.is-hot {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--text); font-weight: 700;
}
.guide__row.is-hot .guide__i { color: var(--brand-lift); }
/* Two things in one picture: tap this, then that */
.guide__stack { display: grid; justify-items: center; gap: .5rem; width: min(100%, 17rem); }
.guide__stack .guide__list { width: 100%; }

/* The round actions at the foot of the iOS share sheet */
.guide__rounds { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; width: 100%; }
.guide__round { display: grid; justify-items: center; gap: .1875rem; min-width: 0; }
.guide__round small { font-size: .5625rem; line-height: 1.1; color: var(--faint); white-space: nowrap; }
.guide__round.is-hot small { color: var(--text); font-weight: 700; }
.guide__dim {
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--surface-hi);
  color: var(--faint);
}
.guide__dim .guide__i, .guide__rounds .guide__hot .guide__i { width: 1.0625rem; height: 1.0625rem; }

/* A picture that is shown only where the screen is tall enough for it. */
@media (max-height: 700px) {
  .guide__pic:has(.guide__roomy) { display: none; }
}

/* A home screen: three blank apps and ours */
.guide__home { display: flex; align-items: center; gap: .875rem; }
.guide__home > i {
  width: 2.5rem; height: 2.5rem; border-radius: 28%;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--line);
}
.guide__app { display: grid; justify-items: center; gap: .25rem; }
.guide__app img {
  width: 2.5rem; height: 2.5rem; border-radius: 28%;
  box-shadow: 0 0 0 2px var(--brand), 0 0 16px -2px var(--brand);
}

/* ── 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; }
  .match.is-open .venue { animation: none; }
  .sheet[open] { animation: none; }
  .btn--brand.is-dirty { animation: none; }
  .swish { display: none; }
  .dribble .ball { translate: 0 1.125rem; }
}

@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, .toast, .segmented, .daynav, .hero__glow { display: none !important; }
  body { background: #fff; color: #000; }
}
