:root {
  font-family: 'Space Grotesk', sans-serif;
  color: #1d2521;
  background: #f5f5f0;
  font-synthesis: none;
  --ink: #1d2521;
  --muted: #777e77;
  --paper: #f5f5f0;
  --line: #d9ddd6;
  --green: #bddc45;
  --red: #ed5a4d;
  --blue: #438ec6;
  --yellow: #f1bb37;
  --mint: #61aa76;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.topbar { height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(6.4vw, 24px); }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: 0; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--green); font-size: 17px; transform: rotate(-6deg); }
.brand-dot { color: #83a82c; }
.main-nav { display: flex; align-self: stretch; gap: 32px; }
.nav-button { border: 0; border-bottom: 2px solid transparent; padding: 2px 0 0; background: transparent; color: #7b827c; font-size: 13px; font-weight: 600; }
.nav-button.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.live-label, .eyebrow, .count-badge, .answers-heading > span:last-child, .players-note, .panel-bottom, .bank-heading > span, .join-step, .join-panel form > label, .join-foot, footer { font-family: var(--mono); letter-spacing: 0; }
.live-label { display: flex; gap: 8px; align-items: center; font-size: 10px; font-weight: 500; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #70ad63; box-shadow: 0 0 0 3px #70ad6322; }
main { width: min(1120px, 88vw); margin: 0 auto; }
.page-heading { padding: 56px 0 38px; display: flex; align-items: flex-end; justify-content: space-between; }
.eyebrow { margin: 0 0 12px; color: #899087; font-size: 10px; font-weight: 500; }
h1, h2, h3, p { margin-top: 0; }
.page-heading h1, .join-copy h1 { margin: 0; font-size: clamp(40px, 5vw, 60px); line-height: .99; letter-spacing: 0; font-weight: 600; }
.page-heading h1 span, .join-copy h1 span { color: #8cae31; }
.heading-note { display: flex; align-items: center; gap: 14px; margin-bottom: 5px; }
.heading-note p { margin: 0; color: #6e776f; font-size: 12px; line-height: 1.6; }
.note-line { width: 28px; height: 1px; background: #8cae31; }
.host-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr); border: 1px solid var(--line); min-height: 630px; }
.editor-panel { padding: 29px 32px 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; font-size: 22px; font-weight: 600; }
.count-badge { font-size: 9px; padding: 7px 9px; border: 1px solid var(--line); color: #687068; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
#prompt { width: 100%; min-height: 74px; resize: vertical; border: 1px solid var(--line); background: #fbfbf8; padding: 13px 14px; outline: none; font-size: 13px; }
#prompt:focus, .answer-input:focus-within, .join-panel input:focus { border-color: #839e42; box-shadow: 0 0 0 2px #bddc4533; }
#prompt::placeholder, .answer-input input::placeholder { color: #a5aaa3; }
.answers-heading { margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.answers-heading .field-label { margin: 0; }
.answers-heading > span:last-child, .bank-heading > span { color: #989e96; font-size: 8px; }
.answer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.answer-input { min-width: 0; height: 45px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #fbfbf8; padding: 0 10px; transition: box-shadow .15s; }
.answer-input > input[type=radio] { accent-color: #526d32; margin: 0; width: 12px; height: 12px; cursor: pointer; }
.answer-shape { width: 21px; height: 21px; display: grid; place-items: center; color: white; font-size: 10px; font-weight: 700; background: var(--red); }
.answer-blue .answer-shape { background: var(--blue); border-radius: 50%; }
.answer-yellow .answer-shape { background: var(--yellow); color: #342a10; transform: rotate(45deg) scale(.86); }
.answer-green .answer-shape { background: var(--mint); border-radius: 2px; transform: rotate(45deg) scale(.82); }
.answer-yellow .answer-shape, .answer-green .answer-shape { font-size: 9px; }
.answer-input input[type=text], .answer-input input:not([type]) { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.form-footer { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.form-hint { color: #8b928a; font-size: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; border: 0; padding: 0 15px; font-size: 11px; font-weight: 600; transition: transform .16s, background .16s; }
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: white; }
.button-dark span { color: var(--green); font-size: 17px; line-height: 0; }
.button-accent { background: var(--green); color: var(--ink); }
.button-accent:hover { background: #c8e959; }
.form-error { color: #b44339; min-height: 15px; font-size: 11px; margin: 8px 0 0; }
.question-bank { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 16px; }
.bank-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bank-heading h3 { font-size: 13px; margin: 0; }
.question-list { max-height: 190px; overflow-y: auto; }
.empty-bank { padding: 19px 10px; text-align: center; color: #8b928a; font-size: 11px; border: 1px dashed var(--line); }
.question-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; border-top: 1px solid #e6e8e2; padding: 10px 0; }
.question-number { font-family: var(--mono); font-size: 10px; color: #8e9689; }
.question-summary { min-width: 0; }
.question-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.question-summary span { display: block; color: #8b928a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; font-size: 9px; }
.delete-question { width: 28px; height: 28px; border: 0; color: #8c938b; background: transparent; font-size: 17px; }
.delete-question:hover { color: #bd433a; }
.game-panel { position: relative; background: #202b26; color: #f5f5f0; padding: 29px 28px 20px; display: flex; flex-direction: column; overflow: hidden; }
.game-panel::after { content: ''; position: absolute; width: 230px; height: 230px; right: -128px; top: 125px; border: 1px solid #ffffff12; border-radius: 50%; box-shadow: 0 0 0 26px #ffffff08, 0 0 0 52px #ffffff05; pointer-events: none; }
.game-panel-top { display: flex; justify-content: space-between; align-items: center; }
.game-panel-top .eyebrow { color: #9da99e; }
.spark-mark { color: var(--green); font-size: 20px; }
.host-idle { position: relative; z-index: 1; margin: auto 0; padding: 28px 0 50px; }
.host-idle h2 { font-size: 36px; line-height: 1.05; font-weight: 500; letter-spacing: 0; margin: 0 0 16px; }
.host-idle p { color: #afb8b0; font-size: 12px; line-height: 1.75; max-width: 265px; margin-bottom: 23px; }
.host-idle .button { min-height: 47px; font-size: 12px; }
.host-idle .button span { font-size: 17px; }
.players-note { display: block; margin-top: 17px; color: #8b9a8e; font-size: 8px; }
.panel-bottom { position: relative; z-index: 1; margin-top: auto; padding-top: 17px; border-top: 1px solid #ffffff20; display: flex; justify-content: space-between; color: #8d9a90; font-size: 8px; }
.panel-index { color: var(--green); }
.host-room { position: relative; z-index: 1; margin: auto 0; padding: 22px 0 38px; }
.room-label { color: #aab7ad; font-family: var(--mono); font-size: 9px; }
.room-code { font-family: var(--mono); font-size: 49px; font-weight: 500; letter-spacing: 0; color: var(--green); line-height: 1.2; margin: 8px 0 6px; }
.room-instruction { color: #c0c8c1; font-size: 11px; margin: 0 0 21px; }
.player-count { border-top: 1px solid #ffffff25; border-bottom: 1px solid #ffffff25; padding: 12px 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; }
.player-count strong { color: var(--green); font-weight: 500; }
.room-players { min-height: 52px; max-height: 145px; overflow-y: auto; padding: 8px 0; }
.room-player { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 11px; color: #e2e7e1; }
.player-avatar { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink); background: #dce3d9; font-size: 9px; font-weight: 700; }
.room-start { width: 100%; margin-top: 13px; min-height: 46px; }
.room-start:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.host-question { padding: 18px 0; }
.host-progress { font-family: var(--mono); font-size: 9px; color: #adbaae; }
.host-progress-row { display: flex; justify-content: space-between; align-items: center; }
.game-timer { font-family: var(--mono); font-size: 10px; color: #d3e99a; }
.host-prompt { font-size: 23px; line-height: 1.22; margin: 12px 0 18px; }
.host-answer { padding: 9px; margin: 6px 0; color: #1d2521; background: #ffffffed; font-size: 10px; }
.host-answer.is-correct { background: var(--green); }
.host-status { color: #c0c8c1; font-size: 10px; margin: 15px 0 0; }
.join-view { min-height: calc(100vh - 140px); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12%; position: relative; }
.join-copy { position: relative; padding: 30px 0 70px; }
.join-copy .eyebrow { margin-bottom: 19px; }
.join-copy h1 { font-size: clamp(56px, 7vw, 82px); }
.join-copy > p:last-of-type { max-width: 300px; margin-top: 22px; color: #737b73; font-size: 13px; line-height: 1.7; }
.join-decoration { position: absolute; right: 10%; top: 20%; width: 142px; height: 142px; border: 1px solid #ccd3c5; border-radius: 50%; display: grid; place-items: center; transform: rotate(13deg); }
.join-decoration::before, .join-decoration::after { content: ''; position: absolute; border: 1px solid #d9ddd6; border-radius: 50%; inset: 12px -12px; transform: rotate(52deg); }
.join-decoration::after { inset: -12px 22px; transform: rotate(-38deg); }
.join-decoration span { font-size: 62px; font-weight: 500; color: #91ad3e; transform: rotate(-13deg); }
.join-decoration i, .join-decoration b { position: absolute; width: 10px; height: 10px; background: var(--red); border-radius: 50%; top: 6px; left: 38px; }
.join-decoration b { background: var(--blue); top: auto; left: auto; bottom: 5px; right: 31px; width: 8px; height: 8px; }
.join-panel { border: 1px solid var(--line); background: #fafaf6; padding: 32px 34px 24px; max-width: 400px; width: 100%; justify-self: end; }
.join-step { display: flex; justify-content: space-between; color: #899187; font-size: 9px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.join-panel h2 { margin: 24px 0 6px; font-size: 25px; }
.join-panel > p { margin: 0 0 22px; color: #798078; font-size: 11px; line-height: 1.6; }
.join-panel form > label { display: block; font-size: 9px; color: #798078; margin: 17px 0 7px; }
.join-panel input { outline: 0; width: 100%; height: 44px; border: 1px solid var(--line); background: #fff; padding: 0 12px; }
.join-panel .code-input { height: 59px; font-family: var(--mono); font-size: 25px; letter-spacing: 0; }
.join-panel .code-input::placeholder { color: #c0c5bd; }
.join-panel .name-input { font-size: 12px; }
.join-submit { width: 100%; min-height: 47px; margin-top: 22px; justify-content: space-between; padding: 0 15px; }
.join-submit span { font-size: 18px; }
.join-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: #899187; font-size: 8px; display: flex; gap: 9px; align-items: center; }
.player-game { grid-column: 1 / -1; width: min(700px, 100%); justify-self: center; margin: 54px 0; padding: 28px; border: 1px solid var(--line); background: #fafaf6; }
.player-game .game-topline { display: flex; justify-content: space-between; color: #858d84; font-family: var(--mono); font-size: 10px; }
.player-game h2 { font-size: 30px; line-height: 1.2; margin: 22px 0; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player-answer { min-height: 70px; border: 0; color: white; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.player-answer:nth-child(1) { background: var(--red); }
.player-answer:nth-child(2) { background: var(--blue); }
.player-answer:nth-child(3) { background: #d4a11e; color: #1d2521; }
.player-answer:nth-child(4) { background: var(--mint); }
.player-answer:disabled { opacity: .62; cursor: default; }
.player-answer.is-selected { outline: 3px solid var(--ink); outline-offset: 2px; opacity: 1; }
.player-answer.is-correct { outline: 3px solid #476525; outline-offset: 2px; }
.player-answer.is-wrong { opacity: .42; }
.answer-letter { font-family: var(--mono); font-size: 10px; opacity: .8; }
.game-feedback { margin: 16px 0 0; color: #69756a; font-size: 12px; }
.waiting-state { text-align: center; padding: 43px 16px; }
.waiting-state .waiting-icon { margin: 0 auto 19px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #e8efd3; color: #67812d; font-size: 25px; }
.waiting-state h2 { margin: 0 0 8px; font-size: 23px; }
.waiting-state p { margin: 0; color: #798078; font-size: 12px; }
.player-score { font-family: var(--mono); color: #6c842e; font-size: 12px; }
.scoreboard { display: grid; gap: 8px; margin-top: 18px; }
.score-row { display: flex; justify-content: space-between; padding: 10px 12px; background: #f0f1e9; font-size: 12px; }
.score-row:first-child { background: #eaf1d3; font-weight: 700; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 12px); background: var(--ink); color: white; padding: 12px 18px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
footer { width: min(1120px, 88vw); margin: 35px auto 0; border-top: 1px solid var(--line); padding: 16px 0 22px; display: flex; justify-content: space-between; color: #92998f; font-size: 8px; }

@media (max-width: 760px) {
  .topbar { height: 65px; padding: 0 20px; }
  .brand { font-size: 17px; }
  .main-nav { gap: 17px; }
  .nav-button { font-size: 11px; }
  .live-label { display: none; }
  main { width: min(100% - 36px, 560px); }
  .page-heading { padding: 38px 0 26px; }
  .page-heading h1 { font-size: 43px; }
  .heading-note { display: none; }
  .host-layout { grid-template-columns: 1fr; }
  .editor-panel { padding: 23px 20px; }
  .game-panel { min-height: 350px; padding: 22px 22px 17px; }
  .host-idle { padding: 25px 0 35px; }
  .host-idle h2 { font-size: 31px; }
  .answer-fields { gap: 7px; }
  .answer-input { padding: 0 7px; gap: 7px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .button-dark { align-self: stretch; }
  .join-view { grid-template-columns: 1fr; gap: 0; align-content: start; padding-top: 35px; }
  .join-copy { padding: 15px 0 20px; }
  .join-copy h1 { font-size: 58px; }
  .join-copy > p:last-of-type { max-width: 240px; margin-top: 12px; font-size: 12px; }
  .join-decoration { width: 95px; height: 95px; top: 20px; right: 7px; }
  .join-decoration span { font-size: 44px; }
  .join-panel { justify-self: stretch; max-width: none; padding: 24px 21px 20px; }
  .player-game { margin: 15px 0 30px; padding: 21px 16px; }
  .player-game h2 { font-size: 24px; }
  .player-answer { min-height: 63px; padding: 9px; font-size: 11px; gap: 7px; }
  footer { width: calc(100% - 36px); margin-top: 24px; }
}

@media (max-width: 380px) {
  .topbar { padding: 0 13px; }
  .main-nav { gap: 12px; }
  main { width: calc(100% - 26px); }
  .section-heading h2 { font-size: 20px; }
  .answer-input { gap: 5px; padding: 0 5px; }
  .answer-input input:not([type=radio]) { font-size: 10px; }
  .answer-shape { width: 18px; height: 18px; }
}