/* Askroom. Colours, fonts and radii come from /theme.css (Aurora or The Majlis of AI); this sheet lays out the tool. */
:root { --margin: 64px; }
@media (max-width: 640px) { :root { --margin: 16px; } }

/* Aurora: display in Bricolage at 400, labels in JetBrains Mono, which runs wider, so buttons are a size smaller */
[data-brand="aurora"] .display-l { font-weight: 400; letter-spacing: -0.01em; }
[data-brand="aurora"] .btn { font-size: 13px; }
[data-brand="aurora"] .card.poche { border-color: var(--surface-200); }
/* The one primary action carries the signal */
[data-brand="aurora"] .btn.primary { background: var(--redline); border-color: var(--redline); color: var(--on-redline); }
[data-brand="aurora"] .btn.primary:hover { background: #7ce8b4; border-color: #7ce8b4; }
[data-brand="aurora"] .qr .code { border-radius: var(--radius-panel); }
/* Bands, not accent borders: the hint is a filled band; the status stamp is an annotation, so the button keeps the signal */
[data-brand="aurora"] .card.hint { border: 1px solid var(--surface-200); background: var(--surface-200); }
[data-brand="aurora"] .stamp { color: var(--kicker); border-color: var(--kicker); border-radius: var(--radius); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/26px var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* type */
.kicker, .label, .btn, .stamp, .tag {
  font-family: var(--font-cond);
  font-weight: 600;
  text-transform: uppercase;
}
.kicker { font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--kicker); }
.kicker.focal { color: var(--focal-text); display: inline-flex; align-items: center; gap: 8px; }
.kicker.focal::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--redline); }
.display-l, .display-m, .numeral { font-family: var(--font-display); }
.display-l { font-weight: 300; font-size: 48px; line-height: 56px; letter-spacing: -0.02em; }
.display-m { font-weight: 400; font-size: 32px; line-height: 40px; }
.heading { font-weight: 500; font-size: 20px; line-height: 28px; }
.numeral { font-weight: 300; font-size: 64px; line-height: 64px; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.caption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
@media (max-width: 640px) {
  .display-l { font-size: 32px; line-height: 40px; }
  .numeral { font-size: 48px; line-height: 48px; }
}

/* sheet */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--margin) 96px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 0; margin-bottom: 48px; border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.top-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tag { font-size: 13px; line-height: 16px; letter-spacing: 0.06em; border: 1px solid var(--ink); padding: 4px 8px; }
.chip { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; }
@media (max-width: 640px) { .chip a { display: none; } }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }
@media (max-width: 1023px) { .grid { grid-template-columns: repeat(8, 1fr); } .span-8, .span-4 { grid-column: span 8; } }

.card { background: var(--surface-100); border: 1px solid var(--hairline); border-radius: var(--radius-panel); padding: 24px; }
.card.poche { background: var(--surface-200); border-color: var(--surface-200); }
.card > .kicker { display: block; margin-bottom: 8px; }

/* controls */
.btn {
  font-size: 15px; line-height: 20px; letter-spacing: 0.06em;
  border: 1px solid var(--border); background: var(--surface-100); color: var(--ink);
  border-radius: var(--radius); padding: 12px 24px; cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.btn:hover { background: var(--surface-200); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink-muted); border-color: var(--ink-muted); }
.btn.small { padding: 4px 12px; font-size: 13px; line-height: 16px; }
.btn.text { border-color: transparent; background: none; padding-left: 8px; padding-right: 8px; }
.btn.text:hover { text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 48px; }

.label { display: block; font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 8px; }
input[type=text], textarea {
  width: 100%; background: var(--surface-100); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px;
}
input[type=text]::placeholder, textarea::placeholder { color: var(--ink-muted); }
textarea { resize: vertical; min-height: 96px; font-size: 20px; line-height: 28px; font-weight: 300; }
.err { color: var(--ink); font-size: 14px; line-height: 22px; min-height: 22px; margin-top: 8px; }
.err:not(:empty)::before { content: "! "; color: var(--redline); font-weight: 600; }

/* landing */
.hero { padding: 48px 0; }
.hero .display-l { margin: 16px 0 24px; max-width: 16ch; }
.hero .lede { max-width: 56ch; color: var(--ink-muted); font-size: 20px; line-height: 28px; font-weight: 300; margin-bottom: 48px; }
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 96px 0 0; border-top: 1px solid var(--ink); }
.steps li { flex: 1; padding: 24px 24px 0 0; position: relative; }
.steps .num {
  position: absolute; top: -17px; left: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-100); border: 1px solid var(--ink);
  font-family: var(--font-cond); font-weight: 600; font-size: 14px;
}
.steps li.active .num { border-color: var(--redline); background: var(--redline); color: var(--on-redline); }
.steps .label { color: var(--ink); margin: 16px 0 4px; }
.steps p { font-size: 14px; line-height: 22px; color: var(--ink-muted); max-width: 30ch; }
@media (max-width: 640px) { .steps { flex-direction: column; border-top: 0; border-left: 1px solid var(--ink); margin-left: 16px; } .steps li { padding: 0 0 32px 32px; } .steps .num { left: -17px; top: 0; } .steps .label { margin-top: 4px; } }

