@charset "UTF-8";
/* Dawri Lab (مختبر الدوري) — direction (أ) «ليلة المباراة» / Matchnight.
   Wordmark idea «ما تحت السطح»: the word, then one accent data point sitting below the baseline.
   Layout concept: a sticky scoreboard bar over one 1080px column of stacked match cards;
   from 900px the round page splits into a story-and-matches column and a table-and-race column.
   Dark by default for every visitor: bare :root holds the dark palette; light only when chosen with the toggle ([data-theme="light"]).
   Contrast values (WCAG, against bg / surface) come from the UX research, section 6 (أ). */

:root {
  color-scheme: dark;
  /* neutrals, blue-biased toward the floodlit night */
  --bg: #0B1016;
  --bar: #0E151D;
  --surface: #141C26;
  --surface-2: #1A2431;
  --line: #1E2833;
  --line-2: #2A3645;
  --fg: #E9EEF3;          /* 16.4 / 14.7 */
  --fg-2: #C5CFD8;
  --muted: #9AA8B6;       /* 7.9 / 7.1 */
  --faint: #4B5866;       /* decoration only, never text */
  /* brand: "scout green", carries no data meaning */
  --accent: #3EE6A0;
  --accent-text: #3EE6A0;
  --accent-hover: #7FF0C2;
  --on-accent: #0B1016;
  --hero-a: #13281F;
  --hero-line: #1F3A2E;
  /* three-way probability (never club colours) */
  --home: #4FB3FF;        /* 8.4 / 7.5 */
  --draw: #8A96A3;        /* graphics */
  --draw-text: #9AA8B6;
  --away: #FF9F5A;        /* 9.4 / 8.5 */
  /* performance vs expectation: colour-blind-safe pair, always with sign and arrow */
  --above: #2DD4BF;
  --below: #FB7185;
  /* result chips, always with a letter */
  --win: #2DD4BF;
  --tie: #8A96A3;
  --loss: #FB7185;
  --on-chip: #0B1016;
  /* table zones, always with a stripe pattern and a text divider */
  --zone-top: #3EE6A0;
  --zone-cont: #4FB3FF;
  --zone-rel: #FB7185;
  --focus: #7FF0C2;
  --skel: #18212C;
  --skel-hi: #212C3A;
  --scrim: rgba(5, 8, 12, 0.72);

  --font-display: "Alexandria", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-body: "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;

  --fs-xs: 13px;   /* Arabic minimum */
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 28px;

  --r-card: 16px;
  --r-chip: 22px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --nav-h: 64px;
  --dur: 200ms;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6F9; --bar: #FFFFFF; --surface: #FFFFFF; --surface-2: #EEF2F6;
  --line: #DCE2E9; --line-2: #C6CFD9;
  --fg: #0F1720; --fg-2: #2B3742; --muted: #566370; --faint: #9AA6B2;
  --accent: #0B7F57; --accent-text: #0A7050; --accent-hover: #075C41; --on-accent: #FFFFFF;
  --hero-a: #E1F3EA; --hero-line: #BFE3D0;
  --home: #1E66C8; --draw: #7A8794; --draw-text: #566370; --away: #B9520C;
  --above: #0F766E; --below: #BE123C;
  --win: #0F766E; --tie: #566370; --loss: #BE123C; --on-chip: #FFFFFF;
  --zone-top: #0B7F57; --zone-cont: #1E66C8; --zone-rel: #BE123C;
  --focus: #0B7F57; --skel: #E5EAF0; --skel-hi: #F0F3F7; --scrim: rgba(15, 23, 32, 0.45);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; scroll-padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* paints the safe-area band above the sticky bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bar); }

.app {
  min-height: 100%;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 0;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.4; margin: 0; text-wrap: balance; letter-spacing: 0; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 700; }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main:focus-visible { outline: none; }

.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.num-d { font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
bdi.sn { unicode-bidi: isolate; direction: ltr; white-space: nowrap; }
.is-above { color: var(--above); }
.is-below { color: var(--below); }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[lang="en"] { font-family: var(--font-body); }

.skip { position: absolute; inset-inline-start: 8px; top: -100px; z-index: 50; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip:focus-visible { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  margin-left: calc(-1 * var(--gutter-l));
  margin-right: calc(-1 * var(--gutter-r));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1080px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0; min-height: 44px; padding-block: 4px; color: var(--fg); text-decoration: none; }
.brand:hover { color: var(--fg); }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.2; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: flex-end; margin-bottom: 9px; margin-inline-start: 4px; flex: none; }
.beta { align-self: center; margin-inline-start: 10px; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent-text); font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tools { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fresh { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 6px; color: var(--muted); font-size: var(--fs-xs); text-decoration: none; white-space: nowrap; border-radius: 10px; }
.fresh:hover { color: var(--fg); }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.fresh.is-stale .fresh-dot { background: var(--away); }
/* The two-word wordmark needs the room on phones: the update time keeps its dot and stays
   readable to screen readers, the full text is on #method. */
@media (max-width: 480px) {
  .topbar .brand-word { font-size: 22px; }
  .topbar .beta { margin-inline-start: 8px; padding-inline: 7px; }
  .fresh-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); }
.ico-moon { display: none; }
.is-light .ico-sun { display: none; }
.is-light .ico-moon { display: block; }

/* ------------------------------------------------------------------ search */
.search { position: fixed; inset: 0; z-index: 40; background: var(--scrim); padding-top: env(safe-area-inset-top, 0px); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.search-in { max-width: 640px; margin: 12px auto 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 12px; max-height: calc(100% - 24px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: inherit; font-size: 16px; }
.search-input::placeholder { color: var(--muted); }
.search-hint { font-size: var(--fs-xs); color: var(--muted); padding: 8px 4px 4px; }
.search-results { display: grid; gap: 2px; }
.search-results a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: 12px; color: var(--fg); text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface-2); }
.sr-kind { font-size: var(--fs-xs); color: var(--muted); }
.sr-main { display: grid; min-width: 0; line-height: 1.4; }
.sr-main b { font-weight: 600; }
.search-group { font-size: var(--fs-xs); color: var(--muted); padding: 10px 8px 2px; }

/* ------------------------------------------------------------------ main */
.main { max-width: 1080px; margin-inline: auto; padding-block: 16px 40px; display: grid; gap: 28px; min-width: 0; }
.main > * { min-width: 0; }
.stack { display: grid; gap: 28px; min-width: 0; }
.stack-sm { display: grid; gap: 12px; min-width: 0; }
.cols { display: grid; gap: 28px; min-width: 0; }
.cols > * { min-width: 0; }
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .cols-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.grid-3 { display: grid; gap: 12px; }
@media (min-width: 600px) and (max-width: 899px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.page-h { display: grid; gap: 6px; }
.page-h .eyebrow { margin-bottom: 2px; }
.page-sub { color: var(--muted); font-size: var(--fs-sm); }
.sec { display: grid; gap: 12px; min-width: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sec-h a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-text); }
.takeaway { font-size: var(--fs-md); color: var(--fg-2); line-height: 1.75; max-width: 68ch; }
.note { font-size: var(--fs-xs); color: var(--muted); line-height: 1.75; max-width: 72ch; }
.disclaimer { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 8px; align-items: center; }
.disclaimer svg { flex: none; }

/* cards: three levels — hero (gradient), card (surface + hairline), flat (no frame) */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; min-width: 0; }
.card-tight { padding: 0; overflow: hidden; }
.card > h2 + * { margin-top: 8px; }
.hero { position: relative; border-radius: var(--r-card); padding: 18px; border: 1px solid var(--hero-line); background: linear-gradient(160deg, var(--hero-a) 0%, var(--surface) 62%); display: grid; gap: 12px; }
.hero h1 { font-size: var(--fs-xl); line-height: 1.45; }
.hero-lead { color: var(--fg-2); font-size: var(--fs-md); line-height: 1.8; max-width: 62ch; }
.hero-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.hero-links a { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.caveat { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 6px; align-items: baseline; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.hero .tile { background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); }
.tile-v { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile-l { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }

/* chips and pills */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pill { min-height: 44px; padding: 0 16px; border-radius: var(--r-chip); display: inline-flex; align-items: center; white-space: nowrap; font-size: var(--fs-sm); color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: transparent; flex: none; }
.pill:hover { color: var(--fg); border-color: var(--line-2); }
.pill[aria-current="page"], .pill.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: 14px; font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--fg-2); white-space: nowrap; }
.chip-dots { letter-spacing: 1px; font-size: 11px; }
.str-0 { color: var(--accent-text); }
.str-1 { color: var(--home); }
.str-2 { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; font-size: var(--fs-xs); font-weight: 600; background: color-mix(in srgb, var(--away) 16%, transparent); color: var(--fg); border: 1px solid color-mix(in srgb, var(--away) 45%, transparent); }
.badge svg { color: var(--away); flex: none; }
.review { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; padding: 0 8px; white-space: nowrap; line-height: 1.8; }

/* segmented switch */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; padding: 4px 6px; line-height: 1.35; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ------------------------------------------------------------------ probability bar
   Categorical, not a scale: home at the inline start (right), draw in the middle, away at the inline end (left). */
.pb { display: grid; gap: 8px; }
.pb-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.pb-bar span { display: block; height: 100%; min-width: 3px; }
.pb-h { background: var(--home); }
.pb-d { background: var(--draw); }
.pb-a { background: var(--away); }
.pb-nums { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; font-size: var(--fs-xs); line-height: 1.4; }
.pb-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; color: var(--muted); min-width: 0; }
.pb-nd { justify-content: center; }
.pb-na { justify-content: flex-end; text-align: end; }
.pb-n b { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.pb-nh b { color: var(--home); }
.pb-nd b { color: var(--draw-text); font-weight: 600; }
.pb-na b { color: var(--away); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key-h { background: var(--home); } .key-d { background: var(--draw); } .key-a { background: var(--away); }

/* fixture card */
.fx-list { display: grid; gap: 10px; }
.fx-day { font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2); padding-top: 4px; }
.fx { display: grid; gap: 12px; padding: 14px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; }
a.fx:hover { color: var(--fg); border-color: var(--line-2); }
.fx-when { font-size: var(--fs-xs); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.fx-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.fx-team { font-size: 16px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.fx-away { text-align: end; }
.fx-vs { font-size: var(--fs-xs); color: var(--muted); }
.fx-say { font-size: var(--fs-sm); color: var(--fg-2); }
.fx-say b { font-weight: 600; color: var(--fg); }
.fx-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* score and results */
.score { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
.sc-team { font-size: var(--fs-md); font-weight: 600; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.sc-away { text-align: end; }
.sc-team.is-loser { color: var(--fg-2); font-weight: 500; }
.sc-n { font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; min-width: 1ch; text-align: center; line-height: 1.2; }
.sc-sep { color: var(--faint); text-align: center; font-weight: 700; }
.score-lg .sc-n { font-size: 44px; }
.score-lg .sc-team { font-size: var(--fs-lg); font-family: var(--font-display); }
.res-list { display: grid; }
.res { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; min-height: 44px; }
.res:last-child { border-bottom: 0; }
a.res:hover { background: var(--surface-2); color: var(--fg); }
.res-xg { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; font-size: var(--fs-xs); color: var(--muted); align-items: center; }
.res-xg span:last-child { text-align: end; }
.res-xg .num { font-family: var(--font-display); font-weight: 600; color: var(--fg-2); font-size: var(--fs-sm); }
.res-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.res-day { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: 10px 14px 0; background: var(--surface); }

/* form chips: time runs oldest at the right to newest at the left */
.form { display: inline-flex; gap: 2px; vertical-align: middle; }
.fc { width: 21px; height: 21px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; line-height: 1; color: var(--on-chip); flex: none; }
.fc-w { background: var(--win); } .fc-d { background: var(--tie); } .fc-l { background: var(--loss); }
.fc-last { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--muted); }
.form-cap { font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------------------------------------------ horizontal bars (HTML)
   Labels at the inline start (right); bars grow toward the inline end (left). */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 6px; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--fs-sm); }
.bar-top a, .bar-top span:first-child { font-weight: 600; color: var(--fg); text-decoration: none; }
.bar-top a { min-height: 32px; display: inline-flex; align-items: center; }
.bar-top b { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); white-space: nowrap; }
.bar-track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bar-fill.is-rel { background: var(--below); }
.bar-fill.is-cont { background: var(--home); }
.bar-fill.is-base { background: var(--draw); }
.bar-sub { font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); -webkit-overflow-scrolling: touch; }
.tbl-wrap:focus-visible { outline-offset: 2px; }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-sm); line-height: 1.4; }
.t th, .t td { padding: 0 6px; height: 46px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.t thead th { height: 40px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); background: var(--surface); position: sticky; top: 0; }
.t tbody tr:last-child td, .t tbody tr:last-child th { border-bottom: 0; }
.t .c-team { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); text-align: start; padding-inline-start: 0; padding-inline-end: 10px; box-shadow: inset 1px 0 0 var(--line); }
.t thead .c-team { z-index: 3; padding-inline-start: 12px; }
.t .c-pts { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); }
.t .c-wrap { white-space: normal; min-width: 9.5em; text-align: start; font-size: var(--fs-xs); color: var(--fg-2); }
.t td.c-dim { color: var(--muted); }
.team-cell { display: flex; align-items: center; gap: 8px; min-height: 46px; }
.team-cell .pos { width: 30px; flex: none; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; align-self: stretch; display: flex; align-items: center; justify-content: center; border-inline-start: 4px solid transparent; }
.team-cell .pos:empty { width: 12px; }
.team-cell a { color: var(--fg); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.team-cell a:hover { color: var(--accent-text); }
.is-mine .team-cell a::after { content: "★"; color: var(--accent); font-size: 12px; margin-inline-start: 6px; }
/* zone stripes: solid = leader, double = continental places, dashed = relegation; each zone also gets a text divider */
.z-top .pos { border-inline-start-color: var(--zone-top); }
.z-cont .pos { border-inline-start: 4px double var(--zone-cont); }
.z-rel .pos { border-inline-start: 4px dashed var(--zone-rel); }
.t tr.zone-line td, .t tr.zone-line th { height: 28px; padding: 0 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); background: var(--surface-2); text-align: start; }
.t tr.zone-line th { position: sticky; inset-inline-start: 0; z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-stripe { width: 4px; height: 16px; flex: none; }
.lg-top { background: var(--zone-top); }
.lg-cont { border-inline-start: 4px double var(--zone-cont); }
.lg-rel { border-inline-start: 4px dashed var(--zone-rel); }
.scroll-hint { font-size: var(--fs-xs); color: var(--muted); }
@media (min-width: 760px) { .scroll-hint { display: none; } }

/* mini table */
.mini { display: grid; }
.mini-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px 48px; align-items: center; min-height: 46px; padding-inline-end: 14px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--fg); text-decoration: none; }
a.mini-row:hover { background: var(--surface-2); color: var(--fg); }
.mini-row .pos { align-self: stretch; display: flex; align-items: center; justify-content: center; color: var(--muted); border-inline-start: 4px solid transparent; font-variant-numeric: tabular-nums; }
.mini-row .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .pl { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-row .pt { text-align: end; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-head { min-height: 34px; font-size: var(--fs-xs); color: var(--muted); }
.mini-head .pt { font-family: var(--font-body); font-weight: 600; }
.mini-gap { min-height: 26px; display: flex; align-items: center; padding-inline: 14px; font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mini-row.is-mine .nm::after { content: " ★"; color: var(--accent); }
.mini-row.z-top .pos { border-inline-start-color: var(--zone-top); }
.mini-row.z-cont .pos { border-inline-start: 4px double var(--zone-cont); }
.mini-row.z-rel .pos { border-inline-start: 4px dashed var(--zone-rel); }
.card-link { display: flex; align-items: center; justify-content: center; min-height: 48px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }

/* monogram */
.mono { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; flex: none; }
.mono-lg { width: 56px; height: 56px; font-size: 22px; }

/* ------------------------------------------------------------------ range chart (projected points) */
.rg { display: grid; gap: 2px; }
.rg-axis, .rg-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.rg-row { min-height: 44px; }
.rg-name { font-weight: 600; color: var(--fg); text-decoration: none; font-size: var(--fs-sm); min-height: 44px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rg-track { position: relative; height: 22px; }
.rg-track::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line); }
.rg-band { position: absolute; top: 6px; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 30%, transparent); border: 1px solid var(--accent); }
.rg-mean { position: absolute; top: 5px; width: 12px; height: 12px; margin-inline-start: -6px; border-radius: 50%; background: var(--fg); border: 2px solid var(--surface); }
.rg-now { position: absolute; top: 1px; width: 3px; height: 20px; margin-inline-start: -1.5px; background: var(--muted); border-radius: 2px; }
.rg-val { font-size: 12px; color: var(--muted); text-align: end; line-height: 1.35; white-space: nowrap; }
.rg-val b { font-family: var(--font-display); font-size: var(--fs-md); color: var(--fg); font-weight: 700; }
.rg-ticks { position: relative; height: 18px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rg-ticks span { position: absolute; transform: translateX(50%); top: 0; line-height: 18px; }
.rg-axis { min-height: 22px; }
.rg-axis .rg-cap { font-size: var(--fs-xs); color: var(--muted); }
.rg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--muted); }
.rg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-band { width: 22px; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 30%, transparent); border: 1px solid var(--accent); }
.lg-mean { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); }
.lg-now { width: 3px; height: 14px; background: var(--muted); border-radius: 2px; }

