/* =====================================================================
   AnalystWorld Quizz — design system
   A distinct, energetic identity that still belongs to AnalystWorld:
   electric-violet "play" energy as the primary, the parent site's teal
   as a secondary accent, Clash Display / DM Sans / JetBrains Mono type.
   Light + dark, reduced-motion aware, mobile-first. Self-contained:
   loads nothing from the existing site's CSS so production is untouched.
   ===================================================================== */

:root {
  /* brand — AnalystWorld / Roadmaps red (light) */
  --brand:        #f01920;
  --brand2:       #ff6b70;   /* lighter red for gradients */
  --brand-ink:    #ffffff;   /* text on top of brand fills */
  --brand-glow:   rgba(240,25,32,0.14);
  --brand-dim:    rgba(240,25,32,0.07);
  --brand-soft:   #fff2f2;
  --brand-line:   #ffd4d6;

  /* surfaces (light) */
  --bg:       #ffffff;
  --bg2:      #faf8f7;
  --surface:  #ffffff;
  --surface2: #f3f1ef;
  --border:   #ececec;
  --border2:  #e3e3e3;

  /* text */
  --text:  #121214;
  --muted: #6b6b72;
  --hint:  #9a9aa2;

  /* answer channels — shape-coded for colour-blind safety */
  --ans-a: #ef4e6b; --ans-a-ink:#fff;  /* ▲ */
  --ans-b: #2f86ff; --ans-b-ink:#fff;  /* ● */
  --ans-c: #f5a524; --ans-c-ink:#1a1304;/* ■ */
  --ans-d: #2fd27a; --ans-d-ink:#05230f;/* ◆ */

  /* status */
  --ok:   #2fd27a;
  --warn: #f5a524;
  --err:  #ef4e6b;

  /* type — matches Roadmaps */
  --display: 'Manrope', system-ui, sans-serif;
  --body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --serif:   'Playfair Display', Georgia, serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* shape */
  --r:   12px;
  --r2:  18px;
  --r3:  26px;
  --shadow:    0 14px 40px rgba(17,17,20,0.07);
  --shadow-lg: 0 22px 60px rgba(240,25,32,0.14);
  --ring: 0 0 0 3px var(--brand-glow);
  --maxw: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:#f6323a; --brand2:#ff6b70;
    --brand-glow:rgba(246,50,58,0.22); --brand-dim:rgba(246,50,58,0.10);
    --brand-soft:#1e1416; --brand-line:#49232a;
    --bg:#0a0b0e; --bg2:#101217; --surface:#14161c; --surface2:#171a20;
    --border:#23262e; --border2:#2b2f38;
    --text:#f2f2f5; --muted:#9a9aa6; --hint:#6f6f7a;
    --shadow:0 18px 44px rgba(0,0,0,0.4);
    --shadow-lg:0 24px 64px rgba(246,50,58,0.2);
  }
}
:root[data-theme="dark"] {
  --brand:#f6323a; --brand2:#ff6b70;
  --brand-glow:rgba(246,50,58,0.22); --brand-dim:rgba(246,50,58,0.10);
  --brand-soft:#1e1416; --brand-line:#49232a;
  --bg:#0a0b0e; --bg2:#101217; --surface:#14161c; --surface2:#171a20;
  --border:#23262e; --border2:#2b2f38;
  --text:#f2f2f5; --muted:#9a9aa6; --hint:#6f6f7a;
  --shadow:0 18px 44px rgba(0,0,0,0.4);
  --shadow-lg:0 24px 64px rgba(246,50,58,0.2);
}

* { box-sizing:border-box; }
html,body { margin:0; padding:0; }

/* visible keyboard focus for every interactive element (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible,
.q-ptile:focus-visible, .q-live-tile:focus-visible {
  outline:3px solid var(--brand); outline-offset:2px; border-radius:6px;
}
body {
  font-family:var(--body);
  background:
    radial-gradient(1100px 620px at 85% -8%, var(--brand-dim), transparent 60%),
    radial-gradient(900px 540px at -5% 12%, var(--brand-dim), transparent 55%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
a { color:inherit; }
h1,h2,h3 { font-family:var(--display); letter-spacing:-0.02em; margin:0; line-height:1.08; }
::selection { background:var(--brand-glow); }

/* ── layout ─────────────────────────────────────────────────────── */
.q-wrap { max-width:var(--maxw); margin:0 auto; padding:0 20px; }
.q-screen { display:none; }
.q-screen.is-active { display:block; animation:q-fade .35s ease both; }

/* ── top bar ────────────────────────────────────────────────────── */
.q-top {
  position:sticky; top:0; z-index:40;
  backdrop-filter:saturate(1.4) blur(14px);
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom:1px solid var(--border);
}
.q-top-inner { max-width:var(--maxw); margin:0 auto; padding:14px 20px;
  display:flex; align-items:center; gap:16px; }
.q-logo { display:flex; align-items:center; gap:10px; cursor:pointer; text-decoration:none; }
.q-logo-mark {
  width:34px; height:34px; border-radius:10px; display:grid; place-items:center;
  background:linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff; font-family:var(--display); font-weight:700; font-size:19px;
  box-shadow:0 6px 16px -6px var(--brand);
}
.q-logo-txt { font-family:var(--display); font-weight:700; font-size:19px; letter-spacing:-0.03em; }
.q-logo-txt b { color:var(--brand); }
.q-top-spacer { flex:1; }
.q-top-user { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted); }
.q-avatar {
  width:30px; height:30px; border-radius:50%; background:var(--surface2);
  border:1px solid var(--border2); display:grid; place-items:center;
  font-weight:600; font-size:13px; color:var(--brand);
}

