/* ============================================================
   PACY — SECTIONS, SEARCH, MATCH CENTRE, STATES
   ============================================================ */

/* ---- PAGE INTRODUCTION --------------------------------------
   The direct answer, above everything else. Server-rendered, never
   lazy, and dimensioned so nothing below it moves when the live
   data arrives — the summary is one or two lines at every width the
   layout supports, and the space for both is reserved. */
.intro {
  background: var(--shell);
  /* Only the top: the date and status controls are a child of this section,
     so a bottom padding here would open a gap under the control bar rather
     than between the introduction and it. */
  padding-block: var(--s-8) 0;
}
/* Three pieces of decreasing weight — the claim, the detail, the shortcut —
   so they are spaced by decreasing intervals rather than by one flat gap.
   Set as margins, not as a flex gap: the heading's own leading already
   contributes space above the summary, and a single gap value applied to
   both intervals made the block read as one dense slab. */
.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: var(--s-6);
}
.intro-inner h1 {
  margin: 0;
  font-size: var(--t-h1);
  line-height: var(--lh-tight);
  /* Display sizes need the tracking pulled in; at 44px the default spacing
     reads as loose beside the tight leading. */
  letter-spacing: -0.02em;
  color: var(--on-shell);
  text-wrap: balance;
}
.intro-summary {
  /* Wide enough that the sentence breaks on a phrase rather than stranding
     "with" at the end of the first line, still short of a tiring measure. */
  max-width: 72ch;
  min-height: 2lh;
  margin: var(--s-4) 0 0;
  color: var(--on-shell-mid);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  text-wrap: pretty;
}
.intro-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s-5);
  min-height: 34px;
  padding-inline: var(--s-4);
  border: 1px solid rgba(127, 196, 255, .22);
  border-radius: var(--r-pill);
  background: rgba(37, 99, 235, .12);
  color: var(--on-shell);
  font-size: var(--t-meta);
  font-weight: 600;
}
.intro-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}
/* On a phone the same three elements take a third of the first screen at
   desktop spacing, and the intervals no longer need to hold apart type
   that large. Tightened proportionally rather than collapsed — the block
   still reads as three things, not one. */
@media (max-width: 620px) {
  .intro { padding-block: var(--s-6) 0; }
  .intro-inner { padding-bottom: var(--s-4); }
  .intro-summary { margin-top: var(--s-3); }
  .intro-live { margin-top: var(--s-4); }
}

/* ---- LIVE NOW SPOTLIGHT ------------------------------------- */
/* The page opens on the most characteristic thing Pacy has: a
   match happening right now, rendered larger than anything else. */
/* Vertical footprint.
   The section used to open 32px down and close 56px later, with a
   20px gap under the heading and a 20px rail pad below the cards.
   None of that was the cards — it was chrome around them. The card
   size and the score type are unchanged; only the space they sit in
   is tightened, which is what buys back the first viewport. */
.spotlight {
  background: var(--shell);
  padding-block: var(--s-5) var(--s-6);
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(148deg, rgba(37,99,235,.20) 0%, rgba(37,99,235,.20) 18%, transparent 18.3%),
    linear-gradient(214deg, rgba(23,74,126,.40) 0%, rgba(23,74,126,.40) 30%, transparent 30.3%);
  pointer-events: none;
  background-size: 112% 112%;
  animation: spotlightFacetDrift 16s var(--ease-in-out) infinite alternate;
}
.spotlight::after {
  content: "";
  position: absolute;
  width: min(44vw, 620px);
  aspect-ratio: 1;
  inset-inline-end: -14%;
  inset-block-start: -65%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 141, 255, .18), transparent 68%);
  pointer-events: none;
  animation: spotlightOrbFloat 12s var(--ease-in-out) infinite alternate;
}
@keyframes spotlightFacetDrift {
  to { background-position: 6% 3%, -7% 5%; }
}
@keyframes spotlightOrbFloat {
  to { transform: translate3d(-18vw, 18%, 0) scale(1.18); opacity: .72; }
}
.spotlight > .page { position: relative; }

.spotlight-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  padding-bottom: 6px;
}
.spotlight-head::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 2px;
  opacity: .8;
  background: linear-gradient(90deg,
    transparent 0 12%, rgba(37,99,235,.18) 30%, var(--electric) 44%,
    var(--bolt-core) 49%, #fff 50%, var(--bolt-hot) 52%,
    rgba(37,99,235,.18) 70%, transparent 88% 100%);
  background-size: 230% 100%;
  animation: liveLineTravel 4.6s var(--ease-in-out) infinite;
  filter: drop-shadow(0 0 6px rgba(127,196,255,.55));
  pointer-events: none;
}
.spotlight-head h2 {
  position: relative;
  font-size: var(--t-h2);
  color: var(--on-shell);
  text-shadow: 0 0 24px rgba(37,99,235,.22);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .spotlight-head h2 {
    color: transparent;
    background: linear-gradient(100deg,
      var(--on-shell) 0 34%, var(--bolt-core) 44%, var(--on-shell) 50%, var(--bolt-hot) 54%, var(--on-shell) 64% 100%);
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: liveTitleCharge 5.2s var(--ease-in-out) infinite;
  }
}
.spotlight-head .live-count {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid rgba(127,196,255,.18);
  border-radius: var(--r-pill);
  background: rgba(37,99,235,.1);
  font-size: var(--t-meta);
  color: var(--on-shell-mid);
}
.spotlight-head .live-count::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(229,53,43,.5);
  animation: liveCountBeat 2s var(--ease-in-out) infinite;
}
@keyframes liveLineTravel {
  0%, 12% { background-position: 115% 0; opacity: .18; }
  44%, 70% { opacity: .9; }
  100% { background-position: -115% 0; opacity: .18; }
}
@keyframes liveTitleCharge {
  0%, 18% { background-position: 110% 0; }
  66%, 100% { background-position: -70% 0; }
}
@keyframes liveCountBeat {
  0%, 55%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229,53,43,.44); }
  68% { transform: scale(1.2); box-shadow: 0 0 0 7px rgba(229,53,43,0); }
}
.spotlight-nav { margin-inline-start: auto; display: flex; gap: var(--s-2); }
.spotlight-nav .icon-btn { border: 1px solid var(--shell-line); }
.spotlight-nav .icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* Sport selector for the live rail.
   A dropdown rather than a row of chips: the sport list grows with
   every sport added, and a row would either wrap or scroll. Scoped
   to this section — it picks what appears in the live rail, while
   the bar above governs the full board below. Only sports with a
   live match are listed, so no option is ever dead. */
