/* LiveSports360 components — revamp plan §5.2.
   Replaces mdb.min.css (317KB) + font-awesome (101KB) on migrated pages.
   Status is never colour-only: .badge--live/.badge--ft carry text. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 420px at 50% -120px, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Screen-reader-only utility (used by form labels). */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Scrollbars: slim, themed, unobtrusive — on the page and every scroll
   container. Firefox via scrollbar-width/color; Chromium/Safari via
   ::-webkit-scrollbar. */
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 38%, transparent) transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 34%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  background-clip: content-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
/* Horizontal strips (nav, featured, date track) stay scrollbar-free —
   they scroll by swipe/arrows. */
.site-nav, .featured-leagues, .date-nav__track { scrollbar-width: none; }
.site-nav::-webkit-scrollbar, .featured-leagues::-webkit-scrollbar, .date-nav__track::-webkit-scrollbar { display: none; }


html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-4); }

/* --- shell: skip link, header, nav, footer, main ------------------------ */

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface-raised); color: var(--text);
  padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius-2) 0; z-index: 50;
}
.skip-link:focus { left: 0; }

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 56px; flex-wrap: wrap;
}
.site-logo { font-weight: 700; font-size: 1.1rem; color: var(--text); letter-spacing: .02em; }
.site-logo strong { color: var(--accent); }
.site-nav { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.site-nav a {
  position: relative;
  color: var(--text-muted); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2); font-size: .875rem; font-weight: 550;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--surface-raised); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--space-3); right: var(--space-3);
  bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border); margin-top: var(--space-7);
  padding: var(--space-6) 0 var(--space-5); color: var(--text-muted); font-size: .875rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.footer-grid { display: flex; gap: var(--space-8); flex-wrap: wrap; justify-content: space-between; }
.footer-col { min-width: 180px; }
.footer-col h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin: 0 0 var(--space-2); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.footer-legal { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; font-size: .78rem; }

main { padding: var(--space-5) 0 var(--space-6); min-height: 50vh; }

/* --- page furniture ------------------------------------------------------ */

.page-title {
  font-size: 1.5rem; margin: 0 0 var(--space-3); line-height: 1.2;
}
.crumbs { font-size: .8rem; color: var(--text-muted); margin-bottom: var(--space-3); }
.crumbs a { color: var(--text-muted); }

.pill-switch {
  display: flex; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-4);
}
.pill-switch a {
  border: 1px solid var(--border); color: var(--text-muted);
  padding: var(--space-1) var(--space-3); border-radius: 999px; font-size: .8rem;
}
.pill-switch a[aria-current="page"] {
  background: var(--surface-raised); color: var(--text); border-color: var(--accent);
}

/* --- standings table (card language) ------------------------------------- */

.standings-group { margin-bottom: var(--space-6); }
.standings-group__name {
  font-size: 1.05rem; font-weight: 700; margin: 0 0 var(--space-2); color: var(--text);
  letter-spacing: -.01em;
}
.table-wrap {
  overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3);
}

table.standings { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 640px; }
table.standings th, table.standings td {
  padding: var(--space-2) var(--space-2); text-align: center;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.standings tbody tr:last-child td { border-bottom-color: var(--border); }
table.standings tbody tr:hover td { background: var(--surface-raised); }
table.standings thead th {
  background: var(--surface-raised); color: var(--text-muted);
  font-weight: 600; position: sticky; top: 0;
}
table.standings .team-cell {
  text-align: left; min-width: 160px;
}
table.standings .team-cell img {
  width: 20px; height: 20px; vertical-align: middle; margin-right: var(--space-2);
  border-radius: 2px;
}
table.standings .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
table.standings tbody tr:last-child td { border-bottom: 0; }

.zone-note { font-size: .75rem; color: var(--text-muted); margin-top: var(--space-2); }

/* --- status badges (text + colour, never colour-only) -------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 600; letter-spacing: .03em;
  border-radius: 999px; padding: 2px 8px;
}
.badge--live    { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); }
.badge--ft      { background: color-mix(in srgb, var(--draw) 18%, transparent); color: var(--draw); }
.badge--sched   { background: var(--surface-raised); color: var(--text-muted); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live .badge__dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* --- empty states -------------------------------------------------------- */

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius-3);
  background: var(--surface);
  color: var(--text-muted); padding: var(--space-7) var(--space-5); text-align: center;
}
.empty svg { opacity: .55; margin-bottom: var(--space-2); }
.empty a { font-weight: 600; }

/* Live cards carry a subtle top accent bar (colour + text badge both). */
.mcard--live::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--live), transparent);
  opacity: .8;
}

/* --- sport scoreboard (professional pass, 2026-10-25) ------------------- */

/* Page head: eyebrow + title + toolbar on one visual rhythm */
.eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-1);
}
.sport-head { margin-bottom: var(--space-4); }
.sport-head h1.page-title { font-size: 1.75rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.sport-toolbar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-2); color: var(--text-muted); font-size: .8rem;
}
.sport-toolbar .tz-picker { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.sport-toolbar .tz-picker select {
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-1); padding: 3px var(--space-2); font: inherit; font-size: .8rem;
}

/* Featured leagues quick-nav (soccer): chip cards with logo, hover lift
   and accent edge; scrollable but scrollbar-free. */