/* ── buttons ────────────────────────────────────────────────────── */
.q-btn {
  font-family:var(--body); font-weight:600; font-size:15px;
  border:1px solid transparent; border-radius:var(--r);
  padding:11px 20px; cursor:pointer; transition:transform .12s ease, box-shadow .2s ease, background .2s ease;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--surface2); color:var(--text); text-decoration:none;
}
.q-btn:hover { transform:translateY(-1px); }
.q-btn:active { transform:translateY(0); }
.q-btn-primary { background:linear-gradient(135deg,var(--brand),var(--brand2)); color:var(--brand-ink);
  box-shadow:0 10px 24px -10px var(--brand); }
.q-btn-primary:hover { box-shadow:0 14px 30px -10px var(--brand); }
.q-btn-ghost { background:transparent; border-color:var(--border2); color:var(--text); }
.q-btn-ghost:hover { border-color:var(--brand); color:var(--brand); }
.q-btn-lg { padding:15px 28px; font-size:17px; border-radius:var(--r2); }
.q-btn-block { width:100%; }
.q-btn[disabled] { opacity:.5; cursor:not-allowed; transform:none; }
.q-btn-icon { background:transparent; border:1px solid var(--border); border-radius:10px;
  width:38px; height:38px; padding:0; color:var(--muted); }
.q-btn-icon:hover { color:var(--brand); border-color:var(--brand); }
.q-btn-icon.is-on { border-color:var(--brand); background:var(--brand-dim); box-shadow:0 0 0 2px var(--brand-glow); }

/* ── cards / inputs ─────────────────────────────────────────────── */
.q-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2);
  box-shadow:var(--shadow); }
.q-field { display:block; margin-bottom:14px; }
.q-label { display:block; font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.q-input, .q-textarea, .q-select {
  width:100%; font-family:var(--body); font-size:15px; color:var(--text);
  background:var(--bg2); border:1.5px solid var(--border2); border-radius:var(--r);
  padding:12px 14px; transition:border-color .15s, box-shadow .15s;
}
.q-input:focus, .q-textarea:focus, .q-select:focus {
  outline:none; border-color:var(--brand); box-shadow:var(--ring);
}
.q-textarea { resize:vertical; min-height:120px; line-height:1.6; }
.q-input.mono, .q-textarea.mono { font-family:var(--mono); }

/* ── welcome ────────────────────────────────────────────────────── */
.q-hero { text-align:center; padding:64px 0 34px; }
.q-pill {
  display:inline-flex; align-items:center; gap:7px; font-family:var(--mono);
  font-size:12px; font-weight:500; color:var(--brand);
  background:var(--brand-dim); border:1px solid var(--brand-glow);
  padding:6px 13px; border-radius:999px; margin-bottom:22px;
}
.q-pill-dot { width:6px; height:6px; border-radius:50%; background:var(--brand); animation:q-pulse 2s ease-in-out infinite; }
.q-hero h1 { font-size:clamp(40px,6vw,68px); font-weight:700; margin-bottom:16px; }
.q-hero h1 .g { background:linear-gradient(120deg,var(--brand),var(--brand2)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.q-hero p { font-size:clamp(16px,2vw,19px); color:var(--muted); max-width:580px; margin:0 auto; }

.q-paths { display:grid; grid-template-columns:1fr 1fr; gap:22px; margin:38px 0 60px; }
.q-path {
  position:relative; text-align:left; padding:30px; border-radius:var(--r3);
  background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow);
  cursor:pointer; transition:transform .16s ease, box-shadow .25s ease, border-color .2s;
  overflow:hidden;
}
.q-path:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); border-color:var(--brand); }
.q-path::after { content:""; position:absolute; inset:0; background:radial-gradient(420px 220px at 110% -20%, var(--brand-dim), transparent 60%); opacity:0; transition:opacity .3s; }
.q-path:hover::after { opacity:1; }
.q-path-ico { width:58px; height:58px; border-radius:16px; display:grid; place-items:center; font-size:28px; margin-bottom:18px; }
.q-path-join .q-path-ico { background:var(--brand-dim); }
.q-path-create .q-path-ico { background:var(--brand-dim); }
.q-path h3 { font-size:24px; margin-bottom:8px; }
.q-path p { color:var(--muted); font-size:14.5px; margin:0 0 18px; }
.q-path .q-path-cta { font-weight:600; color:var(--brand); font-size:14.5px; display:inline-flex; gap:6px; align-items:center; }
.q-path-join .q-path-cta { color:var(--brand2); }

/* join-by-pin inline form on welcome */
.q-joinbar { display:flex; gap:10px; margin-top:4px; }
.q-joinbar .q-input { font-family:var(--mono); letter-spacing:.3em; font-size:20px; text-align:center; font-weight:700; }

/* ── landing (home) ─────────────────────────────────────────────── */
.q-eyebrow { display:inline-block; font-family:var(--display); font-size:12px; font-weight:800;
  letter-spacing:.18em; color:var(--brand); margin-bottom:16px; }
