/* Hallmark · shape: app screen · genre: modern-minimal · theme: Microsoft (by request) · redesign: restyle
 * nav: kept (top bar, editor bar, live control row) · signature: the projector's answer tiles and the lobby PIN card · states: lobby, empty lobby, expired lobby, question, reveal, leaderboard, podium, editor problems, empty Home, empty Library, empty Reports · microsoft: fluent
 * axes: light/grotesk-sans/cool · posture: restrained · contrast: pass · v2.0.0 · brand: Microsoft (spec 2026-10-27), Fluent 2 tokens; no Microsoft logo (QuizCraft keeps its own name and mark, FR-66)
 * copy: verbatim (every string is spec v3.1 text, checked by the acceptance suite) */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V3 · weakest: V, a restyle keeps the frames' layout on purpose; the variety comes from the projector stage (brand blue for lobby, countdown, leaderboard and podium, a white Fluent canvas for questions) instead of a new composition */
/* Hallmark · kept "{players} players · {x}% correct · {date}" (H10d) and "{n} questions · Edited {date}" (H02) · 63 names the middle dots; FR-4 and FR-63 fix these strings, so changing them is a spec change for the owner */
/* Hallmark · waive 23 · H05, H06, H08l, H09, P03, P04, P06o and P07 in docs/design/FRAMES.md ask for a full-bleed accent background · a presentation surface seen across a room, not a work area */
/* Hallmark · waive 39b · .question-select is the H03 list row (two lines and a thumbnail, min 64 px); .player-answer and .player-puzzle-item are the P05 tiles · each Question row of the editor and each answer tile of a phone Question screen is a touch target sized by the frames, not a toolbar control */
/* Hallmark · waive 72 · .answer-row .answer-letter is the H03 answer block of DESIGN_SYSTEM.md · a full-height colour block at the left edge of its field by design; the input beside it has its own padding */
/* Hallmark · answered F1 · straight apostrophes are spec text (copy: verbatim; "Don't use your real name." and the like are checked word for word) · answered 49 · the H03a menu rows are a title over a description by design · answered F23 · app screens behind sign-in and a join page, no link previews · answered F7 · .puzzle-row takes the input recipe on purpose: each H03g puzzle item is one Fluent field holding its handle, number and move buttons */
/* Hallmark · finish-review: subagent · 8 findings · 7 resolved 1 partial (6: below 40rem the library table scrolls inside its card with edge shadows instead of stacking rows, to keep it a table) · gap: none */
/* Hallmark · dismissed 73 · H03a and H03i are frames with a modal dialog open; in the app the dialog sits in the top layer over a scrim (checked in the browser captures), so the page text under it is meant to be covered */
/* Hallmark · dismissed kept · each capture makes new quiz ids, PINs, scores and times; the forms, fields, handlers and link patterns of the HTML are unchanged (H01 and the rest diffed) */
/* tokens.css and base.css load first, as <link> elements (an @import makes axe-core inject a <style> that the CSP blocks) */

:root {
  /* QuizCraft tokens on the Fluent 2 palette (docs/DESIGN_SYSTEM.md). */
  --qc-bg: var(--color-paper);
  --qc-surface: var(--color-paper-2);
  --qc-well: var(--color-paper-3);
  --qc-border: var(--color-rule);
  --qc-border-strong: var(--color-rule-2);
  --qc-border-accessible: var(--color-muted);
  --qc-border-field: #8a8a8a;
  --qc-ink: var(--color-ink);
  --qc-ink-2: var(--color-ink-2);
  --qc-muted: var(--color-muted);
  --qc-accent: var(--color-accent);
  --qc-accent-hover: var(--color-accent-hover);
  --qc-accent-press: var(--color-accent-press);
  --qc-accent-text: #115ea3;
  --qc-accent-soft: #ebf3fc;
  --qc-accent-soft-hover: #cfe4fa;
  --qc-on-accent: #ffffff;
  --qc-white: #ffffff;
  --qc-stage: #0f6cbd;
  --qc-stage-deep: #0f548c;
  --qc-stage-line: rgb(255 255 255 / 0.4);
  --qc-stage-hover: #115ea3;
  --qc-stage-press: #0c3b5e;
  --qc-stage-tint: rgb(255 255 255 / 0.14);
  --qc-stage-tint-press: rgb(255 255 255 / 0.24);
  --qc-danger: #c50f1f;
  --qc-danger-hover: #a80e1b;
  --qc-danger-press: #8e0c17;
  --qc-success: #107c10;
  --qc-success-soft: #f1faf1;
  --qc-timeout: #616161;
  --qc-streak: #92400e;
  --qc-streak-soft: #fef3c7;
  --qc-subtle-hover: #f5f5f5;
  --qc-subtle-press: #e0e0e0;
  --qc-scrim: rgb(0 0 0 / 0.4);
  --qc-edge-shadow: rgb(0 0 0 / 0.16);
  --qc-shadow-2: 0 0 2px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.14);
  --qc-shadow-4: 0 0 2px rgb(0 0 0 / 0.12), 0 2px 4px rgb(0 0 0 / 0.14);
  --qc-shadow-8: 0 0 2px rgb(0 0 0 / 0.12), 0 4px 8px rgb(0 0 0 / 0.14);
  --qc-shadow-16: 0 0 2px rgb(0 0 0 / 0.12), 0 8px 16px rgb(0 0 0 / 0.14);
  --qc-shadow-28: 0 0 8px rgb(0 0 0 / 0.12), 0 14px 28px rgb(0 0 0 / 0.14);
  --qc-shadow-64: 0 0 8px rgb(0 0 0 / 0.12), 0 32px 64px rgb(0 0 0 / 0.14);
  /* the six answer colors are fixed by FR-66 */
  --qc-answer-1: #c2410c; --qc-answer-1-ink: #ffffff;
  --qc-answer-2: #0f766e; --qc-answer-2-ink: #ffffff;
  --qc-answer-3: #f5b301; --qc-answer-3-ink: #1a1a1a;
  --qc-answer-4: #be185d; --qc-answer-4-ink: #ffffff;
  --qc-answer-5: #4d7c0f; --qc-answer-5-ink: #ffffff;
  --qc-answer-6: #0369a1; --qc-answer-6-ink: #ffffff;
  --qc-radius-control: var(--radius-control);
  --qc-radius-card: var(--radius-card);
  --qc-radius-tile: 12px;
  --qc-radius-pill: var(--radius-pill);
  --qc-control: 40px;
  --qc-control-sm: 32px;
  --qc-control-phone: 48px;
  --qc-type-caption: 0.75rem;
  --qc-type-small: 0.875rem;
  --qc-type-body: 1rem;
  --qc-type-subtitle: 1.25rem;
  --qc-type-title3: 1.5rem;
  --qc-type-title2: 1.75rem;
  --qc-type-title1: 2rem;
  --qc-type-large: 2.5rem;
  --qc-type-display: 4rem;
  --qc-type-question: 2.75rem;
  --qc-type-answer: 1.875rem;
  --qc-type-pin: 6.5rem;
  --qc-type-letter: 4rem;
  --qc-icon: 1.25rem;
}

