/* =========================================================
   Quiz — style (telefon najpierw, panel nauczyciela niżej)
   Motyw: <html data-theme="light|dark|blue">, przyciski: <html data-answers="color|mono">
   ========================================================= */
:root {
  /* tło strony i to, co leży bezpośrednio na nim */
  --page: #ffffff;
  --on-page: #1e1b4b;
  --glass: #f2f3fa;
  --chip: #e9ebf7;
  --chip-text: #1e1b4b;
  --star: #f59e0b;
  --track: #e6e8f3;
  --ring: #1e1b4b;          /* obwódka wybranej / poprawnej odpowiedzi */
  /* karty */
  --card: #ffffff;
  --card-border: #e4e6f1;
  --text: #1e1b4b;
  --muted: #6b6f8f;
  --line: #e7e9f3;
  --soft: #f2f3fa;
  --input: #f8f9ff;
  --me-bg: #e0e7ff;
  --me-text: #4f46e5;
  --bonus-bg: #fef3c7;
  --bonus-text: #b45309;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --ok: #16a34a;
  --bad: #e11d48;
  --gold: #f59e0b;
  --c1: #f43f5e;   /* A */
  --c2: #3b82f6;   /* B */
  --c3: #f59e0b;   /* C */
  --c4: #10b981;   /* D */
  --mono: #4f46e5; /* jednolite przyciski */
  --btn-light: #eceefa;
  --shadow: 0 8px 24px -14px rgba(30, 27, 75, .3);
  --radius: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #0c0d18;
  --on-page: #ecebff;
  --glass: rgba(255, 255, 255, .07);
  --chip: rgba(255, 255, 255, .1);
  --chip-text: #ecebff;
  --star: #fde047;
  --track: rgba(255, 255, 255, .12);
  --ring: #ffffff;
  --card: #181a2c;
  --card-border: #262942;
  --text: #ecebff;
  --muted: #a3a3c7;
  --line: #2b2d48;
  --soft: #23253d;
  --input: #20223a;
  --me-bg: rgba(129, 140, 248, .22);
  --me-text: #c7d2fe;
  --bonus-bg: rgba(245, 158, 11, .18);
  --bonus-text: #fbbf24;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --ok: #22c55e;
  --bad: #f43f5e;
  --mono: #4f46e5;
  --btn-light: #2a2c48;
  --shadow: 0 12px 30px -14px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root[data-theme="blue"] {
  --page: linear-gradient(165deg, #2563eb 0%, #1e40af 38%, #172554 75%, #0b1433 100%);
  --on-page: #ffffff;
  --glass: rgba(255, 255, 255, .13);
  --chip: rgba(0, 0, 0, .22);
  --chip-text: #ffffff;
  --star: #fde047;
  --track: rgba(255, 255, 255, .2);
  --ring: #ffffff;
  --card-border: transparent;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --mono: #1d4ed8;
  --shadow: 0 12px 30px -12px rgba(5, 10, 40, .55);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--page); background-attachment: fixed;
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.ic.fill { fill: currentColor; }
.ic.big { width: 2.6rem; height: 2.6rem; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--text); }
.error { color: var(--bad); font-weight: 800; min-height: 1.3em; text-align: center; }
.ok-t { color: var(--ok); }
.bad-t { color: var(--bad); }
.gold { color: var(--gold); }

/* wzory: zawsze w jednej linii; treść pytania może mieć kilka linii (\n w pliku) */
.katex { white-space: nowrap; }
.katex-display { margin: 0; }
.qtext > div, .qlist .tex { white-space: pre-line; }
.aimg { display: block; width: 100%; max-height: 76px; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; }
.ans:has(.aimg) { padding-right: 44px; gap: 8px; }
.ans:has(.aimg) .let { width: 32px; height: 32px; }

input {
  width: 100%; font: inherit; font-size: 1.2rem; padding: 13px 15px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--input); color: var(--text); transition: border-color .15s, background .15s;
}
input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 11px 16px; font: inherit; font-weight: 800; cursor: pointer; background: var(--primary); color: #fff; text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.btn:disabled { background: #9aa0c3; color: #fff; cursor: not-allowed; box-shadow: none; opacity: .6; }
.btn.block { width: 100%; font-size: 1.2rem; padding: 16px; }
.btn.light { background: var(--btn-light); color: var(--text); }
.btn.green { background: var(--ok); }
.btn.red { background: var(--bad); }
.btn.small { padding: 6px 9px; border-radius: 10px; box-shadow: none; }
.btn.grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; cursor: pointer; color: var(--on-page); background: var(--glass); font: inherit;
}
.icon-btn .ic { width: 1.3em; height: 1.3em; }