/* setup */
.opt-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.opt-row .idx { width: 24px; text-align: center; color: var(--ink-muted); font-family: var(--font-cond); font-weight: 600; }
.opt-row .x { border: 0; background: none; color: var(--ink-muted); font-size: 22px; cursor: pointer; padding: 0 8px; }
.opt-row .x:hover { color: var(--ink); }
.qr { text-align: center; }
.qr .code { background: #fff; padding: 12px; display: inline-block; border: 1px solid var(--hairline); }
.qr img { display: block; width: 224px; height: 224px; }
.qr .url { word-break: break-all; font-family: var(--font-mono); font-size: 12px; line-height: 16px; margin: 16px 0 8px; }

.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
@media (max-width: 640px) { .types { grid-template-columns: repeat(2, 1fr); } }
.type-btn {
  text-align: left; background: var(--surface-100); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.type-btn:hover { border-color: var(--border); }
.type-btn[aria-checked="true"] { border: 3px solid var(--ink); padding: 10px; }
.type-btn .label { margin: 0; color: var(--ink); }
.type-btn small { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.opt-row .ok {
  border: 1px solid var(--hairline); background: none; border-radius: var(--radius); cursor: pointer; padding: 0 8px; height: 46px;
  font-family: var(--font-cond); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap;
}
.opt-row .ok[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.field-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.side { display: flex; flex-direction: column; gap: 24px; }
.deck-title { margin-bottom: 16px; }
.deck-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.deck-list li { display: flex; align-items: stretch; border-bottom: 1px solid var(--hairline); }
.deck-list .pick {
  display: flex; gap: 8px; flex: 1; min-width: 0; text-align: left; background: none; border: 0;
  padding: 8px 4px; font: 14px/20px var(--font); color: var(--ink);
}
.deck-list button.pick { cursor: pointer; }
.deck-list button.pick:hover { background: var(--surface-200); }
.deck-list .pick[aria-current="true"] { box-shadow: inset 3px 0 0 var(--ink); padding-left: 8px; }
.deck-list .pick.used { color: var(--ink-muted); }
.deck-list .x { flex: none; border: 0; background: none; color: var(--ink-muted); font-size: 20px; cursor: pointer; padding: 0 8px; }
.deck-list .x:hover { color: var(--ink); background: var(--surface-200); }
.deck-undo { margin-bottom: 8px; }
.deck-review { margin-top: 16px; max-width: 720px; }
.deck-review summary { cursor: pointer; font-size: 14px; line-height: 22px; margin-bottom: 8px; }
.deck-review .deck-list { background: var(--surface-100); }
.deck-list .idx { flex: none; width: 20px; color: var(--ink-muted); font-family: var(--font-cond); font-weight: 600; }
.deck-list small { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.deck-warn { margin: 16px 0 0; padding-left: 16px; }
.up-next { margin-top: 16px; }
.deck-line { margin-top: 16px; max-width: 64ch; }
.deck-line b { font-weight: 600; color: var(--ink); }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
select.input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-100);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px;
}

/* chart view toggle */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); margin-left: auto; }
.seg button {
  border: 0; background: none; padding: 4px 12px; cursor: pointer;
  font-family: var(--font-cond); font-weight: 600; font-size: 13px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chart svg { display: block; overflow: visible; }

/* results */
.q-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.stamp { font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--focal-text); border: 1.5px solid var(--focal-text); padding: 4px 8px; }
.stamp.closed { color: var(--ink-muted); border-color: var(--ink-muted); }
.q-title { margin-bottom: 48px; max-width: 24ch; }
.result { margin-bottom: 24px; }
.result .row { display: flex; justify-content: space-between; gap: 16px; font-size: 20px; line-height: 28px; font-weight: 500; margin-bottom: 8px; }
.result .row .n { font-variant-numeric: tabular-nums; color: var(--ink-muted); font-weight: 400; white-space: nowrap; }
.track { background: var(--surface-200); height: 32px; }
.fill { height: 100%; background: var(--ink); transition: width 240ms ease-out; }
.result.lead .fill { background: var(--redline); }
.result.lead .row span:first-child { color: var(--lead-text); }
.stat .numeral { margin: 16px 0 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.overlay { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.72); display: grid; place-items: center; z-index: 10; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay .card { text-align: center; max-width: 480px; width: 100%; }
.overlay img { width: min(70vw, 384px); height: auto; background: #fff; padding: 16px; }
.overlay .url { font-family: var(--font-mono); font-size: 14px; margin: 16px 0 24px; word-break: break-all; }

/* audience */
.join { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.join .topbar { margin-bottom: 32px; padding: 16px 0; }
.join h1 { margin: 8px 0 32px; font-weight: 300; font-size: 32px; line-height: 40px; }
.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; margin-bottom: 12px; padding: 16px 20px;
  background: var(--surface-100); border: 1px solid var(--border); border-radius: var(--radius); font-size: 18px; line-height: 26px; cursor: pointer;
}
.choice::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); }
.choice.sel { border: 3px solid var(--redline); padding: 14px 18px; font-weight: 500; }
.choice.sel::before { background: var(--redline); border-color: var(--redline); }
.choice.multi::before { border-radius: var(--radius); }
.join .btn.primary { width: 100%; margin-top: 16px; }
.join .btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.word-form { display: flex; gap: 8px; }
.word-form input { flex: 1; font-size: 18px; }
.word-form .btn.primary { width: auto; margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips span { border: 1px solid var(--ink); padding: 4px 12px; font-size: 16px; }
.statement { margin-bottom: 28px; }
.statement p { font-weight: 500; margin-bottom: 8px; }
.scale-btns { display: flex; gap: 4px; }
.scale-btns button {
  flex: 1; min-width: 0; height: 48px; background: var(--surface-100); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.scale-btns button.sel { background: var(--redline); border-color: var(--redline); color: var(--on-redline); font-weight: 600; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-muted); margin-top: 4px; }
.rank-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface-100); border: 1px solid var(--border); border-radius: var(--radius);
}
.rank-row .pos { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.rank-row:first-child .pos { background: var(--redline); border-color: var(--redline); color: var(--on-redline); }
.rank-row .txt { flex: 1; font-size: 17px; }
.rank-row button { width: 40px; height: 40px; border: 1px solid var(--hairline); background: none; border-radius: var(--radius); cursor: pointer; font-size: 18px; color: var(--ink); }
.rank-row button:disabled { opacity: 0.3; cursor: default; }
.note { font-size: 14px; line-height: 22px; color: var(--ink-muted); margin-top: 16px; }
.center { text-align: center; padding: 64px 0; }
.center .display-m { margin: 16px 0 8px; }

/* typed join code */
.room-code { font-family: var(--font-mono); font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: 0.12em; margin: 4px 0 12px; }
.overlay .room-code { font-size: 48px; line-height: 56px; margin-bottom: 24px; }
.qr .present { margin-top: 8px; }
.join-code { display: flex; gap: 8px; max-width: 360px; margin: 32px auto 0; }
.join-code input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 24px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }
.join .join-code .btn.primary { width: auto; margin-top: 0; }