.featured-leagues {
  display: flex; gap: var(--space-2); overflow-x: auto;
  padding: 2px 2px var(--space-2); margin: 0 0 var(--space-4);
}
.featured-leagues a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-3);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  color: var(--text); font-size: .84rem; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.featured-leagues a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: var(--shadow-2);
  text-decoration: none;
}
.featured-leagues img { width: 28px; height: 28px; border-radius: var(--radius-1); flex: none; }
.featured-leagues .featured-leagues__go {
  color: var(--text-muted); display: inline-flex;
  transition: color .15s ease, transform .15s ease;
}
.featured-leagues a:hover .featured-leagues__go { color: var(--accent); transform: translateX(2px); }

/* Date nav: infinite scroller — track + paging arrows + native picker.
   Server renders ±3 real links; assets/date-scroller.js widens it. */
.date-nav {
  display: flex; align-items: stretch; gap: var(--space-1);
  margin: 0 0 var(--space-5);
}
.date-nav__arrow {
  flex: none; width: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-2);
  cursor: pointer;
}
.date-nav__arrow:hover { color: var(--text); background: var(--surface-raised); }
.date-nav__track {
  display: flex; gap: var(--space-1); align-items: stretch;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; /* no scroll-snap: JS owns positioning, snap fights it */
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-2); padding: 3px;
  scrollbar-width: none;
}
.date-nav__track::-webkit-scrollbar { display: none; }
.date-nav__day {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  border-radius: var(--radius-1); padding: var(--space-1) var(--space-3);
  min-width: 60px; flex: none; color: var(--text-muted);
}
.date-nav__day:hover { background: var(--surface-raised); text-decoration: none; }
.date-nav__day.is-selected { background: var(--accent); color: #08130d; }
.date-nav__day.is-selected .date-nav__d { color: #08130d; }
.date-nav__dow { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-nav__d   { font-size: 1rem; color: var(--text); font-family: var(--font-num); font-variant-numeric: tabular-nums; line-height: 1.2; }
.date-nav__mon { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; }
.date-nav__day { min-width: 64px; }

/* Picker matches the tab design: one tab-sized pill, calendar icon +
   input + subtle Go, sharing the track's surface language. */
.date-nav__picker {
  display: flex; align-items: center; gap: 0; flex: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-2); padding: 0 2px;
  color: var(--text-muted);
}
.date-nav__picker:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.date-nav__cal { flex: none; margin: 0 var(--space-2) 0 var(--space-2); }
.date-nav__picker input {
  flex: none; width: 118px;
  background: transparent; color: var(--text);
  border: 0; padding: var(--space-2) 0; font: inherit; font-size: .78rem;
}
.date-nav__picker input:focus { outline: none; }
.date-nav__picker input { color-scheme: dark; }
.date-nav__picker button {
  flex: none; margin: 2px; padding: var(--space-1) var(--space-3);
  background: var(--surface-raised); color: var(--text);
  border: 0; border-radius: var(--radius-1); font: inherit; font-size: .78rem; font-weight: 600;
  cursor: pointer;
}
.date-nav__picker button:hover { color: var(--accent); }
@media (max-width: 639px) {
  .date-nav__arrow { display: none; }            /* swipe is natural there */
  .date-nav__picker button { display: none; }    /* Enter in the input submits */
}


/* League section: header + responsive card grid; every section is a
   <details> (featured ones start open). Hovering the header reveals
   competition links (Fixtures / Standings). */
.league-section { margin-bottom: var(--space-5); }
.league-section__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-3);
  cursor: pointer; list-style: none; user-select: none;
}
.league-section__head::-webkit-details-marker { display: none; }
.league-section__head img { width: 26px; height: 26px; flex: none; }
.league-section__name {
  font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--text); letter-spacing: -.01em;
}
.league-section__name:hover { color: var(--accent-strong); }
.league-section__count {
  color: var(--text-muted); font-size: .75rem; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 999px; font-weight: 600;
  margin-left: auto;
}

/* Hover-revealed competition links: Fixtures · Standings */
.league-section__actions {
  display: inline-flex; align-items: center; gap: var(--space-1);
  margin-left: var(--space-2);
  opacity: 0; transform: translateY(3px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.league-section__head:hover .league-section__actions,
.league-section__head:focus-within .league-section__actions {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
@media (hover: none) {
  .league-section__actions { opacity: 1; transform: none; pointer-events: auto; }
}
.league-section__actions a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-muted); font-size: .74rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
}
.league-section__actions a:hover {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  text-decoration: none;
}

.league-section__chev { color: var(--text-muted); transition: transform .22s ease; flex: none; font-size: .7rem; }
details.league-section[open] > .league-section__head .league-section__chev { transform: rotate(90deg); }

/* Smooth accordion: the rows wrapper animates height (JS-driven; see
   assets/accordion.js). The wrapper itself never clips when JS is off. */
.league-section.is-animating > .league-section__rows {
  overflow: hidden;
}
.league-section__rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 292px), 1fr));
  gap: var(--space-3);
}

/* --- match card -----------------------------------------------------------
   One card per game: status strip, two team rows (logo chip, name, score),
   footer with venue · broadcast. Winner emphasised on final cards; live
   cards carry the accent; pre-game cards lead with kickoff time. */
.mcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  overflow: hidden;
}
.mcard:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-2);
  text-decoration: none;
}
.mcard:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.mcard__top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 22px;
}
.mcard__when { font-size: .72rem; color: var(--text-muted); font-weight: 600; letter-spacing: .02em; }