/* ------------------------------------------------------------------ position strips (1 at the right, 18 at the left) */
.ps-list { display: grid; gap: 4px; }
.ps-head { display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; gap: 10px; font-size: 12px; color: var(--muted); align-items: end; }
.ps-scale { display: flex; justify-content: space-between; }
.ps { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; gap: 10px; align-items: center; min-height: 48px; padding: 4px 0; border: 0; border-radius: 10px; background: transparent; color: var(--fg); text-align: start; cursor: pointer; }
.ps:hover { background: var(--surface-2); }
.ps[aria-expanded="true"] { background: var(--surface-2); }
.ps-name { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-inline-start: 6px; }
.ps-cols { display: flex; align-items: flex-end; gap: 1px; height: 34px; }
.ps-cols i { flex: 1; min-width: 0; background: var(--muted); border-radius: 2px 2px 0 0; display: block; }
.ps-cols i.z-top, .ps-cols i.z-cont { background: var(--accent); }
.ps-cols i.z-rel { background: var(--below); }
.ps-cols i.is-zero { background: var(--line-2); height: 2px !important; }
.ps-say { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; padding-inline-end: 6px; white-space: nowrap; }
.ps-say b { color: var(--fg); font-family: var(--font-display); font-weight: 700; }
.ps-detail { padding: 8px 12px 12px; font-size: var(--fs-xs); color: var(--fg-2); }
.ps-detail ul { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-detail li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }
.ps-zones { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* team position distribution (larger) */
.dist { display: grid; gap: 6px; }
.dist-cols { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line-2); }
.dist-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.dist-col i { display: block; width: 100%; background: var(--muted); border-radius: 3px 3px 0 0; }
.dist-col.z-top i, .dist-col.z-cont i { background: var(--accent); }
.dist-col.z-rel i { background: var(--below); }
.dist-col small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.dist-labels { display: flex; gap: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dist-labels span { flex: 1; text-align: center; min-width: 0; }

/* ------------------------------------------------------------------ SVG charts */
.chart { display: grid; gap: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ax-line { stroke: var(--line-2); stroke-width: 1; fill: none; }
.ax-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.ax-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.ax-diag { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.ax-text { fill: var(--muted); font-size: 12px; font-family: var(--font-body); }
.ax-title { fill: var(--fg-2); font-size: 13px; font-family: var(--font-body); font-weight: 600; }
.pt-dot { fill: var(--muted); stroke: var(--surface); stroke-width: 2; }
.pt-dot.is-hi { fill: var(--fg); }
.pt-ring { fill: none; stroke: transparent; stroke-width: 2.5; }
.pt-hit { fill: transparent; stroke: none; }
.pt { cursor: pointer; }
.pt:focus { outline: none; }
.pt:focus-visible .pt-ring, .pt.is-sel .pt-ring { stroke: var(--focus); }
.pt.is-sel .pt-dot { fill: var(--accent); }
.pt-label { fill: var(--fg); font-size: 13px; font-family: var(--font-body); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart-pick { min-height: 48px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.6; }
.chart-pick b { color: var(--fg); }

/* interval chart (HTML) */
.iv { display: grid; gap: 6px; }
.iv-track { position: relative; height: 36px; }
.iv-track::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line-2); }
.iv-zero { position: absolute; top: 2px; bottom: 2px; width: 0; border-inline-start: 1px dashed var(--muted); }
.iv-band { position: absolute; top: 12px; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 30%, transparent); border: 1px solid var(--accent); }
.iv-dot { position: absolute; top: 9px; width: 18px; height: 18px; margin-inline-start: -9px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); }
.iv-other { position: absolute; top: 14px; width: 8px; height: 8px; margin-inline-start: -4px; border-radius: 50%; background: var(--faint); }
.iv-scale { position: relative; height: 18px; font-size: 12px; color: var(--muted); }
.iv-scale span { position: absolute; transform: translateX(50%); white-space: nowrap; }
.iv-caps { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); }