/* ---------- base ---------- */
body { font-size: var(--qc-type-body); line-height: 1.5; }
h1, h2, h3 { max-width: none; }
a { color: var(--qc-accent-text); }
a:hover { color: var(--qc-accent-press); }
a:active { color: var(--qc-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }
.icon { flex: 0 0 auto; display: inline-block; width: var(--qc-icon); height: var(--qc-icon); background-color: currentColor; mask: var(--icon) center / contain no-repeat; vertical-align: middle; }
.i-home { --icon: url("/icons/fluent/home-24-regular.svg"); }
.i-library { --icon: url("/icons/fluent/library-24-regular.svg"); }
.i-data-bar-vertical { --icon: url("/icons/fluent/data-bar-vertical-24-regular.svg"); }
.i-add { --icon: url("/icons/fluent/add-24-regular.svg"); }
.i-sign-out { --icon: url("/icons/fluent/sign-out-24-regular.svg"); }
.i-arrow-left { --icon: url("/icons/fluent/arrow-left-24-regular.svg"); }
.i-arrow-right { --icon: url("/icons/fluent/arrow-right-24-regular.svg"); }
.i-arrow-up { --icon: url("/icons/fluent/arrow-up-24-regular.svg"); }
.i-arrow-down { --icon: url("/icons/fluent/arrow-down-24-regular.svg"); }
.i-arrow-upload { --icon: url("/icons/fluent/arrow-upload-24-regular.svg"); }
.i-arrow-download { --icon: url("/icons/fluent/arrow-download-24-regular.svg"); }
.i-arrow-reset { --icon: url("/icons/fluent/arrow-reset-24-regular.svg"); }
.i-save { --icon: url("/icons/fluent/save-24-regular.svg"); }
.i-delete { --icon: url("/icons/fluent/delete-24-regular.svg"); }
.i-copy { --icon: url("/icons/fluent/copy-24-regular.svg"); }
.i-edit { --icon: url("/icons/fluent/edit-24-regular.svg"); }
.i-image-add { --icon: url("/icons/fluent/image-add-24-regular.svg"); }
.i-re-order { --icon: url("/icons/fluent/re-order-dots-vertical-24-regular.svg"); }
.i-checkmark { --icon: url("/icons/fluent/checkmark-24-regular.svg"); }
.i-checkmark-circle { --icon: url("/icons/fluent/checkmark-circle-24-regular.svg"); }
.i-dismiss { --icon: url("/icons/fluent/dismiss-24-regular.svg"); }
.i-dismiss-circle { --icon: url("/icons/fluent/dismiss-circle-24-regular.svg"); }
.i-error-circle { --icon: url("/icons/fluent/error-circle-24-regular.svg"); }
.i-document-table { --icon: url("/icons/fluent/document-table-24-regular.svg"); }
.i-settings { --icon: url("/icons/fluent/settings-24-regular.svg"); }
.i-speaker-2 { --icon: url("/icons/fluent/speaker-2-24-regular.svg"); }
.i-speaker-mute { --icon: url("/icons/fluent/speaker-mute-24-regular.svg"); }
.i-full-screen-maximize { --icon: url("/icons/fluent/full-screen-maximize-24-regular.svg"); }
.i-lock-closed { --icon: url("/icons/fluent/lock-closed-24-regular.svg"); }
.i-lock-open { --icon: url("/icons/fluent/lock-open-24-regular.svg"); }
.i-play { --icon: url("/icons/fluent/play-24-regular.svg"); }
.i-people { --icon: url("/icons/fluent/people-24-regular.svg"); }
.i-clock { --icon: url("/icons/fluent/clock-24-regular.svg"); }
.i-fire { --icon: url("/icons/fluent/fire-24-regular.svg"); }
.i-trophy { --icon: url("/icons/fluent/trophy-24-regular.svg"); }
.i-keyboard { --icon: url("/icons/fluent/keyboard-24-regular.svg"); }
.i-send { --icon: url("/icons/fluent/send-24-regular.svg"); }
.i-quiz { --icon: url("/icons/fluent/text-bullet-list-square-24-regular.svg"); }
.i-true-false { --icon: url("/icons/fluent/toggle-left-24-regular.svg"); }
.i-type-answer { --icon: url("/icons/fluent/text-field-24-regular.svg"); }
.i-slider { --icon: url("/icons/fluent/slide-size-24-regular.svg"); }
.i-puzzle { --icon: url("/icons/fluent/puzzle-piece-24-regular.svg"); }
.i-poll { --icon: url("/icons/fluent/poll-24-regular.svg"); }

/* ---------- controls: Fluent 2 buttons, inputs, switches, segments, dialogs ---------- */
.button { min-height: var(--qc-control); padding: 0 var(--space-md); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); border: 1px solid var(--qc-border-strong); border-radius: var(--qc-radius-control); background: var(--qc-bg); color: var(--qc-ink); font: 600 var(--qc-type-small)/1.25 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.button:hover { border-color: var(--qc-border-accessible); background: var(--qc-subtle-hover); color: var(--qc-ink); }
.button:active { background: var(--qc-subtle-press); }
.button:disabled, .button[aria-disabled="true"] { border-color: var(--qc-border); background: var(--qc-well); color: var(--qc-muted); cursor: default; }
.button.primary { border-color: transparent; background: var(--qc-accent); color: var(--qc-on-accent); }
.button.primary:hover { background: var(--qc-accent-hover); color: var(--qc-on-accent); }
.button.primary:active { background: var(--qc-accent-press); }
.button.primary:disabled { border-color: transparent; background: var(--qc-well); color: var(--qc-muted); }
.button.ghost, .button.subtle { border-color: transparent; background: transparent; }
.button.ghost:hover, .button.subtle:hover { border-color: transparent; background: var(--qc-subtle-hover); }
.button.ghost:active, .button.subtle:active { background: var(--qc-subtle-press); }
.button.danger { border-color: transparent; background: var(--qc-danger); color: var(--qc-on-accent); }
.button.danger:hover { background: var(--qc-danger-hover); color: var(--qc-on-accent); }
.button.danger:active { background: var(--qc-danger-press); }
.danger-text, .button.danger-text, .button.danger-text:hover { color: var(--qc-danger); }
.button.small { min-height: var(--qc-control-sm); padding: 0 var(--space-sm); }
.button.wide { width: 100%; }
.button.accent-icon .icon { color: var(--qc-accent); }
.button.accent-icon:disabled .icon { color: inherit; }
.i-next { --icon: url("/icons/fluent/next-24-regular.svg"); }
.button.icon-only { width: var(--qc-control-sm); min-height: var(--qc-control-sm); padding: 0; }
.button[aria-pressed="true"], .button.selected { border-color: var(--qc-accent); background: var(--qc-accent-soft); color: var(--qc-accent-text); }
label { display: grid; gap: var(--space-2xs); color: var(--qc-ink); font-size: var(--qc-type-small); font-weight: 600; }
input[type="text"], input:not([type]), input[type="number"], textarea, select { width: 100%; min-height: var(--qc-control); padding: 0 var(--space-sm); border: 1px solid var(--qc-border-field); border-bottom-color: var(--qc-border-accessible); border-radius: var(--qc-radius-control); background: var(--qc-bg); color: var(--qc-ink); font: 400 var(--qc-type-body)/1.4 var(--font-body); transition: border-color var(--dur-micro) var(--ease-out); }
textarea { min-height: 96px; padding: var(--space-xs) var(--space-sm); resize: vertical; }
select { appearance: none; padding-right: var(--space-xl); background: var(--qc-bg) url("/icons/fluent/chevron-down-24-regular.svg") right 10px center / 16px no-repeat; cursor: pointer; }
input:hover, textarea:hover, select:hover { border-color: var(--qc-border-accessible); }
input:active, textarea:active, select:active { border-bottom-color: var(--qc-ink); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; border-bottom-color: var(--qc-accent); box-shadow: inset 0 -1px 0 var(--qc-accent); }
input:disabled, textarea:disabled, select:disabled { background: var(--qc-well); color: var(--qc-muted); }
[aria-invalid="true"] { border-color: var(--qc-danger); border-bottom-color: var(--qc-danger); }
::placeholder { color: var(--qc-muted); opacity: 1; }
.counter { justify-self: end; color: var(--qc-muted); font-size: var(--qc-type-caption); font-weight: 400; font-variant-numeric: tabular-nums; }
.field-error { margin: var(--space-2xs) 0 0; display: flex; align-items: center; gap: var(--space-2xs); color: var(--qc-danger); font-size: var(--qc-type-small); }
.muted { color: var(--qc-muted); }
input[role="switch"] { appearance: none; position: relative; flex: 0 0 40px; width: 40px; height: 20px; margin: 0; border: 1px solid var(--qc-border-accessible); border-radius: var(--qc-radius-pill); background: var(--qc-bg); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
input[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--qc-ink-2); transition: transform var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
input[role="switch"]:hover { border-color: var(--qc-ink); }
input[role="switch"]:active::after { transform: scale(1.15); }
input[role="switch"]:checked { border-color: transparent; background: var(--qc-accent); }
input[role="switch"]:checked:hover { background: var(--qc-accent-hover); }
input[role="switch"]:checked::after { background: var(--qc-white); transform: translateX(20px); }
input[role="switch"]:disabled { border-color: var(--qc-border-strong); background: var(--qc-well); cursor: default; }
input[role="switch"]:disabled::after { background: var(--qc-border-strong); }
.switch-control { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-xs); font-weight: 400; }
.switch-track { display: none; }
.segmented-field { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-2xs); }
.segmented-field legend { margin-bottom: var(--space-2xs); padding: 0; font-size: var(--qc-type-small); font-weight: 600; }
.segmented { display: flex; }
.segmented .button { flex: 1 1 0; min-width: 0; padding: 0 var(--space-xs); border-radius: 0; }
.segmented .button + .button { margin-left: -1px; }
.segmented .button:first-child { border-radius: var(--qc-radius-control) 0 0 var(--qc-radius-control); }
.segmented .button:last-child { border-radius: 0 var(--qc-radius-control) var(--qc-radius-control) 0; }
.segmented .button.selected, .segmented .button[aria-pressed="true"] { position: relative; z-index: 1; border-color: var(--qc-accent); background: var(--qc-accent); color: var(--qc-on-accent); }
dialog { --color-focus: var(--color-ink); width: 480px; max-width: calc(100% - var(--space-xl)); max-height: calc(100% - var(--space-2xl)); padding: var(--space-lg); border: 0; border-radius: var(--qc-radius-card); background: var(--qc-bg); color: var(--qc-ink); box-shadow: var(--qc-shadow-64); }
dialog::backdrop { background: var(--qc-scrim); }
dialog h2 { margin-bottom: var(--space-xs); font-size: var(--qc-type-subtitle); line-height: 1.4; }
dialog > p { margin-bottom: var(--space-md); color: var(--qc-ink-2); }
.dialog-actions, .import-actions { margin-top: var(--space-lg); display: flex; justify-content: flex-end; gap: var(--space-xs); }
#settings-dialog, #import-dialog { width: 560px; }
.banner { margin-bottom: var(--space-lg); padding: var(--space-sm) var(--space-md); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); border: 1px solid var(--qc-accent-soft-hover); border-radius: var(--qc-radius-control); background: var(--qc-accent-soft); color: var(--qc-ink); }
.banner a { font-weight: 600; }
.editor-status:empty, .connection-status:empty { display: none; }
.editor-status { position: fixed; z-index: var(--z-toast); left: 50%; bottom: var(--space-lg); translate: -50% 0; padding: var(--space-sm) var(--space-md); border-radius: var(--qc-radius-control); background: var(--qc-ink); color: var(--qc-white); font-size: var(--qc-type-small); box-shadow: var(--qc-shadow-16); }