.mcard__teams { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.mcard__team { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.mcard__team img {
  width: 30px; height: 30px; flex: none;
  background: var(--surface-raised); border-radius: var(--radius-2); padding: 2px;
}
.mcard__tname {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .95rem; font-weight: 550;
}
.mcard__tscore {
  flex: none;
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 1.15rem; font-weight: 650; line-height: 1;
  padding-left: var(--space-3);
}
.mcard__record { display: block; font-size: .7rem; color: var(--text-muted); font-weight: 500; margin-top: 1px; }

/* state treatments */
.mcard--post .mcard__team.is-winner .mcard__tname { font-weight: 750; }
.mcard--post .mcard__team.is-winner .mcard__tscore { color: var(--win); }
/* Dim the logo only: whole-row opacity pushed the record line under 4.5:1. */
.mcard--post .mcard__team.is-loser img,
.mcard--post .mcard__team.is-loser .mcard__tlogo { opacity: .62; }
.mcard--post .mcard__team.is-draw .mcard__tscore { color: var(--draw); }
.mcard--live .mcard__tscore { color: var(--text); }
.mcard--live { border-color: color-mix(in srgb, var(--live) 40%, var(--border)); }

.mcard__foot {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: .72rem; color: var(--text-muted);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcard__foot svg { flex: none; opacity: .7; }

/* --- responsive system -----------------------------------------------------
   4 breakpoints, mobile-first. What changes where:
   <480  phone        1-col cards, compact card internals, no arrows
   480   phone+       2-col compact cards
   640   phablet      cards breathe, header nav scrolls, fluid h1 grows
   820   tablet       full nav inline, 3-col cards, toolbar on one line
   1024  desktop      3–4-col cards, roomier gutters
--------------------------------------------------------------------------- */

/* Fluid page title up front (no breakpoint needed) */
.sport-head h1.page-title { font-size: clamp(1.3rem, 1rem + 1.6vw, 1.85rem); }
.standings-group { min-width: 0; }

@media (max-width: 479px) {
  .wrap { padding: 0 var(--space-3); }
  .league-section__rows { grid-template-columns: 1fr; gap: var(--space-2); }
  .mcard { padding: var(--space-3); border-radius: var(--radius-2); }
  .mcard__team img { width: 26px; height: 26px; }
  .mcard__tname { font-size: .9rem; }
  .mcard__tscore { font-size: 1.02rem; }
  .league-section__name { font-size: .95rem; }
  .site-header__inner { min-height: 50px; gap: var(--space-3); }
  .site-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-logo { font-size: 1rem; }
  .crumbs { margin-bottom: var(--space-2); }
}

@media (min-width: 480px) and (max-width: 819px) {
  .league-section__rows {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 225px), 1fr));
    gap: var(--space-2);
  }
  .mcard { padding: var(--space-3) var(--space-3); }
  .mcard__team img { width: 28px; height: 28px; }
  .mcard__tscore { font-size: 1.06rem; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
}

@media (min-width: 820px) and (max-width: 1023px) {
  .league-section__rows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 262px), 1fr)); }
}

@media (min-width: 1024px) {
  .league-section__rows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 296px), 1fr)); gap: var(--space-4); }
  .wrap { padding: 0 var(--space-5); }
  main { padding: var(--space-6) 0 var(--space-7); }
}


/* --- match page (M4) ------------------------------------------------------ */

.match-hero { margin-bottom: var(--space-5); }
.match-hero__teams { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.match-hero__team {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
}
.match-hero__team img { width: 72px; height: 72px; background: var(--surface-raised); border-radius: var(--radius-3); padding: 6px; }
.match-hero__name { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.match-hero__record { font-size: .75rem; color: var(--text-muted); }
.match-hero__score { font-size: 2.4rem; font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums; line-height: 1; }
.match-hero__team.is-winner .match-hero__score { color: var(--win); }
.match-hero__team.is-loser { opacity: .65; }
.match-hero__spacer { flex: 1; }
.match-stream { margin-bottom: var(--space-5); }
.match-stream .ratio { position: relative; padding-top: 56.25%; border-radius: var(--radius-3); overflow: hidden; border: 1px solid var(--border); background: #000; }
.match-stream iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.match-section { margin-bottom: var(--space-5); }
.match-section__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 var(--space-3); letter-spacing: -.01em; }
.match-box th.team-cell { text-align: center; font-weight: 700; }
.match-plays { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.match-plays li {
  display: flex; gap: var(--space-3); align-items: baseline;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3); font-size: .85rem;
}
.match-plays__clock { color: var(--text-muted); font-size: .75rem; flex: none; width: 86px; }
.match-news { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); font-size: .9rem; }
@media (max-width: 479px) {
  .match-hero__score { font-size: 1.9rem; }
  .match-hero__team img { width: 56px; height: 56px; }
}

/* --- match page v2 (full sections) ---------------------------------------- */

.match-hero__teams { grid-template-columns: 1fr auto 1fr; align-items: center; }
.match-hero__side {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1);
}
.match-hero__side img { width: 76px; height: 76px; background: var(--surface-raised); border-radius: var(--radius-3); padding: 6px; }
.match-hero__logo-fallback {
  width: 76px; height: 76px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); border-radius: var(--radius-3);
  font-family: var(--font-num); font-weight: 700; font-size: 1.4rem; color: var(--text-muted);
}
.match-hero__vs { font-size: 1.3rem; font-weight: 700; color: var(--text-muted); font-family: var(--font-num); }
.match-hero__form { display: flex; gap: 4px; justify-content: center; }
.form-pill {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700;
}
.form-pill.is-w { background: color-mix(in srgb, var(--win) 25%, transparent); color: var(--win); }
.form-pill.is-l { background: color-mix(in srgb, var(--loss) 25%, transparent); color: var(--loss); }
.form-pill.is-d { background: color-mix(in srgb, var(--draw) 25%, transparent); color: var(--draw); }
.match-hero__lines { width: 100%; margin-top: var(--space-3); border-collapse: collapse; font-size: .85rem; }
.match-hero__lines th, .match-hero__lines td { padding: 4px 10px; text-align: center; color: var(--text-muted); }
.match-hero__lines tbody td { color: var(--text); }
.match-hero__lines td:first-child, .match-hero__lines th:first-child { text-align: left; }
.match-hero__lines tbody td:last-child { font-weight: 700; color: var(--text); }
.match-hero__odds { color: var(--text-muted); }

