/* Ballumo components, sculpted night theme. Pages place these; they never restyle them. Names follow the app (.button, .icon-button, .card, .badge, .progress,
   .data-table, .fixture-row, .menu, .sheet, .toast, .field, .inline-alert, .empty-state). Tokens only: no raw colour, size, radius or shadow. */

/* ---------- Buttons: four roles, three sizes. Every button is a small sculpted key: a lit face, a darker lower edge, a soft drop. ---------- */
.button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-h); padding: 0 var(--space-5); border-radius: var(--radius-md); border: 0; background: none;
  font-size: var(--fs-body); font-weight: var(--weight-bold); line-height: 1; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: filter var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast), background var(--dur-fast);
}
.button:active { transform: translateY(1px); }
.button svg { flex: none; }
.button:not(.button--small) > .ct-icon { width: var(--icon-l); height: var(--icon-l); }
.button--primary { background: var(--accent); color: var(--text-on-accent); font-weight: var(--weight-heavy); box-shadow: var(--shadow-key); }
.button--primary:hover { filter: brightness(1.06); }
.button--primary:active { box-shadow: var(--shadow-key-pressed); filter: brightness(.97); }
.button--secondary { background: var(--surface-raised); color: var(--text-strong); box-shadow: var(--shadow-key-quiet); }
.button--secondary:hover { filter: brightness(1.14); }
.button--secondary:active { box-shadow: var(--shadow-key-pressed); }
.button--ghost { color: var(--text-link); padding: 0 var(--space-3); }
.button--ghost:hover { color: var(--text-link-hover); }
.button--danger { background: var(--tint-danger); color: var(--text-danger); box-shadow: var(--shadow-key-quiet); }
.button--danger:hover { filter: brightness(1.2); }
.button--solid-danger { background: var(--solid-danger); color: var(--text-on-danger); font-weight: var(--weight-heavy); box-shadow: var(--shadow-key-quiet); }
.button--small { height: var(--control-h-sm); padding: 0 var(--space-4); font-size: var(--fs-label); }
.button--small::before { content: ""; position: absolute; inset: -2px 0; }  /* 40px control, 44px hit area */
.button--large { height: var(--control-h-lg); padding: 0 var(--space-6); font-size: var(--fs-lead); font-weight: var(--weight-heavy); }
.button--block { width: 100%; }
.button[aria-disabled="true"], .button[disabled] { opacity: .45; pointer-events: none; filter: saturate(.5); }
.button.is-loading { pointer-events: none; }
.button.is-loading svg { animation: spin 800ms linear infinite; }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.button-row--end { justify-content: flex-end; }
.button-row--stack { flex-direction: column; align-items: stretch; }
@media (max-width: 600px) { .button-row--stack-phone { flex-direction: column; align-items: stretch; } }

.icon-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--control-h); height: var(--control-h);
  border-radius: var(--radius-md); border: 0; background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); color: var(--text-strong); flex: none;
  transition: filter var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.icon-button:hover { filter: brightness(1.14); }
.icon-button:active { transform: translateY(1px); box-shadow: var(--shadow-key-pressed); }
.icon-button--small { width: var(--control-h-sm); height: var(--control-h-sm); }
.icon-button--small::before { content: ""; position: absolute; inset: -2px; }
.icon-button[disabled] { opacity: .35; pointer-events: none; }
.icon-button--plain { background: none; box-shadow: none; color: var(--text-muted); }
.icon-button--plain:hover { color: var(--text-strong); background: var(--surface-raised); filter: none; }
@container (max-width: 320px) {
  .score-entry__control .icon-button { width: 100%; min-width: var(--tap-min); height: var(--tap-min); }
}
.dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--text-danger); border: 2px solid var(--surface-page); }

/* Header actions retain desktop labels and use accessible icon controls in the mobile shell. */
.responsive-action { padding: 0 var(--space-4); }
.responsive-action.button--ghost { background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); color: var(--text-strong); }
.responsive-action.button--ghost:hover { filter: brightness(1.14); color: var(--text-strong); }
.section-head--actions { align-items: center; }
.section-head--actions > h2 { min-width: 0; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex: none; }
@media (max-width: 959px) {
  .responsive-action { width: var(--control-h); height: var(--control-h); padding: 0; gap: 0; flex: none; }
  .responsive-action__label { display: none; }
  /* A "How it works" link is help, not an action: on phones a bare muted glyph with a 44px target, so it never reads as a second key beside the controls above it. */
  .responsive-action--help.button--ghost { background: none; box-shadow: none; color: var(--text-muted); }
  .responsive-action--help.button--ghost:hover { filter: none; color: var(--text-strong); background: var(--surface-raised); }
  .responsive-action--help { justify-content: flex-end; width: var(--tap-min); height: var(--tap-min); }
}

/* Premium is an access state of the shared secondary key, not another action role. */
.button.is-premium-locked { background: var(--surface-sunken); color: var(--text-muted); border: var(--border-width) solid var(--border-subtle); filter: grayscale(1); }
.button.is-premium-locked:is(:hover, :active) { color: var(--text-muted); filter: grayscale(1); box-shadow: var(--shadow-key-quiet); }
.action-hint { position: absolute; inset-block-end: 100%; inset-inline-end: 0; z-index: var(--z-menu); padding-block-end: var(--space-2); max-inline-size: calc(100vw - var(--space-8)); white-space: normal; text-align: center; }
.action-hint__body { display: block; inline-size: max-content; max-inline-size: inherit; padding: var(--space-2) var(--space-3); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text-strong); box-shadow: var(--shadow-key-quiet); font: var(--type-caption); }

