:root {
  --bg: #0a0a0c;
  --surface: #17171b;
  --border: #2a2a30;
  --text: #f3f1ea;
  --text-dim: #9a99a3;
  --accent: #ff5a29;
  --accent-tint: rgba(255, 90, 41, 0.12);
  --adv: #b7a6f7;
  --adv-tint: rgba(183, 166, 247, 0.12);
  --beg: #ff7a52;
  --beg-tint: rgba(255, 122, 82, 0.12);
  --int: #7ddc7a;
  --int-tint: rgba(125, 220, 122, 0.12);
  --active: var(--accent);
  --active-tint: rgba(255, 90, 41, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }

body {
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding-inline: 20px;
  padding-block: 40px;
  margin: 0;
}

.page { max-width: 720px; margin-inline: auto; }

header { margin-bottom: 22px; }

.eyebrow {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

h1 {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: clamp(34px, 9vw, 54px);
  letter-spacing: .01em;
  line-height: .95;
  margin: 0 0 10px;
  text-wrap: balance;
}

h1 .home-link {
  color: inherit;
  text-decoration: none;
}
h1 .home-link:hover { color: var(--accent); }

.subtitle { color: var(--text-dim); margin: 0; font-size: 15px; }

.city-tabs { display: flex; gap: 10px; margin-bottom: 14px; }

.city-tab {
  flex: 1 1 0;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.city-tab:hover { border-color: var(--accent); color: var(--text); }
.city-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #0a0a0c; }
.city-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.tab {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 11px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab:hover { border-color: var(--active); color: var(--text); }
.tab[aria-selected="true"] { background: var(--active); border-color: var(--active); color: #0a0a0c; }
.tab:focus-visible { outline: 2px solid var(--active); outline-offset: 2px; }

.board { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px 10px; gap: 10px; }
.board-title { font-family: 'Anton', sans-serif; font-size: 20px; letter-spacing: .02em; }
.board-count { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.table-wrap { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 8px 8px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child { width: 44px; padding-right: 0; }
thead th:nth-child(2) { padding-left: 12px; }
thead th:last-child { text-align: right; width: 56px; padding-right: 20px; padding-left: 4px; }

tbody td { padding: 12px 8px 12px 20px; border-bottom: 1px solid var(--border); font-size: 15px; overflow-wrap: break-word; }
tbody tr:last-child td { border-bottom: none; }
td.pos { padding-right: 0; font-family: 'Anton', sans-serif; font-size: 18px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
td.player { padding-left: 12px; font-weight: 600; }
td.pts { padding-right: 20px; padding-left: 4px; text-align: right; font-family: 'Anton', sans-serif; font-size: 18px; font-variant-numeric: tabular-nums; }

tr.top3 { background: var(--active-tint); }
tr.top3 td.pos { color: var(--active); }

tr.cutoff-row td { padding: 2px 20px; border-bottom: none; }
.cutoff-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cutoff-line::before, .cutoff-line::after { content: ''; flex: 1 1 auto; border-top: 2px dotted var(--border); }
.cutoff-line span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--active);
  white-space: nowrap;
}

footer { margin-top: 22px; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }
footer p + p { margin-top: 8px; }
footer .credit {
  margin-top: 12px;
  font-family: 'Anton', sans-serif;
  letter-spacing: .05em;
  color: var(--text);
  opacity: .55;
  font-size: 13px;
}

.not-found { text-align: center; padding-block: 60px; }
.not-found a { color: var(--accent); }

@media (max-width: 420px) {
  .tab { font-size: 12px; padding: 10px 8px; }
  .city-tab { font-size: 14px; padding: 12px 8px; }
  thead th:first-child, tbody td.pos { padding-left: 14px; }
  thead th:nth-child(2), tbody td.player { padding-left: 10px; }
  thead th:last-child, tbody td.pts { padding-right: 14px; }
  thead th:first-child { width: 30px; }
  thead th:last-child { width: 48px; }
  tbody td { padding-top: 10px; padding-bottom: 10px; }
  td.pos { font-size: 16px; }
  td.pts { font-size: 16px; }
  .board-head { padding: 16px 14px 10px; }
  .board-title { font-size: 17px; }
}