.match-report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-4) var(--space-5); }
.match-report h3 { margin: 0 0 var(--space-2); font-size: 1.1rem; line-height: 1.3; }
.match-report p { margin: 0 0 var(--space-2); color: var(--text); font-size: .95rem; line-height: 1.55; }
.match-report__more { font-size: .85rem; font-weight: 600; }

.stat-table { display: grid; gap: var(--space-2); }
.stat-row { display: grid; grid-template-columns: 74px 1fr 74px; gap: var(--space-3); align-items: center; }
.stat-row__val { text-align: center; font-weight: 650; }
.stat-row__mid { min-width: 0; }
.stat-row__label {
  display: block; text-align: center; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 3px;
}
.stat-row__bar { height: 6px; border-radius: 3px; background: var(--surface-raised); overflow: hidden; display: flex; }
.stat-row__away { background: var(--accent); height: 100%; transition: width .4s ease; }
.stat-row__home { background: color-mix(in srgb, var(--text-muted) 45%, transparent); height: 100%; transition: width .4s ease; }

.performers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.performers__team { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-3) var(--space-4); }
.performers__abbr { margin: 0 0 var(--space-2); font-size: .8rem; letter-spacing: .1em; color: var(--accent); }
.performers__team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.performers__team li { display: flex; flex-direction: column; gap: 1px; padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.performers__team li:last-child { border-bottom: 0; padding-bottom: 0; }
.performers__name { font-size: .9rem; font-weight: 600; }
.performers__line { font-size: .74rem; color: var(--text-muted); }

.match-videos { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.match-videos li {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3); font-size: .88rem;
}
.match-videos__dur { flex: none; background: var(--surface-raised); border-radius: var(--radius-1); padding: 2px 8px; font-size: .72rem; color: var(--text-muted); }
.match-videos a { margin-left: auto; font-weight: 600; font-size: .8rem; white-space: nowrap; }

.match-h2h { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-4) var(--space-5); }
.match-h2h__summary { margin: 0 0 var(--space-2); font-weight: 650; }
.match-h2h ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: .88rem; }
.match-h2h li { display: flex; gap: var(--space-3); }
.match-h2h li .num { color: var(--text-muted); min-width: 64px; }

.injuries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.injuries__team { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-3) var(--space-4); }
.injuries__team h3 { margin: 0 0 var(--space-2); font-size: .8rem; letter-spacing: .1em; color: var(--accent); }
.injuries__team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: .86rem; }
.injuries__status { color: var(--text-muted); font-size: .78rem; }

/* match page v2.1: report image, ESPN-style highlight cards, lineups,
   timeline, game info, mini table */
