/* Betlab: module grid in the manner of a sports gamecast. */

:root {
  --canvas: #edf0f3;
  --module: #ffffff;
  --module-2: #f6f7f9;
  --ink: #121417;
  --ink-2: #48505c;
  --ink-3: #636b77;
  --rule: #dde1e6;
  --rule-strong: #c9ced5;
  --bar: #15171b;
  --bar-ink: #f3f4f6;
  --bar-ink-2: #a9b0ba;
  --home: #2456c9;
  --draw: #8b95a2;
  --away: #d4651f;
  --home-soft: rgba(36, 86, 201, 0.12);
  --away-soft: rgba(212, 101, 31, 0.12);
  --hit: #1f7a4d;
  --miss: #a33a2b;
  --focus: #121417;
  --shadow: 0 1px 2px rgba(18, 20, 23, 0.06), 0 1px 1px rgba(18, 20, 23, 0.04);
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0e1013;
    --module: #171a1f;
    --module-2: #1d2127;
    --ink: #eceef2;
    --ink-2: #b6bcc6;
    --ink-3: #9198a3;
    --rule: #2a2f37;
    --rule-strong: #39404a;
    --bar: #08090b;
    --home: #6b95f2;
    --draw: #7c8592;
    --away: #f08b4c;
    --home-soft: rgba(107, 149, 242, 0.16);
    --away-soft: rgba(240, 139, 76, 0.16);
    --hit: #4cc38a;
    --miss: #f07a68;
    --focus: #eceef2;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #0e1013;
  --module: #171a1f;
  --module-2: #1d2127;
  --ink: #eceef2;
  --ink-2: #b6bcc6;
  --ink-3: #9198a3;
  --rule: #2a2f37;
  --rule-strong: #39404a;
  --bar: #08090b;
  --home: #6b95f2;
  --draw: #7c8592;
  --away: #f08b4c;
  --home-soft: rgba(107, 149, 242, 0.16);
  --away-soft: rgba(240, 139, 76, 0.16);
  --hit: #4cc38a;
  --miss: #f07a68;
  --focus: #eceef2;
  --shadow: none;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection { background: color-mix(in srgb, var(--ink) 20%, transparent); color: inherit; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

img { display: block; }

h1, h2, h3 { margin: 0; line-height: 1.2; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- top bar */

.topbar { background: var(--bar); color: var(--bar-ink); }
.topbar__inner {
  max-width: 1320px; margin: 0 auto; padding: 0 16px; height: 52px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px;
  letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 10px; color: var(--bar-ink-2);
  font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -0px;
}
.nav a:hover { color: var(--bar-ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--bar-ink); border-bottom-color: var(--bar-ink); }
.topbar__tools { margin-left: auto; display: flex; gap: 4px; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 8px; border-radius: var(--radius);
  background: transparent; color: var(--bar-ink-2); border: 0; font: inherit; cursor: pointer;
}
.iconbtn:hover { color: var(--bar-ink); background: rgba(255, 255, 255, 0.08); }
.theme-dark-icon { display: none; }
:root[data-theme="dark"] .theme-dark-icon { display: block; }
:root[data-theme="dark"] .theme-light-icon { display: none; }

/* ---------------------------------------------------------------- day strip and match ticker */

.strip, .ticker { background: var(--module); border-bottom: 1px solid var(--rule); position: relative; }
/* Edge fades show that the strip scrolls sideways */
.strip::before, .strip::after, .ticker::before, .ticker::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 24px; pointer-events: none; z-index: 1;
}
.strip::before, .ticker::before { left: 0; background: linear-gradient(to right, var(--module), transparent); }
.strip::after, .ticker::after { right: 0; background: linear-gradient(to left, var(--module), transparent); }
.strip__inner, .ticker__inner {
  max-width: 1320px; margin: 0 auto; padding: 0 8px;
  display: flex; overflow-x: auto; scrollbar-width: none;
}
.strip__inner::-webkit-scrollbar, .ticker__inner::-webkit-scrollbar { display: none; }
.strip a {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 86px; padding: 9px 10px 7px; border-bottom: 3px solid transparent;
  color: var(--ink-2); line-height: 1.25;
}
.strip a + a { border-left: 1px solid var(--rule); }

.ticker__day, .ticker__cell {
  flex: none; display: grid; align-content: center; gap: 2px; padding: 8px 12px 6px;
  border-bottom: 3px solid transparent; color: var(--ink); line-height: 1.3;
}
/* The way back to the day stays pinned at the left edge while the matches scroll beneath */
.ticker__day {
  font-weight: 700; font-size: 13px; border-right: 1px solid var(--rule); padding-left: 8px;
  position: sticky; left: 0; z-index: 2; background: var(--module);
  box-shadow: 8px 0 10px -8px rgba(0, 0, 0, 0.25);
}
.ticker::before { display: none; }
/* No inner padding, or scrolled cells would show through left of the pinned cell.
   Cells snap flush to the pinned cell, so no cut-off fragment ever sits next to it. */
.ticker__inner { padding-left: 0; scroll-snap-type: x mandatory; scroll-padding-left: 116px; }
.ticker__day { width: 116px; }
.ticker__cell { scroll-snap-align: start; }
.ticker__day small { font-weight: 600; font-size: 11px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.ticker__cell { width: 168px; font-size: 12px; }
.ticker__cell + .ticker__cell { border-left: 1px solid var(--rule); }
.ticker__cell:hover, .ticker__day:hover { text-decoration: none; background: var(--module-2); }
.ticker__cell[aria-current="page"] { border-bottom-color: var(--ink); background: var(--module-2); }
.ticker__meta { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.ticker__meta .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.ticker__hit { color: var(--hit); }
.ticker__miss { color: var(--miss); }
.ticker__team { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.ticker__team img { width: 14px; height: 14px; object-fit: contain; }
.ticker__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker__team b { font-weight: 800; }
.strip a:hover { text-decoration: none; background: var(--module-2); }
.strip a[aria-current="date"] { color: var(--ink); border-bottom-color: var(--ink); }
.strip__day { font-weight: 700; font-size: 13px; }
.strip__count { font-size: 12px; color: var(--ink-3); }
.strip a.is-today .strip__day::after { content: " · heute"; font-weight: 600; color: var(--ink-3); }

/* ---------------------------------------------------------------- layout */

.page { max-width: 1320px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 14px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.015em; }

.grid {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  grid-template-areas: "left main right";
}
.col { display: grid; gap: 16px; min-width: 0; }
.col--left { grid-area: left; }
.col--main { grid-area: main; }
.col--right { grid-area: right; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "main right" "main left"; }
}
@media (max-width: 1180px) {
  /* Match page: the prediction stays in view next to the content */
  .grid--match { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "left main" "right main"; }
}
@media (max-width: 820px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "left" "right"; }
  .grid--day { grid-template-areas: "summary" "main" "left" "right"; }
  .grid--match { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "main" "right"; }
  .page { padding: 12px; }
}

/* ---------------------------------------------------------------- modules */

.module {
  background: var(--module); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--rule); min-width: 0;
}
:root:not([data-theme="dark"]) .module { border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .module { border-color: var(--rule); } }

.module__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px 10px; margin: 0 14px; border-bottom: 1px solid var(--rule);
  padding-left: 0; padding-right: 0;
}
.module__title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.module__body { padding: 12px 14px 14px; }
.module__foot { padding: 0 14px 12px; font-size: 12px; color: var(--ink-3); }
.module__link { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--rule);
  margin: 0 14px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.empty { padding: 18px 14px 20px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* ---------------------------------------------------------------- probability bar */

.pbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--module); }
.pbar span { display: block; height: 100%; }
.pbar .h { background: var(--home); }
.pbar .x { background: var(--draw); }
.pbar .a { background: var(--away); }
.pbar--lg { height: 12px; border-radius: 6px; }

