/* spawndb: dark by default, light when the visitor picks it (html[data-theme="light"]). */
:root {
  color-scheme: dark;
  --bg: #161C26;
  --surface: #1C2430;
  --field: #121821;
  --text: #E8EDF4;
  --text-2: #C3CCD8;
  --muted: #A3AEBD;
  --line: #2A3443;
  --line-strong: #3A4556;
  --row: #252E3B;
  --track: #253041;
  --current: #283345;
  --link: #8AB4FF;
  --link-hover: #B5CEFF;
  --accent: #F97316;
  --note-bg: rgba(42, 31, 18, 0.85);
  --note-line: #5A3A14;
  --note-text: #FCD9A8;
  --count: #FDBA74;
  --btn-bg: #E8EDF4;
  --btn-text: #111827;
  --glow-warm: rgba(249, 115, 22, 0.24);
  --glow-cool: rgba(96, 165, 250, 0.14);
  --glow-low: rgba(45, 212, 191, 0.08);
  --header-bg: rgba(22, 28, 38, 0.55);
  --header-line: rgba(58, 69, 86, 0.6);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --field: #FFFFFF;
  --text: #111827;
  --text-2: #374151;
  --muted: #4B5563;
  --line: #DDE1E7;
  --line-strong: #C9CFD8;
  --row: #E6E9EE;
  --track: #EEF0F3;
  --current: #EEF1F5;
  --link: #1D4ED8;
  --link-hover: #1E3A8A;
  --accent: #EA580C;
  --note-bg: #FFF7ED;
  --note-line: #FED7AA;
  --note-text: #7C2D12;
  --count: #9A3412;
  --btn-bg: #111827;
  --btn-text: #FFFFFF;
  --glow-warm: rgba(234, 88, 12, 0.13);
  --glow-cool: rgba(37, 99, 235, 0.09);
  --glow-low: rgba(13, 148, 136, 0.06);
  --header-bg: rgba(255, 255, 255, 0.7);
  --header-line: #DDE1E7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
/* spawndb glow, pinned to the screen: warm "live" orange rising from the bottom middle
   ringed by a wider cool-blue halo, a faint teal at the top. Sits behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 680px at 50% calc(100% + 60px), var(--glow-warm), transparent 72%),
    radial-gradient(1700px 900px at 50% calc(100% + 60px), transparent 30%, var(--glow-cool) 52%, transparent 76%),
    radial-gradient(1400px 900px at 50% 0%, var(--glow-low), transparent 70%);
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 6px; background: var(--btn-bg); color: var(--btn-text);
}
.skip:focus { top: 12px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wide { font-stretch: 125%; }

/* Header */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--header-line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); text-decoration: none;
  font-size: 22px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px;
  color: var(--text-2); text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--current); }
.nav a[aria-current="page"] { background: var(--current); color: var(--text); font-weight: 600; }
.search { flex: 1 1 240px; display: flex; flex-direction: column; align-items: flex-end; }
.search-msg { margin: 4px 0 0; max-width: 360px; font-size: 13px; color: var(--count); text-align: right; }
.search-msg:empty { display: none; }
.search input {
  width: 100%; max-width: 360px; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--field); color: var(--text); font: inherit; font-size: 15px;
}
.online { margin: 0; font-size: 15px; color: var(--muted); }
.online strong { color: var(--text); font-weight: 700; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: transparent;
  color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--current); }

.note { background: var(--note-bg); border-bottom: 1px solid var(--note-line); }
.note p { margin: 0 auto; padding-top: 10px; padding-bottom: 10px; font-size: 14px; color: var(--note-text); }

