:root {
  --bg: #121214;
  --bg-card: #1c1e24;
  --bg-card-2: #22252d;
  --line: #2a2d36;
  --text: #e1e1e6;
  --muted: #9aa0ad;
  --accent: #f2a950;
  --green: #4ade80;
  --red: #ef4444;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  padding: 2rem 1.25rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}

.mono,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code,
code {
  font-size: 0.85em;
}

.accent {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}

.brand .accent {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.sub {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
main {
  display: grid;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.games {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.grid.panels {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

/* ── Game cards ─────────────────────────────────────────────────────────── */
.game {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.time {
  color: var(--muted);
  font-size: 0.8rem;
}

.note {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.btn {
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.btn:hover {
  background: var(--accent);
  color: #1a1206;
  text-decoration: none;
}

/* ── Live panels ────────────────────────────────────────────────────────── */
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot.live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.dot.down {
  background: var(--red);
}

.rows {
  display: grid;
  gap: 0.2rem;
  margin: 0.4rem 0 0.2rem;
}

.row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

.row:nth-child(odd) {
  background: var(--bg-card-2);
}

.row .rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .val {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.row.empty {
  display: block;
  color: var(--muted);
  background: none;
  font-size: 0.82rem;
}

/* ── Standings ──────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.6rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:first-child td {
  color: var(--text);
}

tbody tr.leader td {
  color: var(--accent);
  font-weight: 600;
}

.cell-points {
  color: var(--muted);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

@media (max-width: 520px) {
  body {
    padding: 1.25rem 0.9rem 2rem;
  }

  th,
  td {
    padding: 0.35rem 0.35rem;
    font-size: 0.78rem;
  }
}
