/* LiveQuiz shared tokens + primitives */
:root {
  --bg: #f4f7fb; --bg2: #eaf0f7; --panel: #ffffff; --panel2: #f1f5fa; --line: #d9e1ec;
  --text: #0e1726; --muted: #586780; --faint: #8a97ab;
  --accent: #0b8f84; --accent-2: #4f6bed; --accent-soft: rgba(11,143,132,.12);
  --good: #0f9f6e; --good-soft: rgba(15,159,110,.14); --bad: #d93a5b; --bad-soft: rgba(217,58,91,.12); --warn: #c98a06;
  --bar: #4f6bed; --bar-2: #0b8f84;
  --shadow: 0 1px 2px rgba(14,23,38,.06), 0 6px 24px rgba(14,23,38,.06);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a111e; --bg2: #0e1728; --panel: #121c2f; --panel2: #18243b; --line: #24334f;
  --text: #e9eff8; --muted: #9aa9c0; --faint: #66768f;
  --accent: #2fd3bf; --accent-2: #8aa2ff; --accent-soft: rgba(47,211,191,.14);
  --good: #3ddc97; --good-soft: rgba(61,220,151,.16); --bad: #ff6f8a; --bad-soft: rgba(255,111,138,.15); --warn: #f6c453;
  --bar: #7d95ff; --bar-2: #2fd3bf;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111e; --bg2: #0e1728; --panel: #121c2f; --panel2: #18243b; --line: #24334f;
    --text: #e9eff8; --muted: #9aa9c0; --faint: #66768f;
    --accent: #2fd3bf; --accent-2: #8aa2ff; --accent-soft: rgba(47,211,191,.14);
    --good: #3ddc97; --good-soft: rgba(61,220,151,.16); --bad: #ff6f8a; --bad-soft: rgba(255,111,138,.15); --warn: #f6c453;
    --bar: #7d95ff; --bar-2: #2fd3bf;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.4; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
a { color: var(--accent); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: .55em 1.1em; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; transition: background .15s, transform .08s, border-color .15s, opacity .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #04201c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #04201c; } }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.input { width: 100%; min-height: 48px; padding: .6em .85em; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1.05rem; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: .35em; padding: .2em .65em; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { color: var(--good); background: var(--good-soft); border-color: transparent; }
.chip.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.dot { width: .6em; height: .6em; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite; }
.dot.warn { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,.55); } 70% { box-shadow: 0 0 0 8px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.virion { width: 1.6em; height: 1.6em; flex: none; }
.virion .capsid { fill: var(--accent); }
.virion .spike { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.virion .core { fill: var(--panel); opacity: .9; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6em 1em; border-radius: 10px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
