:root {
  color-scheme: dark;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
  color: #fff7ee;
  background: #100e1b;
  --theme: #b4a0ff;
  --ink: #171226;
  --line: #c9aff34a;
  --panel: #20192dea;
  --wash: #352055;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 35%, var(--wash), transparent 67%), #100e1b;
}
body[data-theme="quiz"] {
  --theme: #dbff67;
  --panel: #08174bea;
  --wash: #172d91;
  --line: #8caffe75;
}
body[data-theme="pitch"] {
  --theme: #ffc394;
  --panel: #381522ef;
  --wash: #822c37;
  --line: #f3ac8075;
}
#stage { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .36; pointer-events: none; }
.top, main { position: relative; }
.top {
  width: min(92%, 1220px);
  margin: auto;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}
.brand { color: inherit; font-weight: 950; text-decoration: none; letter-spacing: .12em; display: inline-flex; align-items: center; gap: .6rem; }
.brand span { background: #d8f879; color: #171226; border-radius: .28rem; padding: .21rem .48rem; transform: rotate(-9deg); }
.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: end; }
main { width: min(92%, 1120px); margin: clamp(2rem, 5vw, 5.5rem) auto 3rem; }
.intro { margin-bottom: clamp(1.5rem, 4vw, 3rem); text-align: center; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3rem, 9vw, 8rem); line-height: .92; letter-spacing: -.075em; margin-bottom: .2em; font-weight: 950; }
h1 em { color: var(--theme); }
.intro p { margin-bottom: 0; color: #e6dbf4; font-size: clamp(1rem, 2vw, 1.3rem); }
.shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.8rem, 3vw, 2rem); }
button { color: inherit; font: inherit; cursor: pointer; }
.cover {
  --accent: #e3fe78;
  isolation: isolate;
  position: relative;
  min-height: clamp(16rem, 32vw, 24rem);
  overflow: hidden;
  display: grid;
  align-items: end;
  text-align: left;
  padding: clamp(1.1rem, 3vw, 2rem);
  color: white;
  background: #172e69;
  border-radius: 1.3rem;
  border: 2px solid #729bff8c;
  box-shadow: 0 .75rem 0 #0c0a16, 0 1.6rem 3rem #0006;
  transition: transform .2s, border-color .2s;
}
.cover.pitch { --accent: #ffcb9a; background: #612536; border-color: #ffab8e8c; }
.cover:hover, .cover:focus-visible { transform: translateY(-.4rem); border-color: var(--accent); }
.cover img, .cover::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.cover img { object-fit: cover; object-position: center 52%; }
.cover::after { content: ''; background: linear-gradient(180deg, transparent 29%, #140d224d 50%, #100b19 100%); }
.cover p, .eyebrow { color: var(--theme); font-size: .79rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.cover p { margin: 0 0 .28rem; color: var(--accent); }
.cover h2 { font-size: clamp(2.4rem, 6vw, 5.2rem); letter-spacing: -.07em; line-height: .91; margin: 0 0 .65rem; font-weight: 950; }
.cover.pitch h2, body[data-theme="pitch"] #game h2 { font-family: Georgia, serif; letter-spacing: -.05em; }
.cover span { font-weight: 850; }
.cover b { margin-left: .35rem; color: var(--accent); }
.quiet, .primary, .answer {
  border-radius: .55rem;
  padding: .68rem .96rem;
  font-weight: 850;
  border: 1px solid var(--line);
}
.quiet { background: #151020bd; }
.primary { color: var(--ink); background: var(--theme); border-color: transparent; }
button:hover:not(:disabled) { filter: brightness(1.13); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.panel {
  padding: clamp(1.2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--panel);
  box-shadow: 0 1rem 3rem #100a2090;
}
.join { width: min(100%, 460px); margin: auto; }
.join h1 { font-size: clamp(2.4rem, 7vw, 3.5rem); margin: 1.2rem 0; }
label { display: block; font-weight: 800; margin-bottom: .45rem; }
input { width: 100%; padding: .85rem; margin-bottom: 1rem; border-radius: .5rem; border: 1px solid var(--line); background: #120f20; color: inherit; font: inherit; }
#code { text-transform: uppercase; letter-spacing: .22em; }
.join .primary { width: 100%; }
#game { max-width: 980px; margin-inline: auto; }
body[data-role="player"] #game { max-width: 620px; }
.game-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.game-head a, .invite { color: inherit; overflow-wrap: anywhere; }
.game-head a:hover, .invite:hover { color: var(--theme); }
#game h2 { font-size: clamp(2rem, 5.2vw, 4rem); line-height: 1.02; letter-spacing: -.055em; overflow-wrap: anywhere; }
body[data-role="player"] #game h2 { font-size: clamp(1.75rem, 5.5vw, 2.7rem); }
.room-code { display: block; color: var(--theme); font-size: clamp(3.2rem, 12vw, 9rem); line-height: 1; font-weight: 950; letter-spacing: .12em; margin-bottom: .35rem; }
.invite { display: inline-block; margin-bottom: 1.3rem; }
.answers, .pitches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.answer, .entry { background: #fff2; overflow-wrap: anywhere; min-width: 0; text-align: left; min-height: 58px; }
.answer { display: flex; align-items: center; gap: .7rem; }
.answer .letter { padding: .22rem .48rem; border-radius: .25rem; background: var(--theme); color: var(--ink); }
.answer.selected, .answer.correct { border-color: var(--theme); }
.answer.correct { color: var(--theme); }
.entry { border: 1px solid var(--line); border-radius: .65rem; padding: .9rem; margin: 0; }
.entry p { margin-bottom: .45rem; }
.entry strong { font-size: .9rem; color: var(--theme); }
.scores { list-style: none; padding: 0; display: grid; gap: .5rem; }
.scores li { padding: .65rem .85rem; background: #fff2; border-radius: .45rem; display: flex; justify-content: space-between; gap: .75rem; overflow-wrap: anywhere; }
.timer { width: max-content; padding: .32rem .7rem; color: var(--ink); background: var(--theme); font-weight: 900; border-radius: .3rem; font-variant-numeric: tabular-nums; }
#status { color: #ffd2d9; margin-top: 1rem; }
@media (max-width: 620px) {
  .shelf, .answers, .pitches { grid-template-columns: 1fr; }
  .top { min-height: 60px; }
  .quiet { padding: .55rem .61rem; }
  main { margin-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cover { transition: none; }
}

#rules {
  width: min(92%, 590px);
  max-height: 90dvh;
  color: inherit;
  background: #241b36;
}
#rules::backdrop { background: #080610bf; }
#rules form { float: right; margin-left: .75rem; }
#rules h2 { font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.065em; line-height: 1; margin-bottom: .75rem; }
#rules p { line-height: 1.5; }
#rules ol { padding-left: 1.35rem; margin: 0 0 1.35rem; }
#rules li { padding-left: .25rem; margin-bottom: .65rem; line-height: 1.4; }
#rules-status { color: #ffd2d9; margin: .75rem 0 0; }
#rules-status:empty { display: none; }
