/* Duo Quiz host dashboard. Same look as duoquizz.online: dark purple stage, Unbounded + Outfit, amber buttons, teal accents. */
@font-face { font-family: Unbounded; src: url("/assets/Unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: Outfit; src: url("/assets/Outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg0: #12052E; --bg1: #2B0F6B; --surface: #231055; --raised: #341A7C; --ink: #0B0E2E;
  --text: #FFFFFF; --muted: #CFC5F7; --faint: #9A8FD0; --line: rgba(255,255,255,0.13); --line2: rgba(255,255,255,0.22);
  --amber: #FFC233; --amber-deep: #E08600; --coral: #FF6A4D; --coral-deep: #D23A2E;
  --aqua: #3DE8D6; --aqua-deep: #0FA39C; --green: #3DDC84; --green-deep: #16934D;
  --violet: #9B7BFF; --violet-deep: #5E3FD6; --pink: #FF5FA2; --blue: #4DA3FF; --blue-deep: #2361C9;
  --card: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  --field: rgba(11,8,40,0.55);
  --display: Unbounded, "Arial Black", system-ui, sans-serif;
  --body: Outfit, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --r: 20px;
  --shadow: 0 18px 50px rgba(5,2,20,0.38);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg0); color: var(--text); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--aqua); }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.noscript { padding: 40px; text-align: center; }
[hidden] { display: none !important; }

/* Stage background: a soft spotlight and slow light rays, like the landing page but calmer. */
.stage-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 90% 60% at 50% -5%, #5B2BD6 0%, var(--bg1) 36%, var(--bg0) 78%); overflow: hidden; }
.stage-bg::before { content: ""; position: absolute; inset: -40% -20% auto; height: 150%; background: repeating-conic-gradient(from 0deg at 50% 0%, rgba(255,255,255,0.045) 0 5deg, transparent 5deg 12deg); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 62%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 62%); animation: spin 160s linear infinite; transform-origin: 50% 0%; }
@keyframes spin { to { transform: rotate(360deg); } }