.live-select { position: relative; }
/* Same height as .ls-trigger below, which replaces it on hydration. */
.ls-reserve { height: 44px; }
/* On a phone the heading row wraps rather than squeezing the selector,
   which would clip its sport name. */
@media (max-width: 620px) {
  .spotlight { padding-block: var(--s-3) var(--s-4); }
  .spotlight-head { flex-wrap: wrap; margin-bottom: var(--s-2); }
  .live-select { order: 3; width: 100%; }
}

.ls-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  min-width: 230px;
  padding: 0 var(--s-4);
  border-radius: var(--r-md);
  background: var(--shell-hover);
  border: 1px solid var(--shell-line);
  color: var(--on-shell);
  font-size: var(--t-body);
  font-weight: 600;
  transition: background var(--d-fast) var(--ease-out),
              border-color var(--d-fast) var(--ease-out);
}
.ls-trigger:hover { background: var(--shell-hover-2); border-color: var(--shell-line); }
.ls-trigger[aria-expanded="true"] { border-color: rgba(37, 99, 235, .7); }
.ls-trigger .glyph { width: 18px; height: 18px; opacity: .9; }
.ls-trigger .ls-label { margin-inline-end: auto; }
.ls-trigger .n {
  font-size: var(--t-micro);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--shell-hover-2);
}
.ls-trigger .caret {
  width: 16px; height: 16px;
  transition: transform var(--d-med) var(--ease-out);
}
.ls-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }

.ls-menu {
  position: absolute;
  inset-block-start: calc(100% - var(--s-2));
  inset-inline-start: 0;
  z-index: 40;
  min-width: 260px;
  max-height: 340px;
  overflow-y: auto;
  padding: var(--s-2);
  border-radius: var(--r-lg);
  background: var(--shell-raised);
  border: 1px solid var(--shell-line);
  box-shadow: var(--sh-shell);
  animation: lsIn var(--d-fast) var(--ease-out);
}
.ls-menu[hidden] { display: none; }
@keyframes lsIn { from { opacity: 0; transform: translateY(-6px); } }

/* The menu's own scrollbar sits on the dark panel too. */
.ls-menu {
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, .8) transparent;
}
.ls-menu::-webkit-scrollbar { width: 8px; }
.ls-menu::-webkit-scrollbar-track { background: transparent; }
.ls-menu::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background: var(--electric);
  background-clip: padding-box;
}
.ls-menu::-webkit-scrollbar-thumb:hover {
  background: var(--blue-400);
  background-clip: padding-box;
}

.ls-opt {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s-3);
  border-radius: var(--r-md);
  color: var(--on-shell-mid);
  font-size: var(--t-body);
  font-weight: 500;
  text-align: start;
  transition: background var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out);
}
.ls-opt:hover,
.ls-opt.is-active { background: var(--shell-hover-2); color: var(--on-shell); }
.ls-opt .glyph { width: 18px; height: 18px; opacity: .85; }
.ls-opt .n {
  margin-inline-start: auto;
  font-size: var(--t-micro);
  font-weight: 700;
  color: var(--on-shell-soft);
  font-variant-numeric: tabular-nums;
}

/* The checkmark trails the row rather than leading it. A leading
   tick reserves its width on every option, so unselected rows sat
   indented from the edge while only the selected one looked aligned. */
.ls-opt .tick {
  width: 16px; height: 16px;
  color: var(--blue-300);
  flex: none;
  order: 99;
  margin-inline-start: var(--s-2);
}
.ls-opt[aria-selected="false"] .tick { display: none; }

/* Selection is carried by weight and a leading accent, so it reads
   without depending on the tick alone. */
.ls-opt[aria-selected="true"] {
  color: var(--on-shell);
  font-weight: 650;
  background: rgba(37, 99, 235, .18);
  box-shadow: inset 3px 0 0 var(--electric);
}
[dir="rtl"] .ls-opt[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--electric); }

.ls-sep {
  height: 1px;
  margin: var(--s-2) var(--s-3);
  background: var(--shell-line);
}

.spotlight-rail {
  display: flex;
  align-items: stretch;
  gap: var(--s-5);
  padding-bottom: var(--s-2);
  scroll-padding-inline: var(--s-2);
}
/* Three complete cards at a common laptop width: the basis is the rail
   minus its two gaps, divided three ways, so a card is always whole. The
   floor keeps a card readable rather than letting three squeeze into a
   narrow window — below it the responsive steps drop to two, then one. */
.spotlight-rail > .card {
  /* Three cards, with slack. Sized to exactly a third of the remaining
     width, sub-pixel rounding puts the third card's edge a fraction past
     the rail and it stops being a complete card — so a few pixels are
     given back rather than relying on the arithmetic landing clean. */
  flex: 0 0 clamp(320px, calc((100% - (var(--s-5) * 2) - 10px) / 3), 460px);
  scroll-snap-align: start;
  animation: liveRailSettle 520ms var(--ease-out) backwards;
}
.spotlight-rail > .card:nth-child(2) { animation-delay: 70ms; }
.spotlight-rail > .card:nth-child(3) { animation-delay: 140ms; }
.spotlight-rail > .card:nth-child(4) { animation-delay: 210ms; }

/* The complete list, as a link rather than a swipe. */
.rail-all {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-4);
  border: 1px solid var(--shell-line);
  border-radius: var(--r-pill);
  background: rgba(37, 99, 235, .12);
  color: var(--on-shell);
  font-size: var(--t-meta);
  font-weight: 600;
  white-space: nowrap;
}
.rail-all:hover { background: rgba(37, 99, 235, .22); }
.rail-empty {
  padding-block: var(--s-4);
  color: var(--on-shell-mid);
  font-size: var(--t-meta);
}
.rail-empty a { color: var(--on-shell); text-decoration: underline; }
@keyframes liveRailSettle {
  from { opacity: 0; transform: translate3d(18px, 8px, 0) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* Scrollers on the dark shell.
   The shared .scroll-x scrollbar is coloured for pale surfaces, so
   on the shell it read as a grey slab across the section. These are
   built for the dark background: a faint track and an electric-blue
   thumb that belongs to the brand rather than the OS.
   Applies to the live rail and the sports bar, which are the two
   scrollers sitting on the shell. */
.spotlight-rail,
.sports-scroller {
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, .8) rgba(255, 255, 255, .07);
}
.spotlight-rail::-webkit-scrollbar,
.sports-scroller::-webkit-scrollbar { height: 8px; }

.spotlight-rail::-webkit-scrollbar-track,
.sports-scroller::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .06);
  border-radius: var(--r-pill);
}