/* ---------- Choice: chip, segmented, answer, toggle ---------- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: var(--space-2) var(--space-1) var(--space-3); margin-inline: calc(var(--space-1) * -1); }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; row-gap: var(--space-3); padding: 0; margin-inline: 0; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-sm); padding: 0 var(--space-4); flex: none;
  border-radius: var(--radius-pill); border: 0; background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); color: var(--text-muted); font-size: var(--fs-label); font-weight: var(--weight-bold); white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), filter var(--dur-fast);
}
.chip::before { content: ""; position: absolute; inset: -2px 0; }
.chip:hover { color: var(--text-strong); filter: brightness(1.12); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip[aria-current="page"] { background: var(--accent-subtle); color: var(--text-accent); box-shadow: inset 0 0 0 2px var(--accent); }
.chip img { width: var(--icon-m); height: var(--icon-m); }

.segmented { display: inline-flex; align-self: flex-start; padding: 4px; gap: 4px; border: 0; border-radius: var(--radius-md); background: var(--surface-sunken); max-width: 100%; box-shadow: var(--shadow-well); }
.segmented a, .segmented button {
  position: relative; min-height: var(--control-h-sm); min-width: 0; padding: 0 var(--space-4); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border-radius: var(--radius-sm);
  font-size: var(--fs-label); font-weight: var(--weight-bold); color: var(--text-muted); white-space: normal; overflow-wrap: anywhere; text-align: center; transition: background var(--dur-base) var(--ease-out), color var(--dur-fast), box-shadow var(--dur-fast);
}
.segmented a::before, .segmented button::before { content: ""; position: absolute; inset: -2px 0; }
.segmented a:hover, .segmented button:hover { color: var(--text-strong); }
.segmented [aria-current="page"], .segmented [aria-pressed="true"], .segmented [aria-selected="true"] { background: var(--surface-raised); color: var(--text-strong); box-shadow: var(--shadow-key-quiet); }
.segmented--touch a, .segmented--touch button { min-height: var(--tap-min); }
.segmented--compact a, .segmented--compact button { padding-inline: var(--space-3); white-space: nowrap; }

/* An answer to a question: three keys across, the team's crest on a team answer. Selected is the lit lime key. */
.choices { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: var(--space-2); }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 88px; padding: var(--space-2);
  border-radius: var(--radius-md); border: 0; background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); text-align: center;
  font-size: var(--fs-label); font-weight: var(--weight-bold); line-height: 1.15; color: var(--text-strong);
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), filter var(--dur-fast), transform var(--dur-fast) var(--ease-pop);
}
.choice:hover { filter: brightness(1.14); }
.choice:active { transform: translateY(1px); }
.choice[aria-pressed="true"] { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-key); filter: none; }
.choice[disabled] { opacity: .6; pointer-events: none; }

.toggle { position: relative; width: 52px; height: 32px; flex: none; border-radius: var(--radius-pill); background: var(--surface-sunken); box-shadow: var(--shadow-well); transition: background var(--dur-fast); }
.toggle:disabled { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.locked-toggle { position: relative; display: inline-flex; align-items: center; min-height: var(--tap-min); cursor: not-allowed; }
.locked-toggle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }

.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-inverse); box-shadow: var(--shadow-plate); transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast); }
.toggle[aria-checked="true"] { background: var(--accent-subtle); box-shadow: inset 0 0 0 2px var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent); box-shadow: var(--shadow-key); }
.toggle::before { content: ""; position: absolute; inset: -8px -2px; }

/* ---------- Card: a calm panel, lit from above. Variants: --you, --hero, --flush, --sunken, --dashed, --tile ---------- */
.card { position: relative; min-width: 0; background: var(--surface-card); border: 0; border-radius: var(--radius-lg); padding: var(--card-pad); box-shadow: var(--shadow-card); }
.card--flush { padding: 0; overflow: hidden; }
.card--you { background: var(--surface-accent-soft); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-card); }
.card--dashed { border: 1.5px dashed var(--border-control); background: transparent; box-shadow: none; }
.card--tile { transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out), filter var(--dur-fast); }
.card--tile:hover { background: var(--surface-raised); transform: translateY(-2px); }
.card--tile:active { transform: translateY(0); }
.card--compact { padding: var(--space-3); }
.card--linked { isolation: isolate; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.card--linked :is(a, button, input, select, summary):not(.card-link) { position: relative; z-index: 2; }
.card--linked:has(.card-link:hover) { background: var(--surface-raised); }
.card--linked:has(.card-link:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.card--linked .card-link:focus-visible { outline: none; }
.featured-challenge > a:focus-visible { outline-offset: -2px; }

/* The hero: the approved painted clay pitch, one source for the shared assets/pitch crops, lit from the top left like the logo.
   A page never draws a circle, a line or a stripe. */
.card--hero {
  position: relative; overflow: hidden; isolation: isolate; padding: var(--card-pad-lg); box-shadow: var(--shadow-hero); color: var(--text-strong);
  background: var(--hero-light), url("/assets/pitch/pitch-centre-82b5ec48.svg") 80% 50% / cover no-repeat, var(--surface-brand);
}
.card--hero-box { background: var(--hero-light), url("/assets/pitch/pitch-box-8361f925.svg") 50% 45% / cover no-repeat, var(--surface-brand); }
.card--hero-wide { background: var(--hero-light), url("/assets/pitch/pitch-full-dfae15b1.svg") 50% 50% / cover no-repeat, var(--surface-brand); }
.card--hero .muted, .card--hero .caption { color: var(--text-on-hero); }
/* Keep the clay visible at the edges and calm where the words are: a floodlit pool of night under the copy (--veil-x says where), fading into the open pitch. */
.hero-veil { --veil-x: 50%; --veil-y: 50%; --veil-core: 78%; --veil-edge: 66%; --veil-wash: 18%; }
.hero-veil::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 62% 120% at var(--veil-x) var(--veil-y), color-mix(in srgb, var(--surface-page) var(--veil-core), transparent) 0%, color-mix(in srgb, var(--surface-page) var(--veil-edge), transparent) 55%, transparent 100%),
    color-mix(in srgb, var(--surface-page) var(--veil-wash), transparent);
}
.hero-veil :is(h1, h2, p, .label) { text-shadow: 0 1px 14px color-mix(in srgb, var(--surface-page) 80%, transparent); }
.hero-veil .muted, .hero-veil .lead { color: var(--text-body); }
.hero-note { align-self: center; max-width: 100%; padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--veil-dark); }
/* Challenge looks: the same pitch crop with the stripes recoloured, behind the hero or a challenge card */
.look--midnight { background-color: var(--look-midnight-bg); background-image: var(--hero-light), url("/assets/pitch/pitch-centre-midnight-16f4a815.svg"); border-color: var(--look-midnight-line); }
.look--orange { background-color: var(--look-orange-bg); background-image: var(--hero-light), url("/assets/pitch/pitch-centre-orange-6ebd420c.svg"); border-color: var(--look-orange-line); }
.look--red { background-color: var(--look-red-bg); background-image: var(--hero-light), url("/assets/pitch/pitch-centre-red-3edbfbfc.svg"); border-color: var(--look-red-line); }
.look--violet { background-color: var(--look-violet-bg); background-image: var(--hero-light), url("/assets/pitch/pitch-centre-violet-b29afefb.svg"); border-color: var(--look-violet-line); }
.look--emerald { background-color: var(--look-emerald-bg); background-image: var(--hero-light), url("/assets/pitch/pitch-centre-emerald-d3b23571.svg"); border-color: var(--look-emerald-line); }
.look--lime { border-color: var(--look-lime-line); }
.look--midnight, .look--orange, .look--red, .look--violet, .look--emerald { background-position: 0 0, 80% 50%; background-size: auto, cover; background-repeat: no-repeat; }