/* reactions */
.react-toggle { margin-top: 0; }
.react-toggle[hidden] { display: none; }
.react-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--page); border-top: 1px solid var(--hairline);
}
.react-bar[hidden] { display: none; }
.react-bar button {
  width: 52px; height: 52px; font-size: 26px; line-height: 1; border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--surface-100); cursor: pointer; touch-action: manipulation;
}
.react-bar button:disabled { opacity: 0.5; cursor: default; }
.react-bar button.pop { animation: react-pop 300ms ease-out; }
.has-reacts .join { padding-bottom: 112px; }
@keyframes react-pop { 50% { transform: scale(1.3); } }
.react-floats { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
.react-float {
  position: absolute; bottom: 16px; font-size: 40px; line-height: 1; opacity: 0;
  animation: react-rise 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
@keyframes react-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 1; transform: translateY(-5vh) scale(1.1); }
  100% { opacity: 0; transform: translateY(-40vh) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .react-bar button.pop { animation: none; }
  .react-float { animation-name: react-fade; animation-timing-function: ease-in-out; }
  @keyframes react-fade { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 1; } }
}

/* hint: a quote from the course notes under the question, on the main screen and the phones */
.card.hint { border-left: 4px solid var(--redline); margin-top: 32px; }
.hint blockquote { margin: 0; font-size: 20px; line-height: 30px; font-weight: 300; }
.hint blockquote::before { content: "“"; }
.hint blockquote::after { content: "”"; }
.hint cite { display: block; margin-top: 12px; font-style: normal; font-family: var(--font-mono); font-size: 13px; line-height: 18px; color: var(--ink-muted); word-break: break-word; }
.join .card.hint { margin-top: 24px; padding: 16px 20px; }
.join .hint blockquote { font-size: 16px; line-height: 24px; }
.hint-input { min-height: 72px; font-size: 16px; line-height: 24px; }
