:root {
  --bg: #f4f6f9;
  --panel: #fff;
  --ink: #15202b;
  --muted: #5b6875;
  --line: #d9dee5;
  --brand: #1d3557;
  --accent: #2364aa;
  --hl: #1f4fd1;
  --open: #fff3cd;
  --soft: #eef2f7;
  --gold: #b8860b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --panel: #18202a;
    --ink: #e8edf2;
    --muted: #9aa7b4;
    --line: #2c3742;
    --brand: #1b3354;
    --accent: #6aa6ff;
    --hl: #8fb3ff;
    --open: #3a3216;
    --soft: #202a35;
    --gold: #e0b84a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--brand); color: #fff; padding: 14px 0; }
.top .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.club { opacity: 0.8; font-size: 15px; }
h1 { margin: 0; font-size: 26px; }
.updated { font-size: 14px; opacity: 0.85; }
main { padding-top: 16px; padding-bottom: 24px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
select, input[type='search'] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); min-height: 48px; }
input[type='search'] { flex: 1; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.seg button { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 10px 16px; min-height: 48px; cursor: pointer; }
.seg button[aria-selected='true'] { background: var(--accent); color: #fff; font-weight: 700; }
.leagues { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.leagues button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.leagues button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.card h2 { margin: 0 0 4px; font-size: 22px; }
.card h3 { margin: 12px 0 6px; font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 14px; color: var(--muted); font-weight: 700; background: var(--soft); }
td.num, th.num { text-align: right; }
td.name { font-weight: 600; white-space: normal; min-width: 140px; }
.gear { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
td.score { font-size: 1.1em; }
th.sticky, td.sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; }
th.sticky { background: var(--soft); }
tr.open td, tr.open td.sticky { background: var(--open); }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--soft); }
tr.detail td { background: var(--soft); white-space: normal; }
.x { color: var(--muted); font-size: 0.8em; }
.hl { color: var(--hl); font-weight: 800; }
.avg { font-weight: 400; }
.avg.q { font-weight: 800; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); margin-left: 6px; }
.place { font-weight: 800; }
.place.p1 { color: var(--gold); }
.matches { display: flex; flex-wrap: wrap; gap: 6px; }
.matches span { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--panel); font-size: 15px; }
.matches span.no { opacity: 0.55; text-decoration: line-through; }
.empty { padding: 24px; text-align: center; }
footer { padding-bottom: 32px; }
mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; }
@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 22px; }
  th, td { padding: 7px 6px; }
}
