:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f9f4e9;
  background: #151722;
  --muted: #c5c1d0;
  --border: #41445a;
  --panel: #202334;
  --gold: #f6c978;
  --green: #9de0c2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background-image: radial-gradient(#35384b 1px, transparent 1px);
  background-size: 16px 16px;
}

main { width: min(100% - 32px, 960px); margin: auto; padding: clamp(28px, 7vw, 72px) 0; }
.masthead, .round-info, .player, .clue { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.masthead { align-items: flex-start; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1, .player strong, .round-info, .mode { font-family: ui-monospace, "Cascadia Mono", monospace; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: -.075em; line-height: 1.06; }
h1 span { color: var(--gold); }
h2 { margin-bottom: 8px; line-height: 1.2; }
p { color: var(--muted); line-height: 1.5; }
.masthead p { margin: 0; }
.mode { border: 1px solid var(--border); padding: 8px 10px; font-size: .875rem; white-space: nowrap; background: #151722; }

.scoreboard, .board { display: grid; gap: 16px; }
.scoreboard { grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.player, .panel { border: 1px solid var(--border); background: var(--panel); box-shadow: 4px 4px #0e1019; }
.player { padding: 12px 18px; border-left: 4px solid var(--accent); }
.player strong { color: var(--accent); font-size: 1.4rem; }
.player.active { outline: 2px solid var(--accent); outline-offset: -2px; }
#player-1 { --accent: var(--gold); }
#player-2 { --accent: var(--green); }

.board { grid-template-columns: 1.08fr 1fr; align-items: start; }
.panel { padding: clamp(16px, 3vw, 26px); min-width: 0; }
.round-info { font-size: .875rem; margin-bottom: 9px; }
#category { color: var(--gold); }
progress { width: 100%; height: 9px; margin-bottom: 16px; border: 0; background: #141623; accent-color: var(--gold); }
progress::-webkit-progress-bar { background: #141623; }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }

label { display: block; margin-bottom: 7px; font-weight: 600; }
input, button { font: inherit; }
input { display: block; width: 100%; padding: 12px; border: 1px solid #777b95; border-radius: 0; background: #151722; color: inherit; }
input::placeholder { color: #a9a7bc; }
button { padding: 10px 16px; min-height: 44px; border: 1px solid transparent; border-radius: 0; background: var(--gold); color: #151722; cursor: pointer; font-weight: 700; }
button:hover:not(:disabled) { background: #ffe0a0; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
button.alternate, .samples button { background: #32364b; color: #f9f4e9; border-color: #696d89; }
button.alternate:hover:not(:disabled), .samples button:hover:not(:disabled) { background: #454a62; }
#feedback { margin: 12px 0 0; color: var(--gold); }
.demo-help { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; }
.demo-help p { margin-bottom: 10px; font-size: .875rem; }
.samples { display: flex; flex-wrap: wrap; gap: 7px; }
.samples button { font-size: .875rem; padding: 5px 9px; }
.history-panel { min-height: 185px; }
#empty-log { margin-bottom: 0; }
ol { list-style: none; padding: 0; margin: 0; }
.clue { border-top: 1px solid var(--border); padding: 10px 0; }
.clue:last-child { padding-bottom: 0; }
.clue div { min-width: 0; }
.clue small { display: block; color: var(--muted); margin-bottom: 3px; }
.clue p { color: inherit; margin-bottom: 0; overflow-wrap: anywhere; }
.result { color: var(--gold); white-space: nowrap; font-size: .875rem; font-weight: 700; }
.result[data-result="yes"], .result[data-result="correct"] { color: var(--green); }
.result[data-result="no"], .result[data-result="wrong"] { color: #ffadad; }

@media (max-width: 670px) {
  .board { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .masthead { flex-direction: column; gap: 10px; }
}