/* ---------- The ivory plate: a Rating, a rank, a shirt number. A raised ivory face on a pitch-green wall, like the wordmark; a gloss from the top left and a fine inset line. ---------- */
.plate {
  --plate-radius: var(--radius-md);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; background: var(--plate-face); color: var(--plate-ink); border-radius: var(--plate-radius); padding: 0 var(--space-3);
  font-family: var(--font-display); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; line-height: 1.2; font-size: var(--fs-lead); letter-spacing: var(--tracking-numeral);
  text-shadow: 0 1px 0 var(--bb-chalk-0); box-shadow: var(--shadow-plate);
}
.plate::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(90% 70% at 0% 0%, rgba(255, 255, 255, .85), transparent 62%); pointer-events: none; }
.plate::after { content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: calc(var(--plate-radius) - 3px); box-shadow: inset 0 0 0 1px var(--plate-line); pointer-events: none; }
.plate--sm { --plate-radius: var(--radius-sm); font-size: var(--fs-label); padding: 0 var(--space-2); }
.plate--sm::after { display: none; }
.plate--md { font-size: var(--fs-num-m); padding: 0 var(--space-3); }
.plate--lg { --plate-radius: var(--radius-lg); font-size: var(--fs-num-xl); padding: 0 var(--space-4); }
.plate--you { background: var(--plate-you-face); color: var(--text-on-accent); text-shadow: 0 1px 0 rgba(255, 255, 255, .45); box-shadow: var(--shadow-plate-you); }
.plate--you::after { box-shadow: inset 0 0 0 1px rgba(63, 107, 31, .3); }
.rating-plate { gap: var(--space-1); white-space: nowrap; }
.rating-icon { display: inline-block; flex: none; object-fit: contain; vertical-align: middle; }
.rating-plate.plate--sm { font-size: var(--fs-lead); line-height: var(--lh-lead); }
.rating-plate.plate--lg { gap: var(--space-2); }

/* A Rating movement (ct_delta): a direction disc and the size of the move on a tinted, softly lit chip. */
.delta { --delta-ink: var(--rating-flat); --delta-tint: var(--surface-sunken); --delta-disc: var(--border-control); display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-2) 0 var(--space-1); border-radius: var(--radius-pill); background: var(--delta-tint); color: var(--delta-ink); font-family: var(--font-display); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; font-size: var(--fs-label); line-height: 1; white-space: nowrap; box-shadow: var(--shadow-chip); }
.delta__disc { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--delta-disc); color: var(--text-inverse); box-shadow: var(--shadow-disc); }
.delta--up { --delta-ink: var(--rating-up); --delta-tint: var(--tint-success); --delta-disc: var(--rating-up); }
.delta--down { --delta-ink: var(--rating-down); --delta-tint: var(--tint-danger); --delta-disc: var(--rating-down); }
.delta--down .delta__disc svg { transform: rotate(180deg); }
.delta--flat .delta__disc { color: var(--text-strong); }
.delta--sm { height: 24px; padding-right: var(--space-2); font-size: var(--fs-caption); }
.delta--sm .delta__disc { width: 16px; height: 16px; }
.delta--lg { height: 40px; padding: 0 var(--space-3) 0 var(--space-1); gap: var(--space-2); font-size: var(--fs-num-m); }
.delta--lg .delta__disc { width: 32px; height: 32px; }
.rating-widget { position: relative; display: inline-flex; margin-block: var(--space-2); margin-inline-end: var(--space-2); }
.rating-with-change > .delta { position: absolute; right: 0; bottom: 0; z-index: 1; transform: translate(25%, 65%); }
.rating-with-change > .delta--up { top: 0; bottom: auto; transform: translate(25%, -65%); }

.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 var(--space-1); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--fs-label); font-variant-numeric: tabular-nums; color: var(--text-muted); border-radius: var(--radius-xs); background: var(--surface-sunken); box-shadow: var(--shadow-well); }
.data-table__row > .rank { justify-self: start; }
.rank.is-top { background: var(--plate-face); color: var(--plate-ink); text-shadow: 0 1px 0 var(--bb-chalk-0); box-shadow: var(--shadow-plate); }
.rank.is-you { background: var(--plate-you-face); color: var(--text-on-accent); box-shadow: var(--shadow-plate-you); }

/* ---------- Badge: one pill shape, ten tones (ct_badge). Always a word; the icon is extra. ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  font-size: var(--fs-caption); font-weight: var(--weight-bold); line-height: 1; white-space: nowrap; flex: none; border: 0; background: var(--surface-sunken); box-shadow: var(--shadow-well); color: var(--text-muted);
}
.badge--outline { background: var(--surface-sunken); color: var(--text-muted); }
.badge--dashed { background: none; box-shadow: none; border: 1.5px dashed var(--border-control); }
.badge--good { background: var(--tint-success); color: var(--text-up); box-shadow: none; }
.badge--waiting { background: var(--state-pending-bg); color: var(--state-pending); box-shadow: none; }
.badge--final { background: var(--state-final-bg); color: var(--state-final); box-shadow: none; }
.badge--danger { background: var(--state-live-bg); color: var(--state-live); box-shadow: none; }
.badge--info { background: var(--tint-info); color: var(--text-info); box-shadow: none; }
.badge--corrected { background: var(--state-corrected-bg); color: var(--state-corrected); box-shadow: none; }
.badge--signal { background: var(--accent); color: var(--text-on-accent); box-shadow: none; }
.badge--inverse { background: var(--surface-inverse); color: var(--text-inverse); box-shadow: none; }
.badge--plain { background: none; box-shadow: none; padding: 0; height: auto; }
.badge--premium { background: var(--premium-pill); color: var(--bb-ivory-50); box-shadow: var(--shadow-pill); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.badge--live { background: var(--solid-danger); color: var(--text-on-danger); box-shadow: none; }
.badge--live svg { animation: pulse 1.6s ease-in-out infinite; }

/* Difficulty (bots): a word and four pips. The label carries the meaning; the pips are a glance. */