.q-land-hero { text-align:center; padding:clamp(40px,7vw,78px) 0 30px; position:relative; }
.q-land-hero::before { content:""; position:absolute; top:-120px; left:50%; transform:translateX(-50%);
  width:720px; height:460px; max-width:100vw; background:radial-gradient(ellipse at center, var(--brand-glow), transparent 68%);
  pointer-events:none; z-index:-1; }
.q-land-h1 { font-size:clamp(38px,6.4vw,66px); font-weight:800; line-height:1.04; letter-spacing:-.02em; margin:0 0 18px; }
.q-land-h1 span { color:var(--brand); font-family:var(--serif); font-style:italic; font-weight:600; }
.q-land-lead { font-size:clamp(16px,2vw,19px); color:var(--muted); max-width:640px; margin:0 auto; line-height:1.6; }
.q-land-lead b { color:var(--text); font-weight:600; }

.q-land-sec { max-width:var(--maxw); margin:0 auto; padding:clamp(40px,7vw,72px) 0 0; }
.q-land-sec-h { text-align:center; max-width:620px; margin:0 auto 34px; }
.q-land-sec-h h2 { font-size:clamp(26px,3.6vw,36px); font-weight:800; letter-spacing:-.02em; margin:0 0 10px; }
.q-land-sec-h p { color:var(--muted); font-size:15.5px; line-height:1.6; margin:0; }

.q-benefit-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.q-benefit { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2); padding:24px 22px;
  position:relative; overflow:hidden; transition:transform .2s var(--ease,ease), box-shadow .25s, border-color .2s; }
.q-benefit::before { content:""; position:absolute; inset:0 0 auto 0; height:3px;
  background:linear-gradient(90deg,var(--brand),var(--brand2)); transform:scaleX(0); transform-origin:left; transition:transform .25s ease; }
.q-benefit:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); border-color:var(--brand-line); }
.q-benefit:hover::before { transform:scaleX(1); }
.q-benefit-ic { width:52px; height:52px; border-radius:14px; background:var(--brand-soft); border:1px solid var(--brand-line);
  display:grid; place-items:center; font-size:26px; margin-bottom:16px; }
.q-benefit h3 { font-size:17px; font-weight:800; margin:0 0 6px; }
.q-benefit p { color:var(--muted); font-size:14px; line-height:1.55; margin:0; }

.q-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; max-width:900px; margin:0 auto; }
.q-step { display:flex; gap:16px; align-items:flex-start; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r2); padding:22px; }
.q-step-n { flex:none; width:40px; height:40px; border-radius:12px; background:linear-gradient(135deg,var(--brand),var(--brand2));
  color:#fff; font-family:var(--display); font-weight:800; font-size:18px; display:grid; place-items:center; box-shadow:0 8px 18px var(--brand-glow); }
.q-step h3 { font-size:16.5px; font-weight:800; margin:2px 0 5px; }
.q-step p { color:var(--muted); font-size:14px; line-height:1.55; margin:0; }

.q-land-cta { text-align:center; background:var(--surface); border:1px solid var(--border); border-radius:var(--r3);
  padding:clamp(34px,5vw,52px); margin-top:clamp(40px,7vw,72px); position:relative; overflow:hidden; }
.q-land-cta::before { content:""; position:absolute; inset:0; background:radial-gradient(600px 300px at 50% -40%, var(--brand-dim), transparent 70%); pointer-events:none; }
.q-land-cta h2 { font-size:clamp(24px,3.4vw,34px); font-weight:800; margin:0 0 8px; position:relative; }
.q-land-cta p { color:var(--muted); font-size:15.5px; max-width:520px; margin:0 auto 24px; position:relative; }
.q-land-cta-btns { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; position:relative; }

/* scroll reveal (reduced-motion safe) */
[data-reveal] { opacity:0; transform:translateY(22px); transition:opacity .6s var(--ease,ease), transform .6s var(--ease,ease); }
[data-reveal].revealed { opacity:1; transform:none; }
@media (prefers-reduced-motion:reduce) { [data-reveal] { opacity:1; transform:none; transition:none; } }

/* top-bar dashboard button + dashboard actions */
.q-top-dash { padding:8px 14px; font-size:14px; }
.q-dash-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

@media (max-width:860px){ .q-benefit-grid { grid-template-columns:1fr 1fr; } .q-steps { grid-template-columns:1fr; } }
@media (max-width:560px){ .q-benefit-grid { grid-template-columns:1fr; } .q-top-dash { display:none; } }

/* ── modal ──────────────────────────────────────────────────────── */
.q-modal-back { position:fixed; inset:0; z-index:80; background:rgba(12,8,28,.55);
  backdrop-filter:blur(6px); display:none; align-items:center; justify-content:center; padding:20px; }
.q-modal-back.is-open { display:flex; animation:q-fade .2s ease both; }
.q-modal { width:100%; max-width:420px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r3); box-shadow:var(--shadow-lg); padding:30px; animation:q-pop .25s cubic-bezier(.2,.9,.3,1.3) both; }
.q-modal h2 { font-size:25px; margin-bottom:6px; }
.q-modal .q-sub { color:var(--muted); font-size:14px; margin-bottom:22px; }
.q-modal-x { position:absolute; }
.q-tabs { display:flex; gap:6px; background:var(--surface2); padding:4px; border-radius:12px; margin-bottom:20px; }
.q-tab { flex:1; text-align:center; padding:9px; border-radius:9px; font-size:14px; font-weight:600;
  color:var(--muted); cursor:pointer; border:none; background:transparent; transition:all .15s; }