.spotlight-rail::-webkit-scrollbar-thumb,
.sports-scroller::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  /* The 2px transparent border keeps the thumb visually inset from
     the track instead of filling its whole height. */
  border: 2px solid transparent;
  background: linear-gradient(90deg,
    var(--electric), var(--blue-400) 60%, var(--blue-300));
  background-clip: padding-box;
}
.spotlight-rail::-webkit-scrollbar-thumb:hover,
.sports-scroller::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--blue-400), var(--blue-300));
  background-clip: padding-box;
}

/* Spotlight cards read on the dark shell rather than the sheet. */
.spotlight .card { border-color: transparent; box-shadow: var(--sh-shell); }
.spotlight .card[data-status="live"]::before {
  background: linear-gradient(90deg,
    var(--live), var(--bolt-hot), var(--bolt-core), #fff, var(--live));
  background-size: 240% 100%;
  animation: liveEdgeCurrent 3.8s linear infinite;
  box-shadow: 0 0 10px rgba(37,99,235,.35);
}
@keyframes liveEdgeCurrent { to { background-position: -240% 0; } }

/* ---- SCROLL ARC ---------------------------------------------
   An electric arc rides the rail while it is being scrolled. It is
   driven by velocity rather than a fixed animation: --arc is the
   charge (0-1) and --arc-pos is where the head sits, both written
   from JS on each frame. Idle, it is completely invisible — the
   effect exists only while the rail is actually moving.

   Everything animates on opacity and transform, so scrolling stays
   on the compositor.
   ------------------------------------------------------------- */
.rail-wrap { position: relative; }

.rail-arc {
  position: absolute;
  inset-inline: 0;
  /* Sits just above the scrollbar, along the rail's lower edge. */
  inset-block-end: 10px;
  height: 2px;
  pointer-events: none;
  z-index: 3;
  opacity: var(--arc, 0);
  transition: opacity 240ms var(--ease-out);
  background: linear-gradient(90deg,
    transparent,
    rgba(37, 99, 235, .28) 12%,
    rgba(37, 99, 235, .28) 88%,
    transparent);
}

/* The travelling head: a bright bolt whose width and glow grow with
   the charge. */
.rail-arc i {
  position: absolute;
  inset-block: -1px;
  inset-inline-start: 0;
  width: clamp(70px, calc(90px + var(--arc, 0) * 160px), 260px);
  border-radius: var(--r-pill);
  transform: translateX(calc(var(--arc-pos, 0) * 1px - 50%));
  background: linear-gradient(90deg,
    transparent,
    var(--bolt-deep) 20%,
    var(--bolt-core) 42%,
    var(--white) 52%,
    var(--bolt-hot) 68%,
    transparent);
  filter:
    drop-shadow(0 0 calc(4px + var(--arc, 0) * 8px) rgba(127, 196, 255, .95))
    drop-shadow(0 0 calc(8px + var(--arc, 0) * 16px) rgba(255, 176, 32, .5));
}

/* Leading-edge glow: the side you are travelling toward lights up,
   which also hints there is more rail that way. */
.rail-edge {
  position: absolute;
  inset-block: 0;
  width: 84px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.rail-edge--start {
  inset-inline-start: 0;
  background: linear-gradient(to right,
    rgba(37, 99, 235, .30), rgba(255, 176, 32, .06) 45%, transparent);
}
.rail-edge--end {
  inset-inline-end: 0;
  background: linear-gradient(to left,
    rgba(37, 99, 235, .30), rgba(255, 176, 32, .06) 45%, transparent);
}
.rail-wrap[data-dir="end"]   .rail-edge--end   { opacity: var(--arc, 0); }
.rail-wrap[data-dir="start"] .rail-edge--start { opacity: var(--arc, 0); }

/* The arc is decoration for a motion the user is already making, so
   it is removed outright when motion is reduced. */
@media (prefers-reduced-motion: reduce) {
  .rail-arc, .rail-edge { display: none; }
}
[data-motion="off"] .rail-arc,
[data-motion="off"] .rail-edge { display: none; }

/* ---- FAVOURITES --------------------------------------------- */
.fav-section { background: var(--surface-sunk); }
.fav-empty {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-6);
  border: 1px dashed var(--surface-line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-soft);
  font-size: var(--t-meta);
}
.fav-empty svg { width: 28px; height: 28px; color: var(--ink-faint); flex: none; }

/* Empty state: one row, not a section.
   A dashed 24px-padded panel under an h2 took roughly 150px of the page
   to tell a reader about a feature they had not asked for, and pushed
   the matches down by exactly that much. This is a single line. */
.fav-section:has(.fav-prompt) { background: transparent; }
.fav-prompt {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0;
  padding-block: var(--s-3);
  border-block-end: 1px solid var(--surface-line);
  color: var(--ink-soft);
  font-size: var(--t-meta);
}
.fav-prompt-icon { display: inline-flex; flex: none; color: var(--ink-faint); }
.fav-prompt-icon svg { width: 18px; height: 18px; }
.fav-prompt-act {
  min-height: 44px;
  padding-inline: var(--s-3);
  margin-inline-start: auto;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--electric);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.fav-prompt-act:hover { border-color: var(--electric); }

/* ---- PACY BRIEF --------------------------------------------- */
/* Restrained by construction: the list is capped at five and the
   scoreboard stays the dominant content on the page. */
.brief-list {
  display: grid;
  gap: var(--s-1);
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.brief-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--s-4);
  padding: var(--s-5);
  transition: background var(--d-fast) var(--ease-out);
}
.brief-item + .brief-item { border-top: 1px solid var(--surface-line); }
.brief-item:hover { background: var(--surface-sunk); text-decoration: none; }

