:root {
  color-scheme: light dark;
  --page: #f5f5f3; --surface: #fcfcfb; --line: #e1e0dc; --ink: #1c1c1a; --muted: #62615c;
  --series: #2a78d6; --series-soft: #cfe1f7; --accent: #fbf236; --accent-ink: #1c1c1a; --warn: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111110; --surface: #1a1a19; --line: #353430; --ink: #f2f1ec; --muted: #a5a39b;
    --series: #3987e5; --series-soft: #1f3a5c; --warn: #e5b454;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; }
button { cursor: pointer; }
button:hover { border-color: var(--muted); }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.small { padding: 1px 7px; font-size: 12px; }
:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.home { font-weight: 700; text-decoration: none; }
.grow { flex: 1; }
#status, .muted { color: var(--muted); }
main { max-width: 1240px; margin: 0 auto; padding: 20px; }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 30px 0 10px; }
h3 { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.note { color: var(--warn); margin: 0 0 14px; }

.tiles, .grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 45%), 1fr)); }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); align-items: start; }
.tile, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tile b { display: block; font-size: 24px; line-height: 1.2; }
.tile span { color: var(--muted); font-size: 13px; }
.card.wide { grid-column: 1 / -1; }
.card-head { display: flex; align-items: start; gap: 8px; margin-bottom: 2px; }
.card-head h3 { flex: 1; }
.card-sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.card-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.card-tools select { padding: 1px 4px; max-width: 190px; }

.game { text-decoration: none; display: block; }
.game:hover { border-color: var(--muted); }
.game dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0 0; }
.game dt { color: var(--muted); font-size: 12px; }
.game dd { margin: 0; font-weight: 600; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 8px; font-size: 11px; font-weight: 700; }

.columns { display: flex; align-items: stretch; gap: 2px; height: 150px; border-bottom: 1px solid var(--line); }
.column { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: end; align-items: center; background: none; border: 0; border-radius: 0; padding: 0; cursor: default; }
.column i { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--series); min-height: 1px; }
.column:hover i, .column:focus-visible i { filter: brightness(1.15); }
.column em { font-style: normal; font-size: 11px; color: var(--muted); }
.axis { position: relative; display: flex; gap: 2px; font-size: 11px; color: var(--muted); padding-top: 3px; height: 20px; }
.axis > span { flex: 1; min-width: 0; display: flex; justify-content: center; white-space: nowrap; }
.axis-title { text-align: center; font-size: 11px; color: var(--muted); }

.bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 8px; align-items: center; }
.bar .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track i { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--series); min-width: 2px; }
.bar .value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

.scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: var(--page); }
tr.on td { background: var(--series-soft); }
tr.hidden-player td { color: var(--muted); }

.session { margin-bottom: 14px; }
.session summary { cursor: pointer; font-weight: 600; }
.event { display: grid; grid-template-columns: 62px minmax(90px, 160px) 1fr; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.event .props { color: var(--muted); overflow-wrap: anywhere; }
.event time { font-variant-numeric: tabular-nums; color: var(--muted); }

#tip { position: fixed; z-index: 5; pointer-events: none; background: var(--ink); color: var(--page); padding: 5px 9px; border-radius: 6px; font-size: 12px; max-width: 300px; white-space: pre-line; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.login { max-width: 320px; margin: 15vh auto 0; display: grid; gap: 12px; }
.logged-out .top button { display: none; }
