:root {
  --bg: #0d1117;
  --bg-soft: #131a23;
  --bg-row: #161f2a;
  --bg-row-alt: #131b24;
  --line: #22303f;
  --text: #e6edf3;
  --muted: #93a4b5;
  --accent: #09add3;
  --gold: #ffaa00;
  --silver: #c7d0d9;
  --bronze: #c9855a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(1000px 400px at 50% -180px, rgba(9, 173, 211, 0.16), transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

.wrap {
  width: min(920px, 100% - 2.5rem);
  margin: 0 auto;
}

/* ── Kopf ─────────────────────────────────────────────────────────── */

.site-header {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--accent);
}

.brand-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 600;
  color: var(--gold);
}

.lede {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 48ch;
}

/* ── Summen ───────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.75rem 0;
}

.stat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

.stat-value {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Tabelle ──────────────────────────────────────────────────────── */

.board {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

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

tbody td {
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(34, 48, 63, 0.65);
  font-size: 0.97rem;
}

tbody tr:nth-child(even) { background: var(--bg-row-alt); }
tbody tr:nth-child(odd) { background: var(--bg-row); }

tbody tr:hover { background: #1b2633; }

.col-rank { width: 3.2rem; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  background: #1d2835;
}

tr.podium-1 .rank-badge { background: var(--gold); color: #23180a; }
tr.podium-2 .rank-badge { background: var(--silver); color: #1b232b; }
tr.podium-3 .rank-badge { background: var(--bronze); color: #24160e; }

tr.podium-1 td:nth-child(2) { color: var(--gold); font-weight: 600; }
tr.podium-2 td:nth-child(2) { font-weight: 600; }
tr.podium-3 td:nth-child(2) { font-weight: 600; }

.player-name {
  font-weight: 500;
  word-break: break-all;
}

.streak-hot { color: var(--gold); font-weight: 600; }
.muted { color: var(--muted); }

tr.placeholder td,
tr.error td {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.empty {
  margin: 1.25rem 0 0;
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ── Fuß ──────────────────────────────────────────────────────────── */

.site-footer {
  padding: 1.75rem 0 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.site-footer p { margin: 0.35rem 0; }
.site-footer .dot { margin: 0 0.35rem; }

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #1b2633;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .site-header { padding-top: 2rem; }
  thead th, tbody td { padding: 0.6rem 0.65rem; }
  .stats { gap: 0.5rem; }
  .stat { padding: 0.8rem 0.5rem; }
  .stat-label { font-size: 0.68rem; }
  .hide-sm { display: none; }
}