.brief-sport {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--med-blue);
  background: var(--blue-050);
  padding: 4px var(--s-3);
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.brief-body h3 {
  font-size: var(--t-h3);
  margin-bottom: 4px;
  line-height: 1.3;
}
.brief-body p { font-size: var(--t-meta); color: var(--ink-mid); }
.brief-body .brief-meta {
  margin-top: var(--s-2);
  font-size: var(--t-meta);
  color: var(--ink-faint);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.brief-item .chev { color: var(--ink-faint); align-self: center; }
.brief-item:hover .chev { color: var(--electric); }

/* ---- CONTEXTUAL PANEL (wide screens) ------------------------ */
/* Fills the space a 1360px content column leaves on a wide
   display, with a running score ticker rather than filler. */
.ctx-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ctx-live {
  isolation: isolate;
  box-shadow: var(--sh-1);
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--electric) 8%, var(--surface)), var(--surface) 38%);
}
.ctx-live::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  inset-block: 0;
  width: 2px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent, var(--electric), var(--bolt-core), #fff, var(--bolt-hot), transparent);
  background-size: 100% 240%;
  animation: ctxEdgeCurrent 4s linear infinite;
  filter: drop-shadow(0 0 6px rgba(37,99,235,.55));
}
@keyframes ctxEdgeCurrent { to { background-position: 0 240%; } }
.ctx-block + .ctx-block { margin-top: var(--s-4); }

.ctx-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--surface-line);
}
.ctx-live .ctx-head {
  color: var(--ink);
  background: linear-gradient(110deg,
    color-mix(in srgb, var(--electric) 13%, transparent), transparent 62%);
}
.ctx-live .ctx-head::after {
  content: "";
  position: absolute;
  inset-inline: var(--s-4);
  inset-block-end: -1px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--electric), var(--bolt-core), var(--bolt-hot), transparent);
  background-size: 220% 100%;
  animation: ctxHeadCharge 3.6s var(--ease-in-out) infinite;
}
@keyframes ctxHeadCharge {
  from { background-position: 120% 0; opacity: .25; }
  55% { opacity: 1; }
  to { background-position: -120% 0; opacity: .25; }
}
.ctx-bolt {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--electric), var(--blue-600));
  box-shadow: 0 5px 12px rgba(37,99,235,.24);
}
.ctx-bolt svg { width: 13px; height: 13px; }
.ctx-head h3 {
  font-size: var(--t-meta);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.ctx-head .n { margin-inline-start: auto; font-size: var(--t-meta); color: var(--ink-faint); }
.ctx-live-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--blue-050);
}
.ctx-live-count i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: liveCountBeat 2s var(--ease-in-out) infinite;
}

.ticker { display: grid; }
.tick-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  width: 100%;
  padding: var(--s-3) var(--s-4);
  text-align: start;
  transition: background var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out),
              box-shadow var(--d-fast) var(--ease-out);
  animation: ctxRowIn 360ms var(--ease-out) backwards;
}
.tick-row:nth-child(2) { animation-delay: 35ms; }
.tick-row:nth-child(3) { animation-delay: 70ms; }
.tick-row:nth-child(4) { animation-delay: 105ms; }
.tick-row:nth-child(5) { animation-delay: 140ms; }
.tick-row:nth-child(6) { animation-delay: 175ms; }
.tick-row:nth-child(7) { animation-delay: 210ms; }
.tick-row:nth-child(8) { animation-delay: 245ms; }
@keyframes ctxRowIn {
  from { opacity: 0; transform: translateX(9px); }
  to { opacity: 1; transform: none; }
}
.tick-row + .tick-row { border-top: 1px solid var(--surface-line); }
.tick-row:hover {
  z-index: 2;
  background: color-mix(in srgb, var(--electric) 9%, var(--surface));
  transform: translateX(-4px) scale(1.012);
  box-shadow: 0 8px 22px rgba(4,16,31,.13);
}
.tick-charge {
  position: absolute;
  inset-block: 14%;
  inset-inline-start: 0;
  width: 2px;
  border-radius: var(--r-pill);
  background: linear-gradient(var(--electric), var(--bolt-core), var(--bolt-hot));
  opacity: .2;
  transform: scaleY(.3);
  transition: opacity var(--d-fast) var(--ease-out), transform var(--d-med) var(--ease-out);
}
.tick-row:hover .tick-charge { opacity: 1; transform: scaleY(1); }
.tick-team {
  font-size: var(--t-meta);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.tick-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 30px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  text-align: center;
  background: var(--surface-sunk);
  border: 1px solid var(--surface-line);
}
.tick-score-live { animation: ctxScoreLive 620ms var(--ease-spring); }
@keyframes ctxScoreLive {
  0% { transform: scale(.72); color: var(--electric); }
  48% {
    transform: scale(1.28);
    color: #fff;
    background: var(--electric);
    box-shadow: 0 0 18px rgba(37,99,235,.65);
  }
  100% { transform: scale(1); }
}
.tick-meta {
  grid-column: 1 / -1;
  font-size: var(--t-micro);
  color: var(--live);
  font-weight: 700;
  letter-spacing: .04em;
  display: flex; align-items: center; gap: 5px;
}
.tick-meta .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.8s var(--ease-in-out) infinite;
}
.ctx-empty { padding: var(--s-5) var(--s-4); font-size: var(--t-meta); color: var(--ink-soft); }

.ctx-event {
  display: block;
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-meta);
}
.ctx-event + .ctx-event { border-top: 1px solid var(--surface-line); }
.ctx-event:hover { background: var(--blue-050); text-decoration: none; }
.ctx-event .w {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--electric);
}
.ctx-event .n { font-weight: 600; color: var(--ink); }
.ctx-event .s { color: var(--ink-soft); font-size: var(--t-micro); }

