:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --border: #e4e4df;
  --accent: #1f5fbf;
  --win: #1a7f37;
  --loss: #c62828;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1b1b1b;
    --text: #ececea;
    --muted: #9a9a94;
    --border: #2c2c2a;
    --accent: #7fb0ff;
    --win: #4cc26b;
    --loss: #ff6b6b;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
h1 small { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); }
.top nav a { margin-left: 1rem; }
main { max-width: 1000px; margin: 0 auto; padding: 1rem 16px 3rem; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }

.daynav { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
input, select, button {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.6rem;
}
button { cursor: pointer; }
.search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.games {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  display: block; overflow-x: auto;
}
.games th, .games td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.games th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.games tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.win { font-weight: 700; }
.result.w { color: var(--win); font-weight: 700; }
.result.l { color: var(--loss); font-weight: 700; }

.team { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text); }
.team img { object-fit: contain; }
.rank { font-size: 0.75rem; color: var(--muted); }

.teamhead { display: flex; align-items: center; gap: 1rem; }
.teamhead h1 { margin: 0; }
.teamhead p { margin: 0.2rem 0 0; }

.teamlist { list-style: none; padding: 0; columns: 3 220px; }
.teamlist li { padding: 0.25rem 0; break-inside: avoid; }