.avatar {
  --h: 250;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2em; height: 2em; border-radius: 50%; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 40) 75% 48%));
}
.avatar.lg { font-size: 1.8rem; }

/* animacje */
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 4px var(--ring), 0 0 0 4px rgba(34, 197, 94, .55); } 50% { box-shadow: 0 0 0 4px var(--ring), 0 0 0 14px rgba(34, 197, 94, 0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-8px); opacity: 1; } }
@keyframes floatUp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
@keyframes drift { from { transform: translateY(105vh) rotate(0deg); } to { transform: translateY(-15vh) rotate(200deg); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.rise { animation: rise .4s ease-out backwards; }
.shake { animation: shake .45s ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* pływające symbole w tle */
.bg-symbols { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-symbols span { position: absolute; top: 0; color: var(--on-page); opacity: .07; font-weight: 900; animation: drift linear infinite; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }

/* =========================================================
   TELEFON
   ========================================================= */
.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto; padding: 12px 14px 28px; padding-bottom: max(28px, env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 12px;
}
.app.middle { justify-content: center; }
.corner { position: absolute; top: 12px; right: 14px; z-index: 2; }
.logo { text-align: center; color: var(--on-page); margin: 0 0 8px; }
.logo h1 {
  margin: 0; font-size: 2.6rem; font-weight: 900; letter-spacing: 1px; line-height: 1.05;
  animation: pop .6s cubic-bezier(.2, .9, .3, 1.3) backwards;
}
.logo h1 span { color: var(--star); }
.logo p { margin: 6px 0 0; opacity: .75; }
.field-label { font-size: .9rem; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.stepper input { text-align: center; font-size: 1.6rem; font-weight: 900; }
.stepper .btn { font-size: 1.15rem; padding: 0; }
.status {
  display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 800; color: var(--on-page);
  background: var(--glass); border-radius: 999px; padding: 9px 16px; align-self: center; text-align: center;
}
.status.running { background: var(--bad); color: #fff; }
.link-btn { align-self: center; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--on-page); opacity: .8; font: inherit; cursor: pointer; padding: 6px 10px; }
.link-btn:hover { opacity: 1; }

/* górny pasek gracza */
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--on-page);
  background: var(--glass); backdrop-filter: blur(8px); border-radius: 18px; padding: 8px;
}
.bar .me { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 900; }
.bar .me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .me small { opacity: .7; font-weight: 700; }
.bar .stats { display: flex; gap: 6px; white-space: nowrap; align-items: center; }
.bar .icon-btn { width: 34px; height: 34px; background: var(--chip); color: var(--chip-text); }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--chip); color: var(--chip-text); border-radius: 999px; padding: 6px 11px; font-weight: 900; }
.chip .ic { color: var(--star); }
.chip.bump { animation: pulse .5s ease-in-out; }

/* poczekalnia */
.lobby { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; }
.lobby h2 { margin: 10px 0 0; font-size: 1.5rem; font-weight: 900; }
.dots { display: inline-flex; gap: 6px; margin: 8px 0 4px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.nicks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.nicks .n { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 4px 11px 4px 4px; font-size: .92rem; animation: pop .4s backwards; }
.nicks .n .avatar { font-size: .72rem; }
.nicks .n.me { background: var(--me-bg); color: var(--me-text); }
.info-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 6px 12px; font-size: .92rem; color: var(--muted); }
.pill b { color: var(--text); }
.pill .ic { color: var(--gold); }

/* pytanie */
.qmeta { display: flex; justify-content: space-between; align-items: center; color: var(--on-page); }
.qmeta .chip { font-size: .95rem; }
.timer { position: relative; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.timer > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #a3e635); transition: width .2s linear; }
.timer.mid > div { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.timer.low > div { background: linear-gradient(90deg, #fb7185, #e11d48); }
.tnum { min-width: 2.2em; justify-content: center; }
.tnum.low { background: var(--bad); color: #fff; animation: pulse .6s ease-in-out infinite; }
.tnum.low .ic { color: #fff; }

.qcard { padding: 0; overflow: hidden; }
.qimg { display: block; width: 100%; max-width: 420px; max-height: 36vh; object-fit: contain; margin: 14px auto 0; background: #fff; border-radius: 12px; }
.qtext { font-size: 1.28rem; font-weight: 800; line-height: 1.6; text-align: center; padding: 22px 16px; overflow-x: auto; }
.qtext > div { width: 100%; }

.answers { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ans {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; border-radius: 18px; color: #fff; font: inherit; font-size: 1.22rem; font-weight: 800;
  min-height: 66px; padding: 10px 50px 10px 10px; cursor: pointer; overflow: hidden;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .22); transition: transform .1s, box-shadow .1s, opacity .25s, filter .25s, background-color .25s;
  animation: rise .35s ease-out backwards;
}
.ans:nth-child(1) { background-color: var(--c1); }
.ans:nth-child(2) { background-color: var(--c2); animation-delay: .05s; }
.ans:nth-child(3) { background-color: var(--c3); animation-delay: .1s; }
.ans:nth-child(4) { background-color: var(--c4); animation-delay: .15s; }
[data-answers="mono"] .ans { background-color: var(--mono); }
.ans .let {
  flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .25);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem;
}
.ans .txt { flex: 1; min-width: 0; text-align: center; }
.ans:active:not(:disabled) { transform: translateY(4px) scale(.99); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.ans:disabled { cursor: default; }
.ans.dim { opacity: .28; filter: saturate(.4); }
.ans.chosen { box-shadow: 0 0 0 4px var(--ring), 0 5px 0 rgba(0, 0, 0, .22); transform: scale(1.02); }
.ans.correct { opacity: 1; filter: none; box-shadow: 0 0 0 4px var(--ring); background-color: var(--ok); animation: glow 1.2s ease-out 2; }
.ans.wrong { opacity: 1; filter: none; background-color: var(--bad); animation: shake .45s ease-in-out; }
/* znacznik ✓ / ✗ — wyśrodkowany bez transform (animacja "pop" używa transform) */
.ans .mark {
  position: absolute; right: 10px; top: 0; bottom: 0; margin: auto 0;
  width: 32px; height: 32px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; animation: pop .4s backwards;
}
.ans .mark .ic { stroke-width: 3.2; width: 20px; height: 20px; }
.ans.correct .mark { color: var(--ok); }
.ans.wrong .mark { color: var(--bad); }
.answers.revealed { gap: 7px; }
.answers.revealed .ans { min-height: 50px; padding-top: 5px; padding-bottom: 5px; }
.answers.revealed .ans .let { width: 32px; height: 32px; }

.waiting { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--on-page); font-weight: 800; min-height: 1.6em; }
.waiting .dots i { background: var(--on-page); width: 8px; height: 8px; }

/* wynik pytania */
.result { position: relative; text-align: center; padding: 16px; }
.result .big { font-size: 2.4rem; font-weight: 900; line-height: 1; display: inline-flex; align-items: center; gap: 10px; }
.result .sub { margin-top: 6px; color: var(--muted); }
.result.ok .big { color: var(--ok); }
.result.bad .big { color: var(--bad); }
.result.none .big { color: var(--muted); }
.result .bonus { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 14px; border-radius: 999px; background: var(--bonus-bg); color: var(--bonus-text); font-weight: 900; animation: pop .5s .25s backwards; }
.result .float { position: absolute; left: 50%; top: 4px; margin-left: -1.5em; width: 3em; text-align: center; font-weight: 900; color: var(--gold); pointer-events: none; animation: floatUp 1.4s ease-out both; }
.result .rankchg { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: .95rem; }
.result .rankchg.up { color: var(--ok); }
.result .rankchg.down { color: var(--bad); }
.fast-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.fast-list span { background: var(--soft); border-radius: 999px; padding: 4px 10px; font-size: .88rem; }
.fast-list span b { color: var(--bonus-text); }

/* koniec gry */
.end-head { text-align: center; color: var(--on-page); }
.end-head .ic { color: var(--star); }
.end-head h2 { margin: 6px 0 2px; font-size: 1.8rem; font-weight: 900; }
.end-head p { margin: 0; opacity: .8; }
.final-top { display: flex; justify-content: center; gap: 12px; }
.final-top .tile { flex: 1; text-align: center; background: var(--soft); border-radius: 16px; padding: 12px 8px; }
.final-top .tile b { display: block; font-size: 2rem; font-weight: 900; line-height: 1.1; }
.final-top .tile small { color: var(--muted); }
.final-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; text-align: center; }
.final-stats div { background: var(--soft); border-radius: 12px; padding: 8px 2px; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.05rem; }

.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; padding: 6px 4px 0; }
.podium .col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.podium .who { font-weight: 900; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-page); }
.podium .pts { font-size: .9rem; color: var(--on-page); opacity: .8; }
.podium .step {
  width: 100%; border-radius: 14px 14px 0 0; display: flex; justify-content: center; padding-top: 8px;
  font-size: 1.8rem; font-weight: 900; color: rgba(255, 255, 255, .95); transform-origin: bottom;
  animation: grow .7s cubic-bezier(.2, .9, .3, 1.15) backwards;
}
.podium .p1 .step { height: 120px; background: linear-gradient(180deg, #fcd34d, #f59e0b); animation-delay: .5s; }
.podium .p2 .step { height: 88px; background: linear-gradient(180deg, #cbd5e1, #94a3b8); animation-delay: .25s; }
.podium .p3 .step { height: 66px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.podium .col .avatar { animation: pop .5s backwards; }
.podium .p1 .avatar { animation-delay: 1s; } .podium .p2 .avatar { animation-delay: .75s; } .podium .p3 .avatar { animation-delay: .5s; }
.podium .me .who { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }

.lb { width: 100%; border-collapse: collapse; }
.lb td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.lb tr:last-child td { border-bottom: 0; }
.lb td:first-child { width: 2.2em; color: var(--muted); }
.lb td:last-child { text-align: right; font-weight: 900; }
.lb .who { display: flex; align-items: center; gap: 8px; }
.lb .who .avatar { font-size: .75rem; }
.lb tr.me td { background: var(--me-bg); }
.lb tr.me td:first-child { border-radius: 10px 0 0 10px; }
.lb tr.me td:last-child { border-radius: 0 10px 10px 0; }

.note { text-align: center; color: var(--on-page); opacity: .85; font-weight: 800; display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 1.4em; }

/* ---------- ustawienia ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(8, 6, 30, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease-out;
}
.sheet {
  width: 100%; max-width: 480px; max-height: 100dvh; overflow-y: auto;
  background: var(--card); color: var(--text); border-radius: 24px 24px 0 0; padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom)); animation: sheetUp .28s ease-out;
}
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-radius: 24px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-head h3 { margin: 0; font-size: 1.3rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sheet-head .icon-btn { background: var(--soft); color: var(--text); }
.opt-label { color: var(--muted); font-size: .9rem; margin: 12px 0 6px; }
.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 6px; background: var(--soft); padding: 5px; border-radius: 16px; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 12px; padding: 11px 6px;
  font: inherit; font-weight: 800; color: var(--muted); background: transparent; cursor: pointer; transition: background .15s, color .15s;
}
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.swatch { display: inline-flex; gap: 2px; }
.swatch i { width: 9px; height: 16px; border-radius: 3px; display: inline-block; }
.swatch.round i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.preview {
  margin-top: 14px; border-radius: 20px; padding: 12px; background: var(--page); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.preview .cap { color: var(--on-page); opacity: .75; font-size: .85rem; text-align: center; }
.preview .qtext { font-size: 1.1rem; padding: 14px 10px; }
.preview .answers { gap: 7px; }
.preview .ans { min-height: 50px; font-size: 1.05rem; padding-top: 5px; padding-bottom: 5px; animation: none; cursor: default; }
.preview .ans .let { width: 32px; height: 32px; }
.preview .ans .mark { animation: none; }
.preview .ans.correct { animation: none; }
.preview .ans.dim { opacity: .5; filter: none; }

/* =========================================================
   PANEL NAUCZYCIELA (komputer / rzutnik)
   ========================================================= */
.admin { max-width: 1400px; margin: 0 auto; padding: 18px; }
.topbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.topbar .brand { font-size: 1.35rem; font-weight: 900; margin-right: 6px; letter-spacing: .5px; color: var(--on-page); }
.topbar .brand span { color: var(--star); }
.topbar select { font: inherit; padding: 11px 12px; border-radius: 14px; border: 2px solid var(--line); flex: 0 1 420px; min-width: 220px; width: 420px; background: var(--card); color: var(--text); text-overflow: ellipsis; }
.topbar .sep { flex: 1; }
.admin > .error { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--soft); border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.05rem; }
.stat .ic { color: var(--muted); }
.stat.phase { background: var(--me-bg); color: var(--me-text); }
.stat.phase.question { background: rgba(22, 163, 74, .15); color: var(--ok); }
.stat.phase.finished { background: var(--bonus-bg); color: var(--bonus-text); }
.card.compact { padding: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.joinbox { display: flex; gap: 18px; align-items: center; }
.joinbox .qr { flex: none; background: #fff; padding: 8px; border-radius: 14px; border: 2px solid var(--line); }
.joinbox .qr img, .joinbox .qr canvas { display: block; }
.join-url { font-size: 1.9rem; font-weight: 900; color: var(--primary); word-break: break-all; line-height: 1.15; }
[data-theme="dark"] .join-url { color: #a5b4fc; }
.join-hint { color: var(--muted); margin-bottom: 4px; }
.big-nicks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.big-nicks .n { display: inline-flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 999px; padding: 5px 14px 5px 5px; font-size: 1.1rem; animation: pop .4s backwards; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }

.aq-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .95rem; flex-wrap: wrap; }
.aq-head label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.aq-head input { width: auto; }
.aq-timer { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.aq-timer .timer { flex: 1; background: var(--soft); }
.aq-timer .num { font-size: 1.6rem; font-weight: 900; min-width: 2.4em; text-align: right; }
.aq-timer .num.low { color: var(--bad); }
.qimg.small { max-height: 260px; max-width: 360px; }
.qtext.admin-q { font-size: 1.7rem; padding: 18px 8px; }
.adist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .adist { grid-template-columns: 1fr; } }
.adist .arow {
  position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px; color: #fff; overflow: hidden; min-height: 64px; font-size: 1.2rem;
  transition: opacity .3s, filter .3s;
}
.adist .arow:nth-child(1) { background: var(--c1); } .adist .arow:nth-child(2) { background: var(--c2); }
.adist .arow:nth-child(3) { background: var(--c3); } .adist .arow:nth-child(4) { background: var(--c4); }
.adist .arow > * { position: relative; z-index: 1; }
.adist .txt { min-width: 0; text-align: center; }
.adist .fillbar { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .18); transition: width .4s ease; }
.adist .let { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .25); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.adist .pct { font-weight: 900; font-size: 1.1rem; }
.adist.revealed .arow:not(.correct) { opacity: .3; filter: saturate(.3); }
.adist .arow.correct { box-shadow: 0 0 0 4px var(--ok) inset, 0 0 0 7px #fff inset; }
.adist .arow.correct .let { background: #fff; color: var(--ok); }
.fast-admin { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fast-admin .f { display: inline-flex; align-items: center; gap: 8px; background: var(--bonus-bg); color: var(--bonus-text); border-radius: 999px; padding: 4px 12px 4px 4px; animation: pop .4s backwards; }
.fast-admin .f .avatar { font-size: .75rem; }

.admin .podium .who { color: var(--text); font-size: 1.2rem; }
.admin .podium .pts { color: var(--muted); font-size: 1rem; opacity: 1; }
.admin .podium .p1 .step { height: 170px; } .admin .podium .p2 .step { height: 125px; } .admin .podium .p3 .step { height: 92px; }
.admin .podium .avatar { font-size: 1.6rem; }
.end-admin h2 { margin: 0 0 4px; font-size: 1.6rem; text-align: center; }
.end-admin p { margin: 0 0 12px; text-align: center; color: var(--muted); }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; background: var(--line); vertical-align: 0; }
.dot.waiting { background: #facc15; animation: pulse 1s infinite; }
.dot.correct { background: var(--ok); }
.dot.wrong { background: var(--bad); }
.dot.missed { background: #9ca3af; }
table.players { width: 100%; border-collapse: collapse; }
table.players th, table.players td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.players th { color: var(--muted); font-weight: 800; position: sticky; top: 0; background: var(--card); }
table.players td.nick { display: flex; align-items: center; gap: 8px; }
table.players td.nick .avatar { font-size: .72rem; }
table.players tr.top td:first-child { font-weight: 900; color: var(--gold); }
.tbl-wrap { max-height: 76vh; overflow: auto; }
.qlist td { vertical-align: top; white-space: normal !important; }
.qlist .tex { overflow-x: auto; }
.qlist .aimg { max-width: 260px; border: 1px solid var(--line); }
.bonus-info { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; margin-top: 10px; flex-wrap: wrap; }
.bonus-info b { background: var(--bonus-bg); color: var(--bonus-text); border-radius: 999px; padding: 1px 8px; }