.plegend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 5px; font-size: 12px; }
.plegend span { white-space: nowrap; color: var(--ink-2); }
.plegend span:nth-child(2) { text-align: center; }
.plegend span:nth-child(3) { text-align: right; }
.plegend b { color: var(--ink); font-weight: 700; }
.plegend .is-fav b { font-weight: 800; }
.plegend .odds { color: var(--ink-3); margin-left: 3px; }
.plegend .is-actual { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.key--h { background: var(--home); }
.key--x { background: var(--draw); }
.key--a { background: var(--away); }
/* Neutral key for "naiv" and "nein": never the draw grey, which means only "Remis" */
.key--neutral { background: var(--rule-strong); }

/* ---------------------------------------------------------------- chips */

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: var(--module-2); color: var(--ink-2); border: 1px solid var(--rule);
}
.chip .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.chip--hit { color: var(--hit); border-color: color-mix(in srgb, var(--hit) 35%, transparent);
  background: color-mix(in srgb, var(--hit) 10%, transparent); }
.chip--miss { color: var(--miss); border-color: color-mix(in srgb, var(--miss) 35%, transparent);
  background: color-mix(in srgb, var(--miss) 8%, transparent); }
.chip--low { color: var(--ink-2); }
.chip--live { color: var(--module); background: var(--ink); border-color: var(--ink); }