.match-report__fig { margin: 0 0 var(--space-3); }
.match-report__fig img { width: 100%; border-radius: var(--radius-2); display: block; aspect-ratio: 16/9; object-fit: cover; }
.match-report__fig figcaption { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--space-3); }
.hl-card { display: flex; flex-direction: column; gap: var(--space-2); color: var(--text); }
.hl-card:hover { text-decoration: none; }
.hl-card__thumb { position: relative; border-radius: var(--radius-2); overflow: hidden; aspect-ratio: 16/9; background: var(--surface-raised); }
.hl-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.hl-card:hover .hl-card__thumb img { transform: scale(1.05); }
.hl-card__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(8,12,18,.32);
}
.hl-card__play svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.hl-card__dur { position: absolute; right: 6px; bottom: 6px; background: rgba(8,12,18,.78); color: #fff; border-radius: 3px; padding: 1px 6px; font-size: .7rem; }
.hl-card__title { font-size: .86rem; font-weight: 600; line-height: 1.35; }
.hl-card__src { font-size: .72rem; color: var(--text-muted); }
.lineups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.lineups__team { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-3) var(--space-4); }
.lineups__team h3 { margin: 0 0 var(--space-2); font-size: .8rem; letter-spacing: .1em; color: var(--accent); }
.lineups__team ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: .86rem; }
.lineups__team li { display: flex; gap: var(--space-2); align-items: baseline; }
.lineups__jersey { width: 20px; text-align: right; color: var(--text-muted); }
.lineups__pos { width: 22px; font-size: .7rem; color: var(--text-muted); }
.mtimeline { list-style: none; margin: 0; padding: 0 0 0 10px; display: grid; gap: var(--space-2); position: relative; }
.mtimeline::before { content: ""; position: absolute; left: 19px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.mtimeline__item { display: flex; gap: var(--space-3); align-items: baseline; position: relative; }
.mtimeline__dot { position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.mtimeline__item--y .mtimeline__dot { background: #e8c020; }
.mtimeline__item--r .mtimeline__dot { background: var(--loss); }
.mtimeline__item--s .mtimeline__dot { background: var(--text-muted); }
.mtimeline__min { flex: none; width: 40px; margin-left: 22px; color: var(--text-muted); font-size: .82rem; }
.mtimeline__text { font-size: .88rem; }
.gameinfo { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-2) var(--space-4); }
.gameinfo__row { display: flex; gap: var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.gameinfo__row:last-child { border-bottom: 0; }
.gameinfo dt { flex: 0 0 140px; color: var(--text-muted); font-size: .8rem; padding-top: 1px; }
.gameinfo dd { margin: 0; }
.minitable tr.is-mine td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.minitable__more { margin: var(--space-2) 0 0; font-size: .82rem; }

/* match page v3: two-column layout — main stream + sidebar widgets */
.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.match-main { min-width: 0; display: grid; gap: var(--space-5); }
.match-main > section, .match-main > .match-section { margin-bottom: 0; }
.match-aside {
  min-width: 0; display: grid; gap: var(--space-4);
  position: sticky; top: 76px;
}
.match-aside .match-section { margin-bottom: 0; }
.match-aside .gameinfo, .match-aside .match-h2h {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
}
.match-aside .match-h2h { padding-bottom: var(--space-3); }
.match-aside .match-h2h ul { font-size: .82rem; }
.match-aside .injuries__team { padding: var(--space-2) var(--space-3); }
.match-aside .match-news { font-size: .85rem; }
.match-aside .minitable { min-width: 0; font-size: .78rem; }
@media (max-width: 1023px) {
  .match-layout { grid-template-columns: 1fr; }
  .match-aside { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-4); }
}
@media (max-width: 639px) {
  .match-aside { grid-template-columns: 1fr; }
}

/* Form pills (W/L/D chips) — the rich card is the page-level .form-tip. */
.form-pill { position: relative; text-decoration: none; }

/* lineups + stats upgrades */
.lineups__team ol { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.lineups__team li { align-items: center; gap: var(--space-2); padding: 3px 0; border-bottom: 0; }
.lineups__jersey {
  width: 26px; height: 26px; border-radius: 50%; text-align: center; line-height: 26px;
  background: var(--surface-raised); color: var(--text); font-size: .74rem; font-weight: 700; flex: none;
}
.lineups__body { display: flex; flex-direction: column; min-width: 0; }
.lineups__name { font-size: .86rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineups__pos { font-size: .66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-row__val.is-lead { color: var(--accent-strong); }
.stat-row__val { font-size: .95rem; }

/* Hover-card continuity: the hero must not clip the page-level tooltip. */
.match-hero { overflow: visible; }            /* was clipped by .mcard overflow */
.mcard--live::before, .mcard--live::after { border-radius: var(--radius-3) var(--radius-3) 0 0; }

/* Form-pill hover card: page-level fixed tooltip (see app.js). The whole card
   is the link, so it never underlines; the result chip carries W/L/D. */
.form-tip {
  position: fixed; z-index: 999;
  width: 232px; padding: 12px 14px;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius-2); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  color: var(--text); text-decoration: none;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(6px) scale(.97);
  transition: opacity .16s ease, transform .2s cubic-bezier(.22,.61,.36,1), visibility 0s linear .16s;
}
.form-tip:hover, .form-tip:focus, .form-tip:hover *, .form-tip:focus * { text-decoration: none; }
.form-tip.is-on {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity .16s ease, transform .2s cubic-bezier(.22,.61,.36,1), visibility 0s;
}
.form-tip.is-below { transform: translateY(-6px) scale(.97); }
.form-tip.is-below.is-on { transform: translateY(0) scale(1); }
.form-tip::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.form-tip.is-below::after { top: auto; bottom: 100%; }
.form-tip:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }

.form-tip__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.form-tip__result {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800;
}
.form-tip__result.is-w { background: color-mix(in srgb, var(--win) 24%, transparent); color: var(--win); }
.form-tip__result.is-l { background: color-mix(in srgb, var(--loss) 24%, transparent); color: var(--loss); }
.form-tip__result.is-d { background: color-mix(in srgb, var(--draw) 24%, transparent); color: var(--draw); }
.form-tip__logo { flex: none; width: 22px; height: 22px; object-fit: contain; }
.form-tip__who { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.form-tip__at { flex: none; font-size: .7rem; color: var(--text-muted); text-transform: lowercase; }
.form-tip__opp {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .84rem; font-weight: 650; color: var(--text);
}
.form-tip__score { font-size: 1.25rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.1; }
.form-tip__meta { font-size: .7rem; color: var(--text-muted); }
.form-tip__cta {
  margin-top: 2px; padding-top: 7px; border-top: 1px solid var(--border);
  font-size: .72rem; font-weight: 650; color: var(--accent);
}
@media (hover: none) { .form-tip { display: none !important; } }

/* ==========================================================================
   M5 — team clubhouse + shared news module
   ========================================================================== */

/* Team hero: identity left, next-game card right; tinted by the team colour
   when the provider supplies one (fallback: accent). */
.team-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5); align-items: center;
  padding: var(--space-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3); margin-bottom: var(--space-5);
}
.team-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(460px 200px at 0% 0%,
    color-mix(in srgb, var(--team-color, var(--accent)) 20%, transparent), transparent 72%);
}
.team-hero__identity { position: relative; display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.team-hero__logo { flex: none; width: 88px; height: 88px; object-fit: contain; }
.team-hero__text { min-width: 0; }
.team-hero__name { margin: 0; }
.team-hero__facts {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4);
  margin-top: var(--space-2); font-size: .82rem; color: var(--text-muted);
}
.team-fact strong { color: var(--text); font-weight: 700; }
.team-hero__form { display: flex; gap: 6px; margin-top: var(--space-3); }

.team-next {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  min-width: 220px; padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-2);
  color: var(--text);
}
.team-next:hover {
  color: var(--text); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-1);
}
.team-next__label { font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.team-next__when { font-size: .86rem; font-weight: 650; }
.team-next__match { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.team-next__match img { flex: none; width: 22px; height: 22px; object-fit: contain; }
.team-next__cta { margin-top: 5px; font-size: .74rem; font-weight: 650; color: var(--accent); }

.team-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); align-items: start; }
.team-main { min-width: 0; }
.team-aside { min-width: 0; }