/* ---- UPCOMING EVENTS ---------------------------------------- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-4);
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: box-shadow var(--d-med) var(--ease-out),
              transform var(--d-med) var(--ease-out);
}
.event-card:hover { box-shadow: var(--sh-2); text-decoration: none; }
.event-card .ev-when {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--electric);
}
.event-card h3 { font-size: var(--t-h3); margin: var(--s-2) 0 var(--s-2); }
.event-card p { font-size: var(--t-meta); color: var(--ink-soft); }
.event-card .countdown {
  margin-top: var(--s-4);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ============================================================
   UNIVERSAL SEARCH
   ============================================================ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 16, 31, .62);
  backdrop-filter: blur(3px);
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(var(--s-5), 8vh, var(--s-11)) var(--s-5) var(--s-5);
  animation: overlayIn var(--d-med) var(--ease-out);
}
@keyframes overlayIn { from { opacity: 0; } }
.search-overlay[hidden] { display: none; }

.search-panel {
  width: min(680px, 100%);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: panelIn var(--d-med) var(--ease-out);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(-10px) scale(.99); } }

.search-field {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--surface-line);
  flex: none;
}
.search-field svg { width: 22px; height: 22px; color: var(--ink-faint); flex: none; }
.search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1.125rem;
  font-family: var(--font-display);
  font-weight: 500;
  min-width: 0;
}
.search-field input::placeholder { color: var(--ink-faint); font-weight: 400; }
.search-field .esc {
  font-size: var(--t-micro);
  color: var(--ink-faint);
  border: 1px solid var(--surface-line-strong);
  border-radius: 5px;
  padding: 3px 7px;
  flex: none;
}

.search-results { overflow-y: auto; padding: var(--s-3); }

.res-group + .res-group { margin-top: var(--s-3); }
.res-group-title {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: var(--s-3) var(--s-4) var(--s-2);
}

.res-item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  min-height: 56px;   /* large, easy hit areas */
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  text-align: start;
  transition: background var(--d-fast) var(--ease-out);
}
.res-item:hover,
.res-item[aria-selected="true"] { background: var(--blue-050); }
.res-item[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--blue-100); }