/* ---------------------------------------------------------------- team */

.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team__logo { width: 20px; height: 20px; object-fit: contain; flex: none; }
.team__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- match list */

.league-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--module-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 12px; font-weight: 700;
}
.league-head:first-child { border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.league-head img { width: 18px; height: 18px; object-fit: contain; }
.league-head .muted { font-weight: 600; }
.league-head__count { margin-left: auto; color: var(--ink-3); font-weight: 600; }

.mrow {
  display: grid; align-items: center; gap: 4px 16px;
  grid-template-columns: 56px minmax(0, 1fr) minmax(200px, 260px) 16px;
  padding: 10px 14px; border-bottom: 1px solid var(--rule); color: var(--ink);
}
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--module-2); text-decoration: none; }
.mrow__time { font-weight: 700; font-size: 13px; }
.mrow__time small { display: block; font-weight: 600; font-size: 11px; color: var(--ink-3); }
.mrow__teams { display: grid; gap: 5px; min-width: 0; }
.mrow__line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mrow__score { font-weight: 800; font-size: 15px; min-width: 14px; text-align: right; }
.mrow__line.is-winner .team__name { font-weight: 700; }
.mrow__line.is-loser { color: var(--ink-2); }
.mrow__pred { min-width: 0; }
.mrow__flags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mrow__chev { color: var(--ink-3); }
.mrow__none { font-size: 12px; color: var(--ink-3); }

@media (max-width: 560px) {
  .mrow {
    grid-template-columns: 48px minmax(0, 1fr) 12px;
    grid-template-areas: "time teams chev" "pred pred pred";
    gap: 8px 10px;
  }
  .mrow__time { grid-area: time; align-self: start; padding-top: 1px; }
  .mrow__teams { grid-area: teams; }
  .mrow__pred { grid-area: pred; }
  .mrow__chev { grid-area: chev; }
}

/* ---------------------------------------------------------------- side lists */

.slist { list-style: none; margin: 0; padding: 0; }
.slist li + li { border-top: 1px solid var(--rule); }
.slist a { display: block; padding: 10px 0; }
.slist a:hover { text-decoration: none; }
.slist a:hover .fav__team { text-decoration: underline; }