.team-month {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-2); margin-bottom: var(--space-2); overflow: clip;
}
.team-month__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); cursor: pointer; list-style: none;
  font-size: .9rem; font-weight: 650;
}
.team-month__head::-webkit-details-marker { display: none; }
.team-month__head::after {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted);
  transform: rotate(45deg); margin-right: 2px; transition: transform .15s ease;
}
.team-month[open] > .team-month__head::after { transform: rotate(-135deg); }
.team-month__count { margin-left: auto; font-size: .74rem; font-weight: 500; color: var(--text-muted); }
.team-schedule { display: grid; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }

.roster td, .roster th { white-space: nowrap; }
.roster .team-cell { white-space: normal; }
.roster__flag { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; margin-right: 6px; vertical-align: -2px; }

/* Shared news module (match + team pages). */
.news-block { margin-top: var(--space-6); }
.news-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.news-block__head .match-section__title { margin: 0; }
.news-block__all { font-size: .78rem; font-weight: 650; white-space: nowrap; }
.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.news-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3); color: var(--text);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.news-card:hover {
  color: var(--text); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-1px); box-shadow: var(--shadow-1);
}
.news-card__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-raised); }
.news-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card__kind {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, #000 62%, transparent); color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.news-card__kind--inline {
  position: static; background: var(--surface-raised); color: var(--text-muted);
}
.news-card__body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; min-width: 0; }
.news-card__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .68rem; color: var(--text-muted); }
.news-card__title {
  font-size: .9rem; font-weight: 650; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__desc {
  font-size: .78rem; line-height: 1.4; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 1023px) {
  .team-hero { grid-template-columns: 1fr; }
  .team-next { min-width: 0; }
  .team-layout { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .team-hero { padding: var(--space-4); }
  .team-hero__identity { align-items: flex-start; }
  .team-hero__logo { width: 64px; height: 64px; }
  .news-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   M5 — soccer league page
   ========================================================================== */

.league-head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3); margin-bottom: var(--space-4);
}
.league-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 160px at 0% 0%,
    color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%);
}
.league-head__logo { position: relative; flex: none; width: 64px; height: 64px; object-fit: contain; }
.league-head__text { position: relative; flex: 1; min-width: 0; }
.league-head__name { margin: 0; }
.league-head__cta {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface-raised); border: 1px solid var(--border);
  color: var(--text); font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.league-head__cta:hover {
  color: var(--accent); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.league-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.league-main, .league-aside { min-width: 0; }

.league-fixhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.league-fixhead .match-section__title { margin: 0; }
.league-fixhead__date { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.league-main .date-nav { margin: var(--space-3) 0 var(--space-4); }

.league-table {
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3);
}
.league-table__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.league-table__head .match-section__title { margin: 0; font-size: .98rem; }
.league-table__all { font-size: .74rem; font-weight: 650; white-space: nowrap; }
.league-table .table-wrap { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.league-table table.standings { min-width: 0; font-size: .78rem; }
.league-table table.standings th, .league-table table.standings td { padding: 6px 3px; }
.league-table table.standings .team-cell { min-width: 0; }
.league-table table.standings .team-cell img { width: 18px; height: 18px; margin-right: 6px; }
.league-table__empty { color: var(--text-muted); font-size: .8rem; margin: var(--space-2) 0 0; }
.league-aside__more { margin: var(--space-3) 0 0; font-size: .8rem; }

@media (max-width: 1023px) {
  .league-layout { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .league-head { padding: var(--space-3) var(--space-4); gap: var(--space-3); }
  .league-head__logo { width: 48px; height: 48px; }
  .league-head__cta { padding: 5px 12px; }
}

/* League table page: qualification stripes + leader boards.
   The stripe is decoration; the legend below the table names every zone by
   position, so the outcome is never conveyed by colour alone. */
.zone-champions  { --zone: #6aa9ff; }
.zone-europa     { --zone: #f5a524; }
.zone-conference { --zone: #35c287; }
.zone-playoff    { --zone: #ff8a3d; }
.zone-relegation { --zone: #ff6b6e; }
.zone-qualify    { --zone: #a3b1c2; }
.zone-other      { --zone: var(--border); }

table.standings--soccer .team-cell { min-width: 190px; }
table.standings--soccer tbody tr[class^="zone-"] td:first-child {
  box-shadow: inset 3px 0 0 var(--zone);
}

.zone-legend {
  margin-top: var(--space-5); padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3);
}
.zone-legend__title { font-size: .92rem; margin: 0 0 var(--space-2); letter-spacing: -.01em; }
.zone-legend__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-1) var(--space-4);
  font-size: .8rem; color: var(--text-muted);
}
.zone-legend__list li { display: flex; align-items: center; gap: var(--space-2); }
.zone-dot {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--zone, var(--border)); flex: none;
}

.league-stats {
  display: grid; gap: var(--space-5); margin-top: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.league-stats__col { min-width: 0; }
.league-stats__col .match-section__title { margin-bottom: var(--space-2); }
table.standings--leaders { min-width: 0; font-size: .78rem; }
table.standings--leaders .team-cell { min-width: 0; }
.league-glossary { margin-top: var(--space-2); }

@media (max-width: 639px) {
  table.standings--soccer .team-cell { min-width: 150px; }
  .zone-legend__list { grid-template-columns: 1fr; }
}

/* ==========================================================================
   M6 - AdSense units
   Nothing is reserved for an ad: the wrapper is collapsed until AdSense
   reports data-ad-status="filled" (assets/ads.js sets the wrapper state).
   Until then it has zero height, no border and no label; unfilled units are
   removed from the layout entirely. Units are responsive (data-ad-format
   "auto"), so the same slot serves phone, tablet and desktop widths.
   ========================================================================== */

.ad-slot {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
  /* Never clip a unit that is still negotiating its height. */
  overflow: visible;
}

.ad-slot__label {
  display: none;
  margin: 0 0 var(--space-1);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ad-slot[data-state="filled"] {
  margin: var(--space-5) 0;
}

.ad-slot[data-state="filled"] .ad-slot__label {
  display: block;
}

.ad-slot[data-state="unfilled"] {
  display: none;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 0;
}

/* In-feed slot (between league sections): centred leaderboard-ish width on
   desktop, full width on mobile. */
.ad-slot--in-feed {
  max-width: 970px;
}
.ad-slot--in-feed[data-state="filled"] {
  margin-left: auto;
  margin-right: auto;
}

/* Inline slots that sit in a grid stack (match/team/league mains) already
   have the parent's gap: no extra outer margin needed. */
.match-main > .ad-slot[data-state="filled"],
.team-main > .ad-slot[data-state="filled"],
.league-main > .ad-slot[data-state="filled"],
.match-aside > .ad-slot[data-state="filled"] {
  margin: 0;   /* the parent's grid gap already spaces it */
}

/* Sidebar slot: 300px is the widest unit a 300-320px rail can serve without
   overflowing at small breakpoints. */
.ad-slot--aside {
  max-width: 300px;
}

/* ==========================================================================
   Channel pages (M5) - channel head, day strip, programme timeline, lineup.
   Status is always spelled out ("On now", "Replay"); colour is decoration.
   ========================================================================== */

.channel-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  background: var(--surface);
}

.channel-head__logo,
.channel-head__mark {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.channel-head__mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface-raised);
  font-weight: 700;
  letter-spacing: .05em;
}

.channel-head__text { flex: 1; min-width: 0; }
.channel-head__name { margin: 0; }
.channel-head__meta { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: .875rem; }

/* Five-day strip. No JS: every date is a crawlable link, 64px targets. */
.channel-days {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 0 0 var(--space-2);
  margin-bottom: var(--space-4);
  scrollbar-width: none;
}
.channel-days::-webkit-scrollbar { display: none; }

.channel-days__day {
  flex: none;
  min-width: 78px;
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
}
.channel-days__day:hover { background: var(--surface-raised); color: var(--text); text-decoration: none; }
.channel-days__day.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
}
.channel-days__dow { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.channel-days__d { color: var(--text); font-size: 1.05rem; font-weight: 700; }
.channel-days__mon { font-size: .72rem; }

.channel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
}
.channel-main, .channel-aside { display: grid; gap: var(--space-4); align-content: start; }
.channel-main > .ad-slot[data-state="filled"] { margin: 0; }

.channel-onnow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface);
  font-size: .875rem;
}
.channel-onnow__text { min-width: 0; }

.prog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.prog {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 120px;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface);
}
.prog--live { border-color: color-mix(in srgb, var(--live) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--live); }

.prog__time { color: var(--text-muted); font-size: .82rem; font-variant-numeric: tabular-nums; line-height: 1.35; }
.prog__time time { display: block; color: var(--text); font-weight: 600; }
.prog__end { display: block; }
.prog__body { min-width: 0; }
.prog__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.prog__title { margin: 0; font-size: 1rem; line-height: 1.3; }
.prog__desc { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: .875rem; }
.prog__thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-2);
  background: var(--surface-raised);
}

