/* =========================================================================
   ASROMA.GE — modules-match.css
   Shared match / football modules. Loaded on every page by @shell:head.
   Reference: styleguide-match.html · cheat-sheet: brief/system-match.md
   Semantic tokens only (var(--…)); both themes; mobile-first (breakpoints 600 / 900 / 1200).
   Big pieces use CONTAINER queries (scoreboard, match-row, timeline, pitch, h2h) so they adapt to the
   column they are dropped into, not only to the viewport.

     1  Scoreboard           .scoreboard
     2  Match row / mini     .match-list .match-row .match-mini
     3  Event timeline       .timeline
     4  Pitch + bench        .pitch .bench
     5  Rating controls      .rating-scale .rating-badge .dist .rating-compare .player-rating-card
     6  Player card / row    .player-card .player-row
     7  Leaderboard          .leaderboard
     8  Prediction pieces    .predict .points-offer .points-breakdown
     9  Mood meter           .mood
    10  Fan presence         .presence
    11  Form guide           .form-guide
    12  H2H summary          .h2h
    13  Chart primitives     .spark .linechart .barchart
   ========================================================================= */

/* ------------------------------------------------------------------ shared bits */
.scoreboard__tag, .timeline__type, .pitch__tag, .bench__head, .predict__label, .mood__label, .h2h__label {
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); line-height: 1; letter-spacing: var(--tracking-label); text-transform: uppercase;
}
@keyframes mm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* =========================================================================
   1. SCOREBOARD — the signature piece. Hero (default), compact, light.
   Always put .on-dark on the hero scoreboard (ink island). Centre slot swaps per state:
   data-state="pre|live|ft" on the root; children with data-for="pre" / "live ft" show only then.
   data-follow on the root = JS mirrors <html data-match> into data-state.
   ========================================================================= */
.scoreboard {
  container: scoreboard / inline-size;
  width: 100%;
  --ring-color: var(--island-surface);
  position: relative; isolation: isolate;
  background: var(--island-surface); color: var(--text);
  border: var(--bw) solid var(--border-subtle); border-radius: var(--r-lg);
  overflow: hidden;
}
html[data-theme="dark"] .scoreboard:not(.scoreboard--light) { border-color: var(--border); }
.scoreboard--light { background: var(--surface-1); --ring-color: var(--surface-1); }
.scoreboard[data-state="live"]::before { content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 2px; background: var(--live); }

/* state gating (children carry data-for) */
.scoreboard[data-state="pre"] [data-for]:not([data-for~="pre"]),
.scoreboard[data-state="live"] [data-for]:not([data-for~="live"]),
.scoreboard[data-state="ft"] [data-for]:not([data-for~="ft"]),
html[data-match] .scoreboard[data-follow]:not([data-state]) [data-for] { display: none; }

/* meta line: status chip · competition · matchday … aside */
.scoreboard__meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 44px; padding: 0 var(--sp-4);
  border-bottom: var(--bw) solid var(--border-subtle);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted);
}
.scoreboard__comp { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; overflow: hidden; white-space: nowrap; }
.scoreboard__comp > span:not(.chip) { overflow: hidden; text-overflow: ellipsis; }
.scoreboard__sep { flex: none; width: 3px; height: 3px; border-radius: var(--r-full); background: var(--text-faint); }
.scoreboard__comp-short { display: none; }
.scoreboard__aside { flex: none; font-variant-numeric: tabular-nums; color: var(--text); }

/* body: home · centre · away, with the pitch-line watermark */
.scoreboard__body {
  --sb-digit: clamp(56px, 32px + 6cqi, 112px);
  --sb-name: clamp(32px, 14px + 2.6cqi, 52px);
  --sb-club: clamp(56px, 28px + 6cqi, 96px);
  --sb-pad: var(--sp-8);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--sp-6);
  padding: var(--sb-pad);
}
.scoreboard__body::before {            /* centre circle */
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
  width: clamp(220px, 34cqi, 460px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: var(--bw) solid color-mix(in srgb, var(--text-strong) 8%, transparent); border-radius: var(--r-full); pointer-events: none;
}
.scoreboard__body::after {             /* halfway line */
  content: ""; position: absolute; z-index: -1; left: 50%; top: 0; bottom: 0; width: var(--bw);
  background: color-mix(in srgb, var(--text-strong) 8%, transparent); pointer-events: none;
}
.scoreboard__team { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.scoreboard__team--away { flex-direction: row-reverse; text-align: right; }
.scoreboard .club { --club-size: var(--sb-club); }
.scoreboard__txt { display: grid; gap: var(--sp-2); min-width: 0; }
.scoreboard__name {
  margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--sb-name); line-height: .94; letter-spacing: var(--tracking-display); text-transform: uppercase; color: var(--text-strong);
  overflow-wrap: anywhere;
}
.scoreboard__name-short { display: none; }
.scoreboard__sub {
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted);
}