/* ---------- Avatar, crest, Premium coin ---------- */
.avatar { position: relative; display: block; flex: none; border-radius: var(--radius-avatar); overflow: hidden; background: var(--surface-raised); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.avatar--tile { display: flex; align-items: center; justify-content: center; color: var(--text-strong); font-weight: var(--weight-heavy); }
.avatar--tile img { width: 56%; height: 56%; object-fit: contain; image-rendering: auto; }
.avatar--bot { background: var(--surface-raised); box-shadow: 0 0 0 2px var(--surface-inverse); }
.avatar--layers { display: block; image-rendering: auto; }
.avatar--layers img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* A Premium member's coin sits on the corner arc of the portrait (the point 45 degrees round the squircle), so it scales with any avatar size and never floats off the edge. */
.avatar-premium, .avatar-marked { position: relative; display: inline-flex; flex: none; vertical-align: middle; border-radius: var(--radius-avatar); }
.premium-coin { position: absolute; top: 8.8%; right: 8.8%; z-index: 1; width: 36%; height: 36%; min-width: 16px; min-height: 16px; max-width: 32px; max-height: 32px; transform: translate(50%, -50%); border-radius: var(--radius-pill); background: url("/assets/meaning_icons/64/premium-045bb1e2.webp") center 46% / 68% no-repeat, var(--premium-coin); box-shadow: var(--shadow-coin); pointer-events: none; }
.avatar-type-coin { position: absolute; top: 8.8%; right: 8.8%; z-index: 1; width: 50%; height: 50%; min-width: 12px; min-height: 12px; max-width: 32px; max-height: 32px; transform: translate(50%, -50%); pointer-events: none; }
.crest { display: block; flex: none; object-fit: cover; border-radius: var(--radius-xs); background: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }

/* ---------- Progress: a fill on a track, or one segment per item (ct_progress, ct_progress_segments) ---------- */
.progress { display: flex; gap: var(--space-1); width: 100%; }
.progress__seg { flex: 1; height: var(--progress-h-sm); border-radius: var(--radius-pill); background: var(--progress-track); transition: background var(--dur-base) var(--ease-out); }
.progress__seg.is-done { background: var(--progress-fill); }
.progress__seg.is-now { background: var(--progress-now); }
.progress--bar { display: block; height: var(--progress-h); border-radius: var(--radius-pill); background: var(--progress-track); box-shadow: var(--shadow-well); overflow: hidden; }
.progress--bar > i { display: block; height: 100%; background: var(--progress-fill); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-out); }

/* ---------- Meaning icons: sculpted artwork for things that carry meaning (ct_meaning_icon). Controls keep Lucide. ---------- */
.meaning-icon { display: inline-block; flex: none; object-fit: contain; vertical-align: middle; }

/* ---------- Facts: an icon and a number, read as "5 games, 50 points". Pair with sr-only words. ---------- */
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin: 0; padding: 0; list-style: none; color: var(--text-muted); font-size: var(--fs-body); }
.facts > li { display: inline-flex; align-items: center; gap: var(--space-2); }
.facts b { font-family: var(--font-display); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; color: var(--text-strong); }

/* A completed head-to-head result: one readable, noninteractive outcome object. */
.result-widget { display: inline-grid; justify-items: center; gap: var(--space-1); padding: var(--space-2); border-radius: var(--radius-md); background: var(--surface-sunken); box-shadow: var(--shadow-well); white-space: nowrap; }
.result-status { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.result-status--labelled { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); box-shadow: var(--shadow-well); font: var(--type-label); white-space: nowrap; }
.result-widget--won, .result-status--labelled.result-status--won { color: var(--text-up); background: var(--tint-success); }
.result-widget--draw, .result-status--labelled.result-status--draw { color: var(--text-body); background: var(--surface-raised); }
.result-widget--lost, .result-status--labelled.result-status--lost { color: var(--text-down); background: var(--tint-danger); }

/* ---------- Section head, link, menu ---------- */
.section { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-width: 0; min-height: var(--control-h-sm); }
.section-head--top { align-items: flex-start; }
.link { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-link); font-size: var(--fs-label); font-weight: var(--weight-bold); min-height: var(--tap-min); }
.link:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 3px; }
.link--see-all { flex: none; margin-right: calc(var(--space-1) * -1); padding-inline: var(--space-1); color: var(--text-muted); white-space: nowrap; }
.link--see-all:hover { color: var(--text-strong); }
.menu { position: absolute; z-index: var(--z-menu); min-width: 232px; padding: var(--space-2); border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-pop); transform-origin: top right; animation: pop-in var(--dur-base) var(--ease-out); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: var(--space-3); min-height: var(--tap-min); padding: 0 var(--space-3); border-radius: var(--radius-md); background: none; color: var(--text-strong); font-size: var(--fs-body); font-weight: var(--weight-semibold); text-align: left; transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.menu a:hover, .menu button:hover { background: var(--surface-card); }
.menu a:active, .menu button:active { transform: translateY(1px); background: var(--surface-sunken); }
.menu a:focus-visible, .menu button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.menu svg { flex: none; color: var(--text-muted); }
.menu__item--danger, .menu__item--danger svg { color: var(--text-danger); }
.menu .menu__item--danger:hover { background: var(--tint-danger); }
.menu form { display: contents; }
.menu hr { border: 0; border-top: 1.5px solid var(--border-subtle); margin: var(--space-2) 0; }

/* ---------- Score tile: the scoreboard face. A recessed well with a Fredoka numeral. 44 x 48 minimum in a row. ---------- */
.score-tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--score-w); height: var(--score-h);
  border-radius: var(--radius-sm); background: var(--surface-bezel); color: var(--text-subtle);
  font-family: var(--font-display); font-size: var(--fs-num-m); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; letter-spacing: 0; line-height: 1;
  box-shadow: var(--shadow-well);
}
.score-tile.is-called { color: var(--text-accent); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-well); }
.score-tile.is-locked { color: var(--text-strong); }
.score-tile.is-live { color: var(--text-strong); box-shadow: inset 0 0 0 2px var(--text-danger), var(--shadow-well); }
.score-tile.is-result { color: var(--text-strong); }
.score-tile.is-exact { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-key); }
.score-tile.is-corrected { color: var(--state-corrected); box-shadow: inset 0 0 0 2px var(--state-corrected), var(--shadow-well); }
.score-tile.is-void { color: var(--state-void); background: var(--surface-sunken); box-shadow: var(--shadow-well); }
.score-tile.is-void::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, transparent calc(50% - 1px), var(--border-control) calc(50% - 1px), var(--border-control) calc(50% + 1px), transparent calc(50% + 1px)); }
.score-tile .dash { font-size: .5em; opacity: .7; }
.score-tile--lg { --score-w: 56px; --score-h: 64px; font-size: var(--fs-num-l); }
.score-tile--forecast { --score-w: var(--space-8); --score-h: calc(var(--space-8) + var(--space-4)); font-size: var(--fs-num-xl); border-radius: var(--radius-md); color: var(--text-strong); }
.score-tile--xl { --score-w: 104px; --score-h: 132px; font-size: var(--fs-num-2xl); border-radius: var(--radius-md); }
.score-tile--sm { --score-w: 28px; --score-h: 32px; font-size: var(--fs-num-s); }

