:root {
  color-scheme: light;
  --page: #f6f8f7; --surface: #ffffff; --ink: #0d1b16; --ink-2: #3b4f47; --muted: #66796f; --grid: #e2e8e4; --axis: #c3cdc7;
  --accent: #0f8a5f; --up: #0b7a3b; --down: #b42f2f;
  --s1: #2a78d6; --s2: #eb6834; --draw: #9aa7a0; --band: #f1f4f2; --shield: #e6ece8; --s3: #1baf7a; --s4: #c98500; --s5: #d55181; --s6: #6250d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #07130f; --surface: #0f221c; --ink: #eef6f1; --ink-2: #b6c9bf; --muted: #7d958a; --grid: #1d342c; --axis: #2c473d;
    --accent: #7fe0b3; --up: #4cd28a; --down: #ef7b7b;
    --s1: #5a97e2; --s2: #f08a5d; --draw: #7d8a84; --band: #12271f; --shield: #1b3229; --s3: #3bc893; --s4: #e0a92e; --s5: #e47aa3; --s6: #9085e9;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
.top { padding: 20px 0 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent); }
.home { text-decoration: none; font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; }
.home img { border-radius: 50%; }
.eyebrow { margin: 14px 0 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.1; margin: 4px 0; }
h1 span { color: var(--accent); }
h2 { font-size: 1.1rem; margin: 0 0 6px; }
.sub { color: var(--ink-2); margin: 6px 0 0; }
.card { background: var(--surface); border: 1px solid var(--grid); border-radius: 14px; padding: 16px; margin: 14px 0; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 10px; }
.controls label { font-size: 0.85rem; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
select, input { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--axis); background: var(--page); color: var(--ink); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.muted { color: var(--muted); } .small { font-size: 0.85rem; }
.ghost { font: inherit; margin-top: 10px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--axis); background: transparent; color: var(--ink); cursor: pointer; }
.spark { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
#chart svg { width: 100%; height: auto; display: block; }
.how ul { padding-left: 18px; margin: 6px 0; }
.how li { margin: 4px 0; }
.foot { padding: 18px 16px 30px; }
@media (max-width: 600px) { .hide-sm { display: none; } th, td { padding: 6px 5px; } }

h3 { font-size: 1rem; margin: 0; }
h4 { font-size: 0.9rem; margin: 16px 0 4px; color: var(--ink-2); }
.tabs { display: flex; gap: 6px; margin-top: 12px; }
.tabs a { text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--axis); color: var(--ink); font-size: 0.88rem; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.crest { display: inline-block; flex: none; object-fit: contain; vertical-align: middle; }
.clublink { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.clublink:hover span, .clublink:hover b { text-decoration: underline; }
tr.go { cursor: pointer; }
tr.go:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
tr.go.on td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
tr.go:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.movers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.mini { margin-bottom: 0; }
.mini h3 { margin-bottom: 2px; }
.mini .small { margin: 0 0 8px; }
.movelist, .podium { list-style: none; margin: 0; padding: 0; }
.movelist li, .podium li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--grid); }
.movelist li:last-child, .podium li:last-child { border-bottom: 0; }
.podium li { padding: 4px 0; }
.pos { width: 18px; color: var(--muted); font-weight: 700; }
.clubhead { display: flex; align-items: center; gap: 16px; margin: 6px 0 4px; }
.clubhead h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 0; }
.clubhead p { margin: 2px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--grid); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 999px; overflow: hidden; }
.seg { max-width: 100%; overflow-x: auto; }
.seg button { white-space: nowrap; font: inherit; font-size: 0.82rem; border: 0; background: transparent; color: var(--ink); padding: 5px 11px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--axis); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
.controls h3 { margin-right: auto; }
.chartbox { position: relative; }
.chartbox svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--axis); border-radius: 8px; padding: 6px 9px; font-size: 0.8rem; line-height: 1.4; width: 190px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.legend .dash { background: none; border-top: 2px dashed var(--ink-2); height: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: middle; }
.dot.up { background: var(--up); } .dot.down { background: var(--down); } .dot.draw { background: var(--draw); }
.wdl { display: flex; width: 120px; height: 10px; gap: 2px; }
.wdl i { display: block; height: 100%; }
.wdl i:first-child { border-radius: 4px 0 0 4px; } .wdl i:last-child { border-radius: 0 4px 4px 0; }
.wdl .w { background: var(--up); } .wdl .d { background: var(--draw); } .wdl .l { background: var(--down); }
.res { display: inline-block; min-width: 20px; text-align: center; border-radius: 5px; font-size: 0.75rem; font-weight: 700; padding: 1px 4px; color: #fff; }
.res.W { background: var(--up); } .res.D { background: var(--draw); } .res.L { background: var(--down); }
/* The flex box sits inside the cell, so the cell stays a normal table cell and the row lines up. */
.delta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 150px; vertical-align: middle; }
.delta b { min-width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.dbar { position: relative; width: 90px; height: 10px; background: var(--grid); border-radius: 4px; }
.dbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.dbar i { position: absolute; top: 0; bottom: 0; }
.dbar i.pos { left: 50%; background: var(--up); border-radius: 0 4px 4px 0; }
.dbar i.neg { right: 50%; background: var(--down); border-radius: 4px 0 0 4px; }
.chipx { font: inherit; font-size: 0.8rem; border: 1px solid var(--axis); background: transparent; color: var(--ink); border-radius: 999px; padding: 0 7px; cursor: pointer; margin-left: 6px; }
.formula { font-family: ui-monospace, Consolas, monospace; background: var(--page); border: 1px solid var(--grid); border-radius: 8px; padding: 8px 10px; overflow-x: auto; }
.how h3 { margin: 18px 0 6px; }
@media (max-width: 600px) { .tile b { font-size: 1.3rem; } .wdl { width: 70px; } .delta { min-width: 0; } .dbar { display: none; } .matches .crest { display: none; } .clubhead .crest { width: 48px; height: 48px; } }
.legend .dots { background: none; border-top: 2px dotted var(--s3); height: 0; }
.legend label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); cursor: pointer; }
.tip { width: 230px; }
td.yr { font-size: 0.85rem; }
td.yr.muted { color: var(--ink-2); }
/* Table groups: "Now" against past seasons, split by a rule and a light tint so they don't blend. */
tr.grp th { border-bottom: 0; padding-bottom: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; text-align: right; }
tr.grp .grp-now { color: var(--accent); }
.yr-first { border-left: 2px solid var(--axis); }
td.yr, th.yr-h, tr.grp .grp-past { background: color-mix(in srgb, var(--band) 70%, transparent); }
td.yr { color: var(--ink-2); }
td.yr .rk { display: inline-block; min-width: 34px; text-align: left; color: var(--muted); font-size: 0.78rem; margin-left: 2px; }
.switches { margin: -2px 0 10px; }
.switches input { width: 16px; height: 16px; accent-color: var(--accent); }
.filters { margin-top: -4px; }
.h2h { background: var(--page); border: 1px solid var(--grid); border-radius: 10px; padding: 8px 10px; }
.fx-day { margin: 18px 0 6px; font-size: 0.95rem; }
.fx { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.fx .side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx .side.away { align-items: flex-end; text-align: right; }
.fx .side .clublink span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.fx .mid { text-align: center; min-width: 210px; }
.fx .prob { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 4px 0; }
.fx .prob i { display: block; }
.fx .prob .w { background: var(--s1); } .fx .prob .d { background: var(--draw); } .fx .prob .l { background: var(--s2); }
.fx .stake { font-size: 0.78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fx .comp { font-size: 0.75rem; color: var(--muted); }
@media (max-width: 600px) { .fx { grid-template-columns: 1fr; } .fx .side.away { align-items: flex-start; text-align: left; } .fx .mid { min-width: 0; text-align: left; } }
/* Keep a club link and the small number after it on one line, centred in the row. */
td .clublink { vertical-align: middle; }
td .clublink + .muted { vertical-align: middle; margin-left: 4px; }
@media (max-width: 600px) { #matches td .clublink span { display: inline-block; max-width: 92px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; } #matches td, #matches th { padding: 6px 4px; } }
