:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #68756e;
  --line: #d8ded8;
  --panel: #ffffff;
  --soft: #edf4ef;
  --field: #f7faf8;
  --accent: #e0523f;
  --accent-dark: #ba3828;
  --green: #2e7d5b;
  --blue: #276a90;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f7f4; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px max(16px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); position: sticky; top: 0; z-index: 10; }
.brand { font-size: 1.25rem; font-weight: 800; }
.topbar nav, .topbar form, .page-head, .guess-form, .result-bar { display: flex; align-items: center; gap: 12px; }
.topbar nav { gap: 18px; }
.button, button { border: 0; border-radius: 8px; background: var(--accent); color: white; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; font: inherit; font-weight: 750; }
.button:hover, button:hover { background: var(--accent-dark); }
.button:disabled, button:disabled { background: #aab4ad; cursor: not-allowed; }
.button.small { min-height: 34px; padding: 0 12px; }
.button.ghost { background: #e5eee8; color: var(--ink); }
.link-button { min-height: auto; padding: 0; background: transparent; color: var(--ink); font-weight: 500; }
.messages { width: min(1180px, calc(100% - 32px)); margin: 18px auto 0; }
.message { margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.hero, .page-head { justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.hero { display: flex; align-items: flex-end; }
.eyebrow { color: var(--green); font-weight: 800; margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: 0.95; margin-bottom: 12px; }
h2 { font-size: 1.1rem; }
.lede, .page-head p, .side-panel p, .card p { color: var(--muted); }
.identity { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 12px 14px; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.side-panel, .leaderboard, .form-page { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.map-panel { overflow: hidden; }
.world-map { position: relative; aspect-ratio: 16 / 9; min-height: 420px; overflow: hidden; background: #b6d8e8; }
.world-map.is-guessing, .world-map.is-guessing canvas { cursor: crosshair; }
.maplibregl-map { font: inherit; }
.map-label { position: absolute; left: 16px; top: 16px; z-index: 500; border-radius: 8px; background: rgba(255, 255, 255, 0.92); padding: 8px 10px; font-size: 0.9rem; font-weight: 750; box-shadow: 0 6px 18px rgba(23, 33, 27, 0.12); }
.guess-marker, .answer-marker { width: 20px; height: 20px; border: 3px solid white; border-radius: 999px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28); }
.guess-marker { background: var(--accent); }
.answer-marker { background: var(--blue); }
.hidden { display: none; }
.guess-form, .result-bar { justify-content: space-between; padding: 16px 0 0; border-top: 0; }
.guess-form span, .result-bar span, .card-meta { color: var(--muted); }
.side-panel { padding: 18px; }
.league-stack, .cards { display: grid; gap: 12px; }
.league-card, .card { border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.league-card { display: grid; gap: 4px; padding: 12px; }
.league-card span, .card h2 { font-weight: 800; }
.league-card small { color: var(--muted); }
.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { padding: 18px; }
.leaderboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.leaderboard { padding: 18px; }
.leaderboard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leaderboard li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.leaderboard .empty { color: var(--muted); }
.members { margin-top: 24px; }
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-list span { border-radius: 999px; background: var(--soft); padding: 8px 12px; font-weight: 700; }
.form-page { width: min(560px, 100%); padding: 24px; }
.stack-form { display: grid; gap: 14px; }
.stack-form p { display: grid; gap: 6px; margin: 0; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; padding: 10px 12px; }
.helptext, .stack-form ul { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 850px) { .hero, .page-head, .play-grid, .leaderboard-grid { display: grid; grid-template-columns: 1fr; } .world-map { min-height: 240px; } .topbar { align-items: flex-start; } }

.round-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.round-tab { border: 1px solid var(--line); border-radius: 8px; background: white; display: grid; gap: 3px; padding: 12px; min-height: 64px; }
.round-tab span { font-weight: 800; }
.round-tab small { color: var(--muted); }
.round-tab.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.round-tab.complete { background: var(--soft); }
.identity { display: grid; gap: 3px; }
.identity span { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 680px) { .round-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.leaderboard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.leaderboard-head h2 { margin-bottom: 0; }
.leaderboard-head span { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.score-plot li { display: grid; gap: 7px; }
.score-row-main { display: flex; justify-content: space-between; gap: 12px; }
.score-row-main span { font-weight: 750; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-bar { height: 9px; border-radius: 999px; background: #e8eee9; overflow: hidden; }
.score-bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--accent)); }
.score-row-meta { color: var(--muted); font-size: 0.82rem; }

.section-head { margin: 28px 0 14px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { color: var(--muted); margin-bottom: 0; }
.daily-breakdowns { margin-top: 28px; }
.day-breakdown { margin-bottom: 18px; }
.day-breakdown h3 { font-size: 1rem; margin: 0 0 10px; color: var(--green); }
.round-breakdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.round-breakdown { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.round-breakdown-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px; background: var(--field); border-bottom: 1px solid var(--line); }
.round-breakdown-head div { display: grid; gap: 3px; }
.round-breakdown-head span { color: var(--muted); font-size: 0.9rem; }
.round-breakdown-head em { color: var(--green); font-style: normal; font-weight: 800; white-space: nowrap; }
.score-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.score-table th, .score-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.score-table th { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.score-table tr:last-child td { border-bottom: 0; }
.score-table td:last-child, .score-table th:last-child { text-align: right; }
.muted { color: var(--muted); }
@media (max-width: 680px) { .round-breakdown-grid { grid-template-columns: 1fr; } .score-table { font-size: 0.82rem; } .score-table th, .score-table td { padding: 8px 7px; } }