.fav { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
.fav img { width: 26px; height: 26px; object-fit: contain; grid-row: span 2; }
.fav__team { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav__meta { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav__p { grid-row: span 2; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-align: right; }
.fav__p small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }

.subhead { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 14px 0 2px; }

.filter { display: grid; gap: 2px; }
.filter label {
  display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 4px; cursor: pointer;
}
.filter label:hover { background: var(--module-2); }
.filter input { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }
.filter img { width: 18px; height: 18px; object-fit: contain; }
.filter__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter__count { color: var(--ink-3); font-size: 12px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
  font-size: 13px; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- comparison bars (model vs naive etc.) */

.cmp { display: grid; gap: 14px; }
.cmp__row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: end; }
.cmp__label { grid-column: 2; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cmp__val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.cmp__val small { font-size: 11px; font-weight: 600; color: var(--ink-3); display: block; letter-spacing: 0; margin-top: 3px; }
.cmp__val--r { text-align: right; }
.cmp__bars { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 6px; }
.cmp__bars span { display: block; height: 100%; border-radius: 3px; background: var(--rule); position: relative; overflow: hidden; }
.cmp__bars span i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.cmp__bars span:first-child i { right: 0; background: var(--ink); }
.cmp__bars span:last-child i { left: 0; background: var(--rule-strong); }
.cmp__bars--teams span:first-child i { background: var(--home); }
.cmp__bars--teams span:last-child i { background: var(--away); }
.cmp__note { font-size: 12px; color: var(--ink-3); }

.legend2 { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }

.recent { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; font-size: 13px; }
.recent__teams { min-width: 0; }
.recent__teams div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__score { font-weight: 800; text-align: right; line-height: 1.45; }

.summary-line {
  grid-area: summary; display: none; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--module); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px; font-size: 13px; color: var(--ink-2);
}
.summary-line b { color: var(--ink); }
@media (max-width: 820px) { .summary-line { display: flex; } }

/* ---------------------------------------------------------------- match header */

.mhead { background: var(--module); border-bottom: 1px solid var(--rule); }
.mhead__inner {
  max-width: 1320px; margin: 0 auto; padding: 18px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.mhead__team { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mhead__team--away { flex-direction: row-reverse; text-align: right; }
.mhead__logo { width: 72px; height: 72px; object-fit: contain; flex: none; }
.mhead__name { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }
.mhead__sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.mhead__center { text-align: center; min-width: 150px; }
.mhead__score { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.mhead__score span { color: var(--ink-3); font-weight: 600; padding: 0 6px; }
.mhead__kick { font-size: 20px; font-weight: 800; }
.mhead__meta { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.mhead__league { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.mhead__league img { width: 16px; height: 16px; object-fit: contain; }

@media (max-width: 640px) {
  .mhead__inner { grid-template-columns: 1fr auto 1fr; padding: 14px 12px; gap: 8px; }
  .mhead__team, .mhead__team--away { flex-direction: column; text-align: center; gap: 6px; }
  .mhead__logo { width: 44px; height: 44px; }
  .mhead__name { font-size: 14px; }
  .mhead__sub { font-size: 11px; }
  .mhead__score { font-size: 30px; }
  .mhead__kick { font-size: 16px; }
  .mhead__center { min-width: 0; }
}

/* ---------------------------------------------------------------- predictor donut */

/* Donut on top at full size, the two win probabilities beneath it */
.predictor { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "donut donut" "home away"; align-items: end; gap: 10px; }
.predictor .donut { grid-area: donut; max-width: 184px; }
.predictor__side:first-child { grid-area: home; }
.predictor__side--r { grid-area: away; }
.predictor__side { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.predictor__side small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.predictor__side--r { text-align: right; }
.donut { width: 100%; max-width: 184px; margin: 0 auto; display: block; }
.donut text { fill: var(--ink); font: 800 15px var(--font); }
.donut .donut__sub { fill: var(--ink-3); font: 700 10px var(--font); }

.outcomes { list-style: none; margin: 14px 0 0; padding: 0; }
.outcomes li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); align-items: center; }
.outcomes b { font-weight: 800; }
.outcomes .odds { font-size: 12px; color: var(--ink-3); min-width: 74px; text-align: right; }
.outcomes li.is-actual { font-weight: 700; }

.stamp { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---------------------------------------------------------------- info list */

.info { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.info li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.info .icon { color: var(--ink-3); margin-top: 2px; }
.info small { display: block; color: var(--ink-3); }

/* ---------------------------------------------------------------- stats rows (markets, xG) */

.stat { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 12px; align-items: baseline; padding: 9px 0; }
.stat + .stat { border-top: 1px solid var(--rule); }
.stat__l { font-size: 18px; font-weight: 800; }
.stat__r { font-size: 18px; font-weight: 800; text-align: right; }
.stat__c { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; }
.stat__bars { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 6px; }
.stat__bars span { position: relative; background: var(--rule); border-radius: 3px; overflow: hidden; }
.stat__bars i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.stat__bars span:first-child i { right: 0; background: var(--home); }
.stat__bars span:last-child i { left: 0; background: var(--away); }
.stat__bars--yn span:first-child i { background: var(--ink); }
.stat__bars--yn span:last-child i { background: var(--rule-strong); }
.stat__sub { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ---------------------------------------------------------------- heatmap */

.heat { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.heat th { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 2px; }
.heat thead th:first-child { text-align: left; }
.heat td {
  text-align: center; font-size: 12px; font-weight: 700; padding: 0; height: 36px; border-radius: 4px;
  --c: var(--home);
  background: color-mix(in srgb, var(--c) calc(var(--v) * 100%), var(--module-2));
  color: var(--ink);
}
/* Cells tinted by outcome region: home win below the diagonal, draw on it, away win above */
.heat td.heat--x { --c: var(--draw); }
.heat td.heat--a { --c: var(--away); }
.heat td.is-hot { color: #fff; }
/* Hues differ in lightness, so the single most likely score gets its own ring */
.heat td.is-peak { box-shadow: inset 0 0 0 2px var(--ink); font-weight: 900; }
.heat td.is-actual { outline: 2px dashed var(--ink); outline-offset: -5px; }
.heat caption { caption-side: bottom; text-align: left; font-size: 12px; color: var(--ink-3); padding-top: 8px; }
.heat__axis { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }

.scores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scores li { background: var(--module-2); border-radius: 4px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.scores b { font-size: 16px; font-weight: 800; }
.scores span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
@media (max-width: 420px) { .scores { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- tables */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.split > div + div { border-left: 1px solid var(--rule); padding-left: 14px; }
.split > div:first-child { padding-right: 14px; }
@media (max-width: 640px) {
  .split { grid-template-columns: 1fr; }
  .split > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); margin-top: 10px; padding-top: 10px; }
  .split > div:first-child { padding-right: 0; }
}
.split__team { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.split__team img { width: 20px; height: 20px; object-fit: contain; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.02em; padding: 6px 4px; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .t { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.tbl tr.is-home td { background: var(--home-soft); font-weight: 700; }
.tbl tr.is-away td { background: var(--away-soft); font-weight: 700; }
.res { display: inline-block; min-width: 18px; text-align: center; font-weight: 800; }
.res--S { color: var(--hit); }
.res--N { color: var(--miss); }
.res--U { color: var(--ink-2); }

.strength { display: grid; gap: 12px; }
.strength__row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 10px; align-items: baseline; }
.strength__row b { font-size: 15px; font-weight: 800; }

/* ---------------------------------------------------------------- odds form */

details.odds-box > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.odds-box > summary::-webkit-details-marker { display: none; }
details.odds-box > summary .icon { transition: transform 160ms ease-out; color: var(--ink-3); }
details.odds-box[open] > summary .icon { transform: rotate(90deg); }
.odds-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.odds-form label { font-size: 12px; font-weight: 700; color: var(--ink-2); display: grid; gap: 4px; }
.input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--module); color: var(--ink); font: inherit; font-size: 15px;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius); border: 0; background: var(--ink); color: var(--module); font: inherit;
  font-weight: 700; cursor: pointer;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.htmx-request { opacity: 0.6; }
.odds-form .btn { grid-column: 1 / -1; }
.odds-result { margin-top: 12px; }
.error { color: var(--miss); font-size: 13px; margin-top: 8px; }

/* ---------------------------------------------------------------- login */

.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: 100%; max-width: 360px; background: var(--module); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; border: 1px solid var(--rule); }
.login__brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login__brand svg { width: 28px; height: 28px; }
.login__lead { color: var(--ink-2); margin: 0 0 20px; }
.login form { display: grid; gap: 12px; }
.login label { font-size: 12px; font-weight: 700; color: var(--ink-2); display: grid; gap: 5px; }
.login .btn { height: 40px; }

/* ---------------------------------------------------------------- footer */

.footer { max-width: 1320px; margin: 8px auto 0; padding: 18px 16px 28px; font-size: 12px; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.footer a { text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
