:root {
  --bg: #0f1115; --fg: #e8e6e3; --muted: #9aa0a6; --card: #1a1d23; --line: #2c313a;
  --accent: #ffd54a; --green: #2e7d32; --orange: #c77700; --red: #a4262c; --err: #ff8a80;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.4rem; letter-spacing: .05em; text-decoration: none; color: var(--accent); }
.logout { display: flex; gap: .75rem; align-items: center; margin: 0; }
.who { color: var(--muted); }
button { font: inherit; padding: .5rem 1rem; border: 0; border-radius: 6px; background: var(--accent); color: #111; font-weight: 600; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; font-weight: 400; }
input { font: inherit; padding: .5rem .6rem; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); width: 100%; }
label { display: block; margin-bottom: .75rem; }
.error { color: var(--err); }
.intro, .count, .hint-note, .legend, .yesterday, small { color: var(--muted); }
.auth { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.auth section { background: var(--card); padding: 1rem 1.25rem; border-radius: 10px; }
.guess { position: relative; max-width: 480px; margin-bottom: 1rem; }
.results { display: flex; flex-direction: column; margin-top: .25rem; }
.results .result { text-align: left; background: var(--card); color: var(--fg); border-radius: 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.results .result:first-child { border-radius: 6px 6px 0 0; outline: 1px solid var(--accent); }
.results .result:hover, .results .result:focus { background: #2a2f38; }
.hints { background: var(--card); padding: .75rem 1rem; border-radius: 8px; max-width: 720px; }
.hints dt { font-weight: 700; color: var(--accent); }
.hints dd { margin: 0 0 .5rem; }
.result-banner { font-size: 1.2rem; }
.table-wrap { overflow-x: auto; }
.grid { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 860px; }
.grid th { font-size: .8rem; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: left; padding: 0 .4rem; }
.cell { padding: .5rem; border-radius: 6px; font-size: .9rem; vertical-align: top; color: #fff; }
.cell.green { background: var(--green); }
.cell.orange { background: var(--orange); }
.cell.red { background: var(--red); }
.arrow { font-weight: 800; font-size: 1.1rem; }
.answer-row .cell { outline: 2px solid var(--accent); }
footer { max-width: 1100px; margin: 2rem auto; padding: 1rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.hints .unlock { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 1rem; margin-right: auto; margin-left: 1.5rem; }
.muted { color: var(--muted); }
.panel { background: var(--card); padding: .75rem 1.25rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; }
.panel h2 { margin-top: .25rem; font-size: 1.2rem; }
.ranking, .today-list { padding-left: 1.5rem; }
.ranking li, .today-list li { margin: .25rem 0; }
.ranking .nick, .today-list .nick { font-weight: 600; margin-right: .5rem; }
.ranking .won { color: #81c784; } .ranking .lost { color: var(--err); }
.ranking small { margin-left: .5rem; }
.stats { border-collapse: collapse; width: 100%; }
.stats th, .stats td { padding: .35rem .6rem; border-bottom: 1px solid var(--line); text-align: right; }
.stats th:first-child { text-align: left; }
.stats thead th { color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.stats tr.me th, .ranking li.me .nick { color: var(--accent); }
.dist td { min-width: 2rem; }
.subnav { display: flex; gap: 1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.search-form { display: flex; gap: .5rem; max-width: 640px; }
.admin-chars td, .admin-chars th { text-align: left; font-size: .85rem; vertical-align: top; }
.pool-guess_only { color: var(--orange); } .pool-disabled { color: var(--err); }
.facts { display: grid; grid-template-columns: 12rem 1fr; gap: .35rem 1rem; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.pre { white-space: pre-wrap; }
label.check { display: flex; gap: .5rem; align-items: center; }
label.check input { width: auto; }
code { font-size: .9em; }
form.inline { display: flex; gap: .35rem; align-items: center; margin: 0; }
form.inline input { width: 8rem; padding: .3rem .4rem; }
form.inline button, .admin-players button { padding: .3rem .6rem; font-size: .85rem; }
.admin-players td, .admin-players th { text-align: left; vertical-align: middle; }
.flash.ok { color: #81c784; } .flash.error { color: var(--err); }
button.danger { background: var(--red); color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flag-cell { position: relative; vertical-align: top; padding: .5rem .25rem; white-space: nowrap; }
.flag summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.flag details[open] .flag-form { position: absolute; right: 0; z-index: 5; width: 18rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: .75rem; white-space: normal; }
.flag select, .flag textarea { font: inherit; width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: .3rem; }
.flag-msg { color: var(--muted); white-space: normal; }
.flag-items { list-style: none; padding: 0; }
.flag-items li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.flag-items blockquote { margin: .25rem 0 .5rem 1rem; color: var(--fg); }
.flag-items form.inline input { width: 22rem; max-width: 100%; }
button.secondary { background: var(--line); color: var(--fg); }
