:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #14171c; --muted: #5d6673; --line: #e2e5ea;
  --accent: #1f5fbf; --accent-ink: #ffffff; --v: #b4382f; --h: #1f5fbf; --warn-bg: #fff4d6; --warn-ink: #6b4e00;
  --bad-bg: #fde4e1; --bad-ink: #8a1c12; --row: #f8f9fb;
  --set-band: rgba(31,95,191,.06); --set-head: #e9eef7; --set-head-alt: #dde6f5;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --panel: #171b21; --ink: #e8ebef; --muted: #98a2ae; --line: #2a3038; --accent: #6ea2ff;
    --accent-ink: #0f1216; --v: #ff8a7f; --h: #6ea2ff; --warn-bg: #3a2f10; --warn-ink: #f3d78a; --bad-bg: #42191a; --bad-ink: #ffb4ab; --row: #1c2128;
    --set-band: rgba(110,162,255,.07); --set-head: #1f2631; --set-head-alt: #26303e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 12px 16px 48px; }
header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0 10px; }
.brand { font-weight: 800; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
.brand span { color: var(--accent); }
.meta { color: var(--muted); font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.banner { border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.banner.stale { background: var(--warn-bg); color: var(--warn-ink); }
.banner.held { background: var(--bad-bg); color: var(--bad-ink); }
.banner[hidden] { display: none; }

/* scoreboard */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.team { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team.h { align-items: flex-end; text-align: right; }
.team .name { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.team .rec { color: var(--muted); font-size: 12px; }
.team .sets { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.team.v .sets { color: var(--v); } .team.h .sets { color: var(--h); }
.serve { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin: 0 4px; vertical-align: middle; }
.mid { text-align: center; }
.status { font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.pts { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.linescore { margin-top: 10px; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 5px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
th.l, td.l { text-align: left; }
tbody tr:nth-child(even) { background: var(--row); }
tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
td.name { position: sticky; left: 0; background: inherit; }
tbody tr td.name { background: var(--panel); }
tbody tr:nth-child(even) td.name { background: var(--row); }
.na { color: var(--muted); }
.na small { font-size: 10px; margin-left: 2px; }
.cov { color: var(--muted); font-size: 12px; }
.win { font-weight: 800; }

/* tabs */
nav.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-top: 12px; }
nav.tabs button { appearance: none; border: 0; background: none; color: var(--muted); padding: 10px 12px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.view[hidden] { display: none; }
h2 { font-size: 16px; margin: 4px 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; }
.cmp td.bar { width: 40%; }
.barv, .barh { height: 8px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.barv { background: var(--v); } .barh { background: var(--h); }
.plays .p { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plays .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.plays .pv { color: var(--v); } .plays .ph { color: var(--h); }
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.leader { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.leader .t { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 600; }
.feedlist a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.feedlist .sub { color: var(--muted); font-size: 13px; }
footer { color: var(--muted); font-size: 12px; margin-top: 24px; }
@media (max-width: 560px) {
  .team .name { font-size: 15px; } .team .sets { font-size: 32px; } .pts { font-size: 20px; }
  th, td { padding: 4px 5px; font-size: 13px; }
}

/* players by set: make each set its own block */
table.by-set .set-start { border-left: 3px solid var(--muted); }
table.by-set .set-alt { background: var(--set-band); }
table.by-set th.set-head { text-align: center; color: var(--ink); font-size: 13px; letter-spacing: .06em; background: var(--set-head); border-bottom: 2px solid var(--accent); }
table.by-set th.set-head.set-alt { background: var(--set-head-alt); }
