:root {
  color-scheme: light;
  --ink: #201c27;
  --paper: #fffdf6;
  --bg: #f8f5ee;
  --lilac: #d9cdfa;
  --violet: #38275e;
  --gold: #ffc64d;
  --line: #d8d0dc;
  --muted: #5a5361;
  --green: #245d40;
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { border-bottom: 1px solid var(--line); background: var(--paper); padding: 13px max(18px, calc((100vw - 850px) / 2)); }
a { color: var(--violet); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand b { display: grid; place-items: center; width: 29px; height: 29px; border: 1.5px solid; border-radius: 7px; background: var(--gold); transform: rotate(-6deg); }
main { width: min(100% - 32px, 780px); margin: 42px auto; }
h1, h2 { margin: 0; font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(42px, 8vw, 76px); letter-spacing: -.035em; }
h2 { font-size: clamp(25px, 4.4vw, 38px); }
p { margin: 8px 0; }
.intro, #category, #answered { color: var(--muted); }
#notice { color: var(--violet); font-weight: 650; min-height: 1.5em; }
section { border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); padding: clamp(18px, 5vw, 36px); box-shadow: 5px 5px var(--lilac); }
form { display: grid; gap: 10px; max-width: 360px; }
label { font-weight: 700; }
input, button, .button { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; min-height: 44px; }
input { width: 100%; min-width: 0; background: white; color: var(--ink); }
button, .button { background: var(--violet); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
.button { display: inline-flex; align-items: center; }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.secondary { background: var(--lilac); color: var(--ink); }
#invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 22px; }
#invite input, #invite button { margin-top: 9px; }
#qr { display: block; width: min(184px, 100%); height: auto; image-rendering: pixelated; background: white; border: 1px solid var(--line); border-radius: 6px; }
#roster, #scores { padding-left: 22px; margin: 14px 0 20px; }
#roster li, #scores li { padding: 3px 0; overflow-wrap: anywhere; }
.round-meta { display: flex; justify-content: space-between; font-weight: 750; color: var(--violet); gap: 10px; }
#category { font-size: 14px; }
#choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
#choices button { display: flex; gap: 10px; align-items: center; text-align: left; color: var(--ink); background: var(--paper); overflow-wrap: anywhere; }
#choices button span { flex: none; background: var(--lilac); color: var(--ink); border-radius: 5px; width: 27px; height: 27px; display: grid; place-items: center; }
#choices button.selected { border-color: var(--violet); background: var(--lilac); opacity: 1; }
#choices button.correct { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); opacity: 1; }
#reveal { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
#answer { font-weight: 800; }
.back-link { display: inline-block; margin-top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 520px) {
  main { margin-top: 27px; }
  #invite, #choices { grid-template-columns: 1fr; }
}