/* diverging cell bar: zero in the middle, positive toward the inline end (left) */
.dv { display: inline-grid; grid-template-columns: 56px auto; gap: 8px; align-items: center; justify-content: center; }
.dv-track { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; }
.dv-track::after { content: ""; position: absolute; inset-inline-start: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.dv-fill { position: absolute; top: 0; height: 100%; border-radius: 4px; }
.dv-fill.is-above { background: var(--above); inset-inline-start: 50%; }
.dv-fill.is-below { background: var(--below); inset-inline-end: 50%; }

/* hypotheses */
.hyp { display: grid; gap: 10px; }
.hyp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hyp-rank { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); color: var(--muted); }
.hyp p { color: var(--fg-2); line-height: 1.8; }
.hyp a { font-weight: 600; text-decoration: none; font-size: var(--fs-sm); min-height: 44px; display: inline-flex; align-items: center; }
details.more { border-top: 1px solid var(--line); }
details.more summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-text); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; font-family: var(--font-display); width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; flex: none; }
details.more[open] summary::before { content: "−"; }
details.more > div { display: grid; gap: 8px; padding-bottom: 6px; font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.8; }

.placeholder { display: grid; gap: 8px; border: 1px dashed var(--line-2); border-radius: var(--r-card); padding: 16px; background: transparent; }
.placeholder .chip { justify-self: start; }