/* ---------- Fixture row (shared/_fixture_row): the one fixture component. The .fixture-list around it is its size container. ---------- */
.fixture-list { display: flex; flex-direction: column; gap: var(--space-2); container-type: inline-size; container-name: fixtures; }
.fixture-row {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 0; align-items: center;
  padding: var(--space-3) var(--space-4); min-width: 0; overflow: hidden;
  background: var(--surface-card); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
a.fixture-row:hover, button.fixture-row:hover, label.fixture-row:hover { background: var(--surface-raised); }
a.fixture-row:active, button.fixture-row:active { transform: translateY(1px); }
.fixture-row.is-void { background: var(--surface-sunken); }
/* A row with its own action (Predict, Continue): the row link is stretched behind it, as on a linked card. */
.fixture-row--linked { isolation: isolate; }
.fixture-row--linked :is(a, button, input, select, summary):not(.card-link) { position: relative; z-index: 2; }
.fixture-row--linked:has(.card-link:hover) { background: var(--surface-raised); }
.fixture-row--linked:has(.card-link:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.fixture-row--linked .card-link:focus-visible { outline: none; }
label.fixture-row { cursor: pointer; }
label.fixture-row:has(input:focus-visible), label.opp:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.fixture-row--selected { background: var(--surface-accent-soft); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-card); }
.fixture-row__when { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-caption); line-height: 1.2; font-weight: var(--weight-semibold); color: var(--text-subtle); }
.fixture-row__when b { display: block; color: var(--text-body); font-weight: var(--weight-bold); font-size: var(--fs-label); }
.fixture-row__comp { display: block; margin-top: 2px; line-height: 0; }
.fixture-row__side { display: contents; }
.fixture-row__side--home .fixture-row__when { grid-column: 1; grid-row: 1 / span 2; }
.fixture-row__team--home { grid-column: 2; grid-row: 1; margin-bottom: 6px; }
.fixture-row__team--away { grid-column: 2; grid-row: 2; }
.fixture-row__team { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--fs-label); font-weight: var(--weight-bold); }
.fixture-row__scores { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 6px; align-items: center; }
.fixture-row__foot { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1.5px solid var(--border-faint); font-size: var(--fs-caption); color: var(--text-muted); min-width: 0; }
.fixture-row__foot > * { min-width: 0; }
.fixture-row__foot > span, .fixture-row__foot .cluster { display: inline-flex; align-items: center; gap: var(--space-1); }
.fixture-row__foot .cluster { gap: var(--space-2); }
.fixture-row__foot-end { display: inline-flex; align-items: center; gap: var(--space-2); }
.fixture-row__foot-end > span { white-space: nowrap; }
.fixture-row__foot-end > span:not(.fixture-row__action) { display: inline-flex; align-items: center; gap: var(--space-1); }
/* With an action, the foot is the lock time on the left and the action on the right; the action drops to its own right-aligned line when they cannot share one. */
.fixture-row--linked .fixture-row__foot-end { flex: 1 1 auto; flex-wrap: wrap; justify-content: space-between; row-gap: var(--space-2); }
.fixture-row__action { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.fixture-row.is-void .fixture-row__team { color: var(--text-subtle); text-decoration: line-through; text-decoration-color: var(--border-control); }
.fixture-row .was { text-decoration: line-through; color: var(--text-subtle); font-weight: var(--weight-semibold); }
.qstrip { display: inline-flex; gap: 3px; align-items: center; }
.qstrip i { width: 16px; height: 6px; border-radius: var(--radius-pill); background: var(--progress-track); }
.qstrip i.is-on { background: var(--accent); }

/* A Duel row also shows their call under the teams: sealed until lock, then the call and what it earned */
.fixture-row__opp { grid-column: 1 / -1; grid-row: 4; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1.5px dashed var(--border-faint); font-size: var(--fs-caption); color: var(--text-muted); }
.fixture-row__opp-call { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-info); }
.fixture-row__opp-call .num { font-size: var(--fs-num-s); }
@container fixtures (max-width: 320px) {
  .fixture-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fixture-row__side--home .fixture-row__when { grid-column: 1 / -1; grid-row: 1; flex-direction: row; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
  .fixture-row__team--home { grid-column: 1; grid-row: 2; }
  .fixture-row__team--away { grid-column: 1; grid-row: 3; }
  .fixture-row__scores { grid-column: 2; grid-row: 2 / span 2; }
  .fixture-row__foot { grid-row: 4; }
  .fixture-row__opp { grid-row: 5; }
}

/* Wide (container 860px and up: below that the away name and the 168px foot column compete for one third of the row): home side, score, away side. The two outer columns are equal, so the score boxes sit exactly on the row's centre line
   whatever the team names. Crests and names mirror: home is crest then name toward the score from the right, away is crest then name from the left. */
@container fixtures (min-width: 860px) {
  .fixture-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: var(--space-4); padding: var(--space-3) var(--space-4); }
  .fixture-row__side { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
  .fixture-row__side--home .fixture-row__when { flex: 0 0 64px; grid-column: auto; grid-row: auto; }
  .fixture-row__team { flex: 1 1 0; font-size: var(--fs-body); grid-column: auto; grid-row: auto; margin: 0; }
  .fixture-row__team--home { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
  .fixture-row__scores { grid-column: 2; grid-row: 1; }
  .fixture-row__side--home { grid-column: 1; grid-row: 1; }
  .fixture-row__side--away { grid-column: 3; grid-row: 1; }
  .fixture-row__foot { flex: 0 0 168px; grid-column: auto; grid-row: auto; margin: 0; padding: 0; border-top: 0; flex-direction: column; align-items: flex-end; justify-content: center; gap: var(--space-1); text-align: right; }
  .fixture-row--linked .fixture-row__foot { flex-basis: 200px; }
  .fixture-row--linked .fixture-row__foot-end { flex-direction: column; align-items: flex-end; justify-content: center; flex-wrap: nowrap; gap: var(--space-2); }
  .fixture-row--linked .fixture-row__action { margin-left: 0; }
  .fixture-row__opp { grid-row: 2; }
}

/* Points a call earned (ct_points_pill): tier by share of the best possible */
.points-pill { display: inline-flex; align-items: baseline; gap: 3px; height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; font-size: var(--fs-lead); line-height: 28px; white-space: nowrap; background: var(--points-0-bg); color: var(--points-0-fg); }
.points-pill--score { min-width: var(--tap-min); justify-content: center; padding-inline: var(--space-2); }
.points-pill small { font-size: var(--fs-caption); font-family: var(--font-body); font-weight: var(--weight-bold); letter-spacing: 0; }
.points-pill--5 { background: var(--points-5-bg); color: var(--points-5-fg); }
.points-pill--3 { background: var(--points-3-bg); color: var(--points-3-fg); }
.points-pill--2 { background: var(--points-2-bg); color: var(--points-2-fg); }
.points-pill--lg { height: 36px; line-height: 36px; font-size: var(--fs-num-m); padding: 0 var(--space-4); }

/* ---------- Data table (tables of people): sortable numeric columns, a "you" row, optional columns hidden on phones ---------- */
.data-table { background: var(--surface-card); border: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.data-table__head, .data-table__row { display: grid; grid-template-columns: var(--cols); gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); min-width: 0; }
.data-table__head { background: var(--surface-sunken); padding-block: var(--space-3); }
.data-table__head > * { font-size: var(--fs-caption); font-weight: var(--weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.data-table__row { position: relative; border-top: 1.5px solid var(--border-faint); transition: background var(--dur-fast); }
a.data-table__row:hover, button.data-table__row:hover { background: var(--surface-raised); }
.data-table__row.is-you { background: var(--surface-accent-soft); box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius-md); }
.data-table__row.is-below { opacity: .72; }
.t-right { text-align: right; }
.row-link--stretch::after { content: ""; position: absolute; inset: 0; }
.data-table__optional { display: block; }
.move { display: inline-flex; align-items: center; gap: 1px; font-size: var(--fs-caption); font-weight: var(--weight-bold); }

/* The rating row: rank, identity and the Rating with its weekly movement. Wider screens add games. */
.rating-row { --cols: 40px minmax(0, 1fr) auto; }
.rating-row__rating { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rating-row .rating-widget { margin: 0; flex-direction: row-reverse; align-items: center; gap: var(--space-2); }
.rating-row .rating-with-change > .delta { position: static; transform: none; }

/* ---------- Fields, copy field, alerts, empty, loading, error ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font: var(--type-label); }
.input, .select, .textarea { width: 100%; height: var(--control-h); border-radius: var(--radius-md); border: 0; background: var(--surface-sunken); color: var(--text-strong); font: inherit; font-size: var(--fs-body); padding: 0 var(--space-4); box-shadow: var(--shadow-well); transition: box-shadow var(--dur-fast); }
.textarea, textarea.input { height: auto; font: inherit; min-height: calc(var(--control-h) * 2); padding: var(--space-3) var(--space-4); resize: vertical; line-height: var(--lh-copy); }
.input::placeholder { color: var(--text-subtle); }
/* A fixed leading mark inside the field, such as the @ of a handle. */
.input-affix { position: relative; }
.input-affix__mark { position: absolute; inset-block: 0; inset-inline-start: var(--space-4); display: flex; align-items: center; color: var(--text-muted); font-size: var(--fs-body); font-weight: var(--weight-bold); pointer-events: none; }
.input-affix .input { padding-inline-start: calc(var(--space-4) + 1.2ch + var(--space-1)); }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.input.is-error, .select.is-error { box-shadow: inset 0 0 0 2px var(--text-danger), var(--shadow-well); }
.hint { font-size: var(--fs-label); color: var(--text-muted); }
.hint.is-error { color: var(--text-down); }
.hint.is-ok { color: var(--text-up); }
.copy-field { display: flex; gap: var(--space-2); align-items: center; }
.copy-field .input { font-size: var(--fs-label); }
.inline-alert { display: flex; gap: var(--space-3); align-items: flex-start; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-size: var(--fs-label); border: 0; background: var(--surface-sunken); box-shadow: var(--shadow-well); }
.inline-alert--good { background: var(--accent-subtle); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.inline-alert--warning { background: var(--tint-warning); box-shadow: inset 0 0 0 1.5px var(--tint-warning-line); }
.inline-alert--danger { background: var(--tint-danger); box-shadow: inset 0 0 0 1.5px var(--tint-danger-line); }
/* A status is a receipt, not a second page hero. Artwork and type share one row. */
.status-panel { display: flex; flex-direction: column; gap: var(--space-4); text-align: left; }
.status-panel__head { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.status-panel__head > .meaning-icon { flex: none; }
.status-panel__identity { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.status-panel__identity .page-head { margin: 0; }
.status-panel__identity .page-head__row { display: block; }
.status-panel__identity .page-head__actions:empty { display: none; }
.status-panel__title { margin: 0; font: var(--type-h2); color: var(--text-strong); overflow-wrap: anywhere; text-wrap: balance; }
.status-panel__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); color: var(--text-muted); font: var(--type-caption); }
.status-panel__meta > span:not(.badge) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.status-panel__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding-top: var(--space-4); border-top: var(--border-width) solid var(--border-faint); min-width: 0; }
.status-panel__body > p { max-width: var(--measure-copy); color: var(--text-muted); font: var(--type-body); text-wrap: pretty; }
.status-panel__fact { display: flex; align-items: baseline; gap: var(--space-2); color: var(--text-strong); font: var(--type-label); }
.status-panel__fact > .ct-icon { flex: none; align-self: center; }
.status-panel__body .button-row { width: 100%; }

/* A quiet pause: artwork, readable state, guidance and one next step share a centre line. */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); min-width: 0; padding: var(--space-6) var(--card-pad); border-radius: var(--radius-lg); background: var(--surface-sunken); text-align: center; }
.empty-state__copy { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; max-width: var(--layout-compact); min-width: 0; }
.empty-state__text { margin: 0; font: var(--type-h3); color: var(--text-strong); text-wrap: balance; overflow-wrap: anywhere; }
.empty-state__detail { font: var(--type-body); color: var(--text-muted); text-wrap: pretty; overflow-wrap: anywhere; }
.empty-state__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2); max-width: 100%; min-width: 0; }
.empty-state__actions .button { max-width: 100%; white-space: normal; }
.empty-state__actions form { max-width: 100%; }

