*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e8eaf0;
  --muted: #6b7280;
  --accent: #4f8ef7;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --gold: #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

header {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

.back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

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

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
}

td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

tr.leader td { background: rgba(79, 142, 247, 0.06); }

td.rank { color: var(--muted); font-size: 0.85rem; width: 2rem; }
td.name { font-weight: 500; }
td.score { font-weight: 700; font-size: 1rem; }
td.muted { color: var(--muted); font-size: 0.875rem; }
td.streak { font-size: 0.875rem; }

th.qs, td.qs { text-align: center; width: 3rem; font-size: 0.85rem; }

td.q-great { color: var(--green); font-weight: 600; }
td.q-ok    { color: var(--yellow); }
td.q-bad   { color: var(--red); }

.empty { color: var(--muted); font-size: 0.9rem; }

ul.history {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

ul.history a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

ul.history a:hover { border-color: var(--accent); }

@media (max-width: 600px) {
  th.qs, td.qs { display: none; }
}