.res-item .r-crest {
  width: 34px; height: 34px;
  border-radius: 8px;
  flex: none;
}
.res-item .r-main { min-width: 0; }
.res-item .r-name {
  font-weight: 600;
  font-size: var(--t-body);
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.res-item .r-name mark {
  background: var(--blue-100);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.res-item .r-sub { font-size: var(--t-meta); color: var(--ink-soft); }
.res-item .r-type {
  margin-inline-start: auto;
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: none;
}

.search-empty { padding: var(--s-9) var(--s-5); text-align: center; }
.search-empty .facet-badge { margin: 0 auto var(--s-4); }
.search-empty h3 { font-size: var(--t-h3); margin-bottom: var(--s-2); }
.search-empty p { font-size: var(--t-meta); color: var(--ink-soft); }

.search-foot {
  display: flex;
  gap: var(--s-5);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--surface-line);
  font-size: var(--t-micro);
  color: var(--ink-faint);
  flex: none;
  flex-wrap: wrap;
}
.search-foot kbd {
  font-family: var(--font-body);
  background: var(--surface-sunk);
  border: 1px solid var(--surface-line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  margin-inline-end: 4px;
}

/* ============================================================
   MATCH CENTRE (Level 3)
   ============================================================ */

.mc-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(4, 16, 31, .62);
  backdrop-filter: blur(3px);
  display: grid;
  justify-items: center;
  align-items: end;
  animation: overlayIn var(--d-med) var(--ease-out);
}
.mc-overlay[hidden] { display: none; }

.mc-panel {
  --mc-grid: rgba(37, 99, 235, .07);
  --mc-orb: rgba(37, 99, 235, .17);
  position: relative;
  isolation: isolate;
  width: min(920px, 100%);
  max-height: 92vh;
  background: var(--surface-sunk);
  border: 1px solid color-mix(in srgb, var(--electric) 24%, var(--surface-line));
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -10px 60px rgba(4, 16, 31, .3),
              0 0 0 1px rgba(37, 99, 235, .08);
  display: flex;
  flex-direction: column;
  animation: mcIn var(--d-slow) var(--ease-out);
  overflow: hidden;
}
[data-theme="dark"] .mc-panel {
  --mc-grid: rgba(127, 196, 255, .065);
  --mc-orb: rgba(37, 99, 235, .25);
}
@keyframes mcIn {
  from { transform: translateY(34px) scale(.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@property --mc-circuit {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.mc-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(from var(--mc-circuit), transparent 0 68%,
    var(--electric) 76%, var(--bolt-core) 82%, #fff 85%,
    var(--bolt-hot) 89%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: mcPanelCircuit 1050ms 100ms var(--ease-out) both;
}
@keyframes mcPanelCircuit {
  0% { --mc-circuit: 0deg; opacity: 0; }
  14%, 76% { opacity: 1; }
  100% { --mc-circuit: 360deg; opacity: 0; }
}

.mc-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.mc-ambient > * { position: absolute; display: block; }
.mc-ambient-grid {
  inset: 28% -12% -12%;
  opacity: .75;
  background-image:
    linear-gradient(118deg, transparent 49.6%, var(--mc-grid) 50%, transparent 50.4%),
    linear-gradient(28deg, transparent 49.6%, var(--mc-grid) 50%, transparent 50.4%);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 82%, transparent);
  animation: mcGridDrift 20s linear infinite;
}
.mc-ambient-orb {
  width: 330px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(14px);
  background: radial-gradient(circle, var(--mc-orb), transparent 68%);
}
.mc-ambient-orb--one {
  inset-inline-start: -18%;
  inset-block-start: 42%;
  animation: mcOrbOne 13s var(--ease-in-out) infinite alternate;
}
.mc-ambient-orb--two {
  inset-inline-end: -16%;
  inset-block-end: -15%;
  animation: mcOrbTwo 17s var(--ease-in-out) infinite alternate;
}
.mc-ambient-bolt {
  width: 190px;
  height: 54%;
  inset-inline-start: calc(50% - 95px);
  inset-block-start: 37%;
  opacity: .055;
  background: linear-gradient(var(--electric), var(--bolt-core), transparent);
  clip-path: polygon(58% 0, 20% 48%, 45% 48%, 28% 100%, 82% 39%, 55% 39%);
  animation: mcBoltIdle 7s var(--ease-in-out) infinite alternate;
}
@keyframes mcGridDrift { to { transform: translate3d(72px, 72px, 0); } }
@keyframes mcOrbOne { to { transform: translate3d(150px, -70px, 0) scale(1.15); } }
@keyframes mcOrbTwo { to { transform: translate3d(-130px, -80px, 0) scale(.86); } }
@keyframes mcBoltIdle { to { opacity: .11; transform: translateY(-12px); } }
.mc-panel > :not(.mc-ambient) { position: relative; z-index: 1; }

.mc-head {
  flex: none;
  /* The scoreboard head is navy in BOTH themes — white crests, score and
     lightning are tuned for a dark ground, so it must never follow the shell
     colour into light mode (which turned the head white and hid the teams). */
  background: var(--midnight);
  color: var(--on-dark);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(127, 196, 255, .18);
}
.mc-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(148deg, rgba(37,99,235,.26) 0%, rgba(37,99,235,.26) 20%, transparent 20.3%),
    linear-gradient(214deg, rgba(23,74,126,.5) 0%, rgba(23,74,126,.5) 34%, transparent 34.3%);
  pointer-events: none;
  background-size: 115% 115%;
  animation: mcFacetDrift 14s var(--ease-in-out) infinite alternate;
}
@keyframes mcFacetDrift { to { background-position: 7% 3%, -6% 4%; } }
.mc-head > * { position: relative; }
.mc-head .mc-score-lightning {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.mc-score-lightning svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 5px rgba(96,165,250,.95))
          drop-shadow(0 0 14px rgba(37,99,235,.72));
}
.mc-score-lightning .bolt {
  fill: none;
  stroke: #d9f4ff;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: bevel;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.mc-score-lightning .branch { stroke-width: 2; opacity: .72; }
.lightning-core,
.side-spark {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}
.lightning-core {
  width: 16px;
  height: 16px;
  left: calc(50% - 8px);
  top: 53%;
  background: #fff;
  box-shadow: 0 0 10px 4px #bfebff, 0 0 36px 16px rgba(37,99,235,.82);
}
.side-spark {
  width: 7px;
  height: 7px;
  top: 61%;
  background: #e8f8ff;
  box-shadow: 0 0 8px 3px #60a5fa, 0 0 24px 8px rgba(37,99,235,.72);
}
.side-spark-left { left: 8.5%; }
.side-spark-right { right: 8.5%; }
.mc-head.score-arrived .mc-score-lightning { animation: mcLightningLayer 820ms ease-out both; }
.mc-head.score-arrived .bolt-left { animation: mcBoltTravel 620ms cubic-bezier(.16,.8,.2,1) both; }
.mc-head.score-arrived .bolt-right { animation: mcBoltTravel 620ms 45ms cubic-bezier(.16,.8,.2,1) both; }
.mc-head.score-arrived .branch-left { animation: mcBoltTravel 380ms 180ms ease-out both; }
.mc-head.score-arrived .branch-right { animation: mcBoltTravel 380ms 220ms ease-out both; }
.mc-head.score-arrived .lightning-core { animation: mcLightningCore 600ms ease-out both; }
.mc-head.score-arrived .side-spark-left { animation: mcSideSpark 480ms 270ms ease-out both; }
.mc-head.score-arrived .side-spark-right { animation: mcSideSpark 480ms 315ms ease-out both; }
@keyframes mcBoltTravel {
  0% { stroke-dashoffset: 1; opacity: 0; }
  12% { opacity: 1; }
  62% { stroke-dashoffset: 0; opacity: 1; }
  72% { opacity: .22; }
  78% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes mcLightningLayer {
  0%, 100% { opacity: 0; }
  8%, 76% { opacity: 1; }
}
@keyframes mcLightningCore {
  0% { opacity: 0; transform: scale(.25); }
  18% { opacity: 1; transform: scale(1.4); }
  42% { opacity: .55; transform: scale(.82); }
  58% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(2.7); }
}
@keyframes mcSideSpark {
  0% { opacity: 0; transform: scale(.2); }
  28% { opacity: 1; transform: scale(1.65); }
  48% { opacity: .35; }
  62% { opacity: 1; }
  100% { opacity: 0; transform: scale(3); }
}

.mc-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-meta);
  color: var(--on-dark-mid);
  margin-bottom: var(--s-5);
}
.mc-top .mc-close { margin-inline-start: auto; color: var(--on-dark); }

.mc-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-5);
  text-align: center;
  padding: var(--s-4);
  border: 1px solid rgba(127, 196, 255, .16);
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(37,99,235,.12), rgba(255,255,255,.025) 46%, rgba(23,74,126,.16));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 36px rgba(4,16,31,.18);
  backdrop-filter: blur(8px);
}
.mc-side {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  position: relative;
  isolation: isolate;
  min-height: 112px;
  align-content: center;
  padding: var(--s-3);
  border-radius: var(--r-md);
  transition: transform var(--d-med) var(--ease-out),
              background var(--d-med) var(--ease-out);
}
.mc-side::before {
  content: "";
  position: absolute;
  inset: -18px 10%;
  z-index: -1;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(ellipse, rgba(96,165,250,.3), rgba(37,99,235,.08) 48%, transparent 72%);
  transform: scale(.7);
}
.mc-head.score-arrived[data-score-side="home"] .mc-side[data-side="home"]::before,
.mc-head.score-arrived[data-score-side="away"] .mc-side[data-side="away"]::before,
.mc-head.score-arrived[data-score-side="both"] .mc-side::before {
  animation: mcTeamCharge 900ms 240ms var(--ease-out) both;
}
.mc-head.score-arrived[data-score-side="home"] .mc-side[data-side="home"] .crest,
.mc-head.score-arrived[data-score-side="away"] .mc-side[data-side="away"] .crest,
.mc-head.score-arrived[data-score-side="both"] .mc-side .crest {
  animation: mcCrestCharge 760ms 230ms var(--ease-out);
}
@keyframes mcTeamCharge {
  0% { opacity: 0; transform: scale(.7); }
  30% { opacity: 1; transform: scale(1.12); }
  58% { opacity: .34; }
  72% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.28); }
}
@keyframes mcCrestCharge {
  0%, 100% { transform: scale(1); filter: none; }
  34% { transform: scale(1.1); filter: drop-shadow(0 0 11px #8bd8ff) drop-shadow(0 0 22px #2563eb); }
  58% { transform: scale(1.03); filter: drop-shadow(0 0 5px #60a5fa); }
  74% { transform: scale(1.07); filter: drop-shadow(0 0 9px #8bd8ff); }
}
.mc-side .crest {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: contain;
  transition: transform var(--d-med) var(--ease-out), filter var(--d-med) var(--ease-out);
}
.mc-side .name {
  font-family: var(--font-display);
  font-size: var(--t-team);
  font-weight: 700;
  color: var(--white);
}
.mc-mid {
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: rgba(4, 16, 31, .32);
  border: 1px solid rgba(127, 196, 255, .13);
}
.mc-mid .basketball-state {
  padding: 6px 12px;
  border-color: rgba(147,197,253,.28);
  background: rgba(37,99,235,.18);
  box-shadow: inset 0 0 18px rgba(37,99,235,.08);
}
.mc-mid .basketball-state .period-label { color: var(--on-shell-mid); }
.mc-mid .basketball-state .state-sep { color: rgba(191,219,254,.55); }
.mc-mid .basketball-state .clock { color: #fff; }
.mc-mid .nums {
  font-family: var(--font-display);
  font-size: var(--t-score);
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.mc-mid .nums > span { display: inline-block; min-width: .7em; }
.mc-mid .nums > span[aria-hidden="true"] { min-width: auto; }
.mc-mid .nums .score-live {
  animation: mcScoreLive 520ms var(--ease-out);
}
@keyframes mcScoreLive {
  0% { transform: scale(.72); opacity: .35; color: var(--electric-soft); }
  55% { transform: scale(1.2); color: #fff; text-shadow: 0 0 22px rgba(96,165,250,.9); }
  100% { transform: scale(1); opacity: 1; color: var(--white); text-shadow: none; }
}
.mc-head.score-arrived::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 56%, rgba(37,99,235,.34), transparent 45%);
  animation: mcScoreWash 650ms var(--ease-out) both;
}
@keyframes mcScoreWash {
  from { opacity: 1; transform: scale(.86); }
  to { opacity: 0; transform: scale(1.08); }
}

.mc-tabs {
  flex: none;
  display: flex;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-4);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--surface-line);
  overflow-x: auto;
  backdrop-filter: blur(14px);
}
.mc-tab {
  min-height: 40px;
  padding-inline: var(--s-4);
  font-size: var(--t-meta);
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: color var(--d-fast) var(--ease-out),
              background var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out),
              box-shadow var(--d-fast) var(--ease-out);
}
.mc-tab:hover { color: var(--ink); background: var(--blue-050); transform: translateY(-1px); }
.mc-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--electric), var(--blue-600));
  box-shadow: 0 5px 14px rgba(37, 99, 235, .24);
}

.mc-body {
  position: relative;
  overflow-y: auto;
  padding: var(--s-5);
  scrollbar-color: rgba(37,99,235,.65) transparent;
}
.mc-panel-block { display: grid; gap: var(--s-5); }

.mc-card {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--sh-1);
  backdrop-filter: blur(10px);
  animation: mcCardIn 420ms var(--ease-out) backwards;
  transition: transform var(--d-med) var(--ease-out),
              border-color var(--d-med) var(--ease-out),
              box-shadow var(--d-med) var(--ease-out);
}
.mc-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  opacity: .35;
  transform: scaleX(.18);
  transform-origin: center;
  background: linear-gradient(90deg, transparent, var(--electric), var(--bolt-core), var(--bolt-hot), transparent);
  transition: opacity var(--d-med) var(--ease-out), transform 520ms var(--ease-out);
}
.mc-panel-block > .mc-card:nth-child(2) { animation-delay: 55ms; }
.mc-panel-block > .mc-card:nth-child(3) { animation-delay: 110ms; }
.mc-panel-block > .mc-card:nth-child(4) { animation-delay: 165ms; }
@keyframes mcCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.mc-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--electric) 38%, var(--surface-line));
  box-shadow: 0 14px 34px rgba(4, 16, 31, .12);
}
.mc-card:hover::before { opacity: 1; transform: scaleX(1); }
.mc-card h3 { font-size: var(--t-h3); margin-bottom: var(--s-4); }