.channel-source { margin: var(--space-2) 0 0; color: var(--text-muted); font-size: .78rem; }
.channel-empty h3 { margin: 0 0 var(--space-1); font-size: 1rem; }

.channel-lineup, .channel-about {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface);
}
.channel-about p { margin: 0 0 var(--space-2); color: var(--text-muted); font-size: .875rem; }
.channel-about p:last-child { margin-bottom: 0; }

.channel-lineup__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.channel-lineup__list a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-2);
  color: var(--text);
  font-size: .875rem;
}
.channel-lineup__list a:hover { background: var(--surface-raised); text-decoration: none; }
.channel-lineup__list a[aria-current="page"] { background: var(--surface-raised); font-weight: 650; }
.channel-lineup__list img, .channel-lineup__mark {
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.channel-lineup__mark {
  display: grid;
  place-items: center;
  border-radius: var(--radius-1);
  background: var(--surface-raised);
  font-size: .62rem;
  font-weight: 700;
}

.channel-aside__more { margin: 0; font-weight: 600; }

/* Directory */
.channel-index-head { margin-bottom: var(--space-5); }
.channel-index-head__intro { max-width: 70ch; margin: var(--space-2) 0 0; color: var(--text-muted); }
.channel-index-group { margin-bottom: var(--space-5); }
.channel-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-2);
}
.channel-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  height: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--surface);
  color: var(--text);
}
.channel-card:hover { background: var(--surface-raised); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); text-decoration: none; }
.channel-card__logo, .channel-card__mark {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.channel-card__mark {
  display: grid;
  place-items: center;
  border-radius: var(--radius-2);
  background: var(--surface-raised);
  font-size: .72rem;
  font-weight: 700;
}
.channel-card__text { min-width: 0; }
.channel-card__text strong { display: block; font-size: .92rem; line-height: 1.3; }
.channel-card__text small { display: block; margin-top: 2px; color: var(--text-muted); font-size: .75rem; }
.channel-index-foot { color: var(--text-muted); font-size: .82rem; }

@media (max-width: 1023px) {
  .channel-layout { grid-template-columns: minmax(0, 1fr); }
  .channel-aside { order: 2; }
}

@media (max-width: 639px) {
  .channel-head { align-items: flex-start; }
  .channel-head__logo, .channel-head__mark { width: 48px; height: 48px; }
  .prog { grid-template-columns: 72px minmax(0, 1fr); }
  .prog__thumb { display: none; }
  .channel-grid { grid-template-columns: minmax(0, 1fr); }
}
/* --- global search (M5) -------------------------------------------------- */

.search-head { margin-bottom: var(--space-5); }
.search-form { display: flex; gap: var(--space-2); max-width: 640px; }
.search-form input[type="search"] {
  flex: 1 1 auto; min-width: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-2);
  padding: var(--space-3) var(--space-4);
  font: inherit; font-size: 1rem;
  -webkit-appearance: none; appearance: none;
}
.search-form input[type="search"]::placeholder { color: var(--text-muted); }
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form__submit {
  flex: none; min-height: 44px; padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-2);
  background: var(--accent); color: #08130d;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.search-form__submit:hover { background: var(--accent-strong); }