/* centre slot — shared */
.scoreboard__center { display: grid; justify-items: center; align-content: center; min-width: 0; }
.scoreboard__vs { display: none; }
/* centre — upcoming: kickoff line + countdown */
.scoreboard__center--pre { width: clamp(280px, 32cqi, 420px); gap: var(--sp-3); }
.scoreboard__kickoff { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px var(--sp-3); text-align: center; }
.scoreboard__day, .scoreboard__zone {
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted);
}
.scoreboard__time {
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums;
}
.scoreboard .countdown { max-width: none; }
/* centre — live / full time: score tiles + clock */
.scoreboard__score {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--sb-digit); line-height: .8; font-variant-numeric: tabular-nums lining-nums;
}
.scoreboard__digit {
  width: .92em; padding: .17em 0 .15em; text-align: center;
  background: var(--well); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); color: var(--text-strong);
}
.scoreboard__digit.is-flash { animation: mm-flash 1.4s var(--ease-out); }
@keyframes mm-flash { 0% { background: var(--yellow); color: var(--on-yellow); } 100% { background: var(--well); color: var(--text-strong); } }
.scoreboard__score-sep { font-weight: var(--fw-medium); font-size: .44em; color: var(--text-faint); }
.scoreboard__clock { display: inline-flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.scoreboard__minute {
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-bold);
  font-size: var(--fs-xl); line-height: 1; color: var(--accent-num); font-variant-numeric: tabular-nums;
  animation: mm-blink 1.6s ease-in-out infinite;
}
.scoreboard__period { font-size: var(--fs-xs); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.scoreboard__ht { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* scorers under the teams (two columns, home left / away right) */
.scoreboard__goals {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4) var(--sp-6);
  padding: 0 var(--sb-pad, var(--sp-8)) var(--sp-5);
}
.scoreboard__goals .scoreboard__scorers { padding: 0; }
.scoreboard__scorers { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; min-width: 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--text); }
.scoreboard__scorers--away { align-items: flex-end; text-align: right; }
.scoreboard__scorers li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.scoreboard__scorers--away li { justify-content: flex-end; }
.scoreboard__scorers b { font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scoreboard__scorers .icon { width: 14px; height: 14px; color: var(--text-muted); stroke-width: 1.75; }
.scoreboard__scorers .is-og .icon { color: var(--red-text); }
.scoreboard__scorers .is-yellow .icon { color: var(--yellow); }
.scoreboard__scorers .is-red .icon { color: var(--red-text); }
.scoreboard__tag { padding: 1px 4px; border: var(--bw) solid var(--border); border-radius: var(--r-xs); color: var(--text-muted); font-size: var(--fs-2xs); letter-spacing: .06em; }
.scoreboard__tag--og { border-color: var(--red-text); color: var(--red-text); }

/* progress hairline (core .progress.progress--match) + footer */
.scoreboard > .progress--match { margin: 0; }
.scoreboard__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  padding: var(--sp-3) var(--sp-4);
  border-top: var(--bw) solid var(--border-subtle); background: color-mix(in srgb, var(--island-bg) 45%, transparent);
}
.scoreboard > .progress--match + .scoreboard__foot { border-top: 0; }
.scoreboard--light .scoreboard__foot { background: var(--surface-2); }
.scoreboard__info { display: flex; flex-wrap: wrap; gap: 4px var(--sp-5); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-muted); }
.scoreboard__info li { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.scoreboard__info .icon { width: 16px; height: 16px; }
.scoreboard__info b { font-weight: var(--fw-semibold); color: var(--text); }
.scoreboard__cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.scoreboard__foot .presence { min-width: 0; }

/* ≥ 1200 inside the container: roomier */
@container scoreboard (min-width: 900px) {
  .scoreboard__meta { padding: 0 var(--sp-6); }
  .scoreboard__body { --sb-pad: var(--sp-8) var(--sp-10); gap: var(--sp-8); }
  .scoreboard__goals { padding: 0 var(--sp-10) var(--sp-6); }
  .scoreboard__foot { padding: var(--sp-4) var(--sp-6); }
}
/* medium container: 3 columns, shorter names */
@container scoreboard (max-width: 899px) {
  .scoreboard__body { --sb-pad: var(--sp-6); gap: var(--sp-4); }
  .scoreboard__goals { padding: 0 var(--sp-6) var(--sp-4); }
}
@container scoreboard (max-width: 1099px) {
  .scoreboard__name-full { display: none; }
  .scoreboard__name-short { display: inline; }
}
/* narrow container (phones, ~390): teams stack disc over code, score between, countdown below */
@container scoreboard (max-width: 679px) {
  .scoreboard__meta { min-height: 40px; }
  .scoreboard__comp-long { display: none; }
  .scoreboard__comp-short { display: inline; }
  .scoreboard__sub { letter-spacing: .04em; white-space: nowrap; }
  .scoreboard__body {
    --sb-pad: var(--sp-5) var(--sp-4) var(--sp-4);
    --sb-name: 30px; --sb-club: 48px;
    --sb-digit: 56px;
    grid-template-areas: "home mid away"; gap: var(--sp-3) var(--sp-2); align-items: start;
  }
  .scoreboard[data-state="pre"] .scoreboard__body { grid-template-areas: "home mid away" "cd cd cd"; }
  .scoreboard__body::before { top: 56px; width: 280px; }
  .scoreboard__body::after { display: none; }
  .scoreboard__team, .scoreboard__team--away { flex-direction: column; gap: var(--sp-2); text-align: center; }
  .scoreboard__team--home { grid-area: home; }
  .scoreboard__team--away { grid-area: away; }
  .scoreboard__txt { justify-items: center; }
  .scoreboard__center { grid-area: mid; align-self: start; }
  .scoreboard__center--pre { grid-area: cd; width: 100%; }
  .scoreboard__vs {
    grid-area: mid; align-self: start; display: grid; place-items: center; height: var(--sb-club);
    font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-bold); font-size: var(--fs-lg); letter-spacing: .08em; color: var(--text-faint);
  }
  .scoreboard__score { gap: 6px; }
  .scoreboard__digit { width: .88em; padding: .14em 0 .12em; }
  .scoreboard__clock { flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
  .scoreboard__goals { gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
  .scoreboard__foot { flex-direction: column; align-items: stretch; padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .scoreboard__cta { display: grid; grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
  .scoreboard__cta--stack { grid-auto-flow: row; }
  .scoreboard__cta .btn { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .scoreboard__foot .presence { justify-content: center; }
  .scoreboard__info { justify-content: center; }
}

/* compact: thinner, no watermark, for lists / report headers / prediction pages */
.scoreboard--compact .scoreboard__body { --sb-digit: 44px; --sb-name: 24px; --sb-club: 40px; --sb-pad: var(--sp-4); gap: var(--sp-4); }
.scoreboard--compact .scoreboard__body::before, .scoreboard--compact .scoreboard__body::after { display: none; }
.scoreboard--compact .scoreboard__center--pre { width: auto; }
.scoreboard--compact .scoreboard__goals { padding: 0 var(--sp-4) var(--sp-3); }
.scoreboard--compact .scoreboard__team { gap: var(--sp-3); }
.scoreboard--compact .scoreboard__name-full { display: none; }
.scoreboard--compact .scoreboard__name-short { display: inline; }
.scoreboard--compact .scoreboard__clock { margin-top: var(--sp-2); }
.scoreboard--compact .scoreboard__minute { font-size: var(--fs-lg); }
.scoreboard--compact .countdown__num { font-size: var(--fs-2xl); }
.scoreboard--compact .countdown__unit { gap: 4px; padding: 8px 0 7px; }
.scoreboard--compact .scoreboard__foot { padding: var(--sp-2) var(--sp-4); }

/* =========================================================================
   2. MATCH ROW / MINI
   ========================================================================= */
.match-list { container: match-list / inline-size; width: 100%; display: grid; margin: 0; padding: 0; list-style: none; min-width: 0; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); overflow: hidden; }
.match-list > li { min-width: 0; }
.match-list > li + li, .match-list > .match-row + .match-row { border-top: var(--bw) solid var(--border-subtle); }
.match-list--bare { background: none; border: 0; border-radius: 0; overflow: visible; }
.match-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "meta meta end" "home mid away";
  align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4); min-width: 0; color: var(--text);
  transition: background-color var(--dur-fast);
}
a.match-row:hover { background: var(--surface-2); }
.match-row__meta { grid-area: meta; display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--sp-2); min-width: 0; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-muted); }
.match-row__date { font-weight: var(--fw-semibold); color: var(--text); font-variant-numeric: tabular-nums; }
.match-row__comp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row__comp::before { content: "·"; margin-right: var(--sp-2); color: var(--text-faint); }
.match-row__live { display: inline-flex; align-items: center; gap: 5px; color: var(--red-text); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.match-row__live .dot { width: 7px; height: 7px; }
.match-row__team { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-medium); color: var(--text); }
.match-row__team--home { grid-area: home; justify-content: flex-end; text-align: right; }
.match-row__team--away { grid-area: away; justify-content: flex-start; }
.match-row__team.is-roma { font-weight: var(--fw-bold); color: var(--text-strong); }
.match-row__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row__code { display: none; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; }
.match-row__mid { grid-area: mid; display: grid; place-items: center; }
.match-row__score, .match-row__time {
  display: inline-grid; place-items: center; min-width: 64px; height: 32px; padding: 0 var(--sp-2);
  border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); background: var(--well);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-lg); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap;
}
.match-row__time { background: transparent; border-style: dashed; border-color: var(--border); color: var(--text-muted); font-weight: var(--fw-bold); }
.match-row--live .match-row__score { border-color: var(--live); }
.match-row__end { grid-area: end; justify-self: end; display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.match-row__end .chip { min-height: 22px; padding: 0 6px; }
.match-row__pts { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-md); color: var(--text-strong); font-variant-numeric: tabular-nums; }

@container match-list (min-width: 560px) {
  .match-row { grid-template-columns: 148px minmax(0, 1fr) auto minmax(0, 1fr) 72px; grid-template-areas: "meta home mid away end"; gap: var(--sp-3) var(--sp-4); }
  .match-row__meta { display: grid; gap: 1px; }
  .match-row__comp::before { display: none; }
}
@container match-list (max-width: 420px) {
  .match-row__team:has(.match-row__code) .match-row__name { display: none; }
  .match-row__team:has(.match-row__code) .match-row__code { display: inline; }
}
.match-row--compact { padding: var(--sp-2) var(--sp-3); gap: var(--sp-1) var(--sp-2); }
.match-row--compact .match-row__team { font-size: var(--fs-md); }
.match-row--compact .match-row__score, .match-row--compact .match-row__time { min-width: 52px; height: 28px; font-size: var(--fs-md); }
.match-row--compact .club { --club-size: 24px; font-size: var(--fs-2xs); }
@container match-list (min-width: 560px) {
  .match-row--compact { grid-template-columns: 120px minmax(0, 1fr) auto minmax(0, 1fr) 32px; }
}