@media (hover: hover) and (pointer: fine) {
  .mc-side:hover { transform: translateY(-3px); background: rgba(37,99,235,.1); }
  .mc-side:hover .crest {
    transform: scale(1.08);
    filter: drop-shadow(0 7px 13px rgba(37,99,235,.35));
  }
  .tl-row, .h2h-row, .lineup li, .performer, .stat-row {
    transition: transform var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
  }
  .tl-row:hover, .h2h-row:hover, .lineup li:hover, .performer:hover, .stat-row:hover {
    transform: translateX(3px);
    background: color-mix(in srgb, var(--electric) 6%, transparent);
  }
}

/* match forecast: probability split, then how each side got there.
   The three legs are one bar rather than three, so the eye reads the
   comparison before it reads any single number. */
.fc-card { display: grid; gap: var(--s-4); }
.fc-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.fc-title h3 { margin-bottom: 0; }
.fc-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  color: var(--electric);
  background: color-mix(in srgb, var(--electric) 12%, transparent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.fc-model-badge svg { width: 12px; height: 12px; }
.fc-bar {
  display: flex;
  height: 10px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-line);
}
.fc-bar i { display: block; height: 100%; transition: width var(--d-slow) var(--ease-out); }
.fc-bar i[data-leg="home"], .fc-dot[data-leg="home"] { background: var(--electric); }
.fc-bar i[data-leg="draw"], .fc-dot[data-leg="draw"] { background: var(--surface-line-strong, var(--navy-300)); }
.fc-bar i[data-leg="away"], .fc-dot[data-leg="away"] { background: var(--navy-300); }

.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  font-size: var(--t-meta);
}
.fc-legend li { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  align-self: center;
}
.fc-pct { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.fc-who { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fc-form-rows { display: grid; gap: var(--s-3); font-size: var(--t-meta); }
.fc-form-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.fc-form { display: flex; gap: 4px; flex: none; }
/* Colour is the fast read, but the letter is the actual answer, so both
   are always present -- the row stays legible without colour vision. */
.fc-form b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm, 6px);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-line);
}
/* Win and loss need to separate at a glance across five badges, so they sit
   on opposite sides of the palette rather than on two shades of the same
   blue. A draw keeps the neutral background it inherits. */
.fc-form b[data-result="W"] { background: var(--electric); color: #fff; }
.fc-form b[data-result="L"] { background: var(--danger); color: #fff; }
.fc-model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--surface-line);
  color: var(--ink-soft);
  font-size: var(--t-meta);
}
.fc-model-meta span { display: inline-flex; gap: 6px; }
.fc-model-meta b { color: var(--ink); }
.fc-disclaimer { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.fc-sources,
.fc-provider-note {
  color: var(--ink-soft);
  font-size: var(--t-micro);
  line-height: 1.5;
}
.fc-sources b { color: var(--ink); margin-inline-end: 5px; }
.fc-provider-note {
  padding: var(--s-3);
  border-inline-start: 2px solid var(--electric);
  border-radius: 0 var(--r-sm, 6px) var(--r-sm, 6px) 0;
  background: color-mix(in srgb, var(--electric) 7%, transparent);
}

/* timeline */
.timeline { display: grid; gap: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 52px;
  width: 2px;
  background: var(--surface-line);
}
.tl-row {
  display: grid;
  grid-template-columns: 44px 20px 1fr;
  gap: var(--s-4);
  align-items: start;
  padding-block: var(--s-3);
  position: relative;
  font-size: var(--t-meta);
}
.tl-row .tl-min {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.tl-row .tl-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--surface-line-strong);
  display: grid; place-items: center;
  z-index: 1;
}
.tl-row[data-kind="goal"] .tl-dot { border-color: var(--good); }
.tl-row[data-kind="redcard"] .tl-dot { border-color: var(--danger); }
.tl-row .tl-dot svg { width: 11px; height: 11px; }
.tl-row .tl-what b { color: var(--ink); }
.tl-row .tl-what span { color: var(--ink-soft); }