.search-empty {
  max-width: 720px; padding: var(--space-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-3);
}
.search-empty__title { margin: 0 0 var(--space-2); font-size: 1.05rem; }
.search-empty p { margin: 0 0 var(--space-2); color: var(--text-muted); }
.search-empty p:last-child { margin-bottom: 0; }
.search-empty__hint strong { color: var(--text); }

.search-summary { margin: 0 0 var(--space-4); color: var(--text-muted); font-size: .9rem; }

.search-group { margin-bottom: var(--space-5); }
.search-group__count { margin-left: var(--space-1); color: var(--text-muted); font-size: .82rem; font-weight: 500; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.search-result { display: flex; align-items: stretch; gap: var(--space-2); }
.search-result__link {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-2);
}
.search-result__link:hover {
  background: var(--surface-raised); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.search-result__logo, .search-result__mark { flex: none; width: 36px; height: 36px; object-fit: contain; }
.search-result__mark {
  display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-raised);
  color: var(--text-muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em;
}
.search-result__text { min-width: 0; display: grid; gap: 1px; }
.search-result__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__meta { color: var(--text-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__go { flex: none; margin-left: auto; display: grid; place-items: center; color: var(--text-muted); }

.fav-toggle {
  flex: none; display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2);
  background: var(--surface); color: var(--text-muted);
  font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer;
}
.fav-toggle:hover { color: var(--text); background: var(--surface-raised); }
.fav-toggle[aria-pressed="true"] {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.fav-toggle[hidden] { display: none; }
.fav-toggle__icon { font-size: 1rem; line-height: 1; }

.search-popular { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.search-popular__title {
  margin: 0 0 var(--space-2); color: var(--text-muted);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
}
.search-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.search-chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .85rem;
}
.search-chip:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }

/* --- favourites rail (home, M5) ------------------------------------------ */

.fav-rail { margin: 0 0 var(--space-4); }
.fav-rail[hidden] { display: none; }
.fav-rail__title {
  margin: 0 0 var(--space-2); color: var(--text-muted);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
}
.fav-rail__list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.fav-rail__list::-webkit-scrollbar { display: none; }
.fav-rail__item { flex: none; display: flex; align-items: stretch; }
.fav-card {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-1) var(--space-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-2) 0 0 var(--radius-2);
  border-right: 0; white-space: nowrap;
}
.fav-card:hover { background: var(--surface-raised); text-decoration: none; }
.fav-card img, .fav-card__mark { flex: none; width: 24px; height: 24px; object-fit: contain; }
.fav-card__mark { display: grid; place-items: center; border-radius: 50%; background: var(--surface-raised); color: var(--text-muted); font-size: .62rem; font-weight: 700; }
.fav-card__name { font-size: .86rem; font-weight: 600; }
.fav-rail__remove {
  display: grid; place-items: center; min-width: 36px; min-height: 44px;
  border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius-2) var(--radius-2) 0;
  background: var(--surface); color: var(--text-muted); font: inherit; cursor: pointer;
}
.fav-rail__remove:hover { color: var(--loss); background: var(--surface-raised); }

@media (max-width: 479px) {
  .search-form { flex-wrap: wrap; }
  .search-form__submit { width: 100%; }
  .fav-toggle { padding: 0 var(--space-2); }
  .fav-toggle__text { display: none; }
}