/* mini card: two team lines + kickoff — for scrollers, prediction headers, "up next" */
.match-mini {
  display: grid; gap: var(--sp-2); min-width: 0; padding: var(--sp-3);
  background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); color: var(--text);
  transition: border-color var(--dur-fast);
}
a.match-mini:hover { border-color: var(--border-strong); }
.match-mini--live { box-shadow: inset 0 2px 0 var(--live); }
.match-mini__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.match-mini__comp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-mini__team { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-medium); }
.match-mini__team.is-roma { font-weight: var(--fw-bold); color: var(--text-strong); }
.match-mini__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-mini__score { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums; }
.match-mini__foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); padding-top: var(--sp-2); border-top: var(--bw) solid var(--border-subtle); font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.match-mini__foot .icon { width: 16px; height: 16px; }
.match-mini__foot b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.match-mini__foot .push { margin-left: auto; }

/* =========================================================================
   3. EVENT TIMELINE — minute spine; home left / away right (≥ 480px container), one column + side tint below.
   Markup order never changes; Roma events get .is-roma (red accent edge), opponent events a neutral edge.
   ========================================================================= */
.timeline {
  container: timeline / inline-size;
  width: 100%;
  --tl-spine: 52px; --tl-gap: var(--sp-3);
  display: grid; row-gap: var(--tl-gap); margin: 0; padding: 0; list-style: none; min-width: 0;
}
.timeline__item { position: relative; display: grid; grid-template-columns: var(--tl-spine) minmax(0, 1fr); align-items: start; column-gap: var(--sp-2); min-width: 0; }
.timeline__item::before {            /* spine segment (bridges the row gap) */
  content: ""; position: absolute; top: 0; bottom: calc(-1 * var(--tl-gap)); left: calc(var(--tl-spine) / 2); width: var(--bw-2);
  margin-left: -1px; background: var(--border-subtle);
}
.timeline__item:last-child::before { bottom: 0; }
.timeline__min {
  grid-column: 1; grid-row: 1; justify-self: center; position: relative; z-index: 1;
  display: inline-grid; place-items: center; min-width: 44px; height: 28px; padding: 0 var(--sp-1);
  background: var(--surface-1); border: var(--bw) solid var(--border); border-radius: var(--r-xs);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black);
  font-size: var(--fs-md); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums;
}
.timeline__item--goal .timeline__min, .timeline__item--pen .timeline__min, .timeline__item--og .timeline__min { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
.timeline__event {
  grid-column: 2; grid-row: 1; display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0;
  padding: var(--sp-2) var(--sp-3); background: var(--surface-1);
  border: var(--bw) solid var(--border-subtle); border-left: var(--bw-accent) solid var(--border-strong); border-radius: var(--r-sm);
}
.is-roma > .timeline__event { border-left-color: var(--red); }
.timeline__icon {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px;
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-strong);
}
.timeline__icon .icon { width: 18px; height: 18px; }
.timeline__item--goal .timeline__icon, .timeline__item--pen .timeline__icon { background: var(--surface-inverse); color: var(--text-inverse); }
.timeline__item--og .timeline__icon { background: var(--red-soft); color: var(--red-text); }
.timeline__item--pen-miss .timeline__icon { color: var(--text-muted); }
.timeline__item--yellow .timeline__icon { color: var(--yellow); }
.timeline__item--red .timeline__icon { color: var(--red-text); }
.timeline__item--var .timeline__icon { background: transparent; box-shadow: inset 0 0 0 var(--bw) var(--border-strong); }
.timeline__body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.timeline__team { display: inline-flex; align-items: center; min-height: 18px; padding: 0 5px; border: var(--bw) solid var(--border); border-radius: var(--r-xs); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-2xs); letter-spacing: .08em; color: var(--text-muted); }
.is-roma .timeline__team { border-color: var(--red-text); color: var(--red-text); }
.timeline__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--sp-2); margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.3; color: var(--text-strong); }
.timeline__type { color: var(--text-muted); }
.timeline__title b { font-weight: var(--fw-bold); }
.timeline__score { padding: 1px 6px; border-radius: var(--r-xs); background: var(--surface-2); font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.timeline__detail { margin: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--text-muted); }
.timeline__detail b { font-weight: var(--fw-semibold); color: var(--text); }
.timeline__swap { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.timeline__swap li { display: flex; align-items: center; gap: 6px; }
.timeline__swap .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.timeline__in { color: var(--text-strong); }
.timeline__in .icon { color: var(--success); }
.timeline__out { color: var(--text-muted); font-weight: var(--fw-medium); }
.timeline__out .icon { color: var(--red-text); }
/* markers: period (Kick-off / HT / FT) and "live now" */
.timeline__item--period, .timeline__item--now { grid-template-columns: var(--tl-spine) minmax(0, 1fr); }
.timeline__period, .timeline__now { position: relative; z-index: 1; grid-column: 1 / -1; justify-self: start; margin-left: calc(var(--tl-spine) / 2 - 6px); display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 28px; padding: 0 var(--sp-3); border-radius: var(--r-xs); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.timeline__period { background: var(--surface-inverse); color: var(--text-inverse); }
.timeline__period b { font-weight: var(--fw-black); font-size: var(--fs-sm); }
.timeline__period--soft { background: var(--bg); color: var(--text-muted); box-shadow: inset 0 0 0 var(--bw) var(--border); }
.timeline__now { background: var(--red); color: var(--on-red); }
.timeline__now .dot { width: 7px; height: 7px; background: currentColor; }
.timeline__now b { font-weight: var(--fw-black); font-size: var(--fs-sm); }
.timeline__item--now::before { top: 14px; }

@container timeline (min-width: 480px) {
  .timeline:not(.timeline--compact) { --tl-spine: 64px; }
  .timeline:not(.timeline--compact) .timeline__item { grid-template-columns: minmax(0, 1fr) var(--tl-spine) minmax(0, 1fr); column-gap: var(--sp-3); }
  .timeline:not(.timeline--compact) .timeline__item::before { left: 50%; }
  .timeline:not(.timeline--compact) .timeline__min { grid-column: 2; }
  .timeline:not(.timeline--compact) .timeline__item--away > .timeline__event { grid-column: 3; }
  .timeline:not(.timeline--compact) .timeline__item--home > .timeline__event { grid-column: 1; flex-direction: row-reverse; text-align: right; border-left: var(--bw) solid var(--border-subtle); border-right: var(--bw-accent) solid var(--border-strong); }
  .timeline:not(.timeline--compact) .timeline__item--home.is-roma > .timeline__event { border-right-color: var(--red); }
  .timeline:not(.timeline--compact) .timeline__item--home .timeline__title,
  .timeline:not(.timeline--compact) .timeline__item--home .timeline__swap li { justify-content: flex-end; }
  .timeline:not(.timeline--compact) .timeline__team { display: none; }
  .timeline:not(.timeline--compact) .timeline__period, .timeline:not(.timeline--compact) .timeline__now { grid-column: 1 / -1; justify-self: center; margin-left: 0; }
}
/* compact: one line per event, single column, any width */
.timeline--compact { --tl-spine: 48px; --tl-gap: 0; }
.timeline--compact .timeline__item { padding: 5px 0; align-items: center; }
.timeline--compact .timeline__item::before { top: 0; bottom: 0; }
.timeline--compact .timeline__min { min-width: 40px; height: 24px; font-size: var(--fs-sm); }
.timeline--compact .timeline__event { padding: 0; background: none; border: 0; align-items: center; gap: var(--sp-2); }
.timeline--compact .timeline__icon { width: 24px; height: 24px; background: none; }
.timeline--compact .timeline__item--goal .timeline__icon, .timeline--compact .timeline__item--pen .timeline__icon { background: var(--surface-inverse); }
.timeline--compact .timeline__icon .icon { width: 16px; height: 16px; }
.timeline--compact .timeline__title { flex-wrap: nowrap; font-size: var(--fs-md); gap: var(--sp-2); }
.timeline--compact .timeline__title > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline--compact .timeline__type, .timeline--compact .timeline__detail { display: none; }
.timeline--compact .timeline__team { margin-left: auto; }
.timeline--compact .timeline__item--sub .timeline__body { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: var(--sp-3); width: 100%; }
.timeline--compact .timeline__item--sub .timeline__title { flex: none; }
.timeline--compact .timeline__item--sub .timeline__swap { margin: 0; min-width: 0; }
.timeline--compact .timeline__swap { display: flex; gap: var(--sp-3); }
.timeline--compact .timeline__item--period, .timeline--compact .timeline__item--now { padding: 6px 0; }

/* =========================================================================
   4. PITCH — vertical, CSS-only lines (.pitch__lines is injected by JS if missing).
   Rows are flex rows listed GK first → attack last: the default team (--bottom) has its GK at the bottom,
   the --top team (two-team mode) its GK at the top. Slots count from the team's own left to right.
   ========================================================================= */
.pitch {
  container: pitch / inline-size;
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  width: 100%; max-width: 720px; margin-inline: auto;
  aspect-ratio: 68 / 105;
  border-radius: var(--r-md); overflow: hidden; color: var(--on-red);
  background: repeating-linear-gradient(to bottom, var(--pitch-grass) 0 8.333%, var(--pitch-grass-alt) 8.333% 16.666%);
}
.pitch--duo { aspect-ratio: 68 / 120; }
.pitch--half { aspect-ratio: 68 / 82; }
.pitch__lines { position: absolute; z-index: -1; inset: var(--sp-3); border: var(--bw-2) solid var(--pitch-line); pointer-events: none; }
.pitch__lines::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--bw-2); margin-top: -1px; background: var(--pitch-line); }
.pitch__lines::after { content: ""; position: absolute; left: 50%; top: 50%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); border: var(--bw-2) solid var(--pitch-line); border-radius: var(--r-full); }
.pitch__box { position: absolute; left: 50%; width: 59.3%; height: 15.7%; transform: translateX(-50%); border: var(--bw-2) solid var(--pitch-line); }
.pitch__box--top { top: -2px; border-top: 0; }
.pitch__box--bottom { bottom: -2px; border-bottom: 0; }
.pitch__box::before { content: ""; position: absolute; left: 50%; width: 45.4%; height: 33%; transform: translateX(-50%); border: var(--bw-2) solid var(--pitch-line); }
.pitch__box--top::before { top: 0; border-top: 0; }
.pitch__box--bottom::before { bottom: 0; border-bottom: 0; }
.pitch__box::after { content: ""; position: absolute; left: 50%; width: 5px; height: 5px; margin-left: -2px; border-radius: var(--r-full); background: var(--pitch-line); }
.pitch__box--top::after { top: 66%; }
.pitch__box--bottom::after { bottom: 66%; }
.pitch--half .pitch__lines { overflow: hidden; border-top-width: var(--bw-2); }
.pitch--half .pitch__lines::before { display: none; }
.pitch--half .pitch__lines::after { top: 0; }
.pitch--half .pitch__box--top { display: none; }
.pitch--half .pitch__box--bottom { height: 30%; }