/* standings */
.table-wrap { overflow-x: auto; }
table.pacy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-meta);
  min-width: 460px;
}
.pacy-table th {
  text-align: start;
  font-size: var(--t-micro);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--surface-line);
  white-space: nowrap;
}
.pacy-table td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--surface-line);
  font-variant-numeric: tabular-nums;
}
.pacy-table td:first-child, .pacy-table th:first-child { text-align: center; width: 40px; }
.pacy-table .t-name { font-weight: 600; color: var(--ink); }
.pacy-table tr.is-here { background: var(--blue-050); }
.pacy-table tr.is-here .t-name { color: var(--electric); }

/* head to head */
.h2h { display: grid; gap: var(--s-3); }
.h2h-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: var(--s-4);
  align-items: center;
  font-size: var(--t-meta);
  padding-block: var(--s-2);
}
.h2h-row + .h2h-row { border-top: 1px solid var(--surface-line); }
.h2h-row .h-date { color: var(--ink-faint); }
.h2h-row .h-score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* lineups */
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.lineup h4 {
  font-size: var(--t-meta);
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: var(--s-2);
}
.lineup .formation {
  font-size: var(--t-micro);
  letter-spacing: var(--track-label);
  color: var(--ink-faint);
  margin-bottom: var(--s-3);
}
.lineup li {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--t-meta);
  padding-block: 6px;
}
.lineup .num {
  width: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  font-weight: 700;
  text-align: end;
  flex: none;
}

/* commentary */
.commentary { display: grid; gap: var(--s-4); }
.comm-row { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-4); font-size: var(--t-meta); }
.comm-row .c-min { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-align: end; }
.comm-row p { color: var(--ink-mid); line-height: 1.5; }

/* broadcaster — informational only, no betting content anywhere */
.broadcasters { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.bc-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  border: 1px solid var(--surface-line);
  font-size: var(--t-meta);
  color: var(--ink-mid);
}
.bc-chip svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke-width: 2;
}

/* ---- SHARE CARD --------------------------------------------- */
.share-preview {
  background: var(--shell);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  color: var(--on-shell);
  position: relative;
  overflow: hidden;
}
.share-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(148deg, rgba(37,99,235,.28) 0%, rgba(37,99,235,.28) 22%, transparent 22.3%),
    linear-gradient(214deg, rgba(23,74,126,.5) 0%, rgba(23,74,126,.5) 36%, transparent 36.3%);
}
.share-preview > * { position: relative; }
.share-comp {
  font-size: var(--t-micro);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--blue-300);
  font-weight: 700;
}
.share-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  margin-block: var(--s-5);
  text-align: center;
}
.share-teams .crest { width: 48px; height: 48px; border-radius: 10px; margin-inline: auto; }
.share-teams .t { font-family: var(--font-display); font-weight: 600; color: var(--white); margin-top: var(--s-2); }
.share-teams .s {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.share-foot {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--shell-line);
  font-size: var(--t-meta);
  color: var(--on-shell-mid);
}
.share-foot .mark { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; color: var(--white); font-weight: 700; }
.share-foot .mark svg { width: 16px; height: 16px; }

/* ============================================================
   EMPTY / ERROR STATES
   ============================================================ */

.state-block {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-11) var(--s-5);
}
.facet-badge {
  width: 72px; height: 72px;
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  color: var(--blue-300);
  background-color: var(--navy-700);
  background-image:
    linear-gradient(148deg, rgba(37,99,235,.5) 0%, rgba(37,99,235,.5) 30%, transparent 30.4%),
    linear-gradient(214deg, rgba(23,74,126,.85) 0%, rgba(23,74,126,.85) 46%, transparent 46.4%);
}
.facet-badge svg { width: 30px; height: 30px; }
.state-block h3 { font-size: var(--t-h3); }
.state-block p { font-size: var(--t-meta); color: var(--ink-soft); max-width: 42ch; }
.state-block .actions { display: flex; gap: var(--s-3); margin-top: var(--s-3); flex-wrap: wrap; justify-content: center; }

/* ---- DEMO CONSOLE ------------------------------------------- */
/* Prototype-only: lets a reviewer trigger every mock state on
   demand instead of waiting for the simulation to produce one. */
.demo-fab {
  position: fixed;
  inset-block-end: calc(var(--s-5) + env(safe-area-inset-bottom));
  inset-inline-end: var(--s-5);
  z-index: 90;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--electric);
  color: var(--white);
  display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(37,99,235,.45);
}
.demo-fab svg { width: 22px; height: 22px; }

.demo-panel {
  position: fixed;
  inset-block-end: calc(var(--s-5) + 64px + env(safe-area-inset-bottom));
  inset-inline-end: var(--s-5);
  z-index: 90;
  width: min(300px, calc(100vw - var(--s-8)));
  background: var(--surface);
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s-4);
  max-height: 68vh;
  overflow-y: auto;
}
.demo-panel[hidden] { display: none; }
.demo-panel h3 {
  font-size: var(--t-meta);
  font-family: var(--font-body);
  margin-bottom: var(--s-1);
}
.demo-panel > p {
  font-size: var(--t-micro);
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
  line-height: 1.5;
}
.demo-grid { display: grid; gap: var(--s-2); }
.demo-btn {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 42px;
  padding-inline: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  border: 1px solid var(--surface-line);
  font-size: var(--t-meta);
  font-weight: 500;
  text-align: start;
  color: var(--ink-mid);
}
.demo-btn:hover { background: var(--blue-050); color: var(--ink); border-color: var(--blue-100); }
.demo-sep {
  margin-block: var(--s-3) var(--s-2);
  font-size: var(--t-micro);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}