/* Loading: skeletons keep the shape of what is coming (no spinner on a page). A sheen crosses once a second. */
.skeleton { position: relative; overflow: hidden; background: var(--surface-card); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-well); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-strong) 6%, transparent), transparent); animation: sheen 1.4s ease-in-out infinite; }

/* ---------- Stepper: the call flow's score entry. Two big tiles, a crest above each, thumb-sized buttons under. ---------- */
.stepper { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); min-width: 0; }
.stepper__btns { display: flex; gap: var(--space-2); }
.step-button { width: 56px; height: 56px; border-radius: var(--radius-md); border: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); transition: filter var(--dur-fast), transform var(--dur-fast) var(--ease-pop), box-shadow var(--dur-fast); }
.step-button:hover { filter: brightness(1.14); }
.step-button:active { transform: translateY(1px); box-shadow: var(--shadow-key-pressed); }
.step-button[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ---------- Versus: two players head to head ---------- */
.versus { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; }
.versus__score .versus__dash { padding-inline: var(--space-1); }
.versus--narrow { max-width: 520px; margin-inline: auto; }
.versus__side { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 88px; text-align: center; min-width: 0; flex: none; }
.versus__score { display: flex; align-items: baseline; justify-content: center; gap: var(--space-2); font-size: var(--fs-num-2xl); line-height: .9; min-width: 0; }
.versus__dash { color: var(--text-on-hero); font-size: var(--fs-label); }

/* ---------- Nav: tab bar (phone) and rail (desktop) share one item. The current destination is a raised key. ---------- */
.nav-item { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: var(--bar-h); margin: var(--space-1) 2px; padding: var(--space-1) 2px; border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--fs-caption); font-weight: var(--weight-bold); -webkit-tap-highlight-color: transparent; transition: background var(--dur-base) var(--ease-out), color var(--dur-fast), box-shadow var(--dur-fast); }
.nav-item__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 32px; transition: transform var(--dur-fast) var(--ease-pop); }
.nav-item__art { display: block; flex: none; width: 28px; height: 28px; object-fit: contain; }
.nav-item:active .nav-item__icon { transform: scale(.92); }
.nav-item.is-active { color: var(--text-strong); background: var(--surface-raised); box-shadow: var(--shadow-key-quiet); }
.nav-badge { position: absolute; top: 6px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--solid-danger); color: var(--text-on-danger); font-size: var(--fs-caption); font-weight: var(--weight-black); display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface-page); box-sizing: content-box; }
.bell { position: relative; display: inline-flex; flex: none; }
.bell__count { position: absolute; top: calc(-1 * var(--space-1)); right: calc(-1 * var(--space-1)); display: flex; align-items: center; justify-content: center; min-width: var(--space-5); height: var(--space-5); padding-inline: var(--space-1); border: 2px solid var(--surface-page); border-radius: var(--radius-pill); background: var(--solid-danger); color: var(--text-on-danger); font: var(--type-caption); font-weight: var(--weight-black); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }

/* ---------- Tabs: underlined section links (the You tab and the Group page) ---------- */
.tabs { display: flex; gap: var(--space-4); min-width: 0; overflow-x: auto; scrollbar-width: none; padding-inline-end: var(--space-1); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; gap: var(--space-1); min-height: var(--tap-min); color: var(--text-muted); font-size: var(--fs-body); font-weight: var(--weight-bold); white-space: nowrap; transition: color var(--dur-fast); }
.tabs a { scroll-margin-inline: var(--space-4); }
.tabs a:hover { color: var(--text-strong); }
.tabs a:focus-visible, .chips .chip:focus-visible { outline-offset: -3px; }
.tabs a:is([aria-current="page"], [aria-current="location"]) { color: var(--text-strong); }
.tabs a:is([aria-current="page"], [aria-current="location"])::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: var(--radius-pill); background: var(--accent); }

/* ---------- Stat: a caption over a numeral, in a row ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .num { line-height: 1; }

/* ---------- Chart (ct_rating_chart): inline SVG from tokens. The page places it; the script draws it at the box's own width. ---------- */
.chart { position: relative; min-width: 0; border-radius: var(--radius-md); touch-action: pan-y; cursor: crosshair; }
.chart__plot { line-height: 0; }
.chart__svg { display: block; overflow: visible; max-width: 100%; }
.chart__grid { stroke: var(--border-faint); stroke-width: 1; }
.chart__tick { fill: var(--text-subtle); font-size: var(--fs-caption); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart__peakline { stroke: var(--border-control); stroke-width: 1; stroke-dasharray: 3 4; }
.chart__peak { fill: var(--surface-card); stroke: var(--accent); stroke-width: 3; }
.chart__peaklabel { fill: var(--text-strong); font-size: var(--fs-caption); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.chart__now { fill: var(--accent); stroke: var(--surface-card); stroke-width: 2.5; }
.chart__cursor line { stroke: var(--text-subtle); stroke-width: 1; }
.chart__cursor circle { fill: var(--text-strong); stroke: var(--accent); stroke-width: 3; }
.chart__tip { position: absolute; z-index: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); max-width: 220px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-pop); font-size: var(--fs-caption); line-height: 1.3; pointer-events: none; opacity: 0; transition: opacity var(--dur-fast); }
.chart__tip.is-on { opacity: 1; }
.chart__tip-week { color: var(--text-muted); font-weight: var(--weight-bold); }
.chart__tip-change { color: var(--text-muted); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }

/* ---------- Match stats (ct_match_stats): the timeline and the team statistics. Home and away wear their colours (--home, --away) on the card. ---------- */
.match__line { font-size: var(--fs-body); font-weight: var(--weight-semibold); color: var(--text-muted); padding: var(--space-2) 0; }
.timeline { position: relative; display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-subtle); }
.timeline__row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); align-items: center; gap: var(--space-2); padding: var(--space-1) 0; border-radius: var(--radius-md); }
.timeline__side { min-width: 0; display: flex; }
.timeline__side--home { justify-content: flex-end; text-align: right; }
.timeline__min { position: relative; z-index: 1; justify-self: center; min-width: 44px; padding: 2px var(--space-1); border-radius: var(--radius-pill); background: var(--surface-sunken); box-shadow: var(--shadow-well); font-size: var(--fs-num-s); line-height: 1.1; text-align: center; color: var(--text-strong); }
.timeline__ev { display: inline-flex; align-items: flex-start; gap: var(--space-2); min-width: 0; font-size: var(--fs-label); font-weight: var(--weight-semibold); color: var(--text-body); }
.timeline__side--home .timeline__ev { flex-direction: row-reverse; }
.timeline__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: inherit; }
.timeline__side--home .timeline__text { align-items: flex-end; }
.timeline__text .num { font-size: var(--fs-label); color: var(--text-strong); white-space: nowrap; }
.timeline__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--space-5); height: var(--space-5); }
.timeline__ev.is-removed .timeline__text > span:first-child { text-decoration: line-through; text-decoration-color: var(--state-corrected); color: var(--text-subtle); }
.timeline__break { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); box-shadow: var(--shadow-well); font-size: var(--fs-label); font-weight: var(--weight-bold); color: var(--text-strong); }
.timeline__break .caption { font-weight: var(--weight-semibold); }
.timeline__row.is-settles, .timeline__break.is-settles, .stat-bar.is-settles { background: var(--surface-accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.is-flash { animation: flash 1.8s var(--ease-out); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.stat-bars { display: flex; flex-direction: column; gap: var(--space-3); }
.match__sides { display: flex; justify-content: space-between; gap: var(--space-3); min-width: 0; }
.match__side--away { justify-content: flex-end; min-width: 0; }
.stat-bar { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-2); border-radius: var(--radius-md); min-width: 0; }
.stat-bar__top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; gap: var(--space-2); }
.stat-bar__name { font-size: var(--fs-caption); font-weight: var(--weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); text-align: center; }
.stat-bar__v { font-size: var(--fs-num-s); line-height: 1; color: var(--text-muted); }
.stat-bar__v:last-child { text-align: right; }
.stat-bar__v.is-lead { color: var(--text-strong); }
.stat-bar__track { display: grid; gap: 2px; height: var(--progress-h); }
.stat-bar__track i { display: block; border-radius: var(--radius-xs); }
.stat-bar__track i:first-child { background: var(--home); }
.stat-bar__track i:last-child { background: var(--away); }
.stat-bar.is-empty .stat-bar__track { background: var(--progress-track); border-radius: var(--radius-xs); }
.stat-bar.is-empty .stat-bar__track i { display: none; }
/* Points sit under each player, on their own side of the pitch, so a decimal never has to squeeze between two avatars */

/* ---------- Head to head (shared/_head_to_head): the two players of a Duel, then their points on score tiles once it is final. ---------- */
.h2h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: var(--space-3); width: 100%; max-width: var(--layout-compact); margin-inline: auto; }
.h2h__side { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 0; text-align: center; }
.h2h__portrait { position: relative; display: inline-flex; border-radius: var(--radius-avatar); }
.h2h__side.is-winner .h2h__portrait { box-shadow: 0 0 0 3px var(--accent), var(--glow-accent); }
.h2h__name { max-width: 100%; font: var(--type-h3); overflow-wrap: anywhere; }
.h2h__vs { align-self: start; padding-top: calc((72px - var(--lh-label)) / 2); font: var(--type-label); font-family: var(--font-display); color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-label); }
.score-tile--pts { --score-w: auto; --score-h: 56px; min-width: 96px; padding-inline: var(--space-4); font-size: var(--fs-num-l); }