/* team / player / match headers */
.ent-h { display: grid; gap: 14px; }
.ent-top { display: flex; align-items: center; gap: 14px; }
.ent-top > div { min-width: 0; display: grid; gap: 2px; }
.ent-top h1 { font-size: 26px; overflow-wrap: anywhere; }
.ent-en { font-size: var(--fs-xs); color: var(--muted); }
.ent-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--fg); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { color: var(--on-accent); background: var(--accent-hover); border-color: var(--accent-hover); }
.verdict { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.6; }
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: end; }
.kv dd .num { font-family: var(--font-display); }

/* compare rows (match page): home share at the right, away at the left */
.cmp { display: grid; gap: 14px; }
.cmp-row { display: grid; gap: 6px; }
.cmp-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: baseline; font-size: var(--fs-sm); }
.cmp-top b { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.cmp-top b:last-child { text-align: end; }
.cmp-top span { color: var(--muted); font-size: var(--fs-xs); text-align: center; }
.cmp-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.cmp-bar i { display: block; height: 100%; }
.cmp-h { background: var(--home); } .cmp-a { background: var(--away); }

/* glossary and checks */
.gloss { display: grid; gap: 12px; }
.gloss dt { font-weight: 700; font-family: var(--font-display); font-size: var(--fs-md); }
.gloss dd { margin: 2px 0 0; color: var(--fg-2); line-height: 1.8; }
.checks { display: grid; }
.check { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); align-items: start; }
.check:last-child { border-bottom: 0; }
.check-ico { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--on-chip); }
.check-ok .check-ico { background: var(--win); }
.check-bad .check-ico { background: var(--away); }
.check small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .pick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pick { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; cursor: pointer; text-align: start; }
.pick:hover { border-color: var(--line-2); }
.pick .mono { width: 32px; height: 32px; font-size: 14px; }