.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 20px; }
.wrap.wide { width: min(1440px, 100%); }
.boot, .center-msg { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; }
.center-msg h1 { font-size: 28px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(18,5,46,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar.plain { position: relative; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 4px 0 rgba(11,14,46,0.45), 0 0 0 2px rgba(255,255,255,0.12); flex: none; }
.word { font: 900 22px/1 var(--display); letter-spacing: -0.03em; white-space: nowrap; }
.word b { color: var(--amber); font-weight: 900; }
.word b::after { content: "!"; color: var(--coral); }
.brand-tag { font: 800 11px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--aqua); padding: 5px 8px; border-radius: 999px; transform: rotate(-3deg); }
.bar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; }
.who b { font-weight: 700; font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-email { color: var(--faint); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 14px; font: 700 16px/1.15 var(--body); text-decoration: none; color: var(--text); white-space: nowrap; transition: transform 0.12s, box-shadow 0.12s, background 0.15s, opacity 0.15s; -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: #1C1300; box-shadow: 0 4px 0 var(--amber-deep); font-weight: 800; }
.btn-primary:hover:not(:disabled) { background: #FFCB4F; }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--amber-deep); }
.btn-teal { background: var(--aqua); color: #04302C; box-shadow: 0 4px 0 var(--aqua-deep); font-weight: 800; }
.btn-teal:active:not(:disabled) { box-shadow: 0 2px 0 var(--aqua-deep); }
.btn-ghost { background: rgba(255,255,255,0.08); border: 1px solid var(--line2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.btn-danger { background: rgba(255,106,77,0.14); color: #FFB3A3; border: 1px solid rgba(255,106,77,0.45); }
.btn-danger:hover:not(:disabled) { background: rgba(255,106,77,0.24); }
.btn-sm { padding: 8px 13px; font-size: 14px; border-radius: 11px; }
.btn-primary.btn-sm, .btn-teal.btn-sm { box-shadow: 0 3px 0 var(--amber-deep); }
.btn-teal.btn-sm { box-shadow: 0 3px 0 var(--aqua-deep); }
.btn-lg { padding: 14px 24px; font-size: 17px; border-radius: 16px; }
.btn-xl { padding: 18px 34px; font-size: 22px; border-radius: 20px; }
.btn-primary.btn-xl { box-shadow: 0 6px 0 var(--amber-deep); }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--aqua); text-decoration: underline; font-weight: 600; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,0.16); font: 700 12.5px/1 var(--body); color: var(--text); }
.btn-primary .count-pill { background: rgba(28,19,0,0.16); color: #1C1300; }
.kbd { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 7px; background: rgba(28,19,0,0.14); font: 700 12px/1 var(--body); letter-spacing: 0.02em; }
.btn-ghost .kbd { background: rgba(255,255,255,0.14); }

/* ---------- fields ---------- */
input[type=text], input[type=email], input[type=datetime-local], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--field); color: var(--text);
  font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: rgba(207,197,247,0.5); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(61,232,214,0.16); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: #231055; }
input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; cursor: pointer; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.hint { color: var(--faint); font-size: 14px; line-height: 1.4; }
.hint.warn, .warn { color: #FFD27A; }
.field-error { color: #FFB3A3; font-weight: 600; font-size: 14px; margin-top: 8px; }
.char-count { font-weight: 600; color: var(--faint); font-size: 12px; }
.note { padding: 12px 14px; border-radius: 14px; font-size: 15px; margin-bottom: 16px; }
.note-warn { background: rgba(255,194,51,0.12); border: 1px solid rgba(255,194,51,0.35); color: #FFE3A1; }
.note-dev { background: rgba(61,232,214,0.1); border: 1px dashed rgba(61,232,214,0.5); margin: 16px 0 0; }
.note-dev a { font-weight: 700; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; flex: none; }
.switch-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { width: 52px; height: 30px; border-radius: 999px; background: rgba(255,255,255,0.16); border: 1px solid var(--line2); transition: background 0.18s; display: block; position: relative; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); transition: transform 0.18s; }
.switch-input:checked + .switch-track { background: var(--aqua-deep); border-color: var(--aqua); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* ---------- cards, badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 12.5px/1.2 var(--body); letter-spacing: 0.02em; border: 1px solid transparent; white-space: nowrap; }
.status-draft.badge { background: rgba(255,255,255,0.1); color: var(--muted); border-color: var(--line2); }
.status-open.badge { background: rgba(61,220,132,0.16); color: #8FF0BA; border-color: rgba(61,220,132,0.4); }
.status-closed.badge { background: rgba(255,106,77,0.14); color: #FFB3A3; border-color: rgba(255,106,77,0.38); }
.mode-self.badge { background: rgba(155,123,255,0.16); color: #CDBEFF; border-color: rgba(155,123,255,0.35); }
.mode-live.badge { background: rgba(255,95,162,0.15); color: #FFB2D3; border-color: rgba(255,95,162,0.38); }
.badge .dot, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61,220,132,0.7); animation: pulse 1.8s infinite; display: inline-block; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 800 12.5px/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.page-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.pane-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.saved { font: 600 13px/1 var(--body); color: var(--green); letter-spacing: 0; }
.back { display: inline-flex; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 4px 0; }
.back:hover { color: var(--text); }
.claude-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(135deg, var(--aqua), #2BB6E8); color: #04302C; font-size: 15px; font-weight: 900; flex: none; }
.claude-mark.sm { width: 18px; height: 18px; border-radius: 6px; font-size: 11px; }

/* Spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: var(--aqua); animation: rot 0.8s linear infinite; flex: none; vertical-align: -3px; }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; }
.spinner.big { width: 44px; height: 44px; border-width: 4px; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 30px 6px; }

/* Toasts */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 10px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px 13px 16px; border-radius: 16px; background: #2A1468; border: 1px solid var(--line2); box-shadow: 0 16px 40px rgba(5,2,20,0.55); animation: toastIn 0.25s ease-out; font-weight: 600; }
.toast.out { opacity: 0; transform: translateY(8px); transition: 0.3s; }
.toast-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #07301A; font-weight: 900; font-size: 14px; flex: none; }
.toast.error { background: #4A1630; border-color: rgba(255,106,77,0.5); }
.toast.error .toast-icon { background: var(--coral); color: #fff; }
.toast-text { flex: 1; padding-top: 1px; }
.toast-x { background: none; border: 0; color: var(--faint); font-size: 22px; line-height: 1; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- sign in ---------- */
.signin { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 30px 20px 80px; min-height: calc(100vh - 66px); }
.pitch h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 900; line-height: 1.02; margin: 16px 0 18px; text-shadow: 0 6px 0 rgba(11,14,46,0.4); }
.hl { background: linear-gradient(92deg, var(--aqua), #7BD8FF 55%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.pitch h1 .hl { filter: drop-shadow(0 6px 0 rgba(11,14,46,0.4)); }
.lead { color: var(--muted); font-size: clamp(17px, 1.9vw, 20px); max-width: 32em; }
.points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 18px; }
.points li { display: flex; gap: 14px; align-items: flex-start; }
.points img { width: 40px; height: 40px; flex: none; }
.points b { display: block; font-size: 17px; }
.points span { color: var(--muted); font-size: 15.5px; }
.signin-card { padding: 30px 28px; }
.card-title { font-size: 21px; font-weight: 800; margin-bottom: 18px; }
.signin-form input { padding: 15px 16px; font-size: 17px; }
.signin-form .hint { margin: 8px 0 18px; }
.sent { text-align: center; }
.sent-em { width: 72px; height: 72px; margin-bottom: 8px; animation: bob 2.4s ease-in-out infinite; }
.sent p { color: var(--muted); margin-bottom: 10px; }
.sent .hint { margin-top: 16px; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.small-print { margin-top: 16px; color: var(--faint); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.small-print span::before { content: "✓ "; color: var(--green); font-weight: 800; }

/* ---------- my quizzes ---------- */
.home { padding-top: 34px; padding-bottom: 80px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.home-head p { margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.home-side { display: grid; gap: 18px; position: sticky; top: 90px; }
.side-card { padding: 20px; }
.side-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font: 800 14px/1.3 var(--display); letter-spacing: -0.01em; margin: 0 0 12px; }
.side-card input { margin-bottom: 8px; }
.meter-text { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.meter-text b { color: var(--text); font: 800 22px/1 var(--display); margin-right: 2px; }
.meter { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 10px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), #7BD8FF); transition: width 0.5s; }
.meter.high span { background: linear-gradient(90deg, var(--amber), var(--coral)); }
.meter.full span { background: var(--coral); }
.quiz-list { display: grid; gap: 12px; }
.quiz-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform 0.15s, border-color 0.15s, background 0.15s; box-shadow: 0 10px 30px rgba(5,2,20,0.28); }
.quiz-row:hover { transform: translateY(-2px); border-color: rgba(61,232,214,0.45); background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05)); }
.quiz-row-main { flex: 1; min-width: 0; }
.quiz-row-top { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.quiz-row-title { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.quiz-row-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.quiz-row-meta b { color: var(--amber); }
.quiz-row-meta .past { color: #FFB3A3; }
.chev { font-size: 30px; color: var(--faint); line-height: 1; }
.empty { padding: 44px 28px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.empty h2 { font-size: 22px; }
.empty p { max-width: 30em; }

/* ---------- editor ---------- */
.ed { padding-top: 20px; padding-bottom: 80px; }
.ed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.ed-head-left { min-width: 0; flex: 1 1 360px; }
.ed-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.ed-title { font-size: clamp(22px, 2.8vw, 32px); font-weight: 800; overflow-wrap: anywhere; }
.ed-badges { display: flex; gap: 8px; }
.ed-head-right { display: flex; align-items: center; }
.publish-box { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.publish-hint { font-size: 13.5px; color: var(--faint); font-weight: 600; }
.publish-hint.good { color: var(--green); }
.publish.ready { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 4px 0 var(--amber-deep), 0 0 0 6px rgba(255,194,51,0.18); } }

.banner { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: 16px; margin-bottom: 16px; }
.banner-error { background: rgba(255,106,77,0.13); border: 1px solid rgba(255,106,77,0.45); }
.banner-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--coral); font-weight: 900; flex: none; font-size: 14px; }
.banner-text { flex: 1; }
.banner-x { background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; padding: 0 4px; }

.ed-tabs { display: none; gap: 6px; padding: 5px; border-radius: 16px; background: rgba(11,8,40,0.5); border: 1px solid var(--line); margin-bottom: 16px; }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 700; font-size: 15px; }
.tab.on { background: rgba(255,255,255,0.13); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.mobile-only { display: none !important; }

.editor { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 22px; align-items: start; }
.ed-right { min-width: 0; display: grid; gap: 14px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; }
/* Placeholder cards while Claude writes the first questions. */
.skeleton { display: grid; gap: 12px; animation: skPulse 1.6s ease-in-out infinite; }
.sk { height: 16px; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,0.07), rgba(255,255,255,0.16), rgba(255,255,255,0.07)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-top { width: 120px; height: 26px; }
.sk-line { height: 20px; }
.sk-line.short { width: 60%; }
.sk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk-opts .sk { height: 42px; border-radius: 12px; }
@keyframes skPulse { 50% { opacity: 0.6; } }

/* Desktop: the questions/settings switch sits on top of the right column. */
@media (min-width: 901px) {
  .ed-tabs { display: flex; width: fit-content; margin-bottom: 0; }
  .ed-tabs .tab-chat { display: none; }
  .ed-tabs .tab { flex: none; padding: 9px 20px; }
  .editor[data-tab=settings] .pane-questions { display: none; }
  .editor:not([data-tab=settings]) .pane-settings { display: none; }
  .editor { grid-template-columns: minmax(340px, min(430px, 33%)) minmax(0, 1fr); }
}

/* Chat */
.pane-chat { position: sticky; top: 84px; display: flex; flex-direction: column; height: calc(100vh - 104px); min-height: 460px; padding: 16px 16px 14px; }
.chat-turns { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.chat-turns.low { color: #FFD27A; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 4px 10px; margin: 0 -4px; scroll-behavior: smooth; overscroll-behavior: contain; }
.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 100%; animation: msgIn 0.25s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg-host { justify-content: flex-end; }
.msg-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: linear-gradient(135deg, var(--aqua), #2BB6E8); color: #04302C; font-weight: 900; font-size: 15px; flex: none; }
.msg-avatar.spin { animation: rot 2.4s linear infinite; }
.msg-bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; }
.msg-claude .msg-bubble { background: rgba(255,255,255,0.09); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-host .msg-bubble { background: linear-gradient(135deg, #6A43F0, var(--violet-deep)); border-bottom-right-radius: 6px; box-shadow: 0 6px 18px rgba(94,63,214,0.35); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.typing .msg-bubble { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.typing-text { font-weight: 600; color: var(--text); }
.typing-secs { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 37px; }
.chip-btn { padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(61,232,214,0.55); background: rgba(61,232,214,0.08); color: var(--aqua); font-weight: 700; font-size: 14px; transition: background 0.15s, transform 0.15s; }
.chip-btn:hover { background: rgba(61,232,214,0.18); transform: translateY(-1px); }
.chat-welcome { margin: auto 0; text-align: center; padding: 10px 6px; display: grid; justify-items: center; gap: 10px; }
.welcome-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, var(--aqua), #2BB6E8); color: #04302C; font-size: 28px; font-weight: 900; box-shadow: 0 6px 0 var(--aqua-deep); animation: bob 3s ease-in-out infinite; }
.chat-welcome h3 { font-size: 19px; margin-top: 4px; }
.chat-welcome p { font-size: 15px; max-width: 26em; }
.chat-empty { margin: auto; text-align: center; font-size: 15px; }
.examples { display: grid; gap: 8px; width: 100%; margin-top: 10px; }
.examples-label { font: 800 11px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.example { text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255,255,255,0.05); font-size: 14.5px; font-weight: 500; color: var(--text); transition: background 0.15s, border-color 0.15s; }
.example::before { content: "“"; color: var(--amber); font-weight: 900; margin-right: 2px; }
.example::after { content: "”"; color: var(--amber); font-weight: 900; margin-left: 1px; }
.example:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,194,51,0.6); }
.composer { padding-top: 10px; border-top: 1px solid var(--line); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 4px; border-radius: 18px; background: var(--field); border: 1.5px solid var(--line2); transition: border-color 0.15s, box-shadow 0.15s; }
.composer-box:focus-within { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(61,232,214,0.14); }
.chat-input { border: 0 !important; background: none !important; box-shadow: none !important; resize: none; padding: 8px 10px; min-height: 40px; max-height: 180px; }
.chat-send { width: 42px; height: 42px; padding: 0; border-radius: 13px; font-size: 20px; box-shadow: 0 3px 0 var(--amber-deep); flex: none; }
.composer-note { font-size: 12.5px; color: var(--faint); margin-top: 7px; padding: 0 4px; }
.locked-chat { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.locked-chat b { color: var(--text); }
.to-questions { margin: 6px 0 10px; }
.to-questions.pulse { animation: glowT 1.6s ease-in-out 3; }
@keyframes glowT { 50% { box-shadow: 0 4px 0 var(--aqua-deep), 0 0 0 7px rgba(61,232,214,0.25); } }

/* Questions */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.q-head-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.accept-count { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; }
.accept-count b { color: var(--text); }
.mini-meter { width: 90px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.mini-meter span { display: block; height: 100%; background: var(--aqua); border-radius: inherit; transition: width 0.3s; }
.mini-meter.done span { background: var(--green); }
.q-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.locked-note { color: var(--faint); font-size: 14px; font-weight: 600; }
.q-busy { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: 16px; font-weight: 700; background: linear-gradient(90deg, rgba(61,232,214,0.16), rgba(155,123,255,0.16), rgba(61,232,214,0.16)); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; border: 1px solid rgba(61,232,214,0.35); }
@keyframes shimmer { to { background-position: -200% 0; } }
.pane-questions.is-busy .q-list { opacity: 0.72; transition: opacity 0.2s; }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.q { position: relative; padding: 18px 20px 16px; transition: border-color 0.2s, box-shadow 0.2s; overflow: hidden; }
.q.accepted { border-color: rgba(61,220,132,0.5); box-shadow: inset 4px 0 0 var(--green), var(--shadow); }
.q.flagged:not(.accepted) { border-color: rgba(255,194,51,0.5); box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }
.q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.q-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,0.12); font: 800 14px/1 var(--display); flex: none; }
.topic { padding: 4px 10px; border-radius: 999px; background: rgba(155,123,255,0.18); color: #D6CBFF; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.q-top-right { margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.check-ok { background: rgba(61,220,132,0.14); color: #8FF0BA; }
.check-flag { background: rgba(255,194,51,0.16); color: #FFD27A; }
.check-pending { background: rgba(61,232,214,0.12); color: var(--aqua); }
.check-none { color: var(--faint); padding-right: 0; }
.q-prompt { font-size: 18px; font-weight: 700; line-height: 1.35; margin-bottom: 12px; overflow-wrap: anywhere; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 9px; border-radius: 12px; background: rgba(11,8,40,0.4); border: 1.5px solid var(--line); font-size: 15px; min-width: 0; }
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-letter { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.12); font: 800 12.5px/1 var(--display); flex: none; }
.opt.correct { background: rgba(61,220,132,0.16); border-color: var(--green); color: #E6FFF0; font-weight: 600; }
.opt.correct .opt-letter { background: var(--green); color: #07301A; }
.opt-tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #07301A; font-weight: 900; font-size: 13px; flex: none; }
.opt-claude { font-size: 11.5px; font-weight: 800; color: #1C1300; background: var(--amber); padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.q-expl { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.q-expl-label { color: var(--faint); font-weight: 700; }
.flag-box { display: flex; gap: 10px; margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: rgba(255,194,51,0.1); border: 1px solid rgba(255,194,51,0.4); color: #FFE7AE; font-size: 14.5px; }
.flag-box p + p { margin-top: 4px; }
.flag-said { font-weight: 700; }
.flag-icon { color: var(--amber); font-size: 16px; line-height: 1.3; }
.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.q-actions-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.accept { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; border-radius: 14px; border: 2px solid rgba(61,220,132,0.6); background: rgba(61,220,132,0.06); color: #B5F5CF; font-weight: 800; font-size: 15.5px; transition: background 0.15s, transform 0.12s; }
.accept:hover:not(:disabled) { background: rgba(61,220,132,0.14); }
.accept:active:not(:disabled) { transform: translateY(1px); }
.accept-box { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(61,220,132,0.7); font-weight: 900; font-size: 15px; }
.accept.on { background: var(--green); border-color: var(--green); color: #05301A; box-shadow: 0 3px 0 var(--green-deep); }
.accept.on .accept-box { background: #05301A; border-color: #05301A; color: var(--green); }
.accept:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-group { display: inline-flex; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,0.06); font-size: 15px; font-weight: 700; color: var(--text); }
.icon-btn:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.danger:hover:not(:disabled) { background: rgba(255,106,77,0.2); border-color: rgba(255,106,77,0.5); }
.icon-btn.armed { background: var(--coral); border-color: var(--coral); color: #fff; font-size: 13.5px; padding: 0 12px; animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.rewriting > *:not(.rewrite-overlay) { filter: blur(1.5px); opacity: 0.5; }
.rewrite-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; background: rgba(18,5,46,0.35); }
.ask { margin-top: 12px; padding: 14px; border-radius: 14px; background: rgba(61,232,214,0.07); border: 1px solid rgba(61,232,214,0.35); display: grid; gap: 10px; }
.ask-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.ask-row, .edit-row { display: flex; justify-content: flex-end; gap: 8px; }
.q-empty { list-style: none; padding: 36px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; color: var(--muted); }
.add-q { width: 100%; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-radius: var(--r); border: 2px dashed var(--line2); background: rgba(255,255,255,0.03); color: var(--muted); font-weight: 700; font-size: 15.5px; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.add-q:hover:not(:disabled) { border-color: var(--aqua); color: var(--text); background: rgba(61,232,214,0.06); }
.add-q:disabled { opacity: 0.45; cursor: not-allowed; }
.add-plus { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.12); font-size: 18px; }

/* Edit form */
.q-edit-wrap { list-style: none; }
.q.editing { display: grid; gap: 14px; border-color: rgba(61,232,214,0.55); box-shadow: 0 0 0 4px rgba(61,232,214,0.1), var(--shadow); }
.q.editing .q-top { margin-bottom: 0; }
.edit-label { font: 800 12px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--aqua); }
.field { display: block; }
.edit-prompt { font-size: 17px; font-weight: 600; }
.edit-opts { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.edit-opts legend { padding: 0; margin-bottom: 6px; display: block; }
.edit-opt-row { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 8px; border-radius: 14px; border: 1.5px solid transparent; transition: background 0.15s, border-color 0.15s; }
.edit-opt-row.correct { background: rgba(61,220,132,0.12); border-color: rgba(61,220,132,0.6); }
.edit-opt-row.correct .opt-letter { background: var(--green); color: #07301A; }
.radio { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; cursor: pointer; }
.radio input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.radio-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); background: var(--field); transition: 0.15s; }
.radio input:checked + .radio-dot { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 45%, transparent 50%); }
.radio input:focus-visible + .radio-dot { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* Settings */
.settings { padding: 18px 20px 6px; }
.set-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 10px 24px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.settings .pane-head { padding-bottom: 6px; }
.set-row.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.set-label { display: grid; gap: 3px; }
.set-label b { font-size: 15.5px; }
.set-control { display: flex; align-items: center; gap: 10px; min-width: 0; }
.set-control.col { flex-direction: column; align-items: stretch; gap: 6px; }
.set-control.range { gap: 14px; }
.set-row > .hint { grid-column: 2; }
.range-out { min-width: 56px; font: 800 17px/1 var(--display); color: var(--amber); text-align: right; }
input[type=range] { flex: 1; accent-color: var(--amber); height: 30px; cursor: pointer; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { position: relative; display: block; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: rgba(255,255,255,0.04); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.mode-card:hover { background: rgba(255,255,255,0.08); }
.mode-input { position: absolute; opacity: 0; pointer-events: none; }
.mode-body { display: grid; gap: 3px; }
.mode-body b { font-size: 15.5px; }
.mode-body span { font-size: 13.5px; color: var(--faint); line-height: 1.35; }
.mode-card:has(.mode-input:checked) { border-color: var(--amber); background: rgba(255,194,51,0.1); box-shadow: inset 0 0 0 1px var(--amber); }
.mode-card:has(.mode-input:checked) b::after { content: " ✓"; color: var(--amber); }
.mode-card:has(.mode-input:focus-visible) { outline: 3px solid var(--aqua); outline-offset: 2px; }
.danger-zone { align-items: center; }
.danger-zone .btn { justify-self: start; }

/* Share */
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; padding: 26px 28px; margin-bottom: 20px; background: linear-gradient(135deg, rgba(255,95,162,0.16), rgba(94,63,214,0.22) 55%, rgba(61,232,214,0.1)); border-color: rgba(255,255,255,0.2); }
.share-main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.code-big { display: flex; gap: 8px; flex-wrap: nowrap; }
.code-big span { display: inline-grid; place-items: center; width: clamp(40px, 6vw, 62px); height: clamp(52px, 7.6vw, 78px); border-radius: 14px; background: #fff; color: var(--bg0); font: 900 clamp(26px, 4.2vw, 44px)/1 var(--display); box-shadow: 0 5px 0 rgba(11,14,46,0.45); }
.share-link { display: flex; gap: 8px; max-width: 560px; }
.share-link-input { font-weight: 600; color: var(--aqua) !important; }
.share-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.share-state b { color: var(--text); }
.share-state.closed b { color: #FFB3A3; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.share-qr { margin: 0; display: grid; justify-items: center; gap: 8px; align-content: center; }
.qr { width: 200px; height: 200px; display: block; border-radius: 14px; box-shadow: 0 10px 30px rgba(5,2,20,0.45); }
.share-qr figcaption { font-weight: 700; color: var(--muted); font-size: 14px; }

/* ---------- results ---------- */
.res { padding-top: 20px; padding-bottom: 80px; }
.res-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.res-sub { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); }
.res-sub b { color: var(--text); font-size: 17px; overflow-wrap: anywhere; }
.res-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.updated { font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px 20px; display: grid; gap: 4px; }
.stat b { font: 900 clamp(26px, 3.4vw, 38px)/1 var(--display); color: var(--amber); letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-weight: 700; }
.stat small { font-size: 13px; }
.run-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); }
.run-picker select { width: auto; min-width: 240px; }
.missing { padding: 18px 20px; margin-bottom: 18px; }
.missing .hint { margin: 4px 0 12px; }
.name-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid var(--line2); font-size: 14px; font-weight: 600; }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.board-card { padding: 18px 8px 10px; }
.board-card .pane-head { padding: 0 12px 10px; }
.table-wrap { overflow-x: auto; }
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.lb th.num { text-align: right; }
.lb td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: middle; }
.lb-row { cursor: pointer; transition: background 0.12s; }
.lb-row:hover, .lb-row.open { background: rgba(255,255,255,0.06); }
.lb-row:focus-visible { outline: 3px solid var(--aqua); outline-offset: -3px; }
.lb-rank { width: 44px; color: var(--faint); font-weight: 700; text-align: center; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 800 13px/1 var(--display); color: #1C1300; }
.medal.m1 { background: linear-gradient(135deg, #FFE27A, var(--amber)); }
.medal.m2 { background: linear-gradient(135deg, #F1F1FF, #B9B6D9); }
.medal.m3 { background: linear-gradient(135deg, #FFC79A, #D98245); }
.lb-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-name-text { font-weight: 700; overflow-wrap: anywhere; }
.avatar { font-size: 22px; line-height: 1; }
.lb-score { font-weight: 800; color: var(--amber); }
.lb-time { color: var(--muted); font-size: 14px; white-space: nowrap; }
.in-progress { color: var(--aqua); font-weight: 600; }
.lb-chev { width: 30px; color: var(--faint); text-align: center; }
.lb-detail td { padding: 4px 12px 16px; background: rgba(255,255,255,0.04); }
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ans { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(11,8,40,0.35); font-size: 14px; }
.ans-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 900; font-size: 12px; flex: none; margin-top: 1px; background: rgba(255,255,255,0.12); }
.ans.right .ans-mark { background: var(--green); color: #07301A; }
.ans.wrong .ans-mark { background: var(--coral); color: #fff; }
.ans-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ans-q { color: var(--muted); overflow-wrap: anywhere; }
.ans-a { font-weight: 600; overflow-wrap: anywhere; }
.ans-meta { white-space: nowrap; color: var(--faint); font-variant-numeric: tabular-nums; }
.ans-meta b { color: var(--amber); }
.qstats { display: grid; gap: 12px; }
.qs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.qs { padding: 16px 18px; }
.qs-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.qs-prompt { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.qs-pct { font: 900 20px/1 var(--display); white-space: nowrap; }
.qs-pct small { font: 600 12px/1 var(--body); color: var(--faint); }
.qs-pct.good { color: var(--green); }
.qs-pct.mid { color: var(--amber); }
.qs-pct.bad { color: var(--coral); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.bar-label { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: rgba(155,123,255,0.75); transition: width 0.5s; min-width: 0; }
.bar-row.correct .bar-fill { background: var(--green); }
.bar-row.correct .bar-label { color: #CFFBE0; font-weight: 700; }
.bar-row.correct .opt-letter { background: var(--green); color: #07301A; }
.bar-tick { color: var(--green); font-weight: 900; }
.bar-count { min-width: 26px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.qs-meta { margin-top: 10px; font-size: 13.5px; }

/* ---------- responsive (dashboard) ---------- */
@media (max-width: 1100px) {
  .res-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .signin { grid-template-columns: 1fr; gap: 34px; padding-top: 10px; min-height: 0; }
  .home-grid { grid-template-columns: 1fr; }
  .home-side { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .ed-right { display: contents; }
  .ed-tabs { order: -1; display: flex; position: sticky; top: 72px; z-index: 10; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(18,5,46,0.85); }
  .mobile-only { display: flex !important; }
  .mobile-only[hidden] { display: none !important; }
  .editor { grid-template-columns: 1fr; }
  .editor .pane-chat, .editor .pane-questions, .editor .pane-settings { display: none; }
  .editor[data-tab=chat] .pane-chat { display: flex; }
  .editor[data-tab=questions] .pane-questions, .editor[data-tab=settings] .pane-settings { display: block; }
  .pane-chat { position: relative; top: 0; height: calc(100vh - 220px); height: calc(100dvh - 210px); min-height: 420px; }
  .share { grid-template-columns: 1fr; }
  .share-qr { justify-self: start; grid-auto-flow: column; align-items: center; gap: 14px; }
  .qr { width: 150px; height: 150px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .bar { min-height: 60px; }
  .word { font-size: 19px; }
  .brand img { width: 34px; height: 34px; }
  .who { display: none; }
  .home-side { grid-template-columns: 1fr; }
  .home-head .btn { width: 100%; }
  .quiz-row { padding: 15px 16px; }
  .chev { display: none; }
  .ed-head-right, .publish-box { width: 100%; }
  .publish-box { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  .opts { grid-template-columns: 1fr; }
  .q { padding: 15px 14px 14px; }
  .q-actions-right { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 6px; }
  .q-actions-right > .btn { padding: 8px 10px; }
  .long-label { display: none; }
  .icon-btn { min-width: 34px; height: 34px; padding: 0 6px; }
  .opt { padding: 7px 10px 7px 7px; }
  .accept { width: 100%; justify-content: center; }
  .set-row, .set-row.inline { grid-template-columns: 1fr; }
  .set-row.inline { grid-template-columns: minmax(0, 1fr) auto; }
  .set-row > .hint { grid-column: 1; }
  .mode-cards { grid-template-columns: 1fr; }
  .share { padding: 20px 16px; }
  .code-big { gap: 6px; }
  .code-big span { width: calc((100vw - 110px) / 6); max-width: 52px; height: 58px; font-size: 30px; border-radius: 11px; }
  .share-link { flex-direction: column; }
  .share-actions .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 13px; }
  .stat small { display: none; }
  .lb-time, .lb .lb-right { display: none; }
  .lb td, .lb th { padding: 10px 8px; }
  .res-tools { width: 100%; }
  .updated { flex: 1 0 100%; }
  .ans { flex-wrap: wrap; }
  .ans-meta { margin-left: 32px; }
  .signin-card { padding: 22px 18px; }
  .ed-tabs { top: 66px; }
}

/* ---------- live screen (projector) ---------- */
body.live-mode { background: radial-gradient(ellipse 100% 80% at 50% 0%, #3B1A9E 0%, #1A0846 45%, #0B0322 100%) fixed; overflow: hidden; }
.lv { display: flex; flex-direction: column; height: 100vh; height: 100dvh; font-size: clamp(16px, 1.25vw, 24px); }
.lv-bar { display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 2.4vw, 40px); flex: none; }
.lv-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.lv-brand img { width: 34px; height: 34px; border-radius: 10px; }
.lv-brand .word { font-size: 18px; }
.lv-title { flex: 1; min-width: 0; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; }
.lv-bar-right { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }
.lv-progress, .lv-count { font-weight: 700; font-size: 0.85em; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); white-space: nowrap; }
.lv-progress:empty, .lv-count:empty { display: none; }
.lv-conn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #FFD27A; font-size: 0.85em; }
.lv-icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255,255,255,0.06); font-size: 18px; }
.lv-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 clamp(16px, 3vw, 56px) clamp(16px, 2.6vw, 40px); overflow: auto; }
.lv-center { margin: auto; text-align: center; display: grid; justify-items: center; gap: 18px; max-width: 900px; }
.lv-big { font-size: clamp(30px, 3.6vw, 64px); font-weight: 900; }
.lv-wait { color: var(--muted); font-size: 1.05em; }
.lv-fatal h1 { font-size: clamp(30px, 3.4vw, 54px); }
.lv-fatal p { color: var(--muted); font-size: 1.2em; }
.lv-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.lv-globe img { width: 120px; height: 120px; animation: rot 6s linear infinite; }

/* Lobby */
.lv-lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 40px); min-height: 0; }
.lv-join { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: clamp(14px, 2.2vh, 30px); text-align: center; padding: clamp(20px, 2.6vw, 44px); border-radius: 32px; background: linear-gradient(135deg, rgba(255,95,162,0.18), rgba(94,63,214,0.28) 60%, rgba(61,232,214,0.12)); border: 1px solid rgba(255,255,255,0.18); min-width: 0; }
.lv-kicker { font: 800 0.85em/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.lv-join-row { display: flex; align-items: center; gap: clamp(16px, 2vw, 36px); text-align: left; max-width: 100%; }
.lv-join-text { min-width: 0; display: grid; gap: 0.35em; }
.lv-step { color: var(--muted); font-weight: 600; font-size: 1.05em; }
.lv-link { font: 800 clamp(18px, 1.75vw, 36px)/1.2 var(--display); color: var(--aqua); overflow-wrap: anywhere; }
.code-big.xl { justify-content: center; gap: clamp(6px, 0.7vw, 14px); }
.code-big.xl span { width: clamp(46px, 4.6vw, 100px); height: clamp(60px, 6vw, 128px); font-size: clamp(34px, 3.8vw, 84px); border-radius: clamp(12px, 1.2vw, 22px); box-shadow: 0 7px 0 rgba(11,14,46,0.5); }
.lv-qr { margin: 0; flex: none; }
.lv-qr .qr { width: clamp(130px, 13vw, 280px); height: clamp(130px, 13vw, 280px); border-radius: 18px; }
.lv-away { font: 600 0.5em/1 var(--body); color: var(--faint); letter-spacing: 0; }
.lv-room { display: flex; flex-direction: column; min-height: 0; padding: clamp(18px, 2vw, 34px); border-radius: 32px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.lv-room-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.lv-room-head h2 { font-size: clamp(22px, 2.2vw, 40px); }
.lv-waiting { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 1.1em; margin: auto; }
.lv-players { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px; overflow-y: auto; min-height: 0; padding: 4px; }
.lv-player { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid var(--line2); font-weight: 700; font-size: 1.05em; max-width: 100%; }
.lv-player.pop { animation: pop 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.lv-player.away { opacity: 0.45; }
.lv-avatar { font-size: 1.5em; line-height: 1; }
.lv-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-kick { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,106,77,0.85); color: #fff; font-size: 16px; line-height: 1; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; margin-right: -8px; }
.lv-player:hover .lv-kick, .lv-kick:focus-visible { opacity: 1; }
@media (hover: none) { .lv-kick { opacity: 0.8; } }
.lv-start:disabled { opacity: 0.4; }

/* Question & reveal */
.lv-q { flex: 1; display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 28px); min-height: 0; }
.lv-q-top { display: flex; align-items: center; gap: 12px; }
.lv-q-spacer { flex: 1; }
.lv-pill { padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,0.1); font-weight: 800; font-size: 0.95em; }
.lv-pill.topic { background: rgba(155,123,255,0.22); color: #DCD2FF; }
.lv-score-pill { padding: 10px 20px; border-radius: 999px; background: rgba(61,220,132,0.16); color: #B5F5CF; font-weight: 700; }
.lv-score-pill b { font-family: var(--display); color: var(--green); }
.lv-prompt { font-size: clamp(26px, 3.3vw, 64px); font-weight: 800; line-height: 1.15; text-align: center; margin: auto 0; padding: 0 2%; overflow-wrap: anywhere; text-wrap: balance; }
.lv-prompt.long { font-size: clamp(22px, 2.6vw, 48px); }
.lv-ring { position: relative; width: clamp(72px, 7vw, 130px); height: clamp(72px, 7vw, 130px); flex: none; }
.lv-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lv-ring-bg { fill: rgba(11,8,40,0.6); stroke: rgba(255,255,255,0.12); stroke-width: 8; }
.lv-ring-arc { fill: none; stroke: var(--aqua); stroke-width: 8; stroke-linecap: round; }
.lv-ring-num { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(26px, 2.6vw, 48px)/1 var(--display); font-variant-numeric: tabular-nums; }
.lv-ring.hurry .lv-ring-arc { stroke: var(--coral); }
.lv-ring.hurry .lv-ring-num { color: var(--coral); animation: beat 1s infinite; }
@keyframes beat { 50% { transform: scale(1.12); } }
.lv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.2vw, 20px); }
.lv-tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: clamp(12px, 1.2vw, 22px); min-height: clamp(76px, 10vh, 140px); padding: clamp(12px, 1.4vw, 26px) clamp(16px, 1.6vw, 30px); border-radius: clamp(16px, 1.4vw, 26px); font-weight: 800; font-size: clamp(19px, 1.9vw, 36px); line-height: 1.2; animation: tileIn 0.4s ease-out backwards; transition: opacity 0.4s, transform 0.4s, filter 0.4s; }
@keyframes tileIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.lv-tile.t0 { background: linear-gradient(135deg, #FF7A5E, var(--coral-deep)); box-shadow: 0 6px 0 #9E2A22; }
.lv-tile.t1 { background: linear-gradient(135deg, #5CAEFF, var(--blue-deep)); box-shadow: 0 6px 0 #173F86; }
.lv-tile.t2 { background: linear-gradient(135deg, #FFCB4F, var(--amber-deep)); box-shadow: 0 6px 0 #A35F00; color: #241700; }
.lv-tile.t3 { background: linear-gradient(135deg, #4BE893, var(--green-deep)); box-shadow: 0 6px 0 #0E6334; color: #04230F; }
.lv-shape { font-size: 0.9em; opacity: 0.85; flex: none; }
.lv-letter { display: none; }
.lv-opt { flex: 1; min-width: 0; overflow-wrap: anywhere; position: relative; z-index: 1; }
.lv-tile-count { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; font: 900 1.1em/1 var(--display); flex: none; }
.lv-tick { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: #fff; color: var(--green-deep); font-size: 0.8em; }
.lv-tile-bar { position: absolute; left: 0; bottom: 0; height: 8px; background: rgba(255,255,255,0.75); border-radius: 0 999px 999px 0; animation: grow 0.9s ease-out backwards 0.2s; }
@keyframes grow { from { width: 0 !important; } }
.lv-tiles.revealed .lv-tile.wrong { opacity: 0.32; filter: saturate(0.4); transform: scale(0.97); }
.lv-tiles.revealed .lv-tile.correct { transform: scale(1.02); box-shadow: 0 0 0 5px #fff, 0 0 40px rgba(61,220,132,0.6); }
.lv-q-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lv-answered { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; flex-wrap: wrap; }
.lv-answered-label { font-weight: 700; font-size: 1.1em; white-space: nowrap; }
.lv-answered-n { font: 900 1.3em/1 var(--display); color: var(--aqua); }
.lv-answered-track { width: clamp(120px, 18vw, 320px); height: 12px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.lv-answered-track span { display: block; height: 100%; width: 0; background: var(--aqua); border-radius: inherit; transition: width 0.3s; }
.lv-dots { display: flex; flex-wrap: wrap; gap: 4px; max-height: 2.4em; overflow: hidden; }
.lv-dot { font-size: 1em; opacity: 0.25; filter: grayscale(1); transition: 0.25s; }
.lv-dot.on { opacity: 1; filter: none; transform: scale(1.1); }
.lv-expl { flex: 1; display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-radius: 18px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-size: 1.05em; color: #EDE8FF; }
.lv-expl-icon { font-size: 1.2em; }

/* Leaderboard */
.lv-board { flex: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 1.6vw, 26px); width: min(1000px, 100%); margin: 0 auto; }
.lv-board-head { text-align: center; display: grid; gap: 6px; }
.lv-rows { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: clamp(6px, 0.8vw, 12px); }
.lv-row { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 20px); padding: clamp(8px, 1vh, 14px) clamp(14px, 1.6vw, 26px); border-radius: 18px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-size: clamp(17px, 1.6vw, 30px); animation: rowIn 0.5s cubic-bezier(.2,1.2,.4,1) backwards; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-40px); } }
.lv-row.r1 { background: linear-gradient(90deg, rgba(255,194,51,0.32), rgba(255,194,51,0.08)); border-color: rgba(255,194,51,0.6); }
.lv-row.r2 { background: linear-gradient(90deg, rgba(220,220,255,0.2), rgba(255,255,255,0.06)); }
.lv-row.r3 { background: linear-gradient(90deg, rgba(217,130,69,0.25), rgba(255,255,255,0.06)); }
.lv-row-rank { width: 1.8em; font: 900 1em/1 var(--display); color: var(--muted); text-align: center; }
.lv-row.r1 .lv-row-rank { color: var(--amber); }
.lv-row-name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-delta { font-weight: 800; color: var(--green); font-size: 0.8em; padding: 4px 10px; border-radius: 999px; background: rgba(61,220,132,0.14); animation: deltaIn 0.6s ease-out backwards 0.6s; }
.lv-delta.zero { color: var(--faint); background: rgba(255,255,255,0.06); }
@keyframes deltaIn { from { opacity: 0; transform: translateY(8px) scale(0.8); } }
.lv-row-score { font: 900 1em/1 var(--display); font-variant-numeric: tabular-nums; min-width: 4.2em; text-align: right; }

/* End */
.lv-end { flex: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2vh, 28px); position: relative; z-index: 1; }
.lv-end .lv-big { display: flex; align-items: center; gap: 16px; }
.lv-trophy { width: 1.2em; height: 1.2em; animation: bob 2.4s ease-in-out infinite; }
.lv-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(10px, 1.6vw, 28px); width: min(900px, 100%); margin-top: auto; }
.lv-pod { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; animation: podIn 0.7s cubic-bezier(.2,1.3,.4,1) backwards; }
.lv-pod.p1 { animation-delay: 0.9s; }
.lv-pod.p2 { animation-delay: 0.5s; }
.lv-pod.p3 { animation-delay: 0.1s; }
@keyframes podIn { from { opacity: 0; transform: translateY(60px); } }
.lv-pod-avatar { font-size: clamp(44px, 5vw, 96px); line-height: 1; }
.lv-pod-name { font: 800 clamp(18px, 1.8vw, 34px)/1.15 var(--display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-pod-score { font-weight: 800; color: var(--amber); font-size: 1.15em; }
.lv-pod-block { width: 100%; display: grid; place-items: start center; padding-top: 14px; border-radius: 20px 20px 0 0; font: 900 clamp(34px, 4vw, 76px)/1 var(--display); }
.lv-pod.p1 .lv-pod-block { height: clamp(140px, 24vh, 280px); background: linear-gradient(180deg, #FFD65C, var(--amber-deep)); color: #3A2500; }
.lv-pod.p2 .lv-pod-block { height: clamp(100px, 17vh, 200px); background: linear-gradient(180deg, #ECEBFF, #9C98C8); color: #24204A; }
.lv-pod.p3 .lv-pod-block { height: clamp(70px, 12vh, 150px); background: linear-gradient(180deg, #FFBE8C, #B8652E); color: #3A1A00; }
.lv-rest { margin: 0; padding: 0 0 0 2em; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; color: var(--muted); width: min(900px, 100%); }
.lv-rest li { display: flex; align-items: center; gap: 8px; }
.lv-rest b { color: var(--text); }
.lv-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; display: none; }
.lv-confetti.on { display: block; }

@media (max-width: 900px) {
  body.live-mode { overflow: auto; }
  .lv { height: auto; min-height: 100vh; }
  .lv-lobby { grid-template-columns: 1fr; }
  .lv-join-row { flex-direction: column; text-align: center; }
  .lv-title { display: none; }
  .lv-tiles { grid-template-columns: 1fr; }
  .lv-q-foot { flex-direction: column; align-items: stretch; }
  .lv-room { min-height: 260px; }
}
@media (max-width: 640px) {
  .lv-bar { gap: 10px; }
  .lv-brand .word { display: none; }
  .lv-progress { display: none; }
  .code-big.xl span { width: calc((100vw - 110px) / 6); height: 64px; font-size: 34px; }
  .lv-room-head { flex-wrap: wrap; }
  .lv-start { width: 100%; }
  .btn-xl { padding: 15px 24px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
