:root {
  color-scheme: dark;
  --bg: #0b0d16;
  --panel: rgba(18, 21, 34, .86);
  --panel-strong: #151929;
  --panel-soft: #111524;
  --line: rgba(160, 174, 215, .13);
  --line-strong: rgba(160, 174, 215, .22);
  --text: #f4f6ff;
  --muted: #929ab4;
  --subtle: #68718d;
  --purple: #9673ff;
  --purple-bright: #ad91ff;
  --cyan: #69d9d4;
  --green: #67d9a2;
  --red: #ff7288;
  --amber: #ffc66e;
  --radius: 18px;
  font-family: "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh; margin: 0; color: var(--text); overflow-x: hidden;
  background: radial-gradient(ellipse at 50% -20%, #242044 0, #111321 38%, #0b0d16 75%);
  font-size: 15px;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; pointer-events: none; z-index: -1; filter: blur(100px); opacity: .14; border-radius: 50%; }
.ambient-one { width: 360px; height: 360px; background: #7858ff; top: 150px; left: -230px; }
.ambient-two { width: 300px; height: 300px; background: #258d9a; right: -210px; top: 55%; }
.topbar {
  height: 76px; max-width: 1240px; margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(176, 184, 225, .08);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font: 700 20px "Space Grotesk", sans-serif; letter-spacing: -.8px; }
.brand-accent { color: var(--purple-bright); }
.brand-mark { width: 27px; height: 27px; padding: 5px; border: 1px solid rgba(173,145,255,.55); border-radius: 9px; display: flex; gap: 2px; align-items: end; transform: rotate(-5deg); background: rgba(150,115,255,.12); }
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: #b19aff; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .8; }
.top-nav { display: flex; align-items: center; gap: 8px; margin-left: 80px; }
.top-nav a { color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 13px; border-radius: 9px; transition: .2s; }
.top-nav a:hover, .top-nav a.active { color: #fff; background: rgba(150,115,255,.11); }
.top-status { display: flex; align-items: center; gap: 9px; color: #b2bad0; font-size: 12px; font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(103,217,162,.65); }
.app-shell { width: min(1120px, calc(100% - 48px)); min-height: calc(100vh - 138px); margin: 0 auto; padding: 48px 0 64px; }
.site-footer { min-height: 62px; max-width: 1240px; margin: 0 auto; padding: 18px 30px; border-top: 1px solid rgba(176,184,225,.08); display: flex; align-items: center; justify-content: space-between; color: #666f88; font-size: 10px; letter-spacing: 1.1px; font-weight: 700; }
.footer-dot { color: var(--purple); padding: 0 5px; }
.loading-screen { min-height: 45vh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; color: var(--muted); }
.loader { width: 30px; height: 30px; border: 2px solid rgba(150,115,255,.2); border-top-color: var(--purple-bright); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shared */
.eyebrow { color: var(--purple-bright); font-weight: 800; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 17px; height: 1px; background: var(--purple-bright); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; }
h1 { font-size: clamp(36px, 5vw, 55px); line-height: 1.05; letter-spacing: -2.7px; margin: 16px 0 14px; }
h2 { letter-spacing: -.8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 99px; padding: 7px 11px; color: #bdc4d9; font-size: 11px; font-weight: 700; }
.pill .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.card { background: linear-gradient(145deg, rgba(23,27,44,.94), rgba(17,21,35,.93)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 70px rgba(0,0,0,.13); }
.btn { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .18s, filter .18s, background .18s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { color: #130f23; background: linear-gradient(135deg, #bba8ff, #8c6bff); box-shadow: 0 8px 25px rgba(137,103,255,.22); }
.btn-secondary { background: rgba(255,255,255,.045); color: #e6e9f8; border-color: var(--line-strong); }
.btn-danger { background: rgba(255,114,136,.1); border-color: rgba(255,114,136,.2); color: #ff9aab; }
.btn-quiet { background: transparent; color: var(--muted); border-color: transparent; }
.btn-wide { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); border-radius: 9px; cursor: pointer; }
.icon-btn:hover { color: #fff; border-color: var(--line-strong); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field-label { color: #b8bfd3; font-size: 12px; font-weight: 700; }
.input, .textarea, .select { width: 100%; outline: 0; border: 1px solid rgba(155,169,211,.17); background: rgba(7,10,19,.52); color: var(--text); border-radius: 10px; padding: 12px 13px; transition: border .2s, box-shadow .2s; }
.input::placeholder, .textarea::placeholder { color: #68718a; }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(173,145,255,.65); box-shadow: 0 0 0 3px rgba(150,115,255,.1); }
.textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.select { color-scheme: dark; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.form-error { background: rgba(255,114,136,.09); border: 1px solid rgba(255,114,136,.22); border-radius: 10px; padding: 11px 13px; color: #ff9eae; font-size: 12px; }
.form-success { background: rgba(103,217,162,.08); border: 1px solid rgba(103,217,162,.2); border-radius: 10px; padding: 11px 13px; color: #8ce5b7; font-size: 12px; }

/* Creator */
.hero { display: grid; grid-template-columns: 1fr 300px; align-items: end; gap: 36px; margin: 4px 0 34px; }
.hero-copy p { max-width: 570px; color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 0; }
.hero-emphasis { color: #c3b4ff; }
.hero-side { padding: 19px; align-self: center; }
.hero-side-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.hero-side-title { font-size: 12px; font-weight: 800; }
.mini-live { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .8px; }
.preview-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.preview-tile { height: 54px; background: rgba(150,115,255,.09); border: 1px solid rgba(150,115,255,.12); border-radius: 9px; display: grid; place-items: center; color: #bbaaff; font: 700 16px "Space Grotesk"; }
.hero-side-foot { margin-top: 13px; color: var(--muted); font-size: 10px; }
.builder-layout { display: grid; grid-template-columns: minmax(0,1fr) 265px; gap: 20px; align-items: start; }
.builder-main { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-heading h2 { font-size: 18px; margin: 0 0 5px; }
.section-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.question-list { display: flex; flex-direction: column; gap: 13px; }
.question-card { background: rgba(8,11,20,.43); border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.question-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.question-number { color: #c5b8ff; font: 700 12px "Space Grotesk"; letter-spacing: .7px; }
.question-head-actions { display: flex; align-items: center; gap: 7px; }
.type-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 9px; }
.type-switch button { background: transparent; border: 0; color: var(--muted); border-radius: 6px; padding: 6px 9px; font-size: 10px; font-weight: 800; cursor: pointer; }
.type-switch button.active { background: rgba(150,115,255,.18); color: #d7ceff; }
.question-text { margin-bottom: 14px; }
.option-editor { display: grid; grid-template-columns: 1fr 34px; gap: 7px; margin-top: 7px; align-items: center; }
.option-line { display: flex; align-items: center; gap: 9px; }
.option-letter { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; background: rgba(150,115,255,.1); color: #c3b4ff; border: 1px solid rgba(150,115,255,.14); border-radius: 7px; font: 700 11px "Space Grotesk"; }
.option-input-wrap { position: relative; flex: 1; }
.option-input-wrap .input { padding: 9px 11px; font-size: 12px; }
.correct-pick { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: #9de8c1; font-size: 11px; }
.correct-pick select { max-width: 160px; padding: 6px 8px; border-radius: 7px; background: #0d1320; border: 1px solid rgba(103,217,162,.25); color: #b7f0d0; font-size: 11px; }
.question-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(160,174,215,.08); color: var(--subtle); font-size: 10px; display: flex; justify-content: space-between; }
.add-question-row { margin-top: 15px; display: flex; justify-content: center; }
.add-question { border: 1px dashed rgba(160,174,215,.25); border-radius: 11px; min-height: 44px; width: 100%; background: rgba(255,255,255,.018); color: #bfc6dc; cursor: pointer; font-size: 12px; font-weight: 700; }
.add-question:hover { border-color: rgba(173,145,255,.6); color: #d6ccff; background: rgba(150,115,255,.05); }
.builder-sidebar { display: flex; flex-direction: column; gap: 13px; }
.side-card { padding: 18px; }
.side-title { font: 700 13px "Space Grotesk"; margin-bottom: 14px; }
.quiz-title-field { margin-bottom: 17px; }
.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(160,174,215,.08); font-size: 11px; }
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { color: var(--muted); }
.info-row span:last-child { color: #e3e7f7; font-weight: 700; text-align: right; }
.publish-card { border-color: rgba(150,115,255,.2); background: linear-gradient(145deg, rgba(71,53,123,.22), rgba(17,21,35,.95)); }
.publish-card p { color: #a7aec4; font-size: 11px; line-height: 1.6; margin-bottom: 15px; }
.publish-card .btn { width: 100%; }
.trust-note { display: flex; gap: 9px; padding: 12px; color: #8d96b0; font-size: 10px; line-height: 1.5; }
.trust-icon { color: var(--cyan); font-size: 14px; }

/* Join */
.join-wrap { width: min(470px, 100%); margin: 35px auto 0; }
.join-heading { text-align: center; margin-bottom: 25px; }
.join-heading .eyebrow { justify-content: center; }
.join-heading .eyebrow::after { content: ""; width: 17px; height: 1px; background: var(--purple-bright); }
.join-heading h1 { font-size: 43px; margin-bottom: 10px; }
.join-heading p { color: var(--muted); line-height: 1.6; font-size: 13px; }
.join-card { padding: 25px; }
.join-icon { margin: 0 auto 17px; width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(150,115,255,.25); background: rgba(150,115,255,.11); color: #c7b9ff; border-radius: 16px; font: 700 22px "Space Grotesk"; }
.code-input { text-align: center; font: 700 27px "Space Grotesk"; letter-spacing: 10px; padding: 14px; }
.join-card .field { margin-bottom: 16px; }
.privacy-note { margin: 14px 0 0; text-align: center; color: #747d97; font-size: 10px; line-height: 1.55; }
.join-disclaimer { display: flex; align-items: flex-start; gap: 9px; margin-top: 17px; border: 1px solid rgba(255,198,110,.14); background: rgba(255,198,110,.045); padding: 12px; border-radius: 10px; color: #b9a784; font-size: 10px; line-height: 1.55; }
.join-disclaimer strong { color: #e2c58d; }

/* Host dashboard */
.dashboard-top { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.dashboard-title h1 { font-size: 34px; margin: 8px 0 5px; letter-spacing: -1.6px; }
.dashboard-title p { color: var(--muted); margin: 0; font-size: 12px; }
.code-display { min-width: 170px; padding: 12px 15px; text-align: center; background: rgba(150,115,255,.08); border: 1px solid rgba(150,115,255,.22); border-radius: 13px; }
.code-display small { display: block; color: #a99bd4; font-size: 9px; letter-spacing: 1.5px; font-weight: 800; }
.code-display strong { display: block; font: 700 27px "Space Grotesk"; letter-spacing: 4px; margin: 3px 0; }
.code-display button { background: none; border: 0; color: #bdaeff; font-size: 10px; font-weight: 700; cursor: pointer; }
.dashboard-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 17px; }
.stat-card { padding: 15px 17px; display: flex; align-items: center; gap: 13px; }
.stat-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: rgba(150,115,255,.11); color: #c3b4ff; font-size: 15px; }
.stat-value { font: 700 20px "Space Grotesk"; }
.stat-label { color: var(--muted); font-size: 10px; margin-top: 3px; }
.dashboard-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.dashboard-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 13px 15px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.dashboard-tabs button.active { color: #d6cdff; border-bottom-color: var(--purple-bright); }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; border-radius: 6px; background: rgba(255,114,136,.15); color: #ff9cab; font-size: 9px; }
.dashboard-panel { padding: 20px; min-height: 270px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.panel-heading h2 { font-size: 15px; margin: 0; }
.panel-heading p { color: var(--muted); margin: 4px 0 0; font-size: 10px; }
.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-row { padding: 12px; border: 1px solid rgba(160,174,215,.1); border-radius: 11px; display: grid; grid-template-columns: minmax(150px,1.3fr) minmax(100px,1fr) minmax(90px,.8fr) auto; align-items: center; gap: 13px; background: rgba(7,10,19,.25); }
.player-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 10px; color: #d7ceff; background: rgba(150,115,255,.14); font: 700 11px "Space Grotesk"; }
.player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.player-sub { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.progress-meta { display: flex; justify-content: space-between; color: #b8c0d7; font-size: 9px; margin-bottom: 7px; }
.progress-track { height: 5px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8c6bff, #70d7cf); }
.player-answer { color: #aeb7d0; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-status { display: inline-flex; align-items: center; gap: 6px; color: #8b95af; font-size: 9px; font-weight: 800; white-space: nowrap; }
.player-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #66718a; }
.player-status.online { color: #83dfad; }
.player-status.online::before { background: var(--green); box-shadow: 0 0 9px rgba(103,217,162,.5); }
.player-status.flagged { color: #ffb4be; }
.player-status.flagged::before { background: var(--red); }
.empty-state { text-align: center; padding: 46px 15px; color: var(--muted); }
.empty-icon { font-size: 24px; margin-bottom: 10px; }
.empty-state strong { display: block; color: #dbe0f2; font-size: 13px; margin-bottom: 6px; }
.empty-state p { font-size: 11px; line-height: 1.5; max-width: 340px; margin: 0 auto; }
.host-controls { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; padding: 16px 18px; }
.host-current { display: flex; align-items: center; gap: 12px; }
.host-current-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(105,217,212,.1); color: var(--cyan); }
.host-current strong { display: block; font-size: 12px; }
.host-current small { color: var(--muted); font-size: 10px; }
.host-control-buttons { display: flex; gap: 8px; }
.events-list { display: flex; flex-direction: column; gap: 8px; }
.event-row { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(255,114,136,.12); background: rgba(255,114,136,.035); border-radius: 10px; }
.event-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #ff9cac; background: rgba(255,114,136,.12); }
.event-main strong { display: block; font-size: 11px; }
.event-main span { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.event-time { color: #858da5; font-size: 9px; white-space: nowrap; }
.event-warning { display: flex; gap: 9px; margin-bottom: 15px; padding: 12px; background: rgba(255,198,110,.05); border: 1px solid rgba(255,198,110,.14); border-radius: 10px; color: #b9a784; font-size: 10px; line-height: 1.55; }
.question-preview { padding: 14px; background: rgba(7,10,19,.3); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 9px; }
.question-preview strong { display: block; font-size: 11px; margin-bottom: 7px; }
.question-preview small { color: var(--muted); font-size: 10px; }

/* Player game */
.game-wrap { max-width: 650px; margin: 14px auto 0; }
.game-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.game-header small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.game-header strong { font: 700 15px "Space Grotesk"; }
.game-count { color: #c4b8ff; font: 700 13px "Space Grotesk"; }
.game-card { padding: clamp(20px,4vw,31px); }
.game-progress { height: 5px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 25px; }
.game-progress span { height: 100%; display: block; background: linear-gradient(90deg,#8c6bff,#70d7cf); border-radius: inherit; transition: width .3s; }
.game-question-label { color: var(--purple-bright); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 12px; }
.game-question { font: 700 clamp(22px,4vw,30px) "Space Grotesk"; letter-spacing: -.8px; line-height: 1.25; margin-bottom: 23px; }
.answer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-option { text-align: left; min-height: 61px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.025); color: #e2e6f4; display: flex; align-items: center; gap: 11px; cursor: pointer; transition: .16s; }
.answer-option:hover { border-color: rgba(173,145,255,.48); background: rgba(150,115,255,.07); }
.answer-option.selected { background: rgba(150,115,255,.15); border-color: rgba(173,145,255,.75); box-shadow: inset 0 0 0 1px rgba(173,145,255,.16); }
.answer-letter { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(150,115,255,.1); color: #c9bcff; font: 700 11px "Space Grotesk"; }
.answer-option span:last-child { font-size: 12px; line-height: 1.4; }
.game-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 21px; gap: 12px; }
.game-actions .muted { font-size: 10px; }
.waiting-card { text-align: center; padding: 35px 25px; }
.waiting-orbit { width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 23px; display: grid; place-items: center; background: rgba(150,115,255,.1); border: 1px solid rgba(150,115,255,.2); color: #c5b7ff; font-size: 27px; }
.waiting-card h2 { font-size: 22px; margin-bottom: 8px; }
.waiting-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.finished-mark { color: var(--green); font-size: 34px; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 850px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr 240px; gap: 20px; }
  .player-row { grid-template-columns: minmax(130px,1.2fr) minmax(90px,1fr) auto; }
  .player-answer { display: none; }
}
@media (max-width: 620px) {
  .topbar { height: 65px; padding: 0 18px; }
  .top-nav { margin-left: 0; gap: 0; }
  .top-nav a { padding: 9px 8px; font-size: 11px; }
  .top-status { display: none; }
  .app-shell { width: min(100% - 30px, 540px); padding: 30px 0 46px; }
  .site-footer { padding: 15px; font-size: 8px; }
  .site-footer span:last-child { display: none; }
  .hero { display: block; margin-bottom: 24px; }
  .hero h1 { font-size: 39px; }
  .hero-copy p { font-size: 13px; }
  .hero-side { display: none; }
  .builder-main { padding: 16px; }
  .section-heading { align-items: flex-start; }
  .section-heading .btn { padding: 0 10px; font-size: 10px; }
  .builder-sidebar { display: flex; }
  .dashboard-top { flex-direction: column; }
  .code-display { width: 100%; }
  .dashboard-stats { gap: 7px; }
  .stat-card { padding: 11px 9px; gap: 8px; }
  .stat-icon { width: 30px; height: 30px; }
  .stat-value { font-size: 17px; }
  .stat-label { font-size: 8px; }
  .dashboard-panel { padding: 12px; }
  .player-row { grid-template-columns: minmax(0,1fr) auto; }
  .player-row .player-progress { grid-column: 1 / -1; }
  .player-status { grid-column: 2; grid-row: 1; }
  .host-controls { align-items: flex-start; flex-direction: column; }
  .host-control-buttons { width: 100%; }
  .host-control-buttons .btn { flex: 1; }
  .event-row { grid-template-columns: 30px minmax(0,1fr); }
  .event-time { grid-column: 2; }
  .answer-options { grid-template-columns: 1fr; }
  .join-wrap { margin-top: 12px; }
  .join-heading h1 { font-size: 37px; }
}
.toast { position: fixed; z-index: 20; bottom: 24px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line-strong); background: #1a2032; padding: 12px 17px; border-radius: 11px; color: #e6eaff; box-shadow: 0 15px 50px rgba(0,0,0,.4); font-size: 12px; font-weight: 700; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,114,136,.3); color: #ffabb8; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%,8px); } to { opacity: 1; transform: translate(-50%,0); } }

/* Automatic and manual written-answer grading */
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.dashboard-tabs { flex-wrap: wrap; }
.grading-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: -2px 0 16px; }
.grading-summary span { border: 1px solid var(--line); background: rgba(7,10,19,.25); padding: 8px 11px; border-radius: 9px; color: var(--muted); font-size: 10px; }
.grading-summary strong { color: #e5e9f8; font: 700 14px "Space Grotesk"; margin-right: 4px; }
.grading-question { padding: 15px; margin-top: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,10,19,.22); }
.grading-question-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.grading-question-head h3 { margin: 5px 0 5px; font-size: 13px; }
.grading-question-head small { color: var(--muted); font-size: 10px; }
.grading-list { display: flex; flex-direction: column; gap: 7px; }
.grading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px; border: 1px solid rgba(160,174,215,.1); border-radius: 9px; background: rgba(255,255,255,.018); }
.grading-player { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grading-player strong { font-size: 11px; }
.grading-player span { color: #b6bfd5; font-size: 10px; overflow-wrap: anywhere; }
.grading-result { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }
.grade-pill { display: inline-flex; align-items: center; border-radius: 7px; padding: 5px 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.grade-correct { color: #82e0b0; background: rgba(103,217,162,.1); }
.grade-incorrect { color: #ff9baa; background: rgba(255,114,136,.1); }
.grade-pending { color: #e6c58e; background: rgba(255,198,110,.1); }
.manual-grade-actions { display: flex; gap: 6px; }
.btn-small { min-height: 29px; padding: 0 9px; font-size: 9px; }
.grading-empty { padding: 13px; text-align: center; color: var(--muted); font-size: 10px; }
.final-score { display: flex; flex-direction: column; gap: 3px; margin: 15px 0 7px; }
.final-score strong { font: 700 35px "Space Grotesk"; color: #c9bcff; }
.final-score span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
@media (max-width: 620px) {
  .grading-question-head { flex-direction: column; }
  .grading-row { align-items: flex-start; flex-direction: column; }
  .grading-result { align-items: flex-start; width: 100%; }
  .manual-grade-actions { width: 100%; }
  .manual-grade-actions .btn { flex: 1; }
}

/* QuizFlow start screen */
.home-screen { max-width: 880px; margin: clamp(35px,8vh,85px) auto 35px; text-align: center; }
.home-screen h1 { margin: 15px 0 10px; font: 700 clamp(38px,6vw,62px)/1.06 "Space Grotesk"; letter-spacing: -2px; }
.home-intro { max-width: 570px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.7; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.home-action-card { min-height: 225px; padding: 25px; display: flex; align-items: flex-start; gap: 18px; text-align: left; text-decoration: none; color: #edf0fc; border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(145deg,rgba(30,34,57,.92),rgba(14,18,31,.96)); box-shadow: 0 24px 70px rgba(0,0,0,.2); transition: transform .18s,border-color .18s,background .18s; }
.home-action-card:hover { transform: translateY(-4px); border-color: rgba(173,145,255,.52); background: linear-gradient(145deg,rgba(45,40,78,.95),rgba(14,18,31,.98)); }
.home-action-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 15px; background: rgba(150,115,255,.16); color: #d3c8ff; font-size: 25px; }
.join-action .home-action-icon { color: #87e4d7; background: rgba(103,217,194,.12); }
.home-action-copy { display: flex; flex-direction: column; min-width: 0; gap: 9px; }
.home-action-copy small { color: var(--subtle); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.home-action-copy strong { font: 700 27px "Space Grotesk"; }
.home-action-copy span { color: var(--muted); font-size: 11px; line-height: 1.65; }
.home-action-arrow { margin-left: auto; color: #bfb0ff; font-size: 23px; }
.join-action .home-action-arrow { color: var(--cyan); }
.home-admin-link { margin-top: 24px; }
.home-admin-link a,.admin-back-link { color: var(--muted); font-size: 10px; text-decoration: none; }
.home-admin-link a:hover,.admin-back-link:hover { color: #ded7ff; }
.home-footnote { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 46px; color: var(--subtle); font-size: 9px; letter-spacing: .3px; }
.home-footnote .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(103,217,162,.5); }
.code-expiry { display: block; margin-top: 8px; color: var(--subtle); font-size: 9px; }
.host-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; padding: 13px 16px; }
.host-tools-copy { display: flex; flex-direction: column; gap: 4px; }
.host-tools-copy strong { font-size: 11px; }
.host-tools-copy span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.host-tools-actions,.admin-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-login-wrap { max-width: 460px; margin: 65px auto 0; }
.admin-login { padding: clamp(22px,5vw,36px); }
.admin-login h1 { font: 700 27px "Space Grotesk"; margin: 12px 0 8px; }
.admin-login p,.admin-header p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.admin-lock { display: grid; place-items: center; width: 43px; height: 43px; margin-top: 18px; border-radius: 13px; background: rgba(150,115,255,.14); color: #cbbdff; font-size: 24px; }
.admin-back-link { display: block; margin-top: 18px; text-align: center; }
.admin-dashboard { display: flex; flex-direction: column; gap: 17px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; }
.admin-header h1 { margin: 7px 0; font: 700 clamp(25px,4vw,36px) "Space Grotesk"; }
.admin-quiz-list { padding: 20px; }
.admin-quiz-grid { display: flex; flex-direction: column; gap: 9px; }
.admin-quiz-card { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(140px,.8fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(160,174,215,.12); border-radius: 11px; background: rgba(7,10,19,.25); }
.admin-quiz-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.admin-quiz-main strong { overflow-wrap: anywhere; font-size: 12px; }
.admin-quiz-main small,.admin-quiz-meta small { color: var(--muted); font-size: 9px; }
.admin-code { color: #c7baff; font: 700 13px "Space Grotesk"; letter-spacing: 1px; }
.admin-quiz-meta { display: flex; flex-direction: column; gap: 5px; color: #c2c9dc; font-size: 10px; }
.admin-detail { margin-top: 18px; padding: 20px; }
.admin-detail h2 { margin: 4px 0; font-size: 15px; }
.admin-section-title { margin: 22px 0 10px; font: 700 13px "Space Grotesk"; }
.admin-player-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-player-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(7,10,19,.24); }
.admin-player-heading { display: flex; justify-content: space-between; gap: 9px; margin-bottom: 10px; }
.admin-player-heading strong { font-size: 11px; }
.admin-player-heading span { color: var(--muted); font-size: 9px; text-align: right; }
.admin-player-answers { display: flex; flex-direction: column; gap: 7px; }
.admin-answer { display: flex; flex-direction: column; gap: 3px; padding-top: 7px; border-top: 1px solid rgba(160,174,215,.09); }
.admin-answer strong { font-size: 9px; color: #d6dcf0; line-height: 1.4; }
.admin-answer span { color: #b7c1d9; font-size: 10px; overflow-wrap: anywhere; }
.admin-answer small { color: var(--subtle); font-size: 9px; }
@media (max-width: 700px) {
  .home-actions { grid-template-columns: 1fr; gap: 12px; margin-top: 25px; }
  .home-action-card { min-height: 150px; padding: 19px; }
  .home-screen { margin-top: 25px; }
  .host-tools { align-items: flex-start; flex-direction: column; }
  .host-tools-actions { width: 100%; }
  .host-tools-actions .btn { flex: 1; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-quiz-card { grid-template-columns: 1fr; align-items: flex-start; }
  .admin-player-grid { grid-template-columns: 1fr; }
  .admin-player-heading { flex-direction: column; }
  .admin-player-heading span { text-align: left; }
}

/* Quiz restore code */
.restore-box {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(150, 115, 255, .22);
  border-radius: 13px;
  background: rgba(150, 115, 255, .055);
}
.restore-box p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.restore-box .field-hint { min-height: 14px; color: var(--red, #ff8585); }
.restore-code-display {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.restore-code-display strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  letter-spacing: 2px;
  color: #d7caff;
}
.restore-code-display small:last-child { max-width: 210px; white-space: normal; line-height: 1.45; color: var(--muted); }
