:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2330;
  --line: #2a3340;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #3fb950;
  --accent-2: #58a6ff;
  --warn: #d29922;
  --bar: #233045;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand h1 { margin: 0; font-size: 1.4rem; }
.brand h1 span { color: var(--muted); font-weight: 400; }
.sub { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; max-width: 60ch; }
.meta { display: flex; gap: .5rem; align-items: center; }
.badge {
  background: var(--accent); color: #04260c; font-weight: 600;
  padding: .25rem .6rem; border-radius: 999px; font-size: .78rem; white-space: nowrap;
}
.badge.ghost { background: var(--panel-2); color: var(--muted); }
.badge.live { background: var(--accent); }
.badge.sample { background: var(--warn); color: #2a1d00; }
button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: .4rem .8rem; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
button:hover { border-color: var(--accent-2); }

nav#tabs {
  display: flex; gap: .25rem; padding: .6rem 1.5rem 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
nav#tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
nav#tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 1.25rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.loading { color: var(--muted); padding: 3rem 0; text-align: center; }

/* groups */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.card h3 { margin: 0 0 .6rem; font-size: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: right; padding: .25rem .35rem; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); }
tbody tr.adv td:first-child { color: var(--accent); }
.advbar { position: relative; height: 6px; background: var(--bar); border-radius: 3px; margin-top: .2rem; }
.advbar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }

/* matches */
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1rem; }
.match { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.match .head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.match .num { color: var(--muted); font-size: .78rem; }
.match .slots { font-size: .82rem; color: var(--accent-2); margin: .15rem 0 .7rem; }
.match .decided { color: var(--accent); }
.matchup { margin: .35rem 0; }
.matchup .label { display: flex; justify-content: space-between; font-size: .85rem; }
.matchup .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.matchup .bar { height: 7px; background: var(--bar); border-radius: 4px; margin-top: .2rem; overflow: hidden; }
.matchup .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.muted { color: var(--muted); }
.cover { font-size: .75rem; color: var(--muted); margin-top: .5rem; }

/* teams table */
.team-table th { cursor: pointer; }
.team-table td.name { text-align: left; }
.bar-cell { position: relative; min-width: 64px; }
.bar-cell .v { position: relative; z-index: 1; }
.bar-cell .fill { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--bar); border-radius: 3px; }

footer { padding: 1rem 1.5rem 2rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