/* Competition disclosure: shared fixture groups with native keyboard support. */
.competition-section { border: 0; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); overflow: clip; }
.competition-section__name { flex: 1; min-width: 0; font-size: var(--fs-label); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.competition-section__count { flex: none; }
.competition-section__fixtures { padding: var(--space-3); border-top: 1.5px solid var(--border-faint); background: var(--surface-sunken); }

/* ---------- Contest overview and result (bundles/_overview, bundles/_result): one calm card, the numbers big and everything else a caption. ---------- */
.overview__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.h2h + .overview__row { padding-top: var(--space-4); border-top: 1.5px solid var(--border-faint); }
.overview__meta { display: flex; align-items: center; gap: var(--space-1) var(--space-4); flex-wrap: wrap; }
.overview__duel { margin-left: auto; color: var(--text-strong); }
.overview__duel .ct-icon { color: var(--text-accent); }
@media (max-width: 600px) { .overview__duel { flex: 1 1 100%; margin-left: 0; } }
.overview__row .responsive-action { margin-left: auto; }
.overview__time, .overview__progress { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-label); }
.overview__progress .progress { width: 160px; }
/* Meter tiles: a figure with its own short gauge, laid out in a grid. Replaces full-width bars that stretch across a card (Football DNA, the crowd). */
.meter-grid { display: grid; gap: var(--space-3); margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.meter-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meter-wrap { container-type: inline-size; }
.meter-grid--dna { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 520px) { .meter-grid--dna { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.meter-tile { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2); min-width: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); box-shadow: var(--shadow-well); color: var(--text-strong); }
.meter-tile__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.meter-tile__label { margin: 0; font: var(--type-label); color: var(--text-muted); text-wrap: balance; overflow-wrap: anywhere; }
.meter-tile__value { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-1); margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--fs-num-m); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.meter-tile__value .num { line-height: var(--lh-tight); }
.meter-tile__value small { font: var(--type-caption); font-family: var(--font-body); color: var(--text-muted); }
.meter-tile .progress--bar { height: var(--progress-h-sm); }
.meter-tile .caption { color: var(--text-muted); text-wrap: pretty; }
.meter-tile--link { text-decoration: none; transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.meter-tile--link:hover { background: var(--surface-card); }
.meter-tile--link:active { transform: translateY(1px); }
.meter-tile--link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.meter-tile.is-lead { background: var(--surface-accent-soft); }
/* Performance figures: one leading value and three supporting measures. */
.stat-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin: 0; align-items: center; }
.stat-summary > div { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.stat-summary dt { font: var(--type-label); color: var(--text-muted); }
.stat-summary dd { margin: 0; }
.stat-summary__lead .num { color: var(--text-accent); }
@container (min-width: 600px) { .stat-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* A static, equal-width column chart. Its accompanying disclosure supplies full labelled values. */
.call-chart { display: flex; gap: var(--space-2); height: var(--call-chart-height); margin-top: var(--space-4); }
.call-chart__scale { display: flex; flex-direction: column; justify-content: space-between; flex: none; width: var(--space-4); color: var(--text-muted); font: var(--type-caption); }
.call-chart__plot { display: flex; align-items: stretch; justify-content: space-around; gap: var(--space-1); flex: 1; min-width: 0; border-bottom: var(--border-width) solid var(--border-control); background: linear-gradient(to bottom, var(--border-faint) var(--border-width), transparent var(--border-width)) top / 100% 50%; }
.call-chart__column { flex: 1; min-width: 0; max-width: var(--space-7); display: flex; align-items: flex-end; }
.call-chart__bar { width: 100%; min-height: var(--border-width-strong); height: var(--bar-value); border-radius: var(--radius-xs) var(--radius-xs) 0 0; background: var(--accent); }
.call-chart__column:last-child .call-chart__bar { background: var(--text-strong); }
.comparison-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.comparison-legend > span { display: inline-flex; gap: var(--space-2); align-items: center; }
.comparison-legend > span::before { content: ""; width: var(--space-2); height: var(--space-2); border-radius: var(--radius-pill); background: var(--accent); }
.comparison-legend > span + span::before { background: var(--text-info); }
@media (max-width: 600px) {
  .meter-grid--3 .meter-tile { padding: var(--space-3) var(--space-2); }
  .meter-grid--3 .meter-tile__value { font-size: var(--fs-num-s); }
}
.note { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--text-muted); }
.note svg { flex: none; margin-top: 2px; }
.overview__invite { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-sunken); box-shadow: var(--shadow-well); }
.overview--bare .overview__row .responsive-action { margin-left: auto; }

/* A highlighted final row follows the table's outer corners so its inset ring remains whole. */
.data-table .data-table__row.is-you:last-child { border-end-start-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg); }

/* Shared fixture hero variants used by Event and match pages. */
.fixture-hero--simple.card--hero{--hero-crest:64px;min-height:0;gap:var(--space-4);padding-block:var(--space-5)}
.fixture-hero--scenic.card--hero{background:var(--surface-card)}
@media(min-width:960px){.fixture-hero--simple.card--hero{--hero-crest:80px;min-height:236px}}
@media(max-width:400px){.fixture-hero--simple.card--hero{--hero-crest:56px}}

/* One native disclosure row for every section that opens below its label. */
.disclosure__summary { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h); padding-block: var(--space-3); list-style: none; cursor: pointer; font: var(--type-label); color: var(--text-strong); }
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary--inset { padding-inline: var(--space-4); }
.disclosure__summary:hover { color: var(--text-accent); }
.disclosure__label { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.disclosure__label > .cluster, .disclosure__label > .stack { min-width: 0; }
.disclosure__chevron { flex: none; color: var(--text-muted); transition: transform var(--dur-fast) var(--ease-out); }
details[open] > .disclosure__summary > .disclosure__chevron { transform: rotate(180deg); }