/* ---------- host app shell: a top bar like the Microsoft 365 web apps ---------- */
.topbar { position: sticky; top: 0; z-index: var(--z-sticky-nav); height: 56px; border-bottom: 1px solid var(--qc-border); background: var(--qc-bg); }
.topbar-content { height: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--space-lg); display: flex; align-items: center; gap: var(--space-lg); }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--qc-ink); font-size: var(--qc-type-subtitle); font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.brand:hover { color: var(--qc-ink); }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--qc-radius-card); background: var(--qc-accent); color: var(--qc-on-accent); font-size: var(--qc-type-subtitle); font-weight: 700; }
.nav-links { height: 100%; display: flex; align-items: stretch; gap: var(--space-2xs); }
.nav-links a { position: relative; padding: 0 var(--space-sm); display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--qc-ink-2); font-size: var(--qc-type-small); text-decoration: none; }
.nav-links a:hover { background: var(--qc-subtle-hover); color: var(--qc-ink); }
.nav-links a:active { background: var(--qc-subtle-press); }
.nav-links a[aria-current="page"] { color: var(--qc-ink); font-weight: 600; }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: var(--space-sm); right: var(--space-sm); bottom: 0; height: 3px; border-radius: var(--qc-radius-pill); background: var(--qc-accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: var(--space-sm); color: var(--qc-ink-2); font-size: var(--qc-type-small); }
.account form { margin: 0; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--qc-accent-soft-hover); color: var(--qc-accent-text); font-size: var(--qc-type-caption); font-weight: 600; }
.page-content { width: 100%; max-width: 1280px; margin-inline: auto; padding: var(--space-xl) var(--space-lg) var(--space-2xl); }
.page-header { margin-bottom: var(--space-lg); display: grid; gap: var(--space-2xs); }
.page-header h1 { font-size: var(--qc-type-title1); line-height: 1.25; }
.page-header p { color: var(--qc-ink-2); }
.section-header { margin-bottom: var(--space-md); display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); }
.section-header h2 { font-size: var(--qc-type-subtitle); line-height: 1.4; }
.quiz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
.quiz-card { min-height: 168px; padding: var(--space-lg); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-md); border-radius: var(--qc-radius-card); background: var(--qc-bg); box-shadow: var(--qc-shadow-4); transition: box-shadow var(--dur-short) var(--ease-out); }
.quiz-card:hover { box-shadow: var(--qc-shadow-8); }
.quiz-card h2 { font-size: var(--qc-type-subtitle); line-height: 1.4; overflow-wrap: anywhere; }
.quiz-card p { color: var(--qc-muted); font-size: var(--qc-type-small); }
.quiz-card .actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.quiz-card form { margin: 0; }
.empty-state { padding: var(--space-2xl) var(--space-lg); display: grid; justify-items: center; gap: var(--space-sm); border-radius: var(--qc-radius-card); background: var(--qc-surface); text-align: center; }
.empty-state h2 { font-size: var(--qc-type-title3); line-height: 1.3; }
.empty-state p { color: var(--qc-ink-2); }
.empty-state .button { margin-top: var(--space-xs); }
.answer-letters { margin-bottom: var(--space-sm); display: flex; gap: var(--space-xs); }
.answer-letters span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--qc-answer-1-ink); font-size: var(--qc-type-subtitle); font-weight: 700; box-shadow: var(--qc-shadow-2); }
.answer-letters span:nth-child(1) { background: var(--qc-answer-1); }
.answer-letters span:nth-child(2) { background: var(--qc-answer-2); }
.answer-letters span:nth-child(3) { background: var(--qc-answer-3); color: var(--qc-answer-3-ink); }
.answer-letters span:nth-child(4) { background: var(--qc-answer-4); }
.answer-letters span:nth-child(5) { background: var(--qc-answer-5); }
.answer-letters span:nth-child(6) { background: var(--qc-answer-6); }
/* a table wider than its card scrolls inside it; the edge shadows show there is more to the side */
.quiz-table-wrap { overflow-x: auto; border-radius: var(--qc-radius-card); background: linear-gradient(to right, var(--qc-bg) 40%, transparent) left / 32px 100% no-repeat local, linear-gradient(to left, var(--qc-bg) 40%, transparent) right / 32px 100% no-repeat local, linear-gradient(to right, var(--qc-edge-shadow), transparent) left / 12px 100% no-repeat scroll, linear-gradient(to left, var(--qc-edge-shadow), transparent) right / 12px 100% no-repeat scroll, var(--qc-bg); box-shadow: var(--qc-shadow-4); }
.quiz-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: var(--qc-type-small); }
.quiz-table td:not(:first-child), .quiz-table th { white-space: nowrap; }
.quiz-table td:first-child { min-width: 220px; }
.quiz-table th { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--qc-border); background: var(--qc-surface); color: var(--qc-ink-2); font-weight: 600; text-align: left; }
.quiz-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--qc-border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.quiz-table tbody tr:last-child td { border-bottom: 0; }
.quiz-table tbody tr:hover { background: var(--qc-surface); }
.quiz-table td strong { font-size: var(--qc-type-body); }
.quiz-table .error { margin-top: var(--space-2xs); color: var(--qc-danger); font-size: var(--qc-type-small); }
.table-actions { display: flex; justify-content: flex-end; gap: var(--space-2xs); }
.table-actions form { margin: 0; }
.report-detail-header { margin: var(--space-sm) 0 var(--space-lg); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-md); }
.report-detail-header h1 { font-size: var(--qc-type-title1); line-height: 1.25; }
.report-detail-header p { color: var(--qc-ink-2); }
.report-actions { display: flex; gap: var(--space-xs); }
.report-actions form { margin: 0; }
.report-back { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--qc-type-small); }
.report-tabs { margin-bottom: var(--space-md); display: flex; gap: var(--space-2xs); border-bottom: 1px solid var(--qc-border); }
.report-tabs a { position: relative; padding: var(--space-sm); color: var(--qc-ink-2); font-weight: 600; text-decoration: none; }
.report-tabs a:hover { color: var(--qc-ink); }
.report-tabs a.active { color: var(--qc-ink); }
.report-tabs a.active::after { content: ""; position: absolute; left: var(--space-sm); right: var(--space-sm); bottom: -1px; height: 3px; border-radius: var(--qc-radius-pill); background: var(--qc-accent); }
.report-title-link { font-weight: 600; white-space: nowrap; }
.error-page { max-width: 640px; margin: var(--space-3xl) auto; padding: 0 var(--space-lg); display: grid; gap: var(--space-sm); }