.pitch__tag { position: absolute; z-index: 2; left: var(--sp-3); padding: 3px 8px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--island-bg) 72%, transparent); color: var(--on-red); }
.pitch__tag--top { top: var(--sp-3); }
.pitch__tag--bottom { bottom: var(--sp-3); }

.pitch__team { --pp: clamp(30px, 9cqi, 46px); flex: 1 1 0; display: flex; flex-direction: column-reverse; justify-content: space-around; min-height: 0; padding: 6% 2% 7%; }
.pitch--duo .pitch__team { padding: 6% 2% 5%; }
.pitch__team--top { flex-direction: column; }
.pitch__team--top .pitch__row { flex-direction: row-reverse; }
.pitch__row { display: flex; align-items: flex-start; justify-content: space-around; gap: 2px; min-width: 0; }

.pitch__player, .pitch__slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1 1 0; min-width: 0;
  margin: 0; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: center; text-decoration: none;
}
a.pitch__player, button.pitch__player, .pitch__slot { cursor: pointer; }
.pitch__num {
  position: relative; display: grid; place-items: center; width: var(--pp); height: var(--pp);
  border: var(--bw-2) solid var(--pitch-line); border-radius: var(--r-sm);
  background: var(--brand-red); color: var(--brand-yellow);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: calc(var(--pp) * .5); line-height: 1; font-variant-numeric: tabular-nums lining-nums;
  transition: transform var(--dur-fast);
}
.pitch__player--opp .pitch__num { background: var(--island-surface); color: var(--on-red); }
a.pitch__player:hover .pitch__num, button.pitch__player:hover .pitch__num, .pitch__slot:hover .pitch__num { transform: translateY(-1px); }
.pitch__player:focus-visible, .pitch__slot:focus-visible { outline: 0; }
.pitch__player:focus-visible .pitch__num, .pitch__slot:focus-visible .pitch__num { outline: var(--bw-2) solid var(--focus); outline-offset: 2px; }
.pitch__name {
  max-width: 100%; padding: 1px 5px; border-radius: var(--r-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: color-mix(in srgb, var(--island-bg) 70%, transparent); color: var(--on-red);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.3;
}
/* overlays on the number tile: events (top-right), rating (top-left), captain (bottom-left) */
.pitch__badges { position: absolute; z-index: 1; top: -6px; right: -8px; display: flex; flex-direction: column; gap: 2px; }
.pitch__badge { display: grid; place-items: center; width: 16px; height: 16px; border-radius: var(--r-xs); background: var(--on-red); color: var(--island-bg); }
.pitch__badge .icon { width: 12px; height: 12px; stroke-width: 2.25; }
.pitch__badge--yellow { background: var(--brand-yellow); }
.pitch__badge--red { background: var(--brand-red); box-shadow: inset 0 0 0 1px var(--on-red); }
.pitch__badge--off { color: var(--brand-red); }
.pitch__badge--on { color: var(--island-bg); }
.pitch__badge--off .icon, .pitch__badge--on .icon { stroke-width: 3; }
.pitch__cap { position: absolute; z-index: 1; left: -7px; bottom: -7px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: var(--r-xs); background: var(--brand-yellow); color: var(--on-yellow); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black); font-size: var(--fs-2xs); line-height: 1; }
.pitch__num .pitch__rating { position: absolute; z-index: 1; left: 50%; top: -13px; transform: translateX(-50%); min-width: 26px; height: 17px; padding: 0 3px; font-size: var(--fs-xs); }
.pitch__player.is-off .pitch__num { opacity: .78; }

/* slot mode (All-time XI builder): <button class="pitch__slot is-empty|is-filled|is-selected"> */
.pitch__slot { min-height: 44px; border-radius: var(--r-sm); }
.pitch__slot .pitch__num { border-style: dashed; background: color-mix(in srgb, var(--island-bg) 26%, transparent); color: var(--on-red); }
.pitch__slot .pitch__num .icon { width: 45%; height: 45%; stroke-width: 2.5; }
.pitch__slot .pitch__name { background: color-mix(in srgb, var(--island-bg) 45%, transparent); font-weight: var(--fw-medium); }
.pitch__slot.is-filled .pitch__num { border-style: solid; background: var(--brand-red); color: var(--brand-yellow); }
.pitch__slot.is-filled .pitch__name { background: color-mix(in srgb, var(--island-bg) 78%, transparent); font-weight: var(--fw-bold); }
.pitch__slot.is-selected .pitch__num { border-style: solid; border-color: var(--brand-yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-yellow) 45%, transparent); }
.pitch__slot.is-selected .pitch__name { background: var(--brand-yellow); color: var(--on-yellow); font-weight: var(--fw-bold); }
.pitch__slot.is-empty .pitch__num { animation: none; }