.q-tab.is-active { background:var(--bg2); color:var(--text); box-shadow:var(--shadow); }
.q-oauth { width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  padding:12px; border:1.5px solid var(--border2); border-radius:var(--r); background:var(--bg2);
  font-weight:600; font-size:15px; cursor:pointer; color:var(--text); transition:border-color .15s; }
.q-oauth:hover { border-color:var(--brand); }
.q-or { display:flex; align-items:center; gap:12px; color:var(--hint); font-size:12px; margin:18px 0; }
.q-or::before, .q-or::after { content:""; flex:1; height:1px; background:var(--border); }

/* ── dashboard shell ────────────────────────────────────────────── */
.q-dash-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px;
  padding:40px 0 24px; flex-wrap:wrap; }
.q-dash-head h1 { font-size:clamp(28px,4vw,40px); font-weight:700; }
.q-dash-head p { color:var(--muted); margin:6px 0 0; }
.q-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:28px; }
.q-stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2); padding:18px 20px; }
.q-stat-num { font-family:var(--display); font-size:30px; font-weight:700; letter-spacing:-.02em; }
.q-stat-lbl { color:var(--muted); font-size:13px; margin-top:2px; }
.q-section-head { display:flex; align-items:center; justify-content:space-between; margin:26px 0 14px; }
.q-section-head h2 { font-size:20px; }
.q-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.q-quiz-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2);
  padding:20px; cursor:pointer; transition:transform .14s, box-shadow .22s, border-color .2s; }
.q-quiz-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:var(--brand); }
.q-quiz-cover { width:46px; height:46px; border-radius:12px; background:var(--brand-dim);
  display:grid; place-items:center; font-size:24px; margin-bottom:14px; }
.q-quiz-card h3 { font-size:17px; margin-bottom:5px; }
.q-quiz-meta { display:flex; gap:10px; align-items:center; color:var(--hint); font-size:12.5px; margin-top:12px; }
.q-tag { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  padding:3px 9px; border-radius:999px; }
.q-tag-draft { background:rgba(245,165,36,.14); color:var(--warn); }
.q-tag-published { background:rgba(47,210,122,.14); color:var(--ok); }

/* empty state */
.q-empty { text-align:center; padding:56px 24px; border:1.5px dashed var(--border2);
  border-radius:var(--r3); color:var(--muted); background:var(--surface); }
.q-empty-ico { font-size:40px; margin-bottom:12px; }
.q-empty h3 { font-size:20px; color:var(--text); margin-bottom:6px; }

/* ── toast ──────────────────────────────────────────────────────── */
.q-toasts { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:100;
  display:flex; flex-direction:column; gap:10px; align-items:center; pointer-events:none; }
.q-toast { background:var(--text); color:var(--bg); font-weight:600; font-size:14px;
  padding:12px 20px; border-radius:999px; box-shadow:var(--shadow-lg);
  animation:q-pop .25s ease both; max-width:90vw; }
