:root {
  color-scheme: dark;
  --bg: #080d22;
  --bg-soft: #10183b;
  --surface: rgba(20, 29, 68, .82);
  --surface-strong: #151f4b;
  --line: rgba(150, 171, 255, .2);
  --text: #f5f7ff;
  --muted: #aab6dc;
  --primary: #70a7ff;
  --primary-strong: #486bff;
  --yellow: #ffd463;
  --coral: #ff7b87;
  --green: #5ee3b0;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 22px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3ff;
  --bg-soft: #dce7ff;
  --surface: rgba(255, 255, 255, .85);
  --surface-strong: #ffffff;
  --line: rgba(62, 81, 145, .18);
  --text: #17234c;
  --muted: #59688f;
  --primary: #426cf5;
  --primary-strong: #244be0;
  --shadow: 0 24px 70px rgba(56, 77, 143, .18);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 80% 10%, rgba(110, 88, 255, .25), transparent 30%), radial-gradient(circle at 12% 84%, rgba(0, 180, 255, .12), transparent 27%), var(--bg); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; overflow: hidden; position: relative; }
.app-shell::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 70%); }
.topbar { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(1440px, calc(100% - 44px)); margin: 0 auto; padding: 22px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #77afff, #795bff); box-shadow: 0 8px 28px rgba(83, 106, 255, .4); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.connection-pill, .nickname-badge, .hero-pills span, .status-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); background: rgba(255,255,255,.05); font-size: 12px; }
.connection-pill.live, .status-badge.live { color: var(--green); border-color: rgba(94,227,176,.4); }
.status-badge.warn { color: var(--yellow); border-color: rgba(255,212,99,.4); }
.teacher-entry, .icon-button { border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.06); }
.teacher-entry { padding: 10px 14px; font-weight: 800; }
.teacher-entry span { color: var(--yellow); margin-left: 5px; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; }
.main-content { position: relative; z-index: 1; width: min(1440px, calc(100% - 44px)); margin: 0 auto; padding: 28px 0 80px; }
.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero-view { position: relative; min-height: calc(100vh - 130px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 430px); align-items: center; gap: 70px; padding: clamp(30px, 7vw, 100px) clamp(18px, 7vw, 110px); border: 1px solid var(--line); border-radius: 34px; overflow: hidden; background: linear-gradient(90deg, rgba(8, 13, 34, .98) 0%, rgba(8, 13, 34, .85) 44%, rgba(8, 13, 34, .1) 100%), url('./assets/quiz-king-hero.png') right center / cover no-repeat; box-shadow: var(--shadow); }
html[data-theme="light"] .hero-view { background: linear-gradient(90deg, rgba(238,243,255,.98) 0%, rgba(238,243,255,.82) 44%, rgba(238,243,255,.12) 100%), url('./assets/quiz-king-hero.png') right center / cover no-repeat; }
.hero-copy { max-width: 670px; }
.eyebrow, .panel-kicker, .join-card-kicker { margin: 0 0 12px; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 20px; font-size: clamp(40px, 6vw, 76px); line-height: 1.04; letter-spacing: -.065em; }
h2 { margin-bottom: 12px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.045em; }
h3 { margin-bottom: 10px; font-size: 20px; }
.lede { max-width: 600px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero-pills span { color: var(--text); }
.join-hero-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.join-hero-card { padding: 28px; }
.join-hero-card h2 { font-size: 30px; }
.join-hero-card p, .section-heading p, .panel > p, .small-note { color: var(--muted); line-height: 1.65; }
.join-form { display: grid; gap: 14px; }
.hero-art-caption { position: absolute; left: 42px; bottom: 28px; display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; font-weight: 800; text-shadow: 0 2px 12px #000; }
.hero-art-caption small { color: #b8caff; font-weight: 500; }
.sparkle { color: var(--yellow); font-size: 28px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: rgba(0,0,0,.16); padding: 12px 13px; transition: border .2s, box-shadow .2s, background .2s; }
html[data-theme="light"] input, html[data-theme="light"] textarea, html[data-theme="light"] select { background: rgba(255,255,255,.7); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(112,167,255,.17); }
textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.button, .text-button, .add-question { border: 0; color: var(--text); background: transparent; }
.button { min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 800; transition: transform .2s, filter .2s, border .2s; }
.button:hover, .role-card:hover, .add-question:hover { transform: translateY(-2px); filter: brightness(1.08); }
.button-primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--primary-strong), #8d60ff); box-shadow: 0 12px 26px rgba(72, 89, 255, .3); }
.button-success { color: #061c17; border-color: transparent; background: var(--green); }
.button-warning { color: #281b03; border-color: transparent; background: var(--yellow); }
.button-danger { color: #fff; border-color: transparent; background: var(--coral); }
.button-ghost { background: rgba(255,255,255,.05); }
.button-wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.button-row.compact { justify-content: flex-end; }
.text-button { padding: 5px 0; color: var(--primary); font-weight: 800; }
.centered-button { display: block; margin: 14px auto 0; }
.section-heading, .host-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 auto 24px; }
.section-heading > div { max-width: 800px; }
.setup-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 380px); gap: 20px; align-items: start; }
.panel { padding: 22px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-header h3 { margin: 0; }
.studio-toolbar { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 18px; align-items: end; margin-bottom: 20px; }
.library-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: end; }
.title-save-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.title-save-button { min-width: 112px; white-space: nowrap; }
.question-list { display: grid; gap: 16px; }
.question-card { border: 1px solid var(--line); border-radius: 17px; padding: 17px; background: rgba(255,255,255,.035); }
.question-card-header, .question-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.question-card-header { margin-bottom: 15px; }
.question-number { display: grid; place-items: center; width: 40px; height: 30px; border-radius: 10px; color: #0b1230; background: var(--yellow); font-weight: 1000; }
.question-tools { display: flex; gap: 5px; }
.question-tools .icon-button { width: 32px; height: 32px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0; }
.option-line { display: flex; gap: 7px; align-items: center; }
.correct-select { flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; font-weight: 900; }
.correct-select:has(+ input:focus), .correct-select[aria-label*="目前正確"] { color: #07101f; border-color: var(--yellow); background: var(--yellow); }
.question-meta-row { align-items: end; }
.question-meta-row .field { flex: 1; }
.question-meta-row .field:last-child { max-width: 150px; }
.media-field { margin-top: 10px; }
.add-question { width: 100%; margin-top: 14px; border: 1px dashed var(--line); border-radius: 14px; padding: 14px; color: var(--primary); font-weight: 900; }
.launch-panel { position: sticky; top: 18px; }
.mode-list { display: grid; gap: 9px; }
.mode-option { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: rgba(255,255,255,.025); }
.mode-option.selected { border-color: var(--primary); background: rgba(112,167,255,.11); box-shadow: inset 0 0 0 1px rgba(112,167,255,.12); }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #081024; background: var(--yellow); font-weight: 900; }
.mode-option:nth-child(2) .mode-symbol { background: var(--coral); }
.mode-option:nth-child(3) .mode-symbol { background: var(--primary); }
.mode-option:nth-child(4) .mode-symbol { background: var(--green); }
.mode-option strong, .mode-option small { display: block; }
.mode-option small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.self-time-field { margin-top: 15px; }
.launch-summary { min-height: 63px; margin: 18px 0; border-left: 3px solid var(--yellow); padding: 11px 13px; color: var(--muted); background: rgba(255,212,99,.06); line-height: 1.55; }
.launch-summary strong { color: var(--text); }
.records-panel { margin-top: 20px; }
.records-list { display: grid; gap: 9px; }
.record-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; background: rgba(255,255,255,.025); }
.record-row strong, .record-row small { display: block; }
.record-row small { color: var(--muted); margin-top: 3px; }
.record-stat { color: var(--yellow); font-weight: 900; text-align: right; }
.narrow-view { max-width: 560px; margin: 50px auto; }
.centered { text-align: center; justify-content: center; }
.join-panel { display: grid; gap: 15px; }
.notice { border: 1px solid rgba(112,167,255,.3); border-radius: 11px; padding: 10px 12px; color: var(--primary); background: rgba(112,167,255,.08); white-space: pre-line; line-height: 1.5; }
.notice.error { color: #ff9da6; border-color: rgba(255,123,135,.35); background: rgba(255,123,135,.08); }
#hostQuestionStage .notice:not(.error) { color: #ffd21f; border-color: rgba(255,210,31,.65); background: rgba(255,210,31,.12); font-size: clamp(25px, 3vw, 44px); font-weight: 1000; text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.host-tools { display: flex; align-items: center; gap: 10px; }
.room-code-card { min-width: 160px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; text-align: center; background: var(--surface); }
.room-code-card small, .room-code-card strong { display: block; }
.room-code-card small { color: var(--muted); font-size: 11px; }
.room-code-card strong { margin-top: 4px; color: var(--yellow); font-size: 27px; letter-spacing: .12em; }
.host-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.host-stage-wrap { width: 100%; }
.host-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.scoreboard-panel .scoreboard { padding: 0; }
.stage-panel { min-height: 560px; display: flex; flex-direction: column; justify-content: space-between; }
.qr-stage { margin: auto; width: min(740px, 100%); }
.qr-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 800; }
.qr-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: center; margin-top: 22px; }
.qr-code-box, .modal-qr-box { display: grid; place-items: center; border-radius: 18px; padding: 10px; background: #fff; }
.qr-code-box canvas { max-width: 100%; height: auto !important; }
.join-instructions strong { display: block; color: var(--yellow); font-size: 64px; line-height: 1; }
.join-instructions > span { color: var(--muted); }
.join-instructions p { margin-top: 18px; color: var(--muted); line-height: 1.7; }
.question-stage { margin: auto 0; padding: clamp(24px, 5vw, 58px); min-height: min(68vh, 720px); border-radius: 22px; background: linear-gradient(rgba(8,13,34,.64), rgba(8,13,34,.9)), url('./assets/quiz-king-hero.png') center / cover no-repeat; }
.question-stage::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(8,13,34,.18), rgba(8,13,34,.72)); }
.question-stage { position: relative; isolation: isolate; }
.question-stage > * { position: relative; z-index: 1; }
.stage-number { display: inline-flex; align-items: center; gap: 8px; color: #10182d; background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 16px; font-weight: 900; letter-spacing: .04em; }
.stage-number .timer { color: #10182d; font-weight: 1000; }
.question-stage h3 { max-width: 1100px; margin: 16px 0 24px; font-size: clamp(32px, 4.4vw, 64px); line-height: 1.25; color: #fff; text-shadow: 0 3px 16px rgba(0,0,0,.58); }
.question-media { max-width: 100%; max-height: 220px; margin: 0 0 20px; border-radius: 16px; object-fit: contain; }
.stage-options, .answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stage-option { width: 100%; min-height: 76px; border: 1px solid rgba(255,255,255,.34); border-radius: 14px; padding: 18px 20px; color: #fff; background: rgba(7,13,35,.54); font-size: clamp(22px, calc(1.35rem * var(--host-font-scale, 1)), 38px); line-height: 1.35; text-align: left; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; overflow-wrap: anywhere; }
.question-stage .stage-option { color: #111827; background: #fff; border-color: #fff; border-radius: 18px; }
.question-stage .stage-option strong { color: #111827; }
.stage-option span { display: inline; }
.stage-option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--primary); background: rgba(255,255,255,.16); }
.stage-option:disabled { cursor: default; }
.stage-option.correct { border-color: var(--green); background: rgba(94,227,176,.15); }
.stage-option.correct::after { content: '✓'; display: inline-grid; place-items: center; float: right; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: #25ae72; font-weight: 1000; }
.stage-option.incorrect { border: 4px solid #ff5d67; background: rgba(255,72,86,.2); }
.question-stage .stage-option.correct { color: #111827; background: #fff; border-color: var(--yellow); }
.question-stage .stage-option.correct::after { color: #241900; background: var(--yellow); }
.question-stage .stage-option.incorrect { color: #111827; background: #fff; border-color: #ff5d67; }
.short-answer-host-answer { display: grid; gap: 5px; margin-top: 24px; border: 3px solid var(--yellow); border-radius: 18px; padding: 16px 20px; color: #201600; background: var(--yellow); box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.short-answer-host-answer span { font-size: 15px; font-weight: 900; }
.short-answer-host-answer strong { font-size: clamp(26px, calc(1.55rem * var(--host-font-scale, 1)), 46px); line-height: 1.3; overflow-wrap: anywhere; }
.wrong-mark { float: right; color: #ff5d67; font-size: 42px; line-height: .8; }
.stage-option strong { color: var(--primary); }
.stage-option small { float: right; color: var(--muted); }
.font-controls { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.font-controls .icon-button { width: 34px; height: 32px; font-weight: 800; }
.completion-score { margin: 22px 0; color: var(--primary); font-size: clamp(30px, 5vw, 64px); font-weight: 900; }
.question-paste-panel { display: grid; gap: 12px; margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
.paste-panel-heading { display: grid; gap: 5px; }
.paste-panel-heading strong { font-size: 18px; }
.paste-panel-heading small { color: var(--muted); }
.question-paste-panel textarea { min-height: 150px; resize: vertical; }
.records-panel > summary { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.records-panel > summary::-webkit-details-marker { display: none; }
.records-panel > summary strong { flex: 1; font-size: 18px; }
.records-panel-body { margin-top: 18px; }
.records-actions { justify-content: flex-end; margin-bottom: 12px; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th, .history-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.history-table th { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 16px; }
.roster-list { display: grid; gap: 8px; }
.roster-item, .score-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.roster-item small { min-width: 34px; padding: 4px 8px; border-radius: 8px; color: #2364e8; background: #fff; font-weight: 1000; text-align: center; }
.scoreboard { margin-top: 20px; }
.score-row strong:last-child { min-width: 58px; padding: 4px 8px; border-radius: 8px; color: #2364e8; background: #fff; font-weight: 1000; text-align: center; }
.student-view { max-width: 960px; margin: 25px auto; }
.student-header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.student-content { min-height: 420px; display: grid; place-items: center; }
.student-card { width: min(760px, 100%); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 5vw, 46px); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.student-view { min-height: calc(100vh - 100px); background: linear-gradient(rgba(8,13,34,.74), rgba(8,13,34,.86)), url('./assets/quiz-king-hero.png') center / cover fixed; border-radius: 24px; padding: clamp(18px, 3vw, 36px); }
.student-card h3 { font-size: clamp(25px, 4vw, 40px); line-height: 1.35; }
.student-card .question-media { max-height: 180px; margin-left: auto; margin-right: auto; }
.student-card .answer-grid { margin-top: 20px; }
.answer-button { min-height: 82px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: rgba(255,255,255,.05); font-weight: 800; transition: transform .2s, background .2s, border .2s; }
.answer-button:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--primary); background: rgba(112,167,255,.16); }
.answer-button.correct { border-color: var(--green); background: rgba(94,227,176,.18); }
.answer-button.incorrect { border: 4px solid #ff5d67; background: rgba(255,72,86,.2); }
.answer-result { margin-top: 18px; font-size: 22px; font-weight: 900; }
.correct-text { color: var(--green); }
.incorrect-text { color: #ff5d67; }
.advanced-quiz-settings { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.field-label { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.check-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: center; color: var(--text); font-size: 14px; line-height: 1.45; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.student-card .result-score { text-align: center; font-size: clamp(44px, 10vw, 92px); font-weight: 900; color: var(--primary); }
.student-card .result-name { text-align: center; font-size: clamp(30px, 7vw, 64px); font-weight: 900; color: var(--text); margin-bottom: 12px; }
.ranking-name { font-size: 22px; font-weight: 900; text-align: center; }
.student-card .button.answered { color: #fff; background: #28ad73; border-color: #28ad73; }
.short-answer-submissions { display: grid; gap: 10px; margin-top: 22px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.9); color: #17234c; }
.short-answer-submissions h4 { margin: 0; font-size: 20px; }
.short-answer-submission { display: grid; grid-template-columns: 120px 1fr auto auto; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid rgba(23,35,76,.15); }
.short-answer-submission span { overflow-wrap: anywhere; }
.student-card h3 { text-align: center; }
.result-score { margin: 18px 0; color: var(--yellow); font-size: clamp(54px, 11vw, 100px); font-weight: 1000; line-height: 1; }
.progress-bar { height: 8px; margin: 16px 0; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--green)); }
.buzz-stage { position: relative; min-height: 390px; margin: 16px -12px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(circle at 50% 50%, rgba(112,167,255,.16), transparent 60%); }
.buzz-stage .muted { padding-top: 28px; }
.buzzer-button { position: absolute; left: 45%; top: 42%; width: 155px; height: 155px; border: 9px solid rgba(255,255,255,.26); border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 25%, #ffacb1, #ff3e5c 58%, #b21846); box-shadow: 0 0 0 12px rgba(255,62,92,.12), 0 20px 40px rgba(209,26,81,.35); font-size: 24px; font-weight: 1000; transform: translate(-50%, -50%); transition: left .25s ease, top .25s ease, transform .15s; }
.buzzer-button:hover { transform: translate(-50%, -50%) scale(1.05); }
.buzzer-button.pressed { filter: grayscale(.6); transform: translate(-50%, -50%) scale(.94); }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 7, 22, .76); backdrop-filter: blur(12px); }
.modal-card { position: relative; width: min(470px, 100%); border: 1px solid var(--line); border-radius: 24px; padding: 28px; color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow); }
.modal-card h2 { margin-bottom: 8px; font-size: 32px; }
.modal-card p { color: var(--muted); line-height: 1.6; }
.modal-card .field { margin: 18px 0; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; font-size: 22px; }
.qr-modal-card { width: min(560px, 100%); text-align: center; }
.modal-qr-box { width: min(380px, 80vw); margin: 20px auto; }
.modal-qr-box canvas { max-width: 100%; height: auto !important; }
.muted { color: var(--muted); }
.small-note { font-size: 12px; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; max-width: min(400px, calc(100% - 44px)); border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: #ffb6bc; border-color: rgba(255,123,135,.4); }

@media (max-width: 980px) {
  .hero-view { grid-template-columns: 1fr; min-height: auto; gap: 30px; padding: 42px 26px 100px; background-position: 74% center; }
  .hero-copy { max-width: 590px; }
  .join-hero-card { max-width: 500px; }
  .setup-layout, .host-grid, .host-bottom-grid { grid-template-columns: 1fr; }
  .launch-panel { position: static; }
  .host-topline { align-items: start; }
  .roster-panel { order: 2; }
}
@media (max-width: 680px) {
  .topbar, .main-content { width: min(100% - 24px, 1440px); }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .connection-pill { order: 3; width: 100%; text-align: right; }
  .hero-view { padding: 30px 18px 75px; border-radius: 24px; background-position: 67% center; }
  h1 { font-size: clamp(38px, 13vw, 60px); }
  .lede { font-size: 16px; }
  .section-heading, .host-topline, .student-header { align-items: flex-start; flex-direction: column; }
  .studio-toolbar, .library-actions { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .button-row.compact { justify-content: flex-start; }
  .option-grid, .stage-options, .answer-grid { grid-template-columns: 1fr; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-code-box { width: min(280px, 100%); margin: auto; }
  .join-instructions { text-align: center; }
  .host-tools { width: 100%; align-items: stretch; flex-direction: column; }
  .font-controls { justify-content: center; }
  .room-code-card { width: 100%; }
  .question-meta-row { align-items: stretch; flex-direction: column; }
  .question-meta-row .field:last-child { max-width: none; }
  .buzzer-button { width: 135px; height: 135px; }
}
