:root {
  color-scheme: dark;
  --bg: #0b1023;
  --panel: #151d36;
  --line: #2b3658;
  --ink: #f5f4ff;
  --muted: #a6b1d2;
  --accent: #e5ff62;
  --pink: #fb5fa7;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 85% 0, #232450 0, transparent 60%), var(--bg);
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 36px;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -1px;
}
.brand b {
  color: var(--accent);
}
.brand span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 3px;
  margin-top: 5px;
}
#connection {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
}
main {
  padding: 28px 36px 48px;
  max-width: 1800px;
  margin: auto;
}
h1 {
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -1px;
  margin: 14px 0 28px;
}
h2 {
  font-size: 22px;
}
h3 {
  margin: 8px 0;
  font-size: 18px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  margin: 22px 0;
}
.teams {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.team {
  background: #121b33;
  border: 1px solid var(--line);
  padding: 17px 20px;
  border-radius: 14px;
}
.team.chooser {
  border: 2px solid var(--accent);
  padding: 16px 19px;
}
.team small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
}
.team.chooser small {
  color: var(--accent);
}
.score {
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  align-items: start;
}
button,
input,
select {
  font: inherit;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 12px 16px;
  background: #202c4c;
  color: var(--ink);
}
button {
  cursor: pointer;
  margin: 4px;
}
button:hover {
  border-color: var(--accent);
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.primary {
  background: var(--accent);
  color: #111a2b;
  font-weight: 700;
}
.positive {
  color: #cfff89;
}
.negative {
  color: #ffa4b5;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}
.category {
  display: grid;
  gap: 8px;
  grid-auto-rows: 1fr;
}
.category h3 {
  min-height: 52px;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65px;
  background: #232a59;
  border: 1px solid #393e70;
  border-radius: 10px;
  font-size: 25px;
  font-weight: bold;
  color: var(--accent);
  width: 100%;
  margin: 0;
}
.tile.played {
  opacity: 0.2;
}
.prompt {
  font-size: clamp(24px, 3.6vw, 58px);
  line-height: 1.38;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 130px;
}
.question h2 {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 1px;
}
.private {
  border-color: #704b82;
  background: #261d3d;
}
.private strong {
  font-size: 24px;
}
.answer {
  font-size: 32px;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.attempts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.attempts > div {
  background: #1c2843;
  padding: 12px;
  border-radius: 12px;
}
.attempts span {
  display: block;
  margin-bottom: 12px;
}
.attempts button {
  width: calc(50% - 8px);
  padding: 10px 4px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
form.entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
form.entry label {
  flex: 1;
  min-width: 220px;
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 540px;
}
dialog::backdrop {
  background: #030610cc;
}
dialog form {
  display: block;
}
dialog input {
  width: 100%;
}
#error {
  color: #ffa4b5;
}
a {
  color: var(--accent);
}
code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
  padding: 15px;
  background: #0b1023;
  border-radius: 8px;
}
.big-number {
  font-size: clamp(64px, 8vw, 150px);
  color: var(--accent);
}
.welcome {
  text-align: center;
  padding: 5vh 30px;
}
.wordmark {
  font-size: clamp(80px, 12vw, 180px);
  font-weight: 900;
  letter-spacing: -8px;
  color: var(--accent);
}
.tv main {
  max-width: none;
  padding: 30px 3vw;
}
.tv .team h3 {
  font-size: clamp(20px, 1.8vw, 36px);
}
.tv .score {
  font-size: clamp(30px, 3vw, 60px);
}
.tv .tile {
  min-height: 8vh;
  font-size: clamp(24px, 2.4vw, 48px);
}
.tv .category h3 {
  font-size: clamp(14px, 1.2vw, 24px);
}
.tv .question {
  min-height: 50vh;
}
.tv .panel .question {
  min-height: 38vh;
  margin: 12px 0 0;
}
.tv .prompt {
  font-size: clamp(28px, 3.2vw, 64px);
}
.tv header {
  padding: 18px 3vw;
}
.tv .teams {
  gap: 18px;
}
.tv .welcome h1 {
  font-size: 4vw;
}
.reveal {
  display: inline-block;
  width: 19%;
  padding: 14px;
  border-right: 1px solid var(--line);
  vertical-align: top;
  animation: reveal 0.6s ease-out;
}
.reveal strong {
  font-size: 3vw;
  color: var(--accent);
}
.reveal p {
  font-size: 1vw;
  line-height: 1.6;
}
.stale {
  opacity: 0.65;
}
.disconnected .decision {
  pointer-events: none;
  opacity: 0.35;
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 900px) {
  header,
  main {
    padding: 18px;
  }
  .teams {
    gap: 5px;
  }
  .team {
    padding: 10px;
  }
  .team h3 {
    font-size: 14px;
  }
  .score {
    font-size: 24px;
  }
  .attempts {
    grid-template-columns: repeat(2, 1fr);
  }
  .board {
    gap: 4px;
  }
  .category h3 {
    font-size: 11px;
  }
  .tile {
    font-size: 20px;
  }
  .brand span {
    font-size: 9px;
  }
  header {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
.host header {
  padding: 16px 28px;
}
.host main {
  padding: 22px 28px;
}
.host h1 {
  font-size: 28px;
  margin: 12px 0 18px;
}
.host .panel {
  padding: 18px;
  margin: 16px 0;
}
.host .question .prompt {
  font-size: 26px;
  min-height: 55px;
  line-height: 1.4;
}
.host .question {
  margin: 8px 0;
}
.host .private {
  padding: 14px;
  margin: 12px 0;
}
.host .private strong {
  font-size: 20px;
}
.host .private p {
  font-size: 14px;
  margin: 8px 0;
}
.host .attempts > div {
  padding: 10px;
}
.host .team {
  padding: 12px 16px;
}
.host .team.chooser {
  padding: 11px 15px;
}
.host .score {
  font-size: 28px;
}
.reveal {
  animation: none;
}
.reveal.enter {
  animation: reveal 0.6s ease-out;
}