/* ---------- sign in (H01) ---------- */
.signin-page { min-height: 100vh; padding: var(--space-lg); display: grid; place-content: center; justify-items: center; gap: var(--space-lg); background: var(--qc-surface); }
.signin-card { width: min(100%, 440px); padding: var(--space-xl); display: grid; gap: var(--space-md); border-radius: var(--qc-radius-card); background: var(--qc-bg); box-shadow: var(--qc-shadow-16); }
.signin-card h1 { font-size: var(--qc-type-title2); line-height: 1.3; }
.signin-card > p { color: var(--qc-ink-2); }
.signin-card form { margin: 0; display: grid; }
.signin-card .button.wide { min-height: 44px; }
.dev-signin { padding-top: var(--space-md); display: grid; gap: var(--space-xs); border-top: 1px solid var(--qc-border); }
.dev-signin h2 { font-size: var(--qc-type-body); line-height: 1.4; }
.dev-signin form { grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.signin-note { color: var(--qc-ink-2); font-size: var(--qc-type-small); text-align: center; }
.signin-note p { margin: 0; }

/* ---------- editor (H03 family) ---------- */
.editor-page { min-height: calc(100vh - 56px); display: flex; flex-direction: column; background: var(--qc-surface); }
.editor-toolbar { position: sticky; top: 56px; z-index: var(--z-sticky); min-height: 56px; padding: var(--space-xs) var(--space-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); border-bottom: 1px solid var(--qc-border); background: var(--qc-bg); }
.editor-toolbar-leading { min-width: 0; flex: 1; display: flex; align-items: center; gap: var(--space-sm); }
.editor-toolbar-leading input { max-width: 480px; font-size: var(--qc-type-subtitle); font-weight: 600; }
.editor-toolbar > div:last-child { display: flex; gap: var(--space-xs); }
.editor-layout { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.question-list { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); border-right: 1px solid var(--qc-border); background: var(--qc-bg); }
.question-list h1 { font-size: var(--qc-type-body); line-height: 1.4; }
.question-list ol { margin: 0; padding: 0; display: grid; gap: var(--space-2xs); list-style: none; }
.question-item { position: relative; min-height: 64px; padding: var(--space-xs); display: grid; grid-template-columns: 20px 24px minmax(0, 1fr) auto; align-items: start; gap: var(--space-xs); border-radius: var(--qc-radius-control); }
.question-item:hover { background: var(--qc-subtle-hover); }
.question-item[aria-current="true"] { background: var(--qc-accent-soft); }
.question-item[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: var(--space-sm); bottom: var(--space-sm); width: 3px; border-radius: var(--qc-radius-pill); background: var(--qc-accent); }
.drag-handle { padding-top: var(--space-2xs); color: var(--qc-muted); cursor: grab; }
.question-number { padding-top: var(--space-3xs); color: var(--qc-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.question-select { min-width: 0; padding: 0; display: grid; gap: var(--space-3xs); border: 0; background: transparent; color: var(--qc-ink); font: inherit; text-align: left; cursor: pointer; }
.question-select:hover .question-prompt { text-decoration: underline; }
.question-select:active { color: var(--qc-accent-text); }
/* the number is shown beside the button; inside it stays for the button's name ("Question 1 Quiz …") */
.question-select strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.question-type { color: var(--qc-muted); font-size: var(--qc-type-caption); }
.question-prompt { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: var(--qc-type-small); }
.question-thumbnail { width: 48px; height: 36px; border-radius: var(--qc-radius-control); object-fit: cover; }
.question-reorder-controls { display: flex; flex-direction: column; }
.question-move { width: 28px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--qc-radius-control); background: transparent; color: var(--qc-muted); cursor: pointer; }
.question-move:hover { background: var(--qc-subtle-press); color: var(--qc-ink); }
.question-move:active { background: var(--qc-border-strong); }
.question-move:disabled { visibility: hidden; }
.question-move .icon { --qc-icon: 16px; }
#add-question { margin-top: auto; }
.question-editor { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.question-content { min-width: 0; padding: var(--space-lg); }
.question-fields { max-width: 880px; margin-inline: auto; padding: var(--space-lg); display: grid; gap: var(--space-md); border-radius: var(--qc-radius-card); background: var(--qc-bg); box-shadow: var(--qc-shadow-4); }
.question-fields h2 { color: var(--qc-muted); font-size: var(--qc-type-small); line-height: 1.4; letter-spacing: 0; }
.question-fields h3 { font-size: var(--qc-type-body); line-height: 1.4; }
.image-picker { min-height: 200px; padding: var(--space-md); display: grid; place-content: center; justify-items: center; gap: var(--space-xs); border: 1px dashed var(--qc-border-accessible); border-radius: var(--qc-radius-card); background: var(--qc-surface); text-align: center; }
.image-picker > .button { white-space: normal; }
.image-preview { max-height: 220px; border-radius: var(--qc-radius-control); object-fit: contain; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.answer-row { min-height: 56px; padding-right: var(--space-sm); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-xs); overflow: hidden; border: 1px solid var(--qc-border-field); border-radius: var(--qc-radius-card); background: var(--qc-bg); }
.answer-row label { font-weight: 400; }
.answer-row label > input:not([role="switch"]) { min-height: 36px; padding: 0; border: 0; box-shadow: none; }
.answer-row label > input:not([role="switch"]):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; box-shadow: none; }
.answer-row .switch-control { font-size: var(--qc-type-small); }
.answer-letter { align-self: stretch; display: grid; place-items: center; color: var(--qc-answer-1-ink); font-size: var(--qc-type-title3); font-weight: 700; }
.answer-row .answer-letter { min-height: 56px; }
.answer-letter[data-index="0"] { background: var(--qc-answer-1); }
.answer-letter[data-index="1"] { background: var(--qc-answer-2); }
.answer-letter[data-index="2"] { background: var(--qc-answer-3); color: var(--qc-answer-3-ink); }
.answer-letter[data-index="3"] { background: var(--qc-answer-4); }
.answer-letter[data-index="4"] { background: var(--qc-answer-5); }
.answer-letter[data-index="5"] { background: var(--qc-answer-6); }
.fixed-answer { font-weight: 600; }
/* H03g: one Fluent field per puzzle item, with its handle, its number and its move buttons inside the field */
.puzzle-rows { display: grid; gap: var(--space-xs); }
.puzzle-row { min-height: var(--qc-control); padding-inline: var(--space-2xs); display: flex; align-items: center; gap: var(--space-2xs); border: 1px solid var(--qc-border-field); border-bottom-color: var(--qc-border-accessible); border-radius: var(--qc-radius-control); background: var(--qc-bg); transition: border-color var(--dur-micro) var(--ease-out); }
.puzzle-row:hover { border-color: var(--qc-border-accessible); }
.puzzle-row:focus-within { border-bottom-color: var(--qc-accent); box-shadow: inset 0 -1px 0 var(--qc-accent); }
.puzzle-row .drag-handle { padding: 0 var(--space-2xs); display: grid; place-items: center; }
.puzzle-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-xs); color: var(--qc-accent-text); font-size: var(--qc-type-body); font-variant-numeric: tabular-nums; }
.puzzle-field > input { min-width: 0; min-height: 36px; padding: 0; flex: 1; border: 0; box-shadow: none; }
.puzzle-field > input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; box-shadow: none; }
.inline-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.slider-preview { position: relative; height: 8px; margin: var(--space-sm) 0; border-radius: var(--qc-radius-pill); background: var(--qc-border-strong); }
.slider-range { position: absolute; top: -4px; height: 16px; border-radius: var(--qc-radius-control); background: var(--qc-success); opacity: 0.35; }
.slider-marker { position: absolute; top: -8px; width: 3px; height: 24px; background: var(--qc-success); }
.question-settings { padding: var(--space-lg) var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); border-left: 1px solid var(--qc-border); background: var(--qc-bg); }
.settings-divider { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--qc-border); }
.question-settings .editor-actions { display: grid; gap: var(--space-xs); }
.question-settings .editor-actions .button { justify-content: flex-start; }
.editor-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.type-choice-list { margin: var(--space-sm) 0 var(--space-md); display: grid; gap: var(--space-2xs); }
.type-choice { width: 100%; min-height: 56px; padding: var(--space-xs) var(--space-sm); display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; column-gap: var(--space-sm); border: 0; border-radius: var(--qc-radius-control); background: transparent; color: var(--qc-ink); font: inherit; text-align: left; cursor: pointer; }
.type-choice:hover { background: var(--qc-subtle-hover); }
.type-choice:active { background: var(--qc-subtle-press); }
.type-choice .icon { grid-row: span 2; color: var(--qc-accent); }
.type-choice strong { font-weight: 600; }
.type-choice span:not(.icon) { color: var(--qc-muted); font-size: var(--qc-type-small); }
.csv-file-area { margin-top: var(--space-md); padding: var(--space-lg); display: grid; justify-items: center; gap: var(--space-xs); border: 1px dashed var(--qc-border-accessible); border-radius: var(--qc-radius-card); background: var(--qc-surface); text-align: center; }
.import-problems { margin-top: var(--space-sm); display: grid; gap: var(--space-2xs); font-size: var(--qc-type-small); }
.import-problems p:not(.muted) { color: var(--qc-danger); }

