/* KickoffHour - one stylesheet, BEM, mobile-first. All colours are tokens; components never hardcode colours. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef0f3; --text: #16181d; --text-muted: #555b67;
  --border: #dcdfe5; --accent: #4a6200; --brand: #7a9f00; --focus: #2b59c3;
  --home: #2759c9; --draw: #7d838e; --away: #c2410c; --win: #17773a; --loss: #b42318;
  --radius: 10px; --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114; --surface: #16181d; --surface-2: #1e2128; --text: #f0f2f5; --text-muted: #a6acb8;
    --border: #2b2f37; --accent: #c6f432; --brand: #c6f432; --focus: #8fb4ff;
    --home: #6b9bff; --draw: #9aa0aa; --away: #ff9a5c; --win: #4fd27b; --loss: #ff7a6e;
    color-scheme: dark;
  }
}
:root[data-theme="light"], :root:has(#theme-light:checked) {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef0f3; --text: #16181d; --text-muted: #555b67;
  --border: #dcdfe5; --accent: #4a6200; --brand: #7a9f00; --focus: #2b59c3;
  --home: #2759c9; --draw: #7d838e; --away: #c2410c; --win: #17773a; --loss: #b42318;
  color-scheme: light;
}
:root[data-theme="dark"], :root:has(#theme-dark:checked) {
  --bg: #0f1114; --surface: #16181d; --surface-2: #1e2128; --text: #f0f2f5; --text-muted: #a6acb8;
  --border: #2b2f37; --accent: #c6f432; --brand: #c6f432; --focus: #8fb4ff;
  --home: #6b9bff; --draw: #9aa0aa; --away: #ff9a5c; --win: #4fd27b; --loss: #ff7a6e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-top: 1.5em; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
ul, ol { padding-left: 1.2em; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
td.num, th.num { text-align: right; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; word-break: break-all; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

.page { max-width: 960px; margin: 0 auto; padding: 0 var(--gap) 32px; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.section > h2:first-child { margin-top: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }

/* site-header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner { max-width: 960px; margin: 0 auto; padding: 8px var(--gap); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.site-header__logo { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); margin-right: auto; }
.site-header__logo svg { height: 26px; width: auto; display: block; }
.logo__ink { fill: var(--text); }
.logo__line { stroke: var(--text); }
.logo__accent { fill: var(--brand); }
.site-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
.site-nav__list { display: flex; gap: 4px; list-style: none; margin: 0 -8px; padding: 0; }
.site-nav__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.site-nav__link:hover { color: var(--accent); }
.site-nav__link--current { box-shadow: inset 0 -2px 0 var(--brand); }
@media (min-width: 720px) {
  .site-nav { order: 0; width: auto; }
}

/* theme-switch */
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; margin: 0; }
.theme-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-switch__label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; padding: 0 8px; border-radius: 999px; font-size: .8rem; cursor: pointer; color: var(--text-muted); }
.theme-switch__input:checked + .theme-switch__label { background: var(--surface-2); color: var(--text); font-weight: 600; }
.theme-switch__input:focus-visible + .theme-switch__label { outline: 2px solid var(--focus); }

/* breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--text-muted); margin: 12px 0 4px; }
.breadcrumbs__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs__item + .breadcrumbs__item::before { content: "›"; margin: 0 6px; }
.breadcrumbs__link { color: var(--text-muted); }

/* hero / intro */
.intro { margin: 16px 0 8px; }
.intro__title { margin-bottom: 4px; }
.intro__text { color: var(--text-muted); margin: 0; }

/* day-switch */
.day-switch { display: flex; gap: 6px; overflow-x: auto; list-style: none; padding: 4px 0; margin: 12px 0 0; scrollbar-width: none; }
.day-switch__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap; font-size: .9rem; }
.day-switch__link--current { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 600; }

/* league-group + match-row */
.league-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 16px; overflow: hidden; }
.league-group__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.league-group__title { font-size: .95rem; margin: 0; }
.league-group__title a { color: var(--text); text-decoration: none; }
.league-group__country { font-size: .8rem; color: var(--text-muted); }
.league-group__list { list-style: none; margin: 0; padding: 0; }
.match-row { border-bottom: 1px solid var(--border); }
.match-row:last-child { border-bottom: 0; }
.match-row__link { display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; padding: 12px 16px; color: var(--text); text-decoration: none; }
a.match-row__link:hover { background: var(--surface-2); }
.match-row__time { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--text-muted); padding-top: 2px; }
.match-row__teams { font-weight: 600; }
.match-row__vs { color: var(--text-muted); font-weight: 400; }
.match-row__meta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; }
.match-row__bar { grid-column: 2; }

/* status */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.status--lineups { color: var(--text); border-color: var(--brand); }
.status--final { color: var(--text); }
.mark { font-weight: 700; font-size: .8rem; white-space: nowrap; }
.mark--win { color: var(--win); }
.mark--loss { color: var(--loss); }
.mark--push { color: var(--text-muted); }