/* ------------------------------------------------------------------ states */
.skel { display: grid; gap: 14px; }
.skel i { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--skel) 0%, var(--skel-hi) 50%, var(--skel) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i.sk-h { height: 30px; width: 55%; }
.skel i.sk-card { height: 120px; border-radius: var(--r-card); }
.skel i.sk-row { height: 46px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.err { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-card); border: 1px solid color-mix(in srgb, var(--below) 50%, transparent); background: color-mix(in srgb, var(--below) 8%, var(--surface)); }
.err p { color: var(--fg); }
.empty { padding: 16px; color: var(--muted); font-size: var(--fs-sm); border: 1px dashed var(--line-2); border-radius: var(--r-card); }

/* ------------------------------------------------------------------ footer + bottom nav */
.foot { max-width: 1080px; margin-inline: auto; padding-block: 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 6px; border-top: 1px solid var(--line); }
.foot-tag { display: flex; align-items: center; gap: 0; color: var(--fg-2); font-size: var(--fs-sm); }
.foot-tag .brand-word { font-size: 18px; }
.foot-tag .brand-dot { width: 5px; height: 5px; margin-bottom: 6px; margin-inline-start: 2px; margin-inline-end: 6px; }
.foot-note { font-size: var(--fs-xs); color: var(--muted); }
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--bar);
  border-top: 1px solid var(--line);
  padding-top: 4px;
  padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.bnav-in { max-width: 600px; margin-inline: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: var(--fs-xs); color: var(--muted); text-decoration: none; border-radius: 12px; }
