:root {
  color-scheme: light;
  /* Soft breakroom pastels: lavender paper, plum ink, pistachio for go, blush and apricot for feedback. */
  --ink: #2d2a45;
  --muted: #5f5b78;
  --paper: #f8f7fc;
  --wash: #f1eefb;
  --lavender: #ddd8fa;
  --lavender-soft: #ebe7fb;
  --violet: #5f4bb3;
  --rule: #d4cfe8;
  --periwinkle: var(--lavender);
  --lime: #d5ec9f;
  --lime-hover: #e2f3bd;
  --pink: #f7d0dc;
  --orange: #fadbb3;
  --line: 2px solid var(--ink);
  --sans: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px dashed var(--violet); outline-offset: 4px; }
.shell { display: flex; flex-direction: column; width: 100%; min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.shell > main { flex: 1; min-width: 0; }
#app { display: grid; }
.topbar { position: sticky; top: 0; z-index: 20; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; min-height: 67px; border-bottom: var(--line); background: var(--paper); }
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .topbar { background: rgb(248 247 252 / 80%); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
.footer { display: grid; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; width: max-content; margin-left: clamp(16px, 2.6vw, 40px); text-decoration: none; font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.brand span { margin-left: -8px; }
.footer, legend, figcaption, .tag, .meta, .rank, .field-label { font: 700 .74rem/1.35 var(--sans); letter-spacing: .06em; }
.field-label, legend, .meta, figcaption { color: var(--muted); }
.top-actions { display: flex; justify-self: end; align-self: stretch; }
.account-link { display: flex; align-items: center; justify-content: center; padding: 14px 20px; font-weight: 800; text-decoration: none; }
.account-link:hover { background: var(--lavender-soft); }
.join-link { justify-self: end; padding: 0 clamp(14px, 2.6vw, 40px); align-self: stretch; display: flex; align-items: center; gap: 18px; font-weight: 800; text-decoration: none; border-left: var(--line); }
.join-link:hover { background: var(--lime); }
.player-view .footer, .game-started .join-link { display: none; }
.game-started .top-actions, .sign-in-view .footer { display: none; }
.landing { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); }
.hero-copy { display: grid; align-content: center; padding: clamp(26px, 5vw, 78px) clamp(24px, 5vw, 76px); }
h1, h2, h3, p, figure { margin-top: 0; }
.landing h1 { font-size: clamp(3.5rem, 7.3vw, 6rem); line-height: .92; margin-bottom: 12px; letter-spacing: -.05em; font-weight: 800; }
.landing h1 em { font-style: normal; color: var(--violet); }
.lede { font-size: clamp(1rem, 1.4vw, 1.23rem); line-height: 1.48; margin-bottom: 27px; max-width: 38ch; }
fieldset { margin: 0 0 13px; border: 0; padding: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: 9px; }
.host-setup { width: 100%; max-width: 430px; }
.host-setup [data-create] { width: 100%; height: 46px; margin-top: 24px; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode { min-width: 0; min-height: 61px; display: flex; align-items: center; gap: 10px; cursor: pointer; border: var(--line); border-radius: 8px; padding: 9px 12px; }
.mode:has(input:checked) { background: var(--lavender-soft); }
.mode:hover { background: var(--wash); }
.mode input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--violet); }
.mode-copy { min-width: 0; display: grid; gap: 3px; }
.mode small { font-size: .74rem; }
.button { height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; white-space: nowrap; border: var(--line); border-radius: 8px; background: var(--paper); font-weight: 800; text-decoration: none; cursor: pointer; transition: background-color .16s, transform .16s, box-shadow .16s; }
.button:hover:not(:disabled) { background: var(--wash); transform: translateY(-2px); box-shadow: 0 3px var(--ink); }
.button.primary { background: var(--lime); }
.button.primary:hover:not(:disabled) { background: var(--lime-hover); }
.button:disabled { cursor: default; opacity: .58; }
.button span { font-size: 20px; }
.notice { color: #8b3a5e; font-size: .9rem; line-height: 1.45; margin: 13px 0 0; overflow-wrap: anywhere; }
.notice:empty, #launch-help:empty { display: none; }
.room-back { display: inline-block; margin-top: 16px; font-size: .9rem; font-weight: 700; }
.saved-rooms { margin-top: 18px; text-align: left; border: var(--line); border-radius: 8px; }
.saved-rooms summary { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-weight: 800; list-style: none; }
.saved-rooms summary::-webkit-details-marker { display: none; }
.play-icon { flex: none; display: block; }
.saved-rooms[open] .play-icon path { transform-box: fill-box; transform-origin: center; transform: rotate(90deg); }
.saved-rooms ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 12px 12px; list-style: none; }
.saved-rooms .button { font-family: var(--mono); }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.45; }
form + .hint { margin-top: 14px; }
#launch-help { margin-top: 12px; font-size: .9rem; line-height: 1.45; }
.hero-art { position: relative; display: grid; grid-template-rows: 1fr; justify-items: stretch; align-items: center; border-left: var(--line); margin: 0; padding: clamp(15px, 2vw, 30px); overflow: hidden; background-color: var(--lavender); background-image: linear-gradient(#8b7fd02e 1px, transparent 1px), linear-gradient(90deg, #8b7fd02e 1px, transparent 1px); background-size: 31px 31px; }
.hero-art img { width: 112%; max-width: none; height: auto; justify-self: center; animation: arrive .55s cubic-bezier(.19,.73,.3,1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px) rotate(-2deg) scale(.98); } to { opacity: 1; transform: none; } }
figcaption { display: flex; justify-content: space-between; gap: 10px; }
.footer { grid-template-columns: repeat(3, 1fr); min-height: 53px; border-top: var(--line); background: var(--wash); text-align: center; }
.footer span { min-height: 53px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.footer span + span { border-left: var(--line); }
.footer b { color: var(--violet); }

.game { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); min-height: 500px; }
.game.solo { grid-template-columns: minmax(0, 1fr); }
.game.host-lobby { grid-template-columns: minmax(240px, 1fr) minmax(0, 1.7fr); }
.game-main, .game-side { padding: clamp(22px, 4.2vw, 58px); min-width: 0; }
.game-main > :last-child, .game-side > :last-child { margin-bottom: 0; }
.game-side { border-left: var(--line); background: var(--lavender); }
.host-lobby .game-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 0;
  border-right: var(--line);
  text-align: center;
}
.solo .game-main { width: min(100%, 790px); margin: auto; }
.game h1 { font-size: clamp(2.4rem, 5.3vw, 5.3rem); line-height: 1; margin: 0 0 16px; letter-spacing: -.04em; font-weight: 800; overflow-wrap: anywhere; }
.game.host-lobby h1 { font-size: clamp(2rem, 3.5vw, 3rem); }
.game .question-title { font-size: clamp(1.8rem, 3.6vw, 3.5rem); line-height: 1.07; letter-spacing: -.045em; }
.game h2 { font-size: clamp(1.25rem, 2.25vw, 1.8rem); letter-spacing: -.04em; margin-bottom: 10px; }
.game .join-count { padding-bottom: 15px; }
.game p { line-height: 1.45; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 21px; }
.game-main > .notice:not(:last-child) { margin: 0 0 14px; }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--ink); border-radius: 4px; background: var(--lavender-soft); }
.tag.green { background: var(--lime); }
.tag.pink { background: var(--pink); }
.room-code { font: 800 clamp(1.65rem, 4vw, 2.8rem)/1 var(--mono); letter-spacing: .09em; margin: 14px 0; overflow-wrap: anywhere; }
.invite-qr { width: min(100%, 210px); margin: 0 0 16px; }
.invite-qr svg { display: block; width: 100%; height: auto; border: var(--line); border-radius: 8px; }
.invite-qr figcaption { justify-content: center; margin-top: 8px; }
.invite { display: block; overflow-wrap: anywhere; margin: 10px 0 17px; font-size: .9rem; }
.roster, .scores { padding: 0; list-style: none; margin: 15px 0; }
.roster { display: flex; flex-wrap: wrap; gap: 6px; }
.roster li { display: inline-flex; align-items: center; padding: 6px 9px; background: var(--paper); border: 1px solid var(--ink); border-radius: 4px; overflow-wrap: anywhere; }
.roster-remove { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -4px -5px -4px 6px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #e85d5d; cursor: pointer; }
.roster-remove:hover:not(:disabled) { background: #ffe3e3; color: #e04848; }
.roster-remove:disabled { opacity: .45; cursor: default; }
.lobby-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.host-lobby .game-main { display: flex; flex-direction: column; align-items: flex-start; padding-bottom: 0; }
.host-lobby .lobby-actions { order: 2; margin-top: auto; margin-bottom: 40px; padding-top: 24px; }
.host-lobby .game-main > .notice { order: 1; }
.host-lobby .game-main > .notice:empty { display: none; }
.host-lobby .game-side { justify-content: flex-start; padding-bottom: 0; }
.host-lobby .invite-details { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.host-lobby .game-side > [data-action=copy] { margin: 24px 0 40px; }
.host-lobby .lobby-actions .button, .host-lobby .game-side > [data-action=copy] { min-height: 44px; }
.scores li { display: grid; grid-template-columns: 3ch minmax(0, 1fr) auto; gap: 9px; align-items: baseline; padding: 10px 4px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.scores li.you { font-weight: 800; }
.leaderboard-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.game .leaderboard-heading h2 { margin: 0; }
.leaderboard-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border: var(--line); border-radius: 50%; background: var(--paper); cursor: pointer; }
.leaderboard-toggle:hover { background: var(--lime); }
.scores[hidden] { display: none; }
.finale-intro, .finale { text-align: center; }
.finale-countdown { display: grid; place-items: center; width: 112px; height: 112px; margin: 25px auto; border: 3px solid var(--ink); border-radius: 50%; background: var(--lime); box-shadow: 5px 6px 0 var(--ink); font: 800 4rem/1 var(--mono); animation: countdown-pop .5s ease-out both; }
.podium { display: flex; align-items: end; justify-content: center; gap: 10px; margin: 30px auto 24px; max-width: 600px; }
.podium-place { flex: 1; min-width: 0; }
.podium-person { display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; min-height: 125px; padding: 8px 2px 14px; overflow-wrap: anywhere; }
.game .podium-person h2 { max-width: 100%; margin: 0; font-size: clamp(1rem, 2vw, 1.5rem); }
.podium-person p { margin: 0; font: 700 .85rem/1.3 var(--mono); }
.podium-rank { padding: 4px 8px; border: var(--line); border-radius: 5px; background: var(--paper); font: 800 1rem/1 var(--mono); }
.podium-placeholder { font-size: 3rem; color: #9a90c4; }
.podium-block { display: grid; place-items: center; height: 90px; border: var(--line); border-radius: 10px 10px 0 0; background: var(--lavender); box-shadow: 3px 4px 0 var(--ink); font-size: 2.7rem; }
.podium-1 .podium-block { height: 135px; }
.podium-2 .podium-block { height: 108px; }
.podium-1.is-revealed .podium-block { background: var(--lime); }
.podium-2.is-revealed .podium-block { background: var(--pink); }
.podium-3.is-revealed .podium-block { background: var(--orange); }
.podium-place.is-new .podium-person { animation: podium-arrive .65s cubic-bezier(.16, 1, .3, 1) both; }
.finale-standings { margin-top: 28px; padding-top: 24px; border-top: var(--line); text-align: left; animation: podium-arrive .5s ease-out both; }
.personal-score { padding: 12px 0; }
@keyframes countdown-pop { from { opacity: .3; transform: scale(.65) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes podium-arrive { from { opacity: 0; transform: translateY(22px) scale(.94); } to { opacity: 1; transform: none; } }
.rank { color: var(--violet); }
.field-label { display: grid; gap: 7px; max-width: 415px; margin: 18px 0 12px; }
.field-label input, .setup-prompt input { min-width: 0; height: 40px; font: 600 1rem/1.2 var(--sans); color: var(--ink); padding: 0 10px; border: var(--line); background: #fff; border-radius: 7px; }
.question-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.timer { background: var(--lime); border: var(--line); border-radius: 8px; min-width: 72px; padding: 9px 10px; text-align: center; font: 800 1.5rem/1 var(--mono); }
.timer.urgent { background: var(--pink); }
progress { display: block; width: 100%; height: 9px; margin: 0 0 20px; accent-color: var(--violet); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 20px 0; }
.answer { display: flex; gap: 11px; align-items: center; text-align: left; min-width: 0; min-height: 65px; padding: 9px 12px; border: var(--line); border-radius: 8px; background: var(--wash); overflow-wrap: anywhere; }
button.answer { cursor: pointer; }
button.answer:hover:not(:disabled) { background: var(--lavender); }
button.answer:disabled { cursor: default; }
.answer .letter { font: 800 .9rem/1 var(--mono); padding: 8px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); flex: none; }
.answer .letter:has(.answer-shape, .answer-emoji) { padding: 0; border: 0; background: transparent; }
.answer .answer-shape { display: block; }
[data-answer-label]:has(.answer-shape, .answer-emoji) { display: flex; align-items: center; gap: 8px; }
[data-answer-label] .answer-shape { width: 32px; height: 32px; }
.answer-emoji { display: block; font: 2rem/1 system-ui, sans-serif; }
.answer.correct, .answer.selected { background: var(--lime); }
.answer.incorrect { background: var(--pink); }
.feedback { background: #fbf0e0; border-left: 4px solid var(--violet); padding: 12px 14px; margin-bottom: 17px; }
.feedback p { margin: 0; }
.feedback p + p { margin-top: 5px; }
@media (max-width: 810px) {
  .hero-copy { padding: 32px 25px; }
}
@media (max-width: 650px) {
  .landing, .game, .game.host-lobby { grid-template-columns: minmax(0, 1fr); }
  .game-side { border-left: 0; border-top: var(--line); }
  .host-lobby .game-side { border: 0; border-bottom: var(--line); }
  /* Phones get the task only: decorative art and the step strip are hidden. */
  .hero-art, .footer { display: none; }
  .hero-copy { padding: 28px 20px 32px; }
  .landing h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .lede { margin-bottom: 20px; }
  .host-setup { max-width: none; }
  .game { min-height: 0; }
  .game-main, .game-side { padding: 24px 20px; }
  .game h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .game .question-title { font-size: clamp(1.45rem, 6.5vw, 2rem); }
  .answers { grid-template-columns: 1fr; margin: 16px 0; }
  .answer { min-height: 52px; }
  .field-label { max-width: none; }
  .game-main .button { width: 100%; }
  .invite-qr { width: min(100%, 170px); }
}
@media (max-width: 360px) {
  .mode { padding: 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.clipboard-helper { position: fixed; left: -10000px; top: 0; }
.game-main > .tag:first-child { margin-bottom: 16px; }
.auth-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 650px; }
.auth-story { position: relative; padding: clamp(30px, 4.6vw, 64px); overflow: hidden; background: var(--lavender); }
.auth-story h1 { position: relative; z-index: 1; font-size: clamp(2.9rem, 5.2vw, 5.2rem); font-weight: 800; line-height: 1; letter-spacing: -.045em; margin-bottom: 17px; }
.auth-story h1 em { font-style: normal; color: var(--violet); }
.auth-art { display: block; width: min(105%, 420px); height: auto; margin: -10px auto -75px; transform: rotate(-7deg); }
.auth-panel { display: grid; align-items: center; padding: clamp(28px, 4.6vw, 64px); border-left: var(--line); }
.auth-content { width: min(100%, 400px); margin: auto; text-align: center; }
.auth-content h2 { font-size: clamp(2rem, 3.4vw, 3.3rem); line-height: 1; letter-spacing: -.04em; font-weight: 800; margin-bottom: 13px; }
.auth-content p { line-height: 1.5; }
.auth-content h2 + #auth-entry, .auth-content h2 + #auth-verification { margin-top: 22px; }
.auth-content .button { width: 100%; }
.google-button { background: #fff; font-weight: 600; }
.google-button svg { flex: none; }
.auth-divider { display: flex; align-items: center; gap: 13px; margin: 22px 0; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.auth-content .field-label { margin: 0 0 8px; text-align: left; }
.auth-content input { display: block; width: 100%; height: 40px; border: var(--line); border-radius: 8px; padding: 0 13px; font: inherit; color: var(--ink); background: #fff; margin-bottom: 13px; }
.auth-content input:disabled { background: #f1f0f5; }
#auth-code { letter-spacing: .35em; font: 700 1.6rem/1.2 var(--mono); text-align: center; }
.auth-availability { color: var(--muted); font-size: .84rem; margin: 16px 0; }
.auth-code-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; }
.text-button { min-height: 36px; padding: 5px 0; border: 0; background: transparent; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:disabled { opacity: .55; cursor: default; }
.auth-guest { border-top: 1px solid var(--rule); padding-top: 23px; margin-top: 24px; }
.auth-guest .button { gap: 8px; font-size: .95rem; }
.auth-greeting > p { overflow-wrap: anywhere; }
.auth-greeting .text-button { display: block; margin: 15px auto 0; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin-top: 12px; font-size: .875rem; }
.legal-links a { display: inline-flex; align-items: center; min-height: 28px; text-underline-offset: 3px; }
.host-legal-links { flex-wrap: nowrap; white-space: nowrap; }
.legal-page { max-width: 790px; }
.legal-page h2 { margin: 28px 0 8px; letter-spacing: -.03em; }
.legal-page p, .legal-page li { line-height: 1.6; }
.legal-page li + li { margin-top: 6px; }
.legal-page a { overflow-wrap: anywhere; }
.legal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; }
@media (max-width: 810px) {
  .auth-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .auth-story, .auth-panel { padding: 30px 24px; }
}
@media (max-width: 650px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-story { display: none; }
  .auth-panel { border-left: 0; padding: 28px 20px 32px; }
  .auth-guest { padding-top: 20px; margin-top: 20px; }
}
@media (max-width: 520px) {
  /* One compact row: logo left, two short links right. */
  .topbar { min-height: 56px; }
  .brand { margin-left: 16px; font-size: 20px; gap: 6px; }
  .brand img { width: 26px; height: 26px; }
  .account-link { padding: 0 12px; }
  .join-link { padding: 0 14px; gap: 0; }
  .account-link, .join-link { white-space: nowrap; }
}
@media (max-width: 380px) {
  .brand { margin-left: 12px; font-size: 18px; }
  .brand img { width: 24px; height: 24px; }
  .account-link { padding: 0 10px; }
  .join-link { padding: 0 11px; }
}
@media (min-width: 920px) and (max-height: 820px) {
  .hero-copy { padding-block: 33px; }
  .eyebrow { margin-bottom: 18px; }
  .lede { margin-bottom: 20px; }
  .hero-art img { width: min(105%, 565px); }
}

.quiz-setup { width: min(100%, 890px); padding: 32px clamp(24px, 5vw, 62px) clamp(24px, 5vw, 62px); margin: 0 auto; }
.quiz-setup h1 { font-size: 32px; line-height: 1; letter-spacing: -.04em; font-weight: 600; margin-bottom: 0; }
.quiz-setup > p { line-height: 1.45; }
.setup-questions { display: grid; gap: 16px; margin: 26px 0 16px; }
.setup-card { border: var(--line); border-radius: 10px; margin: 0; background: var(--wash); overflow: clip; }
.setup-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px clamp(12px, 3vw, 24px); cursor: pointer; list-style: none; }
.setup-summary::-webkit-details-marker { display: none; }
.setup-summary [data-question-label] { min-width: 2ch; font: 800 1rem/1.35 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.setup-summary [data-question-preview] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.setup-summary::after { content: '+'; font-size: 22px; }
.setup-card[open] > .setup-summary { border-bottom: var(--line); background: var(--lime); }
.setup-card[open] > .setup-summary::after { content: '−'; }
.setup-content { padding: 16px; margin: 0; }
.setup-card .field-label { max-width: none; margin: 0; }
.setup-card .field-label[hidden] { display: none; }
.setup-card select, .game-settings select {
  appearance: none;
  font: 600 1rem/1.2 var(--sans);
  color: var(--ink);
  border: var(--line);
  border-radius: 7px;
  height: 40px;
  padding: 0 28px 0 10px;
  background: #fff;
}
.setup-select { position: relative; display: block; min-width: 0; }
.setup-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
@supports (appearance: base-select) {
  .setup-card select, .game-settings select,
  .setup-card select::picker(select), .game-settings select::picker(select) { appearance: base-select; }
  .setup-card select, .game-settings select { align-items: center; }
  .setup-card select::picker-icon, .game-settings select::picker-icon { display: none; }
  .setup-card select::picker(select), .game-settings select::picker(select) {
    margin-block: 2px;
    border: var(--line);
    border-radius: 7px;
    padding: 4px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 4px 12px rgb(45 42 69 / 12%);
  }
  .setup-card option, .game-settings option { min-height: 36px; padding: 8px 10px; border-radius: 4px; font: 600 1rem/1.2 var(--sans); }
  .setup-card option:hover, .game-settings option:hover,
  .setup-card option:focus-visible, .game-settings option:focus-visible { background: var(--lavender-soft); }
  .setup-card option:checked, .game-settings option:checked { background: var(--lavender-soft); color: var(--violet); }
}
@media (forced-colors: active) {
  .setup-card select, .game-settings select { appearance: auto; padding-right: 10px; }
  .setup-select::after { display: none; }
}
.setup-types, .setup-answer { display: grid; align-items: end; gap: 10px; margin-bottom: 12px; }
.setup-types { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.setup-types select { width: 100%; min-width: 0; }
.setup-add { display: flex; justify-content: flex-end; margin-top: 40px; margin-bottom: 60px; }
.game-settings { margin: 22px 0 0; padding: 0; border: var(--line); border-radius: 10px; background: var(--wash); box-shadow: 4px 4px 0 var(--ink); overflow: clip; }
.game-settings-title { float: left; width: 100%; padding: 15px clamp(12px, 3vw, 24px); border-bottom: var(--line); background: var(--periwinkle); }
.game-settings-body { clear: both; display: flex; flex-wrap: wrap; align-items: end; gap: 16px 28px; padding: 16px clamp(12px, 3vw, 24px) 18px; }
.game-settings .field-label { width: 190px; max-width: 100%; margin: 0; }
.game-settings select { width: 100%; }
.quiz-order { display: flex; flex-wrap: wrap; gap: 16px 28px; min-height: 40px; align-items: center; }
.quiz-order label { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px; border: var(--line); border-radius: 7px; background: #fff; font: 600 1rem/1.2 var(--sans); cursor: pointer; }
.quiz-order label:hover { background: var(--lavender-soft); }
.quiz-order label:has(input:checked) { background: var(--lavender-soft); border-color: var(--violet); }
.quiz-order input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--violet); }
.setup-prompt { display: grid; gap: 4px; }
.setup-prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setup-ai { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; color: var(--violet); background: transparent; font-size: .875rem; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color .16s, border-color .16s; }
.setup-ai:hover:not(:disabled) { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.setup-ai:disabled { cursor: default; opacity: .4; }
.setup-ai[aria-busy="true"] svg { animation: sparkle-sway .8s ease-in-out infinite alternate; }
@keyframes sparkle-sway { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.setup-ai-status { margin: -4px 0 12px; font-size: .85rem; line-height: 1.4; }
.setup-ai-status:empty { display: none; }
.setup-card .setup-prompt, .setup-card .setup-image { margin-bottom: 12px; }
.setup-answer { grid-template-columns: minmax(0, 1fr) auto; }
.setup-correct { display: flex; align-items: center; gap: 5px; min-height: 40px; font-weight: 700; }
.setup-correct input { width: 18px; height: 18px; accent-color: var(--violet); }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; padding-top: 46px; }
.setup-actions .primary { flex: 1 1 auto; }
.setup-remove { border: 0; padding: 7px 0; background: transparent; text-decoration: underline; cursor: pointer; }
.setup-remove:disabled { display: none; }
.topic-dialog { width: min(calc(100% - 32px), 560px); max-height: calc(100dvh - 32px); padding: 0; border: var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 6px 0 var(--ink); }
.topic-dialog::backdrop { background: rgb(45 42 69 / .32); }
.topic-dialog form { padding: 24px; }
.topic-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topic-heading h2 { margin: 0; font-size: 1.8rem; letter-spacing: -.05em; }
.topic-dialog p { margin: 8px 0 18px; line-height: 1.4; }
.bulk-dialog .bulk-help { margin-top: 16px; font-size: .875rem; color: var(--muted); }
.bulk-template { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%; margin-inline: auto; }
.csv-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; margin-top: 22px; padding: 24px 16px; border: 2px dashed var(--rule); border-radius: 16px; background: linear-gradient(145deg, #fff, var(--lavender-soft)); text-align: center; cursor: pointer; transition: border-color .16s, background-color .16s; }
.csv-dropzone input[type=file] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.csv-dropzone:hover, .csv-dropzone.is-dragging { border-color: var(--violet); background: var(--lavender-soft); }
.csv-dropzone:has(input:focus-visible) { outline: 3px dashed var(--violet); outline-offset: 4px; }
.csv-dropzone:has(input:disabled) { opacity: .6; cursor: progress; }
.csv-dropzone:has(input[aria-invalid=true]) { border-color: #a33e62; }
.csv-dropzone.has-file { border-style: solid; border-color: var(--violet); }
.csv-upload-icon { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--rule); border-radius: 16px; background: #fff; color: var(--violet); box-shadow: 0 3px 0 var(--rule); }
.csv-dropzone strong { max-width: 100%; font-size: 1.05rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.csv-file-status { font-size: .8rem; color: var(--muted); }
.csv-browse { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 12px; border-radius: 8px; background: #fff; color: var(--violet); font-size: .85rem; font-weight: 700; }
.csv-clear { display: block; margin: 10px 0 0 auto; padding: 6px 0; border: 0; background: transparent; color: var(--muted); font-size: .85rem; text-decoration: underline; cursor: pointer; }
.csv-clear[hidden] { display: none; }
.bulk-replace { display: flex; align-items: start; gap: 8px; font-size: .9rem; line-height: 1.4; }
.bulk-replace[hidden] { display: none; }
.bulk-replace input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--violet); }
.bulk-dialog [type=submit] { margin-top: 16px; width: 100%; }
.donation-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.donation-actions .button { flex: 1; }
.donation-actions .button:disabled { opacity: .5; cursor: default; }
.topic-close { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: var(--line); border-radius: 50%; background: var(--paper); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.topic-close:hover { background: var(--pink); }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topic-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border: var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; transition: background-color .16s, transform .16s, box-shadow .16s; }
.topic-option:hover, .topic-option:focus-visible { background: var(--lime); transform: translateY(-2px); box-shadow: 0 3px var(--ink); }
.topic-icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: var(--violet); background: var(--lavender-soft); }
.topic-icon svg { display: block; }
.topic-option:nth-child(4n + 2) .topic-icon { background: #e7f1cf; color: #4b641f; }
.topic-option:nth-child(4n + 3) .topic-icon { background: #f9e6d4; color: #945122; }
.topic-option:nth-child(4n + 4) .topic-icon { background: #f7e0e9; color: #9b466b; }
@media (max-width: 480px) {
  .topic-grid { grid-template-columns: 1fr; }
  .topic-dialog form { padding: 18px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.question-image { display: block; max-width: 100%; max-height: 340px; object-fit: contain; border-radius: 8px; margin: 0 0 17px; }
@media (max-width: 650px) {
  .quiz-setup { padding: 32px 16px; }
  .setup-content { padding: 14px; }
}
@media (max-width: 420px) {
  .setup-actions .primary { flex-basis: 100%; }
  .game-settings .field-label { width: 100%; }
  .setup-types { grid-template-columns: minmax(0, 1fr); }
}

/* Text fields show focus by recolouring their own border, not with an extra outline. */
input:not([type="radio"]):not([type="checkbox"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--violet); }

.shell:not(:has(.landing)) .footer { display: none; }

/* Polish within the original style: the same hard-shadow lift marks what is tappable or chosen. */
.mode:has(input:checked) { box-shadow: 3px 3px 0 var(--ink); }
button.answer { transition: background-color .16s, transform .16s, box-shadow .16s; }
button.answer:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 3px var(--ink); }
.answer.selected, .answer.correct { box-shadow: 3px 3px 0 var(--ink); }
.setup-card { box-shadow: 4px 4px 0 var(--ink); }

/* Single-task screens (join, waiting, connecting, errors) sit in one centred column. */
.solo .game-main:not(:has(.question-head, #finale)) { width: min(100%, 460px); text-align: center; }
.solo .game-main:not(:has(.question-head, #finale)) .field-label { max-width: none; text-align: left; }
.solo .game-main:not(:has(.question-head, #finale)) .button { width: 100%; }

/* Share the audience window; the host's controls stay in the original tab. */
.presentation-view .top-actions, .presentation-view .footer { display: none; }
.presentation-fullscreen { margin-right: clamp(16px, 2.6vw, 40px); font-size: .875rem; }
.presentation-view .game.solo .game-main { width: min(100%, 1280px); }
.presentation-view .host-lobby .game-main { justify-content: center; padding-bottom: 40px; }
.presentation-view .host-lobby .game-side { padding-bottom: 40px; }
.presentation-view .question-title { font-size: clamp(2rem, 4vw, 4rem); }
.presentation-view .answer { min-height: 90px; padding: 18px; font-size: clamp(1.1rem, 2vw, 1.6rem); }
.presentation-view .answers { margin-block: 24px; }
.presentation-view .timer { font-size: clamp(1.5rem, 3vw, 2.5rem); }
.presentation-view .roster, .presentation-view .lobby-actions { display: none; }
.presentation-link { white-space: nowrap; }
@media (max-width: 650px) {
  .presentation-fullscreen { padding: 8px 10px; }
  .presentation-view .answer { min-height: 64px; padding: 12px; }
}