/* ---------- live host: the projector ---------- */
.live-page { min-height: 100vh; background: var(--qc-bg); color: var(--qc-ink); }
.host-live[data-screen="lobby"], .host-live[data-screen="getReady"], .host-live[data-screen="leaderboard"], .host-live[data-screen="results"], .host-live[data-screen="closed"] { --color-focus: var(--qc-white); background: var(--qc-stage); color: var(--qc-on-accent); }
.live-topbar { min-height: 72px; padding: var(--space-md) var(--space-xl); display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); }
.live-topbar .brand { color: inherit; }
.host-live[data-screen="lobby"] .brand-mark, .host-live[data-screen="getReady"] .brand-mark, .host-live[data-screen="leaderboard"] .brand-mark, .host-live[data-screen="results"] .brand-mark, .host-live[data-screen="closed"] .brand-mark { background: var(--qc-white); color: var(--qc-accent); }
.live-quiz-title { flex: 1; overflow: hidden; font-size: var(--qc-type-subtitle); font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.live-controls { display: flex; align-items: center; gap: var(--space-2xs); }
.live-controls .button.subtle { color: inherit; }
.host-live[data-screen="lobby"] .live-controls .button.subtle:hover, .host-live[data-screen="getReady"] .live-controls .button.subtle:hover, .host-live[data-screen="leaderboard"] .live-controls .button.subtle:hover, .host-live[data-screen="results"] .live-controls .button.subtle:hover { background: var(--qc-stage-hover); }
.host-live[data-screen="lobby"] .live-controls .button.subtle:active, .host-live[data-screen="leaderboard"] .live-controls .button.subtle:active, .host-live[data-screen="results"] .live-controls .button.subtle:active { background: var(--qc-stage-press); }
.host-screen { min-height: calc(100vh - 72px); padding: var(--space-md) var(--space-xl) var(--space-xl); display: flex; flex-direction: column; gap: var(--space-lg); }
.sound-prompt { flex: none; min-height: 32px; margin: 0; padding: 0 var(--space-md); display: flex; align-items: center; gap: var(--space-xs); border-radius: var(--qc-radius-pill); background: var(--qc-ink); color: var(--qc-white); font-size: var(--qc-type-small); box-shadow: var(--qc-shadow-16); }
.sound-prompt .icon { --qc-icon: 16px; }
.button.outline { border-color: var(--qc-stage-line); background: transparent; color: var(--qc-on-accent); }
.button.outline:hover { border-color: var(--qc-white); background: var(--qc-stage-hover); color: var(--qc-on-accent); }
.button.outline:active { background: var(--qc-stage-press); }
.button.inverse { border-color: transparent; background: var(--qc-white); color: var(--qc-accent-text); }
.button.inverse:hover { background: var(--qc-accent-soft); color: var(--qc-accent-press); }
.button.inverse:active { background: var(--qc-accent-soft-hover); }
.button.inverse:disabled { background: var(--qc-stage-tint); color: var(--qc-on-accent); }
.host-lobby-main { display: grid; grid-template-columns: minmax(0, 640px) 260px; justify-content: center; align-items: stretch; gap: var(--space-lg); }
.host-join-card, .host-qr-card, .host-leaderboard-row, .host-podium-block, .host-player-chip, .player-podium-row, .player-self-score { --color-focus: var(--color-ink); }
.host-join-card, .host-qr-card { border-radius: var(--qc-radius-card); background: var(--qc-white); color: var(--qc-ink); box-shadow: var(--qc-shadow-28); }
.host-join-card { padding: var(--space-xl); display: grid; align-content: center; gap: var(--space-2xs); }
.host-join-address { margin-bottom: var(--space-sm); font-size: var(--qc-type-title3); line-height: 1.3; overflow-wrap: anywhere; }
.host-pin-label { color: var(--qc-muted); font-size: var(--qc-type-body); font-weight: 600; }
.host-pin { color: var(--qc-ink); font-family: var(--font-display); font-size: var(--qc-type-pin); font-weight: 700; line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.host-qr-card { padding: var(--space-md); display: grid; justify-items: center; align-content: center; gap: var(--space-xs); }
.host-qr-card img { width: 200px; height: 200px; }
.host-qr-caption { display: flex; align-items: center; gap: var(--space-2xs); }
.host-qr-caption > span { color: var(--qc-ink-2); font-size: var(--qc-type-small); font-weight: 600; }
.host-qr-expand { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--qc-radius-control); background: transparent; color: var(--qc-ink-2); cursor: pointer; }
.host-qr-expand:hover { background: var(--qc-subtle-hover); color: var(--qc-ink); }
.host-qr-expand:active { background: var(--qc-subtle-press); }
.host-qr-expand .icon { --qc-icon: 20px; }
/* FR-24: the QR code over the whole screen. Only the open dialog gets a layout: an author display rule would beat the
   browser's own display: none of a closed dialog. */
.qr-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: var(--space-lg) var(--space-xl) var(--space-xl); border-radius: 0; box-shadow: none; }
.qr-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-items: center; align-items: center; gap: var(--space-md); text-align: center; }
.qr-dialog-close { justify-self: end; min-height: 44px; padding: 0 var(--space-lg); font-size: var(--qc-type-body); }
.qr-dialog-close .icon { --qc-icon: 20px; }
.qr-dialog img { width: min(calc(100vh - 300px), 90vw); height: auto; aspect-ratio: 1; }
.qr-dialog h2 { margin: 0; font-size: var(--qc-type-title3); }
.qr-dialog-join { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: var(--space-lg); color: var(--qc-ink-2); font-size: var(--qc-type-title3); overflow-wrap: anywhere; }
.qr-dialog-join strong { color: var(--qc-ink); font-family: var(--font-display); font-size: var(--qc-type-large); line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.host-players { flex: 1; width: 100%; max-width: 1160px; margin-inline: auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); border-radius: var(--qc-radius-card); background: var(--qc-stage-deep); }
.host-players-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); }
.host-player-count { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--qc-type-title3); line-height: 1.3; font-variant-numeric: tabular-nums; }
.host-player-count .icon { --qc-icon: 28px; }
.host-lobby-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.host-lobby-actions .button { min-height: 44px; padding: 0 var(--space-lg); font-size: var(--qc-type-body); }
.host-player-chips { max-height: 40vh; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--space-xs); }
.host-player-chip { min-height: 40px; padding: 0 var(--space-2xs) 0 var(--space-md); display: inline-flex; align-items: center; gap: var(--space-2xs); border-radius: var(--qc-radius-pill); background: var(--qc-white); color: var(--qc-ink); font-weight: 600; box-shadow: var(--qc-shadow-4); animation: qc-pop var(--dur-short) var(--ease-out); }
.chip-remove { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--qc-muted); cursor: pointer; }
.chip-remove:hover { background: var(--qc-subtle-hover); color: var(--qc-danger); }
.chip-remove:active { background: var(--qc-subtle-press); }
.chip-remove:focus-visible { outline-color: var(--qc-ink); }
.chip-remove .icon { --qc-icon: 16px; }
.host-waiting { font-size: var(--qc-type-subtitle); }
.host-phase-screen { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--space-md); text-align: center; }
.host-display { color: inherit; font-size: var(--qc-type-display); line-height: 1.1; text-align: center; }
.host-phase-line { font-size: var(--qc-type-title3); }
.host-countdown { width: 160px; height: 160px; display: grid; place-items: center; border-radius: 50%; background: var(--qc-white); color: var(--qc-accent); font-family: var(--font-display); font-size: var(--qc-type-display); font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--qc-shadow-28); animation: qc-pulse 1s var(--ease-out) infinite; }
.host-expired { gap: var(--space-lg); }
.host-expired-icon { --qc-icon: 64px; }
.host-expired h1 { max-width: 22ch; font-size: var(--qc-type-title1); line-height: 1.3; }
/* H07 and H08: the stage fills the projector; the timer row or the chart sits in the middle and the answer tiles at the bottom, as in the frames */
.host-question-screen, .host-reveal { flex: 1 0 auto; width: min(100%, 1280px); margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-md); }
.host-question-meta { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); color: var(--qc-muted); font-size: var(--qc-type-subtitle); font-weight: 600; }
.host-question-meta .button { min-height: 44px; padding: 0 var(--space-lg); font-size: var(--qc-type-body); }
.host-leaderboard-screen .host-question-meta { color: inherit; }
.host-question-prompt { max-width: 1100px; margin-inline: auto; font-size: var(--qc-type-question); line-height: 1.2; text-align: center; }
.host-hint { color: var(--qc-ink-2); font-size: var(--qc-type-subtitle); text-align: center; }
.host-question-image { max-width: min(640px, 100%); max-height: 240px; margin-inline: auto; border-radius: var(--qc-radius-card); background: var(--qc-surface); object-fit: contain; box-shadow: var(--qc-shadow-4); }
.host-question-middle { margin-block: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); }
.host-timer { --left: 1; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(closest-side, var(--qc-bg) 84%, transparent 85% 100%), conic-gradient(var(--qc-accent) calc(var(--left) * 360deg), var(--qc-border) 0); color: var(--qc-ink); font-family: var(--font-display); font-size: var(--qc-type-title1); font-weight: 700; font-variant-numeric: tabular-nums; }
.host-progress { display: flex; align-items: center; gap: var(--space-md); }
.host-answered { color: var(--qc-ink-2); font-size: var(--qc-type-subtitle); font-weight: 600; font-variant-numeric: tabular-nums; }
.host-progress .button { min-height: 44px; padding: 0 var(--space-lg); font-size: var(--qc-type-body); }
.host-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.host-answer-grid[data-count="2"], .host-answer-grid[data-count="3"] { grid-template-columns: minmax(0, 1fr); }
.host-answer-grid[data-count="5"] > :last-child { grid-column: 1 / -1; }
.host-answer-grid[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.host-answer-tile { min-height: 112px; padding: 0 var(--space-lg); display: flex; align-items: center; gap: var(--space-md); border-radius: var(--qc-radius-tile); color: var(--qc-answer-1-ink); font-size: var(--qc-type-answer); font-weight: 600; line-height: 1.2; box-shadow: var(--qc-shadow-8); animation: qc-rise var(--dur-long) var(--ease-out) both; }
.host-answer-grid[data-count="2"] .host-answer-tile, .host-answer-grid[data-count="3"] .host-answer-tile, .host-answer-grid[data-count="5"] .host-answer-tile, .host-answer-grid[data-count="6"] .host-answer-tile { min-height: 96px; }
.host-answer-tile:nth-child(2) { animation-delay: 60ms; }
.host-answer-tile:nth-child(3) { animation-delay: 120ms; }
.host-answer-tile:nth-child(4) { animation-delay: 180ms; }
.host-answer-tile:nth-child(5) { animation-delay: 240ms; }
.host-answer-tile:nth-child(6) { animation-delay: 300ms; }
.host-answer-tile .answer-letter, .host-puzzle-item .answer-letter { flex: 0 0 48px; width: 48px; height: 48px; align-self: center; border-radius: 50%; background: var(--qc-white); color: var(--qc-ink); font-size: var(--qc-type-title3); box-shadow: var(--qc-shadow-2); }
.answer-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.answer-count { margin-left: auto; font-family: var(--font-display); font-size: var(--qc-type-title1); font-weight: 700; font-variant-numeric: tabular-nums; }
.host-answer-tile .icon { --qc-icon: 36px; }
.host-answer-tile[data-index="0"], .reveal-column[data-index="0"] .reveal-bar { background: var(--qc-answer-1); }
.host-answer-tile[data-index="1"], .reveal-column[data-index="1"] .reveal-bar { background: var(--qc-answer-2); }
.host-answer-tile[data-index="2"], .reveal-column[data-index="2"] .reveal-bar { background: var(--qc-answer-3); }
.host-answer-tile[data-index="2"] { color: var(--qc-answer-3-ink); }
.host-answer-tile[data-index="3"], .reveal-column[data-index="3"] .reveal-bar { background: var(--qc-answer-4); }
.host-answer-tile[data-index="4"], .reveal-column[data-index="4"] .reveal-bar { background: var(--qc-answer-5); }
.host-answer-tile[data-index="5"], .reveal-column[data-index="5"] .reveal-bar { background: var(--qc-answer-6); }
.reveal-tiles .host-answer-tile { animation: none; }
.host-answer-tile.dimmed { opacity: 0.4; }
.reveal-column.dimmed .reveal-bar { opacity: 0.4; }
.host-answer-tile.correct { box-shadow: var(--qc-shadow-28); }
.host-puzzle-items { display: grid; gap: var(--space-sm); }
.host-puzzle-item { min-height: 64px; padding: 0 var(--space-md); display: flex; align-items: center; gap: var(--space-md); border: 1px solid var(--qc-border-strong); border-radius: var(--qc-radius-tile); background: var(--qc-bg); font-size: var(--qc-type-title3); font-weight: 600; box-shadow: var(--qc-shadow-2); }
.host-puzzle-item .answer-letter { color: var(--qc-answer-1-ink); }
.host-puzzle-item[data-index="0"] .answer-letter { background: var(--qc-answer-1); }
.host-puzzle-item[data-index="1"] .answer-letter { background: var(--qc-answer-2); }
.host-puzzle-item[data-index="2"] .answer-letter { background: var(--qc-answer-3); color: var(--qc-answer-3-ink); }
.host-puzzle-item[data-index="3"] .answer-letter { background: var(--qc-answer-4); }
.host-puzzle-item[data-index="4"] .answer-letter { background: var(--qc-answer-5); }
.host-puzzle-item[data-index="5"] .answer-letter { background: var(--qc-answer-6); }
.host-hint-pill { align-self: center; justify-self: center; min-height: 64px; margin: var(--space-md) 0; padding: 0 var(--space-xl); display: inline-flex; align-items: center; gap: var(--space-sm); border-radius: var(--qc-radius-pill); background: var(--qc-accent-soft); color: var(--qc-accent-text); font-size: var(--qc-type-title3); font-weight: 600; }
.host-hint-pill .icon { --qc-icon: 32px; }
.slider-scale { width: min(100%, 1100px); margin: var(--space-lg) auto 0; display: grid; gap: var(--space-sm); }
.slider-scale-track { position: relative; height: 8px; border-radius: var(--qc-radius-pill); background: var(--qc-border-strong); }
.slider-scale-tick { position: absolute; left: var(--at); top: -6px; width: 2px; height: 20px; translate: -1px 0; background: var(--qc-border-accessible); }
.slider-scale-range { position: absolute; left: var(--from); right: calc(100% - var(--to)); top: -8px; height: 24px; border-radius: var(--qc-radius-control); background: var(--qc-success-soft); box-shadow: inset 0 0 0 2px var(--qc-success); }
.slider-scale-marker { position: absolute; left: var(--at); top: -14px; width: 3px; height: 36px; translate: -1px 0; background: var(--qc-success); }
.slider-scale-value { position: absolute; top: 44px; left: 0; translate: -50% 0; padding: 0 var(--space-sm); border-radius: var(--qc-radius-pill); background: var(--qc-success); color: var(--qc-white); font-size: var(--qc-type-title3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slider-scale-track:has(.slider-scale-marker) { margin-bottom: var(--space-2xl); }
.slider-scale-labels { display: flex; justify-content: space-between; color: var(--qc-ink-2); font-size: var(--qc-type-title3); font-weight: 600; font-variant-numeric: tabular-nums; }
.reveal-chart, .reveal-tiles { margin-top: auto; }
.reveal-chart { height: 200px; display: flex; align-items: flex-end; justify-content: center; gap: var(--space-xl); }
.reveal-column { height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; align-items: end; gap: var(--space-2xs); }
.reveal-count { font-family: var(--font-display); font-size: var(--qc-type-title2); font-weight: 700; font-variant-numeric: tabular-nums; }
.reveal-bar { width: 72px; height: var(--bar); border-radius: var(--qc-radius-control) var(--qc-radius-control) 0 0; transform-origin: bottom; animation: qc-grow var(--dur-long) var(--ease-out) both; }
.reveal-letter { font-size: var(--qc-type-title3); }
.reveal-check { --qc-icon: 32px; color: var(--qc-success); }
.reveal-check-slot { width: 32px; height: 32px; }
.reveal-line { color: var(--qc-ink); font-size: var(--qc-type-title3); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.reveal-accepted { font-size: var(--qc-type-title1); line-height: 1.3; text-align: center; }
.reveal-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); }
.reveal-card { min-width: 220px; min-height: 96px; padding: 0 var(--space-lg); display: flex; align-items: center; gap: var(--space-sm); border-radius: var(--qc-radius-card); color: var(--qc-white); font-size: var(--qc-type-title3); font-weight: 600; box-shadow: var(--qc-shadow-8); font-variant-numeric: tabular-nums; }
.reveal-card .icon { --qc-icon: 32px; }
.reveal-card.correct { background: var(--qc-success); }
.reveal-card.wrong { background: var(--qc-danger); }
.reveal-card.none { background: var(--qc-timeout); }
.host-histogram { width: min(100%, 1100px); height: 200px; margin: var(--space-md) auto 0; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); align-items: end; gap: var(--space-2xs); }
.host-histogram-bar { height: var(--bar); border-radius: var(--qc-radius-control) var(--qc-radius-control) 0 0; background: var(--qc-accent); transform-origin: bottom; animation: qc-grow var(--dur-long) var(--ease-out) both; }
.host-correct-order { width: min(100%, 900px); margin: 0 auto; padding: 0; display: grid; gap: var(--space-sm); counter-reset: order; list-style: none; }
.host-correct-order li { min-height: 64px; padding: 0 var(--space-md); display: flex; align-items: center; gap: var(--space-md); border-radius: var(--qc-radius-tile); background: var(--qc-success-soft); box-shadow: inset 0 0 0 2px var(--qc-success); font-size: var(--qc-type-title3); font-weight: 600; counter-increment: order; }
.host-correct-order li::before { content: counter(order); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--qc-success); color: var(--qc-white); }
.host-correct-order .icon { --qc-icon: 28px; color: var(--qc-success); }
.host-leaderboard-screen { width: min(100%, 1040px); margin-inline: auto; display: grid; gap: var(--space-lg); }
.host-leaderboard { margin: 0; padding: 0; display: grid; gap: var(--space-sm); list-style: none; }
.host-leaderboard-row { min-height: 72px; padding: 0 var(--space-lg); display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--space-md); border-radius: var(--qc-radius-card); background: var(--qc-white); color: var(--qc-ink); box-shadow: var(--qc-shadow-16); animation: qc-rise var(--dur-long) var(--ease-out) both; }
.host-leaderboard-row:nth-child(2) { animation-delay: 60ms; }
.host-leaderboard-row:nth-child(3) { animation-delay: 120ms; }
.host-leaderboard-row:nth-child(4) { animation-delay: 180ms; }
.host-leaderboard-row:nth-child(5) { animation-delay: 240ms; }
.leader-place { color: var(--qc-accent-text); font-family: var(--font-display); font-size: var(--qc-type-title2); font-variant-numeric: tabular-nums; }
.leader-name { min-width: 0; overflow: hidden; font-size: var(--qc-type-title3); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.leader-points { color: var(--qc-success); font-size: var(--qc-type-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.leader-score { min-width: 5ch; font-family: var(--font-display); font-size: var(--qc-type-title2); text-align: right; font-variant-numeric: tabular-nums; }
.streak-chip { min-height: 28px; padding: 0 var(--space-sm); display: inline-flex; align-items: center; gap: var(--space-2xs); border-radius: var(--qc-radius-pill); background: var(--qc-streak-soft); color: var(--qc-streak); font-size: var(--qc-type-small); font-weight: 600; }
.streak-chip .icon { --qc-icon: 16px; }
.host-action-row { display: flex; justify-content: flex-end; }
.host-action-row .button { min-height: 48px; padding: 0 var(--space-xl); font-size: var(--qc-type-body); }
.host-results { width: min(100%, 1040px); margin-inline: auto; display: grid; justify-items: center; gap: var(--space-lg); }
.host-podium { width: 100%; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; align-items: end; gap: var(--space-md); list-style: none; }
.host-podium-block { padding: var(--space-lg) var(--space-md); display: grid; align-content: start; justify-items: center; gap: var(--space-xs); border-radius: var(--qc-radius-card) var(--qc-radius-card) 0 0; background: var(--qc-white); color: var(--qc-ink); text-align: center; box-shadow: var(--qc-shadow-28); transform-origin: bottom; animation: qc-grow var(--dur-long) var(--ease-out) both; }
.host-podium-block[data-place="1"] { min-height: 320px; animation-delay: 600ms; }
.host-podium-block[data-place="2"] { min-height: 240px; animation-delay: 300ms; }
.host-podium-block[data-place="3"] { min-height: 180px; }
/* Columns follow the list position, not the rank: with one or two players first place still stands in the centre, and tied ranks never overlap */
.host-podium-block[data-slot="1"] { grid-area: 1 / 2; }
.host-podium-block[data-slot="2"] { grid-area: 1 / 1; }
.host-podium-block[data-slot="3"] { grid-area: 1 / 3; }
.host-podium-block .icon { --qc-icon: 48px; color: var(--qc-streak); }
.podium-place { color: var(--qc-accent-text); font-family: var(--font-display); font-size: var(--qc-type-display); line-height: 1; }
.podium-name { max-width: 100%; overflow: hidden; font-size: var(--qc-type-title3); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: var(--qc-type-subtitle); font-variant-numeric: tabular-nums; }
.host-percent { font-size: var(--qc-type-title3); font-weight: 600; font-variant-numeric: tabular-nums; }
.host-results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); }
.host-results-actions .button { min-height: 44px; font-size: var(--qc-type-body); }
.live-setting { min-height: 64px; padding: var(--space-sm) 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); border-bottom: 1px solid var(--qc-border); }
.live-setting:last-child { border-bottom: 0; }
.live-setting-text { display: grid; gap: var(--space-3xs); }
.live-setting-label { font-size: var(--qc-type-body); }
.live-setting-hint { color: var(--qc-muted); font-size: var(--qc-type-small); }
.connection-status { position: fixed; z-index: var(--z-toast); top: 0; left: 0; right: 0; min-height: 40px; padding: var(--space-xs) var(--space-md); display: flex; align-items: center; justify-content: center; background: var(--qc-ink); color: var(--qc-white); font-size: var(--qc-type-small); }