.q-toast.err { background:var(--err); color:#fff; }
.q-toast.ok  { background:var(--ok);  color:#05230f; }

/* ── misc ───────────────────────────────────────────────────────── */
.q-spinner { width:22px; height:22px; border:2.5px solid var(--border2); border-top-color:var(--brand);
  border-radius:50%; animation:q-spin .7s linear infinite; }
.q-center { display:grid; place-items:center; min-height:50vh; }
.q-hidden { display:none !important; }
.q-err-msg { color:var(--err); font-size:13px; margin-top:-6px; margin-bottom:12px; min-height:16px; }
.q-foot { text-align:center; color:var(--hint); font-size:12.5px; padding:40px 0 30px; }
.q-foot a { color:var(--muted); text-decoration:none; }
.q-foot a:hover { color:var(--brand); }

/* ── quiz studio ────────────────────────────────────────────────── */
.q-studio-bar { display:flex; align-items:center; gap:10px; padding:26px 0 18px; flex-wrap:wrap; }
.q-count-chip { font-family:var(--mono); font-size:13px; font-weight:600; color:var(--brand);
  background:var(--brand-dim); border-radius:999px; padding:2px 10px; margin-left:6px; }

.q-studio-meta { display:flex; gap:16px; align-items:flex-start; padding:18px; margin-bottom:16px; flex-wrap:wrap; }
.q-meta-cover { display:flex; flex-direction:column; align-items:center; gap:4px; }
.q-cover-input { width:58px; height:58px; border-radius:16px; border:1.5px solid var(--border2);
  background:var(--bg2); text-align:center; font-size:28px; line-height:1; padding:0; }
.q-cover-input:focus { outline:none; border-color:var(--brand); box-shadow:var(--ring); }
.q-cover-hint { font-size:11px; color:var(--hint); }
.q-meta-fields { flex:1; min-width:220px; display:flex; flex-direction:column; gap:10px; }
.q-title-input { font-family:var(--display); font-size:22px; font-weight:600; letter-spacing:-.01em; }
.q-meta-timer { display:flex; flex-direction:column; gap:6px; }
.q-timer-pick { position:relative; }
.q-timer-pick .q-input { width:110px; padding-right:40px; }
.q-timer-unit { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--hint); font-size:13px; }

/* bulk paste panel */
.q-paste { padding:0; margin-bottom:22px; overflow:hidden; }
.q-paste > summary { list-style:none; cursor:pointer; padding:16px 18px; display:flex;
  align-items:center; justify-content:space-between; font-weight:600; font-size:15px; }
.q-paste > summary::-webkit-details-marker { display:none; }
.q-paste-caret { transition:transform .2s; color:var(--muted); }
.q-paste[open] .q-paste-caret { transform:rotate(180deg); }
.q-paste-body { padding:0 18px 18px; }
.q-paste-tip { color:var(--muted); font-size:13.5px; margin:0 0 12px; }
.q-paste-body .q-textarea { min-height:180px; font-size:13.5px; }
.q-paste-actions { display:flex; align-items:center; gap:10px; margin-top:12px; flex-wrap:wrap; }
.q-parse-note { font-size:13px; color:var(--muted); }
.q-parse-note.err { color:var(--err); }
.q-parse-note.ok { color:var(--brand2); font-weight:600; }

/* question cards */
.q-qcard { background:var(--surface); border:1px solid var(--border); border-radius:var(--r2);
  padding:18px; margin-bottom:14px; position:relative; transition:border-color .2s; }
.q-qcard.has-err { border-color:var(--err); box-shadow:0 0 0 3px rgba(239,78,107,.12); }
.q-qcard-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.q-qnum { width:30px; height:30px; border-radius:9px; background:var(--brand-dim); color:var(--brand);
  display:grid; place-items:center; font-family:var(--display); font-weight:700; font-size:14px; flex:none; }
.q-qcard-head .q-input { font-weight:500; }
.q-qcard-tools { display:flex; gap:4px; flex:none; }
.q-qcard-tools button { width:30px; height:30px; border:1px solid var(--border); background:transparent;
  border-radius:8px; cursor:pointer; color:var(--muted); font-size:14px; }
.q-qcard-tools button:hover { color:var(--brand); border-color:var(--brand); }
.q-qcard-tools button.del:hover { color:var(--err); border-color:var(--err); }

.q-opts { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.q-opt { display:flex; align-items:center; gap:9px; background:var(--bg2); border:1.5px solid var(--border2);
  border-radius:var(--r); padding:8px 10px; transition:border-color .15s, box-shadow .15s; }
.q-opt:focus-within { border-color:var(--brand); box-shadow:var(--ring); }
.q-opt.is-correct { border-color:var(--ok); box-shadow:0 0 0 2px rgba(47,210,122,.18); }
.q-opt-pick { width:26px; height:26px; border-radius:50%; border:2px solid var(--border2); background:transparent;
  cursor:pointer; flex:none; display:grid; place-items:center; font-size:12px; font-weight:700; color:var(--hint); }
.q-opt.is-correct .q-opt-pick { border-color:var(--ok); background:var(--ok); color:#05230f; }
.q-opt-glyph { font-size:13px; flex:none; width:16px; text-align:center; }
.q-opt-a .q-opt-glyph{ color:var(--ans-a);} .q-opt-b .q-opt-glyph{ color:var(--ans-b);}
.q-opt-c .q-opt-glyph{ color:var(--ans-c);} .q-opt-d .q-opt-glyph{ color:var(--ans-d);}
.q-opt input { flex:1; border:none; background:transparent; color:var(--text); font-size:14px; outline:none; font-family:var(--body); }
.q-qcard-foot { display:flex; gap:10px; margin-top:10px; flex-wrap:wrap; align-items:center; }
.q-qcard-foot .q-expl { flex:1; min-width:180px; }
.q-qcard-foot .q-qtime { width:120px; position:relative; }
.q-qcard-foot .q-qtime input { padding-right:38px; }
.q-qerr { color:var(--err); font-size:12.5px; margin-top:10px; font-weight:500; display:flex; gap:6px; align-items:flex-start; }

/* ── preview (participant simulation) ───────────────────────────── */
.q-preview { width:100%; max-width:620px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r3); box-shadow:var(--shadow-lg); overflow:hidden; animation:q-pop .25s ease both;
  display:flex; flex-direction:column; max-height:92vh; }
.q-preview-top { display:flex; align-items:center; gap:10px; padding:16px 18px; border-bottom:1px solid var(--border); }
.q-preview-badge { font-size:12px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  color:var(--brand); background:var(--brand-dim); padding:5px 11px; border-radius:999px; }
.q-preview-count { font-family:var(--mono); font-size:13px; color:var(--muted); }
.q-preview-body { padding:26px 22px; overflow-y:auto; }
.q-pv-q { font-family:var(--display); font-size:clamp(20px,3.4vw,26px); font-weight:600; text-align:center;
  margin:0 0 22px; line-height:1.2; }
.q-pv-tiles { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.q-pv-tile { display:flex; align-items:center; gap:12px; padding:16px; border-radius:var(--r2);
  color:#fff; font-weight:600; font-size:15.5px; cursor:pointer; border:none; text-align:left;
  transition:transform .12s, filter .2s; min-height:60px; }
.q-pv-tile:hover { transform:translateY(-2px); }
.q-pv-tile .glyph { font-size:18px; flex:none; }
.q-pv-tile.a { background:var(--ans-a); } .q-pv-tile.b { background:var(--ans-b); }
.q-pv-tile.c { background:var(--ans-c); color:var(--ans-c-ink); } .q-pv-tile.d { background:var(--ans-d); color:var(--ans-d-ink); }
.q-pv-tiles.revealed .q-pv-tile:not(.correct) { filter:grayscale(.7) opacity(.45); }
.q-pv-tiles.revealed .q-pv-tile.correct { outline:3px solid #fff; outline-offset:-3px; box-shadow:0 0 0 4px var(--ok); }
.q-pv-expl { margin-top:18px; background:var(--surface2); border-radius:var(--r); padding:14px 16px;
  font-size:14px; color:var(--muted); }
.q-pv-expl b { color:var(--text); }
.q-preview-nav { display:flex; gap:10px; padding:16px 18px; border-top:1px solid var(--border); }
.q-preview-nav .q-btn { flex:1; }

@media (max-width:560px) {
  .q-opts { grid-template-columns:1fr; }
  .q-pv-tiles { grid-template-columns:1fr; }
  .q-studio-meta { flex-direction:column; }
  .q-meta-timer { width:100%; }
}

/* ── host lobby ─────────────────────────────────────────────────── */
.q-lobby-join { display:flex; gap:28px; align-items:center; justify-content:space-between;
  padding:32px; margin:12px 0 26px; flex-wrap:wrap; }
.q-lobby-join-txt { flex:1; min-width:260px; }
.q-lobby-step { font-size:14px; color:var(--muted); font-weight:600; }
.q-lobby-url { font-family:var(--display); font-size:clamp(22px,3vw,30px); font-weight:600; color:var(--text); margin-top:4px; }
.q-lobby-pin { font-family:var(--mono); font-weight:700; letter-spacing:.14em;
  font-size:clamp(44px,9vw,76px); line-height:1.05; color:var(--brand); margin:4px 0 14px;
  background:var(--brand-dim); border-radius:var(--r2); padding:10px 22px; display:inline-block; }
.q-lobby-qr { text-align:center; }
.q-lobby-qr #lobbyQr { background:#fff; padding:12px; border-radius:var(--r2); display:inline-block; box-shadow:var(--shadow); }
.q-lobby-qr #lobbyQr img, .q-lobby-qr #lobbyQr canvas { display:block; }
.q-lobby-qr-cap { display:block; font-size:12px; color:var(--hint); margin-top:8px; }

.q-players-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; min-height:60px; }
.q-player-chip { position:relative; display:flex; align-items:center; gap:9px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--r); padding:11px 13px; font-weight:600; font-size:14.5px;
  animation:q-pop .3s cubic-bezier(.2,.9,.3,1.3) both; }
.q-player-ava { width:28px; height:28px; border-radius:50%; flex:none; display:grid; place-items:center;
  color:#fff; font-size:13px; font-weight:700; }
.q-player-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-player-kick { opacity:0; width:22px; height:22px; border-radius:50%; border:none; cursor:pointer;
  background:var(--err); color:#fff; font-size:12px; line-height:1; flex:none; transition:opacity .15s; }
.q-player-chip:hover .q-player-kick { opacity:1; }
.q-lobby-empty { color:var(--hint); font-size:14px; padding:14px 2px; grid-column:1/-1; }

/* ── participant (play) screens ─────────────────────────────────── */
.q-play-wrap { max-width:460px; margin:0 auto; padding:0 18px; }
.q-play-card { padding:26px; margin-top:8px; }
.q-play-center { text-align:center; padding:46px 0 24px; }
.q-play-big { font-family:var(--display); font-size:clamp(28px,8vw,40px); font-weight:700; margin:10px 0; }
.q-play-you { display:inline-flex; align-items:center; gap:9px; background:var(--surface);
  border:1px solid var(--border); border-radius:999px; padding:7px 15px 7px 7px; font-weight:600; margin-top:6px; }
.q-play-dot { width:10px; height:10px; border-radius:50%; background:var(--ok); box-shadow:0 0 0 4px rgba(47,210,122,.18); }
.q-play-wait-ring { width:54px; height:54px; border:4px solid var(--border2); border-top-color:var(--brand);
  border-radius:50%; animation:q-spin 1s linear infinite; margin:22px auto; }
.q-play-pulse { animation:q-breathe 2.2s ease-in-out infinite; }
@keyframes q-breathe { 0%,100%{ transform:scale(1); opacity:1 } 50%{ transform:scale(1.03); opacity:.9 } }

/* big "time's up" banner (host + participant) */
.q-timeup { text-align:center; font-family:var(--display); font-weight:800; letter-spacing:-.02em;
  font-size:clamp(30px,6vw,52px); color:var(--err); margin:28px auto 6px; padding:10px 20px;
  animation:q-timeup-in .45s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes q-timeup-in { 0%{opacity:0; transform:scale(.75);} 60%{transform:scale(1.06);} 100%{opacity:1; transform:scale(1);} }

/* ── host live (projector) ──────────────────────────────────────── */
.q-live-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 0 10px; }
.q-live-progress { font-family:var(--mono); font-size:14px; font-weight:600; color:var(--muted);
  background:var(--surface2); border-radius:999px; padding:6px 14px; }
/* shared SVG ring timer (host + participant render identically) */
.q-ring { position:relative; display:grid; place-items:center; flex:none; }
.q-ring svg { width:100%; height:100%; transform:rotate(-90deg); display:block; }
.q-ring circle { fill:none; stroke-width:8; }
.q-ring-track { stroke:var(--surface2); }
.q-ring-fill { stroke:var(--brand); stroke-linecap:round; transition:stroke-dashoffset .3s linear, stroke .25s; }
.q-ring-num { position:absolute; font-family:var(--display); font-weight:800; color:var(--text); line-height:1; }
.q-ring.low .q-ring-fill { stroke:var(--err); }
.q-ring.low .q-ring-num { color:var(--err); }
.q-ring.low { animation:q-pulse 1s ease-in-out infinite; }
.q-live-timer { width:76px; height:76px; }
.q-live-timer .q-ring-num { font-size:27px; }
.q-live-q { font-size:clamp(24px,4vw,40px); font-weight:600; text-align:center; margin:14px 0 24px; line-height:1.14; }
.q-live-tiles { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.q-live-tile { position:relative; display:flex; align-items:center; gap:14px; padding:20px; border-radius:var(--r2);
  color:#fff; font-weight:600; font-size:clamp(16px,2.2vw,20px); overflow:hidden; transition:filter .3s, transform .2s; }
.q-live-tile .glyph { font-size:24px; flex:none; }
.q-live-tile .txt { flex:1; }
.q-live-tile.a{background:var(--ans-a)} .q-live-tile.b{background:var(--ans-b)}
.q-live-tile.c{background:var(--ans-c);color:var(--ans-c-ink)} .q-live-tile.d{background:var(--ans-d);color:var(--ans-d-ink)}
.q-live-tile .q-tile-count { font-family:var(--mono); font-weight:700; font-size:18px; background:rgba(0,0,0,.18);
  border-radius:999px; padding:3px 12px; flex:none; }
.q-live-tiles.revealed .q-live-tile:not(.correct) { filter:grayscale(.7) opacity(.4); }
.q-live-tiles.revealed .q-live-tile.correct { box-shadow:0 0 0 4px var(--ok), 0 0 0 7px rgba(47,210,122,.3); transform:scale(1.02); }
.q-live-tile .q-tile-check { position:absolute; top:10px; right:12px; font-size:20px; opacity:0; }
.q-live-tiles.revealed .q-live-tile.correct .q-tile-check { opacity:1; }
.q-live-meta { text-align:center; color:var(--muted); font-size:15px; margin-top:18px; min-height:22px; }
.q-live-meta .q-expl-box { background:var(--surface2); border-radius:var(--r2); padding:14px 18px; margin-top:12px; display:inline-block; color:var(--text); }
.q-live-controls { display:flex; align-items:center; gap:12px; margin-top:26px; padding-top:18px; border-top:1px solid var(--border); }

.q-live-leader { max-width:620px; margin:10px auto 0; }
.q-lb-row { display:flex; align-items:center; gap:14px; padding:14px 18px; border-radius:var(--r2);
  background:var(--surface); border:1px solid var(--border); margin-bottom:10px;
  animation:q-slidein .4s cubic-bezier(.2,.9,.3,1.1) both; }
.q-lb-rank { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; font-family:var(--display);
  font-weight:700; font-size:16px; background:var(--surface2); color:var(--muted); flex:none; }
.q-lb-row.top1 .q-lb-rank{background:#ffd54a;color:#4a3a00} .q-lb-row.top2 .q-lb-rank{background:#cfd4dc;color:#2a2f38}
.q-lb-row.top3 .q-lb-rank{background:#e8a06a;color:#3a2206}
.q-lb-name { flex:1; font-weight:600; font-size:16px; }
.q-lb-score { font-family:var(--mono); font-weight:700; color:var(--brand); font-size:17px; }
@keyframes q-slidein { from{opacity:0; transform:translateX(-12px);} to{opacity:1; transform:none;} }

/* ── participant live ───────────────────────────────────────────── */
.q-plive-head { display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
.q-plive-right { display:flex; align-items:center; gap:12px; }
.q-plive-score { font-family:var(--mono); font-weight:700; color:var(--brand); font-size:16px; }
.q-plive-timer { width:46px; height:46px; }
.q-plive-timer .q-ring-num { font-size:16px; }
.q-plive-q { font-family:var(--display); font-size:clamp(20px,5.5vw,26px); font-weight:600; text-align:center; margin:14px 0 20px; line-height:1.2; }
.q-ptiles { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.q-ptile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  min-height:96px; border-radius:var(--r2); color:#fff; font-weight:600; font-size:15px; cursor:pointer; border:none;
  padding:14px; text-align:center; transition:transform .12s, filter .2s; }
.q-ptile:active { transform:scale(.97); }
.q-ptile .glyph { font-size:26px; }
.q-ptile.a{background:var(--ans-a)} .q-ptile.b{background:var(--ans-b)}
.q-ptile.c{background:var(--ans-c);color:var(--ans-c-ink)} .q-ptile.d{background:var(--ans-d);color:var(--ans-d-ink)}
.q-ptiles.locked .q-ptile { cursor:default; }
.q-ptiles.locked .q-ptile:not(.picked){ filter:grayscale(.6) opacity(.45); }
.q-ptiles.locked .q-ptile.picked{ box-shadow:0 0 0 4px #fff, 0 0 0 7px var(--brand); }
.q-plocked { text-align:center; margin-top:22px; color:var(--muted); }
.q-plocked .q-lock-ico { font-size:30px; }

.q-preveal { text-align:center; padding:30px 0 10px; }
.q-reveal-badge { display:inline-block; font-family:var(--display); font-size:clamp(28px,8vw,40px); font-weight:700; }
.q-reveal-badge.ok { color:var(--ok); } .q-reveal-badge.no { color:var(--err); }
.q-reveal-pts { font-family:var(--mono); font-weight:700; font-size:22px; margin-top:4px; }
.q-reveal-pts.ok { color:var(--ok); }
.q-reveal-sub { color:var(--muted); margin-top:10px; font-size:14.5px; }
.q-reveal-sub b { color:var(--text); }
.q-standing { text-align:center; padding:26px 0; }
.q-standing-rank { font-family:var(--display); font-size:clamp(44px,13vw,72px); font-weight:700; color:var(--brand); line-height:1; }
.q-standing-lbl { color:var(--muted); margin-top:4px; }
.q-standing-score { font-family:var(--mono); font-weight:700; font-size:20px; margin-top:10px; }

@media (max-width:560px){ .q-live-tiles { grid-template-columns:1fr; } }

/* ── podium (host + participant) ────────────────────────────────── */
.q-podium-wrap { text-align:center; padding:12px 0 4px; }
.q-podium-title { font-family:var(--display); font-size:clamp(26px,4vw,40px); font-weight:700; margin-bottom:6px; }
.q-podium-sub { color:var(--muted); font-size:14px; margin-bottom:24px; }
.q-podium { display:flex; align-items:flex-end; justify-content:center; gap:14px; max-width:620px; margin:0 auto; min-height:260px; }
.q-pod { flex:1; max-width:170px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
  opacity:0; transform:translateY(24px); transition:opacity .5s ease, transform .5s cubic-bezier(.2,.9,.3,1.2); }
.q-pod.revealed { opacity:1; transform:none; }
.q-pod-ava { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; color:#fff;
  font-family:var(--display); font-weight:700; font-size:22px; margin-bottom:8px; box-shadow:var(--shadow); }
.q-pod-medal { font-size:26px; line-height:1; margin-bottom:2px; }
.q-pod-name { font-weight:700; font-size:16px; margin-bottom:2px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-pod-score { font-family:var(--mono); font-weight:700; color:var(--brand); font-size:15px; margin-bottom:10px; }
.q-pod-bar { width:100%; border-radius:14px 14px 0 0; display:grid; place-items:start center; padding-top:14px;
  font-family:var(--display); font-weight:700; font-size:34px; color:rgba(255,255,255,.9); }
.q-pod-1 .q-pod-bar { height:180px; background:linear-gradient(180deg,#ffd54a,#f1b400); color:#5a4500; }
.q-pod-2 .q-pod-bar { height:132px; background:linear-gradient(180deg,#d7dce4,#b7bfcb); color:#2f3742; }
.q-pod-3 .q-pod-bar { height:100px; background:linear-gradient(180deg,#eaa676,#d98b4e); color:#4a2a0c; }
.q-podium-rest { max-width:420px; margin:22px auto 0; }
.q-podium-actions { display:flex; gap:10px; justify-content:center; margin-top:24px; flex-wrap:wrap; }
.q-summary-line { color:var(--muted); font-size:14px; margin-top:16px; }
.q-summary-line b { color:var(--text); }

.q-confetti { position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:200; }

/* history / recent games */
.q-history { margin-top:10px; }
.q-hist-row { display:flex; align-items:center; gap:12px; padding:13px 16px; border-radius:var(--r);
  background:var(--surface); border:1px solid var(--border); margin-bottom:9px; cursor:pointer; transition:border-color .15s; }
.q-hist-row:hover { border-color:var(--brand); }
.q-hist-ico { width:34px; height:34px; border-radius:9px; background:var(--brand-dim); display:grid; place-items:center; font-size:16px; flex:none; }
.q-hist-main { flex:1; min-width:0; }
.q-hist-title { font-weight:600; font-size:14.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-hist-meta { color:var(--hint); font-size:12px; margin-top:1px; }
.q-hist-when { color:var(--hint); font-size:12px; flex:none; }

@media (max-width:560px){
  .q-podium { gap:8px; min-height:220px; }
  .q-pod-1 .q-pod-bar{height:150px} .q-pod-2 .q-pod-bar{height:112px} .q-pod-3 .q-pod-bar{height:86px}
  .q-pod-ava{width:46px;height:46px;font-size:18px}
}

/* ── animations ─────────────────────────────────────────────────── */
@keyframes q-fade { from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
@keyframes q-pop  { from{opacity:0; transform:scale(.94);} to{opacity:1; transform:scale(1);} }
@keyframes q-pulse{ 0%,100%{opacity:1;} 50%{opacity:.35;} }
@keyframes q-spin { to{ transform:rotate(360deg); } }

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width:720px) {
  .q-paths { grid-template-columns:1fr; gap:16px; }
  .q-stats { grid-template-columns:1fr; }
  .q-hero { padding:44px 0 26px; }
  .q-top-user .q-top-name { display:none; }
}

/* ── reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after {
    animation-duration:.001ms !important; animation-iteration-count:1 !important;
    transition-duration:.001ms !important; scroll-behavior:auto !important;
  }
  .q-path:hover, .q-quiz-card:hover, .q-btn:hover { transform:none; }
}