main { padding-top: 48px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 64px; }
h1, h2, h3 { margin: 0; }
.h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.05; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; text-wrap: balance; }
.h2 { font-size: 28px; line-height: 1.2; font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.section-head p { margin: 0; }

/* Busiest right now */
.busy { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.busy li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 64px; align-items: center; gap: 20px; }
.busy .who { min-width: 0; display: flex; flex-direction: column; }
.busy .name { font-size: 20px; line-height: 1.25; font-weight: 700; font-stretch: 110%; overflow-wrap: anywhere; text-decoration: none; color: var(--text); }
.busy a.name:hover { color: var(--link-hover); text-decoration: underline; }
.bar { display: block; height: 28px; background: var(--track); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.busy .count { font-size: 30px; line-height: 1; font-weight: 800; font-stretch: 125%; text-align: right; }
@media (max-width: 640px) {
  .busy li { grid-template-columns: minmax(0, 1fr) 48px; gap: 6px 12px; }
  .busy .bar { grid-column: 1 / -1; grid-row: 2; height: 12px; }
  .busy .count { font-size: 24px; }
}

/* Ranked lists */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); gap: 56px 64px; }
.board { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.board > p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.board-head, .rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; }
.board.dated .board-head, .board.dated .rank li { grid-template-columns: 64px minmax(0, 1fr) auto; }
.board-head { padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--muted); }
.board-head span:last-child { text-align: right; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--row); }
.rank .pos { font-size: 14px; color: var(--muted); }
.rank .game { min-width: 0; display: flex; flex-wrap: wrap; column-gap: 8px; }
.rank .game a, .feed .game a { text-decoration: none; }
.rank .game a:hover, .feed .game a:hover { text-decoration: underline; }
.rank .game a { font-weight: 600; }
.rank .val { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; font-weight: 700; text-align: right; }
.rank .val .sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.more { align-self: flex-start; display: flex; align-items: center; min-height: 44px; font-weight: 600; }

.intro { display: flex; flex-direction: column; gap: 8px; }
.intro p { margin: 0; max-width: 64ch; text-wrap: pretty; }
.days { display: flex; flex-direction: column; gap: 48px; }

/* Game page */
.game-head { display: flex; flex-direction: column; gap: 20px; }
.game-intro .muted { margin: 4px 0 0; font-size: 17px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.game-top { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: flex-start; }
.game-intro { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.game-title { font-size: clamp(44px, 7vw, 72px); line-height: 1; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.game-intro .lede { margin: 0; max-width: 60ch; font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 6px;
  background: var(--btn-bg); color: var(--btn-text); font-weight: 700; text-decoration: none;
}
.btn:hover { color: var(--btn-text); opacity: 0.92; }
.stats {
  flex: 1 1 400px; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.stats div { padding: 16px 20px; border-bottom: 1px solid var(--row); }
.stats div:nth-child(odd) { border-right: 1px solid var(--row); }
.stats .last-row { border-bottom: 0; }
.stats .full { grid-column: 1 / -1; border-right: 0; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.stats dd .muted { white-space: nowrap; }
.stats .big { font-size: 30px; line-height: 1.2; font-weight: 800; font-stretch: 125%; }
.stats .date { font-size: 18px; font-weight: 700; }
.chart-empty {
  position: relative; min-height: 300px; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background-image: linear-gradient(var(--track) 1px, transparent 1px);
  background-size: 100% 25%; background-position: 0 -1px;
}
.chart-empty div { position: relative; max-width: 480px; padding: 14px 22px; border-radius: 6px; background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 6px; }
.chart-empty h3 { font-size: 20px; }
.chart-empty p { margin: 0; font-size: 15px; color: var(--muted); text-wrap: pretty; }
.history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.history li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--row); }
.history h3 { font-size: 18px; line-height: 1.3; }
.history p { margin: 4px 0 0; max-width: 72ch; font-size: 15px; color: var(--text-2); text-wrap: pretty; }

/* Updates feed */
.day { display: flex; flex-direction: column; gap: 4px; }
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.day-head p { margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--row); }
.feed .game { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.feed .game a { font-size: 17px; font-weight: 700; }
.feed .titles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text-2); }
.feed .tally { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--count); }

.state { padding: 48px 0; color: var(--muted); }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 40px; padding-top: 24px; padding-bottom: 24px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0; }