/* ---------- phones (P01 to P08) ---------- */
.join-page { min-height: 100vh; padding: var(--space-xl) var(--space-lg); display: grid; justify-items: center; align-content: start; background: var(--qc-bg); }
.join-card { width: min(100%, 342px); display: grid; justify-items: center; gap: var(--space-xl); }
.join-content { width: 100%; display: grid; gap: var(--space-md); }
.join-content h1 { font-size: var(--qc-type-title2); line-height: 1.3; text-align: center; }
.join-content form, .join-content label { display: grid; gap: var(--space-xs); }
.join-content input { min-height: var(--qc-control-phone); font-size: var(--qc-type-subtitle); }
.join-content .button { width: 100%; min-height: var(--qc-control-phone); font-size: var(--qc-type-body); }
.join-hint, .join-error { margin: 0; font-size: var(--qc-type-small); line-height: 1.4; }
.join-hint { color: var(--qc-muted); text-align: center; }
.join-error { color: var(--qc-danger); }
.generated-nickname { min-height: 144px; padding: var(--space-md); display: grid; place-items: center; border-radius: var(--qc-radius-card); background: var(--qc-accent-soft); color: var(--qc-ink); font-size: var(--qc-type-title2); font-weight: 700; text-align: center; }
.generated-nickname.empty { color: var(--qc-ink-2); font-size: var(--qc-type-body); font-weight: 400; }
.player-live { background: var(--qc-surface); color: var(--qc-ink); }
.player-live[data-screen="lobby"], .player-live[data-screen="getReady"], .player-live[data-screen="results"], .player-live[data-screen="result-poll"] { --color-focus: var(--qc-white); background: var(--qc-stage); color: var(--qc-on-accent); }
.player-live[data-screen="result-correct"] { --color-focus: var(--qc-white); background: var(--qc-success); color: var(--qc-white); }
.player-live[data-screen="result-wrong"] { --color-focus: var(--qc-white); background: var(--qc-danger); color: var(--qc-white); }
.player-live[data-screen="result-timeout"] { --color-focus: var(--qc-white); background: var(--qc-timeout); color: var(--qc-white); }
.player-live[data-screen="ended"] { background: var(--qc-bg); }
.player-screen { position: relative; width: min(100%, 430px); min-height: 100vh; margin-inline: auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); }
.player-center { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--space-md); text-align: center; }
.player-title { font-size: var(--qc-type-title2); line-height: 1.3; }
.player-big { font-size: var(--qc-type-large); line-height: 1.2; }
.player-quiet { font-size: var(--qc-type-small); }
.player-small { font-size: var(--qc-type-small); }
.player-strong { font-weight: 600; }
.player-streak { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.player-streak .icon { --qc-icon: 16px; }
.player-nickname-pill { padding: var(--space-xs) var(--space-lg); border-radius: var(--qc-radius-pill); background: var(--qc-white); color: var(--qc-ink); font-size: var(--qc-type-title3); font-weight: 600; box-shadow: var(--qc-shadow-8); }
.player-countdown { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: var(--qc-white); color: var(--qc-accent); font-family: var(--font-display); font-size: var(--qc-type-large); font-weight: 700; font-variant-numeric: tabular-nums; animation: qc-pulse 1s var(--ease-out) infinite; }
.player-sound-button { position: absolute; top: var(--space-md); right: var(--space-md); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.player-sound-button:hover { background: var(--qc-stage-tint); }
.player-sound-button:active { background: var(--qc-stage-tint-press); }
.player-top-row { display: flex; align-items: center; gap: var(--space-xs); font-weight: 600; }
.player-top-row > strong:first-child { flex: 1; }
.player-top-row .player-sound-button { position: static; color: var(--qc-ink); }
.player-top-row .player-sound-button:hover { background: var(--qc-subtle-hover); }
.player-timer { min-width: 48px; height: 48px; padding: 0 var(--space-sm); display: grid; place-items: center; border-radius: var(--qc-radius-pill); background: var(--qc-accent); color: var(--qc-on-accent); font-size: var(--qc-type-subtitle); font-variant-numeric: tabular-nums; }
.player-prompt { font-size: var(--qc-type-subtitle); line-height: 1.35; }
.player-question-image { max-height: 160px; margin-inline: auto; border-radius: var(--qc-radius-card); object-fit: contain; }
.player-hint { color: var(--qc-ink-2); font-size: var(--qc-type-small); text-align: center; }
.player-answers { flex: 1; min-height: 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(96px, 1fr); gap: var(--space-sm); }
.player-answers[data-count="2"], .player-answers[data-count="3"] { grid-template-columns: minmax(0, 1fr); }
.player-answers[data-count="5"] > :last-child { grid-column: 1 / -1; }
.player-answer, .player-answer-words { position: relative; min-width: 0; border: 0; border-radius: var(--qc-radius-tile); color: var(--qc-answer-1-ink); cursor: pointer; box-shadow: var(--qc-shadow-8); transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.player-answer { padding: var(--space-sm); display: grid; place-items: center; font-family: var(--font-display); font-size: var(--qc-type-letter); font-weight: 700; line-height: 1; }
.player-answers[data-type="trueFalse"] .player-answer { display: flex; align-items: center; justify-content: center; gap: var(--space-md); font-size: var(--qc-type-title1); }
.player-answer:hover, .player-answer-words:hover { box-shadow: var(--qc-shadow-16); }
.player-answer:active, .player-answer-words:active { transform: scale(0.97); }
.player-answer:focus-visible, .player-answer-words:focus-visible { outline: 3px solid var(--qc-ink); outline-offset: 2px; }
.player-answer-rows { display: grid; gap: var(--space-sm); }
.player-answer-words { min-height: 72px; padding: 0 var(--space-md); display: flex; align-items: center; gap: var(--space-sm); font: 600 var(--qc-type-body)/1.3 var(--font-body); text-align: left; }
.answer-badge { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--qc-white); color: var(--qc-ink); font-size: var(--qc-type-subtitle); font-weight: 700; }
.player-answer[data-index="0"], .player-answer-words[data-index="0"], .player-locked-tile[data-index="0"] { background: var(--qc-answer-1); }
.player-answer[data-index="1"], .player-answer-words[data-index="1"], .player-locked-tile[data-index="1"] { background: var(--qc-answer-2); }
.player-answer[data-index="2"], .player-answer-words[data-index="2"], .player-locked-tile[data-index="2"] { background: var(--qc-answer-3); color: var(--qc-answer-3-ink); }
.player-answer[data-index="3"], .player-answer-words[data-index="3"], .player-locked-tile[data-index="3"] { background: var(--qc-answer-4); }
.player-answer[data-index="4"], .player-answer-words[data-index="4"], .player-locked-tile[data-index="4"] { background: var(--qc-answer-5); }
.player-answer[data-index="5"], .player-answer-words[data-index="5"], .player-locked-tile[data-index="5"] { background: var(--qc-answer-6); }
.player-answer.selected, .player-answer-words.selected { outline: 4px solid var(--qc-ink); outline-offset: -4px; }
.selected-badge { position: absolute; top: var(--space-xs); right: var(--space-xs); --qc-icon: 32px; }
.player-field { display: grid; gap: var(--space-2xs); }
.player-input { min-height: var(--qc-control-phone); font-size: var(--qc-type-subtitle); }
.player-slider-value { margin-top: auto; font-family: var(--font-display); font-size: var(--qc-type-large); text-align: center; font-variant-numeric: tabular-nums; }
.player-slider { --fill: 50%; width: 100%; height: 32px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.player-slider::-webkit-slider-runnable-track { height: 8px; border-radius: var(--qc-radius-pill); background: linear-gradient(to right, var(--qc-accent) var(--fill), var(--qc-border-strong) var(--fill)); }
.player-slider::-moz-range-track { height: 8px; border-radius: var(--qc-radius-pill); background: linear-gradient(to right, var(--qc-accent) var(--fill), var(--qc-border-strong) var(--fill)); }
.player-slider::-webkit-slider-thumb { width: 32px; height: 32px; margin-top: calc(var(--space-sm) * -1); appearance: none; border: 2px solid var(--qc-white); border-radius: 50%; background: var(--qc-accent); box-shadow: var(--qc-shadow-4); }
.player-slider::-moz-range-thumb { width: 28px; height: 28px; border: 2px solid var(--qc-white); border-radius: 50%; background: var(--qc-accent); box-shadow: var(--qc-shadow-4); }
.player-slider:hover::-webkit-slider-thumb { background: var(--qc-accent-hover); }
.player-slider:active::-webkit-slider-thumb { background: var(--qc-accent-press); }
.player-slider:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.player-slider-ends { display: flex; justify-content: space-between; color: var(--qc-muted); font-size: var(--qc-type-small); font-variant-numeric: tabular-nums; }
.player-order { padding: var(--space-sm); display: grid; gap: var(--space-xs); border-radius: var(--qc-radius-card); background: var(--qc-bg); box-shadow: var(--qc-shadow-2); }
.player-order-title { font-size: var(--qc-type-body); line-height: 1.4; }
.player-order-slots, .player-puzzle-list { display: grid; gap: var(--space-xs); }
.player-order-empty { min-height: 48px; display: grid; place-items: center; border: 1px dashed var(--qc-border-accessible); border-radius: var(--qc-radius-card); color: var(--qc-muted); font-variant-numeric: tabular-nums; }
.player-puzzle-item { min-height: 56px; padding: 0 var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); border: 1px solid var(--qc-border-field); border-radius: var(--qc-radius-card); background: var(--qc-bg); color: var(--qc-ink); font: 600 var(--qc-type-body)/1.3 var(--font-body); text-align: left; cursor: pointer; }
.player-puzzle-item:hover { border-color: var(--qc-border-accessible); background: var(--qc-subtle-hover); }
.player-puzzle-item:active { background: var(--qc-subtle-press); }
.player-puzzle-item .answer-badge { flex-basis: 32px; width: 32px; height: 32px; color: var(--qc-answer-1-ink); font-size: var(--qc-type-small); }
.player-puzzle-item[data-index="0"] .answer-badge { background: var(--qc-answer-1); }
.player-puzzle-item[data-index="1"] .answer-badge { background: var(--qc-answer-2); }
.player-puzzle-item[data-index="2"] .answer-badge { background: var(--qc-answer-3); color: var(--qc-answer-3-ink); }
.player-puzzle-item[data-index="3"] .answer-badge { background: var(--qc-answer-4); }
.player-puzzle-item[data-index="4"] .answer-badge { background: var(--qc-answer-5); }
.player-puzzle-item[data-index="5"] .answer-badge { background: var(--qc-answer-6); }
.player-puzzle-item.placed { border-color: var(--qc-accent-soft-hover); background: var(--qc-accent-soft); }
.puzzle-number { width: 32px; color: var(--qc-accent-text); text-align: center; font-variant-numeric: tabular-nums; }
/* P05s: the value and the scale sit in the middle and Lock in sits at the bottom, as on the other answer screens */
.player-submit { margin-top: auto; }
.player-actions { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: var(--space-xs); }
.player-actions .button, .player-screen > .button.wide { min-height: var(--qc-control-phone); font-size: var(--qc-type-body); }
.player-locked-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }
.player-locked-tile { width: 160px; height: 160px; display: grid; place-items: center; border-radius: var(--qc-radius-tile); color: var(--qc-answer-1-ink); font-family: var(--font-display); font-size: var(--qc-type-letter); font-weight: 700; box-shadow: var(--qc-shadow-16); }
.player-locked-tiles .player-locked-tile:not(:only-child) { width: 96px; height: 96px; font-size: var(--qc-type-large); }
.player-locked-tile.wide { width: 100%; height: 96px; font-size: var(--qc-type-title1); }
.player-locked-box { max-width: 100%; padding: var(--space-md) var(--space-lg); border-radius: var(--qc-radius-card); background: var(--qc-bg); font-size: var(--qc-type-title3); font-weight: 600; box-shadow: var(--qc-shadow-8); overflow-wrap: anywhere; }
.player-result-icon { --qc-icon: 64px; }
.player-result h2 { font-size: var(--qc-type-title3); font-variant-numeric: tabular-nums; }
.player-podium-view { width: 100%; padding-top: var(--space-xl); display: grid; gap: var(--space-md); }
.player-podium-view > h1 { text-align: center; }
.player-podium-rows { margin: 0; padding: 0; display: grid; gap: var(--space-xs); list-style: none; }
.player-podium-row { min-height: 56px; padding: 0 var(--space-md); display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); border-radius: var(--qc-radius-card); background: var(--qc-white); color: var(--qc-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.player-podium-row strong { color: var(--qc-accent-text); }
.player-podium-row.self { box-shadow: inset 0 0 0 2px var(--qc-accent); }
.player-self-score { padding: var(--space-lg); display: grid; justify-items: center; gap: var(--space-2xs); border-radius: var(--qc-radius-card); background: var(--qc-white); color: var(--qc-ink); }
.player-self-score h2 { font-size: var(--qc-type-title3); }
.player-ended { font-size: var(--qc-type-title3); line-height: 1.35; }

/* ---------- motion: Fluent durations, transform and opacity only ---------- */
@keyframes qc-rise { from { transform: translateY(8px); } to { transform: none; } }
@keyframes qc-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes qc-pop { from { transform: scale(0.9); } to { transform: none; } }
@keyframes qc-pulse { 0% { transform: scale(1); } 30% { transform: scale(1.1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .host-answer-tile, .host-leaderboard-row, .host-podium-block, .reveal-bar, .host-histogram-bar, .host-player-chip, .host-countdown, .player-countdown { animation: none; }
  .player-timer, .player-answer, .player-answer-words { transition: none; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 75rem) {
  .question-editor { grid-template-columns: minmax(0, 1fr); }
  .question-settings { border-top: 1px solid var(--qc-border); border-left: 0; }
}
@media (max-width: 60rem) {
  .topbar { height: auto; }
  .topbar-content { flex-wrap: wrap; padding-block: var(--space-xs); gap: var(--space-sm); }
  .account > span:not(.avatar) { display: none; }
  .quiz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .question-list { border-right: 0; border-bottom: 1px solid var(--qc-border); }
  .editor-toolbar { top: 0; flex-wrap: wrap; }
  .host-lobby-main { grid-template-columns: minmax(0, 1fr); }
  .host-answer-grid[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .live-topbar { padding-inline: var(--space-md); flex-wrap: wrap; }
  .live-controls .button span:not(.icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .live-controls .button.subtle { width: 40px; padding: 0; }
  .live-quiz-title { flex-basis: 100%; order: 3; text-align: left; }
  .host-question-meta { flex-wrap: wrap; font-size: var(--qc-type-body); }
  .host-screen { padding-inline: var(--space-md); }
  .host-join-card { padding: var(--space-lg); }
  .host-pin { font-size: var(--qc-type-large); }
  .host-display { font-size: var(--qc-type-large); }
  .host-question-prompt { font-size: var(--qc-type-title3); }
  .host-answer-tile, .host-puzzle-item, .host-hint-pill, .reveal-card { font-size: var(--qc-type-body); }
  .host-answer-grid, .host-answer-grid[data-count="6"] { grid-template-columns: minmax(0, 1fr); }
  .host-podium { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
  .podium-place { font-size: var(--qc-type-title1); }
  .host-leaderboard-row { padding: var(--space-xs) var(--space-sm); display: flex; flex-wrap: wrap; column-gap: var(--space-sm); }
  .leader-name { flex: 1; }
  .reveal-chart { gap: var(--space-md); }
  .reveal-bar { width: 40px; }
  .page-content { padding-inline: var(--space-md); }
  .quiz-grid, .answer-grid, .inline-fields { grid-template-columns: minmax(0, 1fr); }
  .nav-links a { padding-inline: var(--space-xs); }
  .question-content, .question-fields { padding: var(--space-sm); }
  .editor-toolbar-leading { flex-basis: 100%; }
}