/* prob-bar */
.prob-bar { font-variant-numeric: tabular-nums; }
.prob-bar__track { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.prob-bar__segment--home { background: var(--home); }
.prob-bar__segment--draw { background: var(--draw); }
.prob-bar__segment--away { background: var(--away); }
.prob-bar__legend { display: flex; justify-content: space-between; font-size: .8rem; margin-top: 4px; gap: 8px; }
.prob-bar__value--top { font-weight: 700; }
.prob-bar--large .prob-bar__track { height: 14px; border-radius: 7px; }

/* match page */
.match-head { margin-top: 12px; }
.match-head__league { font-size: .85rem; color: var(--text-muted); margin-bottom: 4px; }
.match-head__title { font-size: 1.45rem; margin-bottom: 6px; }
.match-head__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; color: var(--text-muted); }
.match-head__score { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 8px 0 0; }
.match-head__dates { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }

.probs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 12px; }
.probs__item { background: var(--surface-2); border-radius: 8px; padding: 10px 4px; }
.probs__label { font-size: .8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.probs__value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.probs__market { font-size: .75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.probs__item--home .probs__value { color: var(--home); }
.probs__item--away .probs__value { color: var(--away); }
.side-markets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.side-markets__item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: .9rem; }
.side-markets__value { font-weight: 700; font-variant-numeric: tabular-nums; }

.tldr { font-size: 1.05rem; }

.fact-list { margin: 0; padding-left: 1.2em; }
.fact-list__item { margin-bottom: 6px; }
.fact-list__src { font-size: .75rem; vertical-align: super; line-height: 0; margin-left: 2px; }
.source-list { font-size: .8rem; color: var(--text-muted); margin: 12px 0 0; padding-left: 1.6em; }
.source-list__item { margin-bottom: 2px; word-break: break-word; }

.lineup { display: grid; grid-template-columns: 1fr; gap: 12px; }
.lineup__team { font-weight: 600; margin-bottom: 4px; }
.lineup__formation { font-weight: 400; color: var(--text-muted); font-size: .85rem; }
.lineup__list { margin: 0; padding-left: 1.4em; font-size: .9rem; columns: 2; column-gap: 16px; }
.lineup__note { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }
@media (min-width: 640px) { .lineup { grid-template-columns: 1fr 1fr; } .lineup__list { columns: 1; } }

.injury-table td { white-space: normal; min-width: 90px; }
.injury-table__status--out, .injury-table__status--suspended { color: var(--loss); font-weight: 600; }
.injury-table__status--doubtful { color: var(--text); font-weight: 600; }
.injury-table__status--returning { color: var(--win); font-weight: 600; }

.context-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.context-grid__item { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.context-grid__label { font-size: .75rem; color: var(--text-muted); }
.context-grid__value { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.form { display: grid; gap: 12px; }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; } }
.form__badge { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 4px; font-size: .75rem; font-weight: 700; color: var(--surface); background: var(--draw); }
.form__badge--W { background: var(--win); }
.form__badge--L { background: var(--loss); }

.version-table__row--counted td { font-weight: 600; }

.how-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.how-steps__item { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.how-steps__item strong { display: block; }

/* stat-tile */
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.stat-tile__label { font-size: .75rem; color: var(--text-muted); }
.stat-tile__value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-tile__bench { font-size: .75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* calibration-chart */
.calibration-chart { max-width: 360px; }
.calibration-chart__svg { width: 100%; height: auto; display: block; }
.calibration-chart__grid { stroke: var(--border); stroke-width: 1; }
.calibration-chart__ideal { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 4; }
.calibration-chart__line { fill: none; stroke: var(--brand); stroke-width: 2; }
.calibration-chart__dot { fill: var(--brand); stroke: var(--surface); stroke-width: 1.5; }
.calibration-chart__label { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.calibration-chart__axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.calibration-chart--mini { max-width: 200px; }

/* notes */
.ai-note, .rg-note { font-size: .85rem; color: var(--text-muted); border-left: 3px solid var(--brand); padding: 4px 0 4px 12px; margin: 16px 0 0; }
.rg-note { border-left-color: var(--border); }
.empty { color: var(--text-muted); padding: 16px; margin: 0; }
.callout { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }

/* site-footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; font-size: .85rem; }
.site-footer__inner { max-width: 960px; margin: 0 auto; padding: 20px var(--gap) 28px; }
.site-footer__list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-footer__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px 0 0; color: var(--text-muted); }
.site-footer__legal { color: var(--text-muted); margin: 8px 0 0; }
.site-footer__age { display: inline-block; border: 1px solid var(--text-muted); border-radius: 4px; padding: 0 4px; font-weight: 700; margin-right: 6px; }