/* bench list */
.bench { min-width: 0; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); overflow: hidden; }
.bench__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 40px; padding: 0 var(--sp-4); border-bottom: var(--bw) solid var(--border-subtle); color: var(--text-muted); }
.bench__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0; padding: 0; list-style: none; }
.bench--stack .bench__list { grid-template-columns: 1fr; }
.bench__item { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-2) var(--sp-4); border-top: var(--bw) solid var(--border-subtle); color: inherit; text-decoration: none; }
.bench__list > li:first-child > .bench__item, .bench__list > .bench__item:first-child { border-top: 0; }
a.bench__item:hover { background: var(--surface-2); }
.bench__main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.bench__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.bench__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--text-muted); }
.bench__end { display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; color: var(--text-muted); }
.bench__end .icon { width: 16px; height: 16px; }
.bench__item.is-used .bench__name::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: var(--r-full); background: var(--success); vertical-align: middle; }

/* =========================================================================
   5. RATING CONTROLS
   ========================================================================= */
.rating-scale { --rs-h: 44px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.rating-scale__btn {
  display: grid; place-items: center; min-width: 0; min-height: var(--rs-h); padding: 0;
  background: var(--surface-1); border: var(--bw) solid var(--border); border-radius: var(--r-sm); color: var(--text-strong); cursor: pointer;
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-lg); line-height: 1; font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.rating-scale__btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.rating-scale__btn:active { transform: scale(.96); }
.rating-scale__btn[aria-checked="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--yellow); }
.rating-scale__btn.is-fan { box-shadow: inset 0 -3px 0 var(--border-strong); }            /* marks the fan average bucket (compare state) */
.rating-scale.is-locked { pointer-events: none; opacity: .6; }
.rating-scale--sm { --rs-h: 36px; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.rating-scale--sm .rating-scale__btn { font-size: var(--fs-md); }
.rating-scale--lg { --rs-h: 52px; gap: 8px; }
.rating-scale--lg .rating-scale__btn { font-size: var(--fs-xl); }
@media (min-width: 600px) {
  .rating-scale { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
  .rating-scale--lg { --rs-h: 56px; gap: 6px; }
}

.rating-badge {
  display: inline-grid; place-items: center; flex: none; min-width: 44px; height: 28px; padding: 0 var(--sp-2);
  background: var(--surface-2); border: var(--bw) solid var(--border); border-radius: var(--r-xs); color: var(--text-strong);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-lg); line-height: 1; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap;
}
.rating-badge--sm { min-width: 32px; height: 22px; padding: 0 5px; font-size: var(--fs-md); }
.rating-badge--lg { min-width: 64px; height: 52px; padding: 0 var(--sp-3); font-size: var(--fs-2xl); border-radius: var(--r-sm); }
.rating-badge--high, .rating-badge[data-tier="high"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.rating-badge--mid, .rating-badge[data-tier="mid"] { background: var(--surface-2); border-color: var(--border); color: var(--text-strong); font-weight: var(--fw-bold); }
.rating-badge--low, .rating-badge[data-tier="low"] { background: transparent; border-style: dashed; border-color: var(--border-strong); color: var(--text-muted); font-weight: var(--fw-bold); }
.rating-badge--none { background: transparent; border-style: dashed; color: var(--text-faint); }
.rating-badge--you { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--yellow); }

/* distribution: 10 buckets, from --b1..--b10 (percent of votes) or data-dist (JS fills the bars). --avg = fan average marker */
.dist { --dist-h: 44px; --dist-max: 50; --avg: 5; position: relative; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: end; gap: 3px; height: var(--dist-h); min-width: 0; }
.dist > i { display: block; align-self: end; min-height: 2px; border-radius: 1px 1px 0 0; background: var(--bar-fill); transition: background-color var(--dur-fast); }
.dist > i:nth-child(1) { height: calc(var(--b1, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(2) { height: calc(var(--b2, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(3) { height: calc(var(--b3, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(4) { height: calc(var(--b4, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(5) { height: calc(var(--b5, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(6) { height: calc(var(--b6, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(7) { height: calc(var(--b7, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(8) { height: calc(var(--b8, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(9) { height: calc(var(--b9, 0) / var(--dist-max) * 100%); }
.dist > i:nth-child(10) { height: calc(var(--b10, 0) / var(--dist-max) * 100%); }
.dist > i.is-peak { background: var(--bar-strong); }
.dist > i.is-mine { background: var(--yellow); }
.dist::after {                         /* fan average marker */
  content: ""; position: absolute; top: -4px; bottom: 0; left: calc((var(--avg) - .5) * 10%); width: 2px; margin-left: -1px;
  background: var(--text-strong); box-shadow: 0 0 0 1px var(--surface-1); pointer-events: none; transition: left var(--dur-slow) var(--ease-out);
}
.dist--sm { --dist-h: 28px; gap: 2px; }
.dist--lg { --dist-h: 88px; gap: 4px; }
.dist-axis { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; margin: 4px 0 0; padding: 0; list-style: none; font-size: var(--fs-2xs); line-height: 1; text-align: center; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dist--lg + .dist-axis { gap: 4px; }

/* compare: You vs Fans on a 1–10 track (ratings flow, compare state) */
.rating-compare { --you: 7; --fans: 7; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2) var(--sp-3); min-width: 0; }
.rating-compare__vals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-4); font-size: var(--fs-xs); color: var(--text-muted); }
.rating-compare__vals b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.rating-compare__vals .is-you b { color: var(--highlight); }
.rating-compare__track { position: relative; grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bar-track); }
.rating-compare__track::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(min(var(--you), var(--fans)) * 10% - 5%); width: calc((max(var(--you), var(--fans)) - min(var(--you), var(--fans))) * 10%); background: var(--border-strong); opacity: .5; }
.rating-compare__mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: var(--r-xs); }
.rating-compare__mark--fans { left: calc(var(--fans) * 10% - 5%); background: var(--bar-strong); box-shadow: 0 0 0 2px var(--surface-1); }
.rating-compare__mark--you { left: calc(var(--you) * 10% - 5%); background: var(--yellow); box-shadow: 0 0 0 2px var(--surface-1); }
.rating-compare__delta { display: inline-flex; align-items: center; gap: 3px; min-height: 22px; padding: 0 6px; border: var(--bw) solid var(--border); border-radius: var(--r-xs); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.rating-compare__delta .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.rating-compare__delta--up { color: var(--success); border-color: var(--success); }
.rating-compare__delta--down { color: var(--red-text); border-color: var(--red-text); }

/* player rating card: number tile, name, average + votes, distribution, "Your rating" control */
.player-rating-card { display: grid; gap: var(--sp-4); min-width: 0; padding: var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.player-rating-card.is-rated { border-color: var(--border-strong); }
.player-rating-card__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); }
.player-rating-card__id { min-width: 0; }
.player-rating-card__name { margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-rating-card__name a { color: inherit; text-decoration: none; }
.player-rating-card__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.player-rating-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-3); margin: 3px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.player-rating-card__meta .icon { width: 14px; height: 14px; }
.player-rating-card__fact { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.player-rating-card__fact--goal { color: var(--text-strong); font-weight: var(--fw-semibold); }
.player-rating-card__avg { display: grid; justify-items: end; gap: 3px; }
.player-rating-card__avg small { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-rating-card__dist { display: grid; gap: 2px; }
.player-rating-card__rate { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: var(--bw) solid var(--border-subtle); }
.player-rating-card__rate-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.player-rating-card__you { display: inline-flex; align-items: center; gap: var(--sp-2); }
.player-rating-card__delta { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.player-rating-card:not(.is-rated) .player-rating-card__delta { display: none; }
.player-rating-card .label { color: var(--text-muted); }

/* =========================================================================
   6. PLAYER CARD / PLAYER ROW
   ========================================================================= */
.player-card { position: relative; display: grid; align-content: start; min-width: 0; overflow: hidden; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); color: var(--text); text-decoration: none; transition: border-color var(--dur-fast); }
a.player-card:hover { border-color: var(--border-strong); }
.player-card__media {
  position: relative; isolation: isolate; aspect-ratio: 5 / 4; overflow: hidden; color: var(--ph-fg);
  background: radial-gradient(120% 90% at 50% 0%, var(--ph-a) 0%, var(--ph-b) 72%);
}
.player-card__media::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 40%, var(--ph-pattern) 0 17%, transparent 17.5%), radial-gradient(ellipse 44% 32% at 50% 100%, var(--ph-pattern) 0 98%, transparent 100%); }
.player-card__media .jersey { position: absolute; left: var(--sp-3); top: var(--sp-3); }
.player-card__cap { position: absolute; left: calc(var(--sp-3) + 40px); top: var(--sp-3); display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-xs); background: var(--yellow); color: var(--on-yellow); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black); font-size: var(--fs-xs); line-height: 1; }
.player-card__rating { position: absolute; right: var(--sp-3); top: var(--sp-3); }
.player-card__status { position: absolute; left: var(--sp-3); bottom: var(--sp-3); }
.player-card__body { display: grid; gap: 2px; padding: var(--sp-3) var(--sp-3) 0; }
.player-card__first { font-size: var(--fs-xs); line-height: 1.2; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card__name { margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.player-card__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: var(--sp-3) 0 0; padding: 0; border-top: var(--bw) solid var(--border-subtle); }
.player-card__stat { display: grid; gap: 2px; padding: var(--sp-2) var(--sp-1); text-align: center; }
.player-card__stat + .player-card__stat { border-left: var(--bw) solid var(--border-subtle); }
.player-card__stat dd, .player-card__stat > b { order: -1; margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.player-card__stat dt, .player-card__stat > span { font-size: var(--fs-2xs); line-height: 1.2; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }
.player-card.is-out { opacity: .85; }
.player-card.is-out .player-card__media { filter: saturate(.4); }

.player-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-width: 0; min-height: 56px; padding: var(--sp-2) var(--sp-3); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); color: var(--text); text-decoration: none; transition: border-color var(--dur-fast); }
a.player-row:hover { border-color: var(--border-strong); }
.player-row__main { display: grid; gap: 1px; min-width: 0; }
.player-row__name { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.player-row__name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row__cap { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: var(--r-xs); background: var(--yellow); color: var(--on-yellow); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black); font-size: var(--fs-2xs); line-height: 1; }
.player-row__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--text-muted); }
.player-row__stats { display: none; margin: 0; gap: var(--sp-5); }
.player-row__stats > div { display: grid; justify-items: center; gap: 1px; }
.player-row__stats dd { order: -1; margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.player-row__stats dt { font-size: var(--fs-2xs); color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }
.player-row__end { display: inline-flex; align-items: center; gap: var(--sp-4); }
@media (min-width: 600px) {
  .player-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .player-row__stats { display: flex; }
}

/* =========================================================================
   7. LEADERBOARD — real <table> in .leaderboard-wrap (the scroll container; add --tall for a sticky header + pinned You row)
   ========================================================================= */
.leaderboard-wrap { min-width: 0; overflow: auto; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.leaderboard-wrap--tall { max-height: 440px; }
.leaderboard-wrap:focus-visible { outline-offset: 2px; }
.leaderboard { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; font-size: var(--fs-md); }
.leaderboard caption { text-align: left; }
.leaderboard th { position: sticky; top: 0; z-index: 2; padding: 0 var(--sp-3); height: 36px; background: var(--surface-2); border-bottom: var(--bw) solid var(--border-subtle); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; text-align: left; color: var(--text-muted); white-space: nowrap; }
.leaderboard td { padding: var(--sp-2) var(--sp-3); height: 52px; border-top: var(--bw) solid var(--border-subtle); vertical-align: middle; color: var(--text); background: var(--surface-1); }
.leaderboard tbody tr:first-child td { border-top: 0; }
.leaderboard .num { text-align: right; font-variant-numeric: tabular-nums; }
.leaderboard__col-rank { width: 1%; white-space: nowrap; }
.leaderboard__col-user { width: 100%; }
.leaderboard__col-move { width: 1%; white-space: nowrap; }
.leaderboard td.leaderboard__col-user { max-width: 0; }
.leaderboard__rank { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 var(--sp-1); border-radius: var(--r-xs); font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.leaderboard__rank.is-1 { background: var(--yellow); color: var(--on-yellow); }
.leaderboard__rank.is-2 { background: var(--surface-inverse); color: var(--text-inverse); }
.leaderboard__rank.is-3 { background: var(--yellow-soft); color: var(--yellow-text); box-shadow: inset 0 0 0 var(--bw-2) var(--yellow); }
.leaderboard__move { display: inline-flex; align-items: center; gap: 2px; min-width: 30px; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.leaderboard__move .icon { width: 12px; height: 12px; stroke-width: 3; }
.leaderboard__move--up { color: var(--success); }
.leaderboard__move--down { color: var(--red-text); }
.leaderboard__user { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.leaderboard__user .username { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--text-strong); }
.leaderboard__user .level { flex: none; }
.leaderboard__pts { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); }
.leaderboard tr.is-you td { background: var(--yellow-soft); }
.leaderboard tr.is-you td:first-child { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); }
.leaderboard tr.is-you .leaderboard__rank { color: var(--highlight); }
.leaderboard tr.is-pinned td { position: sticky; bottom: 0; z-index: 1; border-top: var(--bw) solid var(--border-strong); }
.leaderboard tr.is-gap td { height: 28px; padding: 0; text-align: center; font-size: var(--fs-xs); color: var(--text-faint); letter-spacing: .3em; background: var(--surface-2); }
.leaderboard tr.is-top td { background: var(--surface-1); }
/* mobile: tighter columns, the "exact" column folds under 440px */
@media (max-width: 439px) {
  .leaderboard th, .leaderboard td { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .leaderboard .is-extra { display: none; }
}
/* compact: sidebars / cards / profile — no header, no extra columns */
.leaderboard--compact th { display: none; }
.leaderboard--compact td { height: 44px; padding: var(--sp-1) var(--sp-2); }
.leaderboard--compact .is-extra, .leaderboard--compact .leaderboard__col-move { display: none; }
.leaderboard--compact .leaderboard__pts { font-size: var(--fs-lg); }
.leaderboard--compact .leaderboard__rank { min-width: 24px; height: 24px; font-size: var(--fs-md); }
.leaderboard-wrap--bare { background: none; border: 0; border-radius: 0; }

/* =========================================================================
   8. PREDICTION PIECES — .predict card, .points-offer tiles, .points-breakdown list
   States on the root: (default = open) · .is-saved · .is-locked. data-show="open saved locked" on any child
   shows it only in those states. JS: [data-predict] (see modules-match.js).
   ========================================================================= */
.predict { container: predict / inline-size; width: 100%; position: relative; display: grid; gap: var(--sp-4); min-width: 0; padding: var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.predict.is-saved:not(.is-locked) { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); }
.predict:not(.is-saved):not(.is-locked) [data-show]:not([data-show~="open"]),
.predict.is-saved:not(.is-locked) [data-show]:not([data-show~="saved"]),
.predict.is-locked [data-show]:not([data-show~="locked"]) { display: none; }
.predict__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.predict__match { display: grid; gap: 3px; min-width: 0; }
.predict__comp { font-size: var(--fs-xs); color: var(--text-muted); }
.predict__when { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.predict__label { display: block; margin-bottom: var(--sp-2); color: var(--text-muted); }
.predict__entry { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-2); background: var(--bg-sunken); border-radius: var(--r-sm); }
.predict__side { display: grid; justify-items: center; gap: var(--sp-3); min-width: 0; }
.predict__team { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1; letter-spacing: .03em; text-transform: uppercase; color: var(--text-strong); }
.predict__team .name-long { display: none; }
.predict__colon { align-self: end; padding-bottom: 12px; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-2xl); line-height: 1; color: var(--text-faint); }
.predict .stepper { gap: 4px; }
.predict .stepper__value { min-width: 48px; width: 48px; }
.predict__lock { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--sp-2); margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.predict__lock .icon { width: 16px; height: 16px; }
.predict__lock b { font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.predict__pick { display: grid; gap: 4px; margin: 0; padding: var(--sp-3); background: var(--bg-sunken); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-muted); }
.predict__pick b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.predict__status { display: flex; align-items: flex-start; gap: var(--sp-2); min-width: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.predict__status .icon { width: 16px; height: 16px; margin-top: 2px; }
.predict__status--saved { color: var(--text-strong); font-weight: var(--fw-semibold); }
.predict__status--saved .icon { color: var(--success); }
.predict__live { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-muted); }
.predict__live b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.predict__foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.predict__foot .btn--primary { flex: 1 1 200px; }
.predict__community { display: grid; gap: var(--sp-2); }
.predict__community .predict__label { margin: 0; }
.predict .btn[disabled] { opacity: .5; }
/* narrow card (< 420px): one line per team — name left, stepper right */
@container predict (max-width: 419px) {
  .predict__entry { grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--sp-3); padding: var(--sp-3); }
  .predict__side { grid-template-columns: minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: var(--sp-3); }
  .predict__side:last-child .predict__team { flex-direction: row-reverse; }
  .predict__colon { display: none; }
}

.points-offer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.points-offer > li { display: grid; gap: 3px; justify-items: center; padding: var(--sp-2) var(--sp-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); text-align: center; background: var(--surface-1); }
.points-offer b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.points-offer span { font-size: var(--fs-xs); line-height: 1.2; color: var(--text-muted); }
.points-offer .is-hit { border-color: var(--yellow); box-shadow: inset 0 2px 0 var(--yellow); }
.points-offer .is-miss b { color: var(--text-faint); }
.points-offer--inline { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.points-offer--inline > li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 8px; }
.points-offer--inline b { font-size: var(--fs-md); }

.points-breakdown { display: grid; margin: 0; padding: 0; list-style: none; min-width: 0; }
.points-breakdown__row { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: var(--sp-2) 0; border-top: var(--bw) solid var(--border-subtle); }
.points-breakdown__row:first-child { border-top: 0; }
.points-breakdown__row > .icon { width: 18px; height: 18px; color: var(--success); }
.points-breakdown__label { flex: 1; min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.points-breakdown__label small { display: block; margin-top: 1px; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--text-muted); }
.points-breakdown__pts { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.points-breakdown__row.is-zero > .icon { color: var(--text-faint); }
.points-breakdown__row.is-zero .points-breakdown__label, .points-breakdown__row.is-zero .points-breakdown__pts { color: var(--text-faint); font-weight: var(--fw-medium); }
.points-breakdown__row.is-pending .points-breakdown__pts { color: var(--text-muted); }
.points-breakdown__total { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-1); padding: var(--sp-3) 0 0; border-top: var(--bw-2) solid var(--text-strong); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-md); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-strong); }
.points-breakdown__total b { font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-2xl); line-height: 1; letter-spacing: 0; color: var(--highlight); font-variant-numeric: tabular-nums; }
.points-breakdown--compact .points-breakdown__row { min-height: 32px; padding: 4px 0; }
.points-breakdown--compact .points-breakdown__label { font-size: var(--fs-sm); }
.points-breakdown--compact .points-breakdown__label small { display: none; }
.points-breakdown--compact .points-breakdown__pts { font-size: var(--fs-lg); }
.points-breakdown--compact .points-breakdown__total b { font-size: var(--fs-xl); }

/* =========================================================================
   9. MOOD METER — 5 bands (Nervous … Buzzing), fill + marker, quick "how do you feel" buttons
   ========================================================================= */
.mood { --val: 50; display: grid; gap: var(--sp-4); min-width: 0; padding: var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.mood__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.mood__label { color: var(--text-muted); }
.mood__checkins { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mood__checkins b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.mood__read { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--sp-3); }
.mood__value { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-4xl); line-height: .9; color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums; }
.mood__state { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; text-transform: uppercase; letter-spacing: .03em; color: var(--text-strong); }
.mood__trend { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.mood__trend .icon { width: 14px; height: 14px; stroke-width: 2.5; color: var(--success); }
.mood__gauge { position: relative; padding-top: 10px; }
.mood__track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; height: 12px; margin: 0; padding: 0; }
.mood__track > i { --f: 0; display: block; border-radius: 1px; background: linear-gradient(90deg, var(--mood-fill, var(--bar-strong)) calc(var(--f) * 100%), var(--bar-track) calc(var(--f) * 100%)); }
.mood__track > i:nth-child(1) { --f: clamp(0, var(--val) / 20, 1); }
.mood__track > i:nth-child(2) { --f: clamp(0, (var(--val) - 20) / 20, 1); }
.mood__track > i:nth-child(3) { --f: clamp(0, (var(--val) - 40) / 20, 1); }
.mood__track > i:nth-child(4) { --f: clamp(0, (var(--val) - 60) / 20, 1); }
.mood__track > i:nth-child(5) { --f: clamp(0, (var(--val) - 80) / 20, 1); }
.mood[data-band="5"] { --mood-fill: var(--yellow); }
.mood__marker { position: absolute; top: 0; left: calc(var(--val) * 1%); width: 2px; height: 22px; margin-left: -1px; background: var(--text-strong); transition: left var(--dur-slow) var(--ease-out); }
.mood__marker::before { content: ""; position: absolute; top: -1px; left: -4px; border: 5px solid transparent; border-top-color: var(--text-strong); border-bottom: 0; }
.mood__bands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 0; list-style: none; }
.mood__bands > li { padding-top: 2px; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); letter-spacing: 0; white-space: nowrap; text-transform: uppercase; text-align: center; color: var(--text-faint); }
.mood__bands > li.is-current { color: var(--text-strong); box-shadow: inset 0 2px 0 var(--yellow); }
.mood__ask { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.mood__feel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.mood__btn {
  position: relative; isolation: isolate; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 52px; padding: var(--sp-1) 2px; overflow: hidden;
  background: var(--surface-1); border: var(--bw) solid var(--border); border-radius: var(--r-sm); color: var(--text-strong); cursor: pointer;
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-xs); letter-spacing: 0; white-space: nowrap; text-transform: uppercase;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.mood__btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.mood__btn::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(var(--pct, 0) * 1%); background: var(--surface-3); opacity: 0; transition: height var(--dur-slow) var(--ease-out); }
.mood__btn small { display: none; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mood__btn[aria-pressed="true"] { border-color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); }
.mood.is-voted .mood__btn small { display: block; }
.mood.is-voted .mood__btn::before { opacity: .7; }
.mood__thanks { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.mood:not(.is-voted) .mood__thanks { display: none; }

/* =========================================================================
   10. FAN PRESENCE
   ========================================================================= */
.presence { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.presence__text b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; margin-right: 2px; }
.presence .dot { flex: none; }
.presence--block { display: flex; padding: var(--sp-3) var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }

/* =========================================================================
   11. FORM GUIDE — last-5 rows (core .form-dots is the compact dots variant)
   ========================================================================= */
.form-guide { display: grid; min-width: 0; --ring-color: var(--surface-1); }
.form-guide__head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding-bottom: var(--sp-3); }
.form-guide__name { flex: 1; min-width: 0; margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1.05; letter-spacing: .03em; text-transform: uppercase; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-guide__summary { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-guide__summary b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.form-guide__list { margin: 0; padding: 0; list-style: none; }
.form-guide__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-1) 0; border-top: var(--bw) solid var(--border-subtle); color: var(--text); text-decoration: none; }
a.form-guide__row:hover .form-guide__score { text-decoration: underline; text-underline-offset: 3px; }
.form-guide__match { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); }
.form-guide__team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.form-guide__team.is-subject { font-weight: var(--fw-bold); color: var(--text-strong); }
.form-guide__score { flex: none; padding: 0 6px; border-radius: var(--r-xs); background: var(--surface-2); font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1.35; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.form-guide__meta { display: grid; justify-items: end; gap: 1px; font-size: var(--fs-xs); line-height: 1.25; color: var(--text-muted); text-align: right; }
.form-guide__ha { font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); letter-spacing: .08em; color: var(--text-faint); }
.form-guide__comp { white-space: nowrap; }

/* =========================================================================
   12. H2H SUMMARY — 3-part W/D/L bar(s) + list of past meetings (match rows)
   ========================================================================= */
.h2h { container: h2h / inline-size; width: 100%; display: grid; gap: var(--sp-5); min-width: 0; }
.h2h__headline { margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1.05; letter-spacing: .03em; text-transform: uppercase; color: var(--text-strong); }
.h2h__note { margin: var(--sp-1) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.h2h__records { display: grid; gap: var(--sp-5); }
.h2h__record { display: grid; align-content: start; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.h2h__label { color: var(--text-muted); }
.h2h__bar { display: flex; gap: 2px; height: 10px; }
.h2h__seg { flex: var(--n, 1) 1 0; min-width: 3px; border-radius: 1px; }
.h2h__seg--w { background: var(--bar-strong); }
.h2h__seg--d { background: var(--bar-fill); }
.h2h__seg--l { background: var(--red); }
.h2h__legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-muted); }
.h2h__legend li { display: inline-flex; align-items: baseline; gap: 6px; }
.h2h__legend b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.h2h__key { display: inline-block; width: 8px; height: 8px; border-radius: 1px; align-self: center; }
.h2h__key--w { background: var(--bar-strong); }
.h2h__key--d { background: var(--bar-fill); }
.h2h__key--l { background: var(--red); }
@container h2h (min-width: 640px) { .h2h__records { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================================
   13. CHART PRIMITIVES — conventions for inline SVG (hand-written) AND the classes the JS renderers use
   ([data-linechart] / [data-spark] / [data-barchart]). Colour via tokens; text 12px (render the SVG at its real width).
   ========================================================================= */
.linechart, .barchart { position: relative; min-width: 0; }
.linechart__svg, .barchart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.linechart__grid, .barchart__grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.linechart__grid--base, .barchart__grid--base { stroke: var(--border); }
.linechart__axis, .barchart__axis { fill: var(--chart-axis); font-family: var(--font-body); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.linechart__axis--x, .barchart__axis--x { text-anchor: middle; }
.linechart__axis--y { text-anchor: end; }
.linechart__area { fill: var(--chart-1); opacity: .06; }
.linechart__series { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linechart__avg { stroke: var(--chart-axis); stroke-width: 1.5; stroke-dasharray: 5 4; }
.linechart__avg-label { fill: var(--text-muted); font-family: var(--font-body); font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.linechart__point { fill: var(--surface-1); stroke: var(--chart-1); stroke-width: 2; transform-box: fill-box; transform-origin: center; transition: transform var(--dur-fast); }
.linechart__point.is-best, .linechart__point.is-latest { fill: var(--chart-2); }
.linechart__point.is-active { transform: scale(1.35); }
.linechart__hit { fill: transparent; cursor: pointer; outline: 0; }
.linechart__hit:focus-visible + .linechart__point, .linechart__hit:focus-visible ~ .linechart__point { stroke-width: 3; }
.linechart__cursor { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.linechart__cursor.is-active { opacity: 1; }
.linechart__res rect { stroke-width: 1.5; }
.linechart__res text { font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-2xs); text-anchor: middle; dominant-baseline: central; }
.linechart__res--w rect { fill: var(--surface-inverse); stroke: var(--surface-inverse); }
.linechart__res--w text { fill: var(--text-inverse); }
.linechart__res--d rect { fill: var(--surface-3); stroke: var(--surface-3); }
.linechart__res--d text { fill: var(--text-strong); }
.linechart__res--l rect { fill: none; stroke: var(--red-text); }
.linechart__res--l text { fill: var(--red-text); }
.chart-tooltip, .linechart__tooltip {
  position: absolute; z-index: 3; left: 0; top: 0; min-width: 120px; max-width: 220px; padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--surface-inverse); color: var(--text-inverse); font-size: var(--fs-xs); line-height: 1.35; pointer-events: none; opacity: 0;
  transform: translate(-50%, calc(-100% - 10px)); transition: opacity var(--dur-fast); box-shadow: var(--shadow-pop);
}
.chart-tooltip.is-open, .linechart__tooltip.is-open { opacity: 1; }
.chart-tooltip b { display: block; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1.1; font-variant-numeric: tabular-nums; }
.chart-tooltip span { display: block; opacity: .75; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); color: var(--text-muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--chart-1); }
.chart-legend i.is-avg { border-top: 2px dashed var(--chart-axis); }
.chart-legend i.is-dot { width: 8px; height: 8px; border: 2px solid var(--chart-1); border-radius: var(--r-full); background: var(--chart-2); }

.barchart__bar { fill: var(--bar-fill); transition: fill var(--dur-fast); }
.barchart__bar.is-max { fill: var(--bar-strong); }
.barchart__bar.is-latest { fill: var(--chart-2); }
.barchart__bar.is-none { fill: none; stroke: var(--border-strong); stroke-dasharray: 3 3; }
.barchart__hit { fill: transparent; cursor: pointer; outline: 0; }
.barchart__hit:hover + .barchart__bar, .barchart__hit:focus-visible + .barchart__bar { fill: var(--bar-strong); }
.barchart__value { fill: var(--text-strong); font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-xs); text-anchor: middle; font-variant-numeric: tabular-nums; }

.spark { display: inline-block; width: 96px; height: 28px; vertical-align: middle; overflow: visible; }
.spark--lg { width: 160px; height: 40px; }
.spark__line { fill: none; stroke: var(--chart-1); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark__area { fill: var(--chart-1); opacity: .07; }
.spark__avg { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.spark__dot { fill: var(--chart-2); stroke: var(--chart-1); stroke-width: 1.5; }

/* =========================================================================
   STYLEGUIDE-ONLY helpers (.sgm-*) for styleguide-match.html — not for product pages
   ========================================================================= */
.sgm-full { width: 100%; }
.sgm-start { align-items: start; }
.sgm-mid { align-items: center; }
.sgm-center { margin-inline: auto; }
.sgm-sm { font-size: var(--fs-sm); }
.sgm-lg { font-size: var(--fs-lg); }
.sgm-h260 { min-height: 260px; }
.sgm-h180 { min-height: 180px; }
.sgm-m { margin: 4px 0 12px; font-size: var(--fs-sm); }
.sgm-island { padding: 16px; background: var(--island-surface); border-radius: var(--r-md); --ring-color: var(--island-surface); }