.bnav a:hover { color: var(--fg); }
.bnav a[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
.bnav a[aria-current="page"] svg { stroke-width: 2.4; }

@media (min-width: 900px) {
  .hero { padding: 24px; }
  .hero h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: no-preference) {
  .main > * { animation: rise var(--dur) ease-out both; }
  @keyframes rise { from { opacity: 0.6; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------ players page */
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-2 button { min-height: 36px; }
.board-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.board-h h3 { margin: 0; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; }
.lb li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lb li:last-child { border-bottom: 0; }
.lb-r { color: var(--muted); font-size: var(--fs-xs); text-align: center; }
.lb li:first-child .lb-r { color: var(--accent-text); font-weight: 700; }
.lb-n { min-width: 0; display: grid; }
.lb-n a { font-weight: 600; text-decoration: none; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-n a:hover { text-decoration: underline; }
.lb-n small { color: var(--muted); font-size: var(--fs-xs); }
.lb-v { font-weight: 700; font-size: var(--fs-md); }
.hl { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chips-wrap .pill { min-height: 40px; padding: 0 14px; }
.motm-hero { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.motm-name { margin: 0; font-size: 22px; }
.motm-name a { color: var(--fg); text-decoration: none; }
.motm-list { list-style: none; margin: 0; padding: 0; display: grid; }
.motm-row { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.motm-row:last-child { border-bottom: 0; }
.motm-match { font-size: var(--fs-xs); color: var(--muted); text-decoration: none; padding-block: 2px; }
.motm-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.motm-who b a { color: var(--fg); text-decoration: none; }
.motm-v { margin-inline-start: auto; font-weight: 700; color: var(--accent-text); }
.insights { margin: 0; padding-inline-start: 18px; display: grid; gap: 10px; color: var(--fg-2); line-height: 1.75; max-width: 72ch; }
.insights a { color: inherit; }
@media (max-width: 480px) { .bnav a { font-size: 10.5px; } }
