/* Gemeinsames Design für Beamer, Handy und Einrichtung.
 * Farben der Schule: Grün #4dba38 und Anthrazit. Antwortfarben so gewählt, dass weiße Schrift
 * gut lesbar ist (Kontrast ≥ 4,9:1) und sie auch bei Farbsehschwäche unterscheidbar bleiben;
 * zusätzlich tragen die Antworten die Buchstaben A–D. */
:root {
  --bg: #2b3035;          /* Anthrazit */
  --bg-dark: #1e2226;
  --brand: #4dba38;       /* Schulgrün */
  --brand-ink: #1e2226;   /* Schrift auf Schulgrün */
  --brand-strong: #2b7a1f;/* dunkleres Grün für Schrift/Rahmen auf Weiß */
  --card: #ffffff;
  --text: #1e2226;
  --muted: #5f666d;
  --ans-a: #0f766e;       /* Türkis */
  --ans-b: #b45309;       /* Kupfer */
  --ans-c: #86198f;       /* Pflaume */
  --ans-d: #1d4ed8;       /* Ozeanblau */
  --good: #2b7a1f;
  --bad: #b42318;
  --radius: 12px;
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* Nunito: stile.css */
  color-scheme: light;
}
/* Außerhalb des Spiels (Anmeldung, Spielzugang, Verwaltung, Editor): Nunito fällt kleiner und
 * leichter aus als die Systemschriften, daher etwas größer und Überschriften/Knöpfe kräftiger. */
html:has(> body:not(.styled)) { font-size: 106.25%; }
body:not(.styled) :is(h1, h2, h3, .btn, .tagline) { font-weight: 800; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2 { margin: 0; line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Grundbausteine ---------- */

.card {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  width: min(100% - 32px, 420px);
  margin: 40px auto;
}
.card.wide { width: min(100% - 32px, 820px); }
.card .muted, .card.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; align-items: center; justify-content: center; }
.muted { color: rgba(255, 255, 255, .75); }
.small { font-size: .85rem; }
.error { color: var(--bad); font-weight: 600; min-height: 1em; }
.logo {
  font-size: 2.2rem; font-weight: 900; color: var(--text); letter-spacing: .01em;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.logo img { width: 1.4em; height: 1.4em; }
.logo img.wordmark { width: auto; height: 1.6em; }

input {
  font: inherit;
  font-size: 1.2rem;
  padding: 14px;
  border: 2px solid #cfcfd6;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  font-weight: 700;
}
input:focus { outline: none; border-color: var(--brand-strong); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-big { font-size: 1.2rem; padding: 14px 24px; }
.btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.card .btn-ghost { background: #ececf1; color: var(--text); }

.conn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: #c98f00; color: #000; text-align: center; padding: 6px; font-weight: 700;
}

.ans-a { background: var(--ans-a); }
.ans-b { background: var(--ans-b); }
.ans-c { background: var(--ans-c); }
.ans-d { background: var(--ans-d); }

.big-icon { font-size: 4.5rem; line-height: 1; }
.icon { width: 1em; height: 1em; flex: none; vertical-align: -.15em; }
.nowrap { white-space: nowrap; }
label.style-wrap { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.style-wrap .icon { width: 1.4em; height: 1.4em; }
.medal .icon { display: block; }
.big-icon .icon { display: block; margin: 0 auto; }
.answer .shape .icon { width: .9em; height: .9em; vertical-align: -.1em; }
.side-link .icon, .pick .icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.p-strip-note .icon { width: 1.3em; height: 1.3em; margin-right: .3em; }
.input-hint .icon { width: 1.5em; height: 1.5em; vertical-align: -.4em; margin-right: .35em; }
.countdown-big {
  font-size: 5rem; font-weight: 900;
  width: 1.8em; height: 1.8em; line-height: 1.8em; border-radius: 50%;
  background: rgba(255, 255, 255, .15); margin: 0 auto; text-align: center;
}
.timer {
  font-weight: 900; font-size: 1.4rem;
  min-width: 2.4em; height: 2.4em; line-height: 2.4em; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); text-align: center; flex-shrink: 0;
}

/* Antwort-Kacheln (Handy und Beamer) */
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer {
  font: inherit; color: #fff; border: 0; border-radius: 8px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px; font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; /* lange Wörter mit Trennstrich statt mitten im Wort */
}
/* Buchstabe A–D als Kennzeichen jeder Antwort */
.answer .shape {
  flex-shrink: 0; font-weight: 900; font-size: 1.2em; line-height: 1;
  width: 1.8em; height: 1.8em; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: rgba(255, 255, 255, .22);
}
.answer.dim { opacity: .35; }
.answer .tick { margin-left: auto; font-size: 1.5em; }

/* ---------- Handy ---------- */

.player-app {
  max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.player-app > section { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.player-app > .center { flex: 1; display: flex; }
.join { margin-top: 12vh; }
.join input#pin { letter-spacing: .3em; font-size: 1.6rem; }
.bar {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 10px 16px; background: rgba(0, 0, 0, .2); font-weight: 700; font-size: .95rem;
}
.bar > span { white-space: nowrap; flex-shrink: 0; }
.bar > .bar-name { overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.bar-score { background: var(--brand); color: var(--brand-ink); padding: 2px 10px; border-radius: 99px; }
.choose { justify-content: space-between; }
.q-top { display: flex; gap: 12px; align-items: center; }
.q-top .q-text { flex: 1; font-weight: 700; font-size: 1.1rem; }
.choose .answers { flex: 1; min-height: 55vh; }
.choose .answer {
  flex-direction: column; justify-content: center; text-align: center;
  font-size: 1.15rem; cursor: pointer; min-height: 90px;
}
.choose .answer .shape { font-size: 1.8rem; }
.choose .answer:active { transform: translateY(3px); box-shadow: none; }
.chosen {
  color: #fff; /* auch in hellen Stilen; helle Farbsätze setzen dunkle Schrift (stile.css) */
  width: 120px; height: 120px; border-radius: 16px; font-size: 4rem; line-height: 120px;
  margin: 0 auto; box-shadow: 0 6px 0 rgba(0, 0, 0, .25);
}
.result.good { background: var(--brand); color: var(--brand-ink); }
.result.good .rank { background: rgba(255, 255, 255, .4); }
.result.bad { background: var(--bad); color: #fff; } /* auch in hellen Stilen, deren Schrift sonst dunkel ist */
.points { font-size: 1.6rem; font-weight: 900; }
.rank { font-size: 1.2rem; font-weight: 700; background: rgba(0, 0, 0, .2); padding: 8px 18px; border-radius: 99px; }

/* Fragetypen auf dem Handy */
.result.partial { background: #f59e0b; color: var(--brand-ink); }
.result.partial .rank { background: rgba(255, 255, 255, .35); }
.result.partial .muted { color: rgba(32, 36, 40, .75); }
.result.neutral { background: var(--bg); }
.solution { font-weight: 700; font-size: 1.1rem; max-width: 30ch; }
.order-echo { margin: .3em 0 0; padding-left: 1.6em; text-align: left; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.order-echo li + li { margin-top: .25em; }
.answer-echo .order-echo { margin: 0; }
.choose .answer.selected { outline: 4px solid #fff; outline-offset: -4px; }
.choose .answer { position: relative; }
.choose .answer .tick { position: absolute; top: 8px; right: 10px; font-size: 1.4rem; }
.choose-mehrfach .answers, .choose-wahrfalsch .answers { min-height: 45vh; }
.tf .shape { font-size: 1.5em; }
.send { width: 100%; }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-item {
  font: inherit; font-weight: 700; font-size: 1.15rem; color: #fff; border: 0; border-radius: 10px;
  display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.order-item.picked { opacity: .55; }
.order-pos {
  width: 2em; height: 2em; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .25); font-weight: 900;
}
.order-item.picked .order-pos { background: #fff; color: var(--text); }
.input-row { display: flex; align-items: center; gap: 10px; }
.big-input { font-size: 1.6rem; padding: 16px; }
.unit { font-size: 1.4rem; font-weight: 700; }
.chosen-sm { width: 70px; height: 70px; line-height: 70px; font-size: 2.4rem; }
.answer-echo {
  background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 14px 20px; font-size: 1.4rem; font-weight: 800;
  max-width: 100%; overflow-wrap: anywhere;
}

/* ---------- Beamer ---------- */

.host { font-size: clamp(16px, 1.25vw, 28px); }
.host-app { min-height: 100vh; display: flex; flex-direction: column; }
.host-app > section { flex: 1; padding: 2vh 3vw; display: flex; flex-direction: column; gap: 2vh; }
.host-app > .center { flex: 1; display: flex; }
.host .card { font-size: 1rem; }
.narrow { margin-top: 15vh; }

.quiz-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.quiz-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid #e3e3ea; border-radius: 8px;
}

.controls {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 1.2vh 3vw; background: var(--bg-dark);
  position: sticky; bottom: 0; z-index: 5; /* bleibt auch bei langen Ranglisten sichtbar */
}

.join-info {
  display: flex; align-items: center; justify-content: center; gap: 4vw;
  background: #fff; color: var(--text); border-radius: var(--radius); padding: 2vh 3vw;
}
.join-info .muted { color: var(--muted); }
.join-text { display: flex; flex-direction: column; gap: 1vh; font-size: 1.5em; }
.lobby-brand { display: flex; align-items: center; gap: .4em; font-weight: 900; font-size: 1.1em; color: var(--text); }
.lobby-brand img { width: 1.5em; height: 1.5em; }
.lobby-brand img.wordmark { width: auto; height: 2.6em; margin-bottom: .2em; }
.pin { font-size: 4.5em; font-weight: 900; letter-spacing: .08em; line-height: 1; }
.qr { width: min(28vh, 320px); height: auto; image-rendering: pixelated; }
.players { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font: inherit; font-weight: 700; font-size: 1.5em;
  background: #fff; color: var(--text); border: 0; border-radius: 8px; padding: 8px 18px; cursor: pointer;
}
.chip.new { animation: pop .3s ease-out; }
.players li { position: relative; }
.chip:hover { box-shadow: 0 0 0 3px rgba(224, 49, 49, .35); }
.armed .chip { box-shadow: 0 0 0 4px #e03131; }
.kick {
  position: absolute; top: -12px; right: -12px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 3px solid #fff; background: #e03131; color: #fff; cursor: pointer;
  display: grid; place-items: center; animation: pop .15s ease-out; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.kick .icon { width: 16px; height: 16px; }
.kick:hover, .kick:focus-visible { background: #c92a2a; outline: none; transform: scale(1.1); }
.waiting { font-size: 1.4em; margin-top: 4vh; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ready { justify-content: center; align-items: center; text-align: center; }
.q-big { font-size: 3em; max-width: 30ch; }
.ready .countdown-big { font-size: 5em; }

.q-title {
  background: #fff; color: var(--text); border-radius: var(--radius);
  padding: 1.5vh 2vw; text-align: center; font-size: 2em;
}
.progress { height: 10px; background: rgba(255, 255, 255, .2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); transform-origin: left; transition: transform .2s linear; }
.q-middle { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 2vw; min-height: 0; }
.timer-big { font-size: 2.6em; }
.q-image { max-height: 38vh; max-width: 55vw; border-radius: var(--radius); object-fit: contain; background: #fff; }
.q-image-empty { flex: 1; }
.answered { text-align: center; font-size: 2.2em; font-weight: 900; }
.tiles .answer { font-size: 1.6em; padding: 2.2vh 1.5vw; min-height: 10vh; }

.reveal-main { flex: 1; display: flex; gap: 3vw; min-height: 0; }
.bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2vw; min-height: 30vh; }
.bar-col {
  width: min(10vw, 160px); height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
}
.bar-col.is-wrong { opacity: .45; }
.bar-count { text-align: center; font-weight: 900; font-size: 1.8em; margin-bottom: .5vh; }
.bar-fill { min-height: 6px; border-radius: 6px 6px 0 0; transition: height .6s ease-out; }
.bar-label { text-align: center; font-size: 1.6em; font-weight: 900; color: #fff; padding: .6vh 0; border-radius: 0 0 6px 6px; }

/* Fragetypen auf dem Beamer */
.type-badge {
  align-self: center; background: var(--brand); color: var(--brand-ink); font-weight: 800;
  border-radius: 99px; padding: .3em 1em; font-size: 1.1em;
}
.order-board { display: flex; flex-wrap: wrap; gap: 1.2vw; justify-content: center; }
.order-chip { color: #fff; font-weight: 800; font-size: 1.6em; border-radius: 10px; padding: 1.6vh 2vw; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.input-hint { text-align: center; font-size: 2em; font-weight: 800; padding: 3vh 0; color: rgba(255, 255, 255, .9); }
.reveal-panel { flex: 1; display: flex; flex-direction: column; gap: 1.2vh; justify-content: center; min-width: 0; }
.reveal-panel .bars { flex: 1; min-height: 18vh; } /* darf schrumpfen, damit lange Fragen lesbar bleiben */
.reveal-stat { font-size: 1.4em; font-weight: 800; }
.big-value { font-size: 4em; font-weight: 900; line-height: 1.05; color: var(--brand); overflow-wrap: anywhere; }
.order-solution { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1vh; }
.order-solution li {
  display: flex; align-items: center; gap: 1vw; background: #fff; color: var(--text); border-radius: 10px;
  padding: 1.2vh 1.2vw; font-size: 1.5em; font-weight: 800;
}
.order-solution .order-pos { background: var(--brand); color: var(--brand-ink); }
.grow { flex: 1; min-width: 0; }
.closest { margin: 0; padding-left: 1.4em; font-size: 1.4em; }
.closest li { padding: .3vh 0; }
.text-answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8vh 1.5vw; }
.text-answers li {
  display: flex; gap: .6em; align-items: center; background: rgba(255, 255, 255, .1); border-radius: 8px;
  padding: .8vh 1vw; font-size: 1.3em;
}
.text-answers li.ok { background: var(--brand); color: var(--brand-ink); }

.leaderboard {
  background: #fff; color: var(--text); border-radius: var(--radius);
  padding: 2vh 2vw; min-width: 28vw; align-self: flex-start;
}
.leaderboard h2 { font-size: 1.3em; margin-bottom: 1vh; }
.leaderboard ol { list-style: none; margin: 0; padding: 0; }
.leaderboard li { display: flex; gap: 1vw; font-size: 1.3em; font-weight: 700; padding: .6vh 0; border-top: 1px solid #eee; }
.lb-rank { width: 2.2em; color: var(--muted); }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.finished { align-items: center; }
.finished h1 { font-size: 2.6em; }
.podium { display: flex; align-items: flex-end; gap: 1.5vw; margin: 2vh 0; }
.podest { width: min(20vw, 280px); text-align: center; animation: pop .5s ease-out; }
.podest-name { font-size: 1.8em; font-weight: 900; overflow-wrap: anywhere; }
.podest-score { font-size: 1.2em; margin-bottom: 1vh; }
.podest-block {
  background: #fff; color: var(--bg); font-size: 4em; font-weight: 900;
  border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: center;
}
.place-1 .podest-block { height: 17vh; background: #ffd34d; }
.place-2 .podest-block { height: 12vh; background: #e1e1e8; }
.place-3 .podest-block { height: 9.5vh; background: #e8a86b; }
.podest-block { font-size: min(4em, 7vh) !important; }
.finished .leaderboard { align-self: center; min-width: min(90vw, 760px); }
/* Weitere Plätze: höchstens drei Zeilen, bis zu vier Spalten (--cols/--lines aus host.js), damit alles über die Steuerleiste passt */
.finished .leaderboard.rest-list { min-width: 0; width: min(94vw, calc(var(--cols) * 300px)); padding-block: 1vh; }
.finished .leaderboard.rest-list h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; font-size: 1.1em; margin-bottom: .4vh; }
.finished .leaderboard.rest-list ol { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--lines), auto); grid-auto-flow: column; column-gap: 2.2vw; }
.finished .leaderboard.rest-list li { font-size: 1.05em; padding: .25vh 0; gap: .5em; }
.finished .leaderboard.rest-list .lb-rank { width: 1.8em; }
.finished .leaderboard.rest-list .avatar-xs { width: 1.5em; height: 1.5em; }
.rest-more { font-size: .8em; font-weight: 700; color: var(--muted); }

/* Quiz-Sammlung: Einfügen und Vorschau */
.quiz-info strong .badge { margin-left: 6px; }
.host-app > section.card { flex: 0 0 auto; }
.badge { margin-left: 8px; vertical-align: middle; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.badge-draft { background: #fff1c2; color: #7a5600; }
.notice { background: #eef2ff; color: #2b2f6b; border-radius: 8px; padding: 10px 12px; }
.end { justify-content: flex-end; }
.nowrap { white-space: nowrap; }
.step { border-top: 1px solid #e3e3ea; padding-top: 14px; }
.step h2 { font-size: 1.15rem; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
label.field { font-weight: 600; font-size: .9rem; }
label.field input { font-size: 1rem; padding: 10px; text-align: left; font-weight: 400; }
textarea {
  font: inherit; width: 100%; padding: 10px; border: 2px solid #cfcfd6; border-radius: 8px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--brand-strong); }
textarea.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; line-height: 1.4; }
details summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.preview { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.preview > li { border: 1px solid #e3e3ea; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.preview-answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preview-answers li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: #f5f5f8; }
.preview-answers li.is-correct { background: #e6f5e1; font-weight: 700; }
.preview-answers .tick { margin-left: auto; color: var(--good); }
.mini {
  width: 24px; height: 24px; border-radius: 4px; color: #fff; font-size: .8rem; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Quiz-Editor */
.stack.tight { gap: 4px; }
input.title-input { font-size: 1.4rem; text-align: left; }
.edit-list { display: flex; flex-direction: column; gap: 14px; }
.edit-card {
  border: 1px solid #e3e3ea; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: #fbfbfd;
}
.edit-card.has-error { border-color: var(--bad); background: #fff6f7; }
.edit-card textarea { font-size: 1.05rem; font-weight: 600; }
.edit-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.edit-answer {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #e3e3ea;
  border-radius: 8px; padding: 4px 6px 4px 8px;
}
.edit-answer.is-correct { border-color: var(--good); background: #f1faee; }
.edit-answer input { border: 0; padding: 8px 4px; font-size: 1rem; font-weight: 400; text-align: left; min-width: 0; }
.edit-answer input:focus { outline: none; }
.edit-answer .mini { width: 28px; height: 28px; font-size: .85rem; }
.correct-toggle {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #cfcfd6;
  background: #fff; color: #cfcfd6; font-size: 1.1rem; font-weight: 900; cursor: pointer;
}
.correct-toggle[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.tools { gap: 6px; }
.tools select { font: inherit; padding: 6px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; }
.icon-btn {
  font: inherit; width: 34px; height: 34px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; cursor: pointer;
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.type-row { gap: 8px; flex-wrap: wrap; }
.type-row select { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; }
.type-row .type-select { font-weight: 700; border-color: var(--brand-strong); }
.tf-pick {
  font: inherit; font-weight: 800; font-size: 1.1rem; padding: 14px; border-radius: 8px; cursor: pointer;
  color: #fff; border: 4px solid transparent; opacity: .55;
}
.tf-pick.is-correct { opacity: 1; border-color: var(--good); box-shadow: 0 0 0 2px #fff inset; }
.order-edit { display: flex; flex-direction: column; gap: 6px; }
.order-num { background: var(--anthracite, #2b3035); }
label.field { display: flex; flex-direction: column; gap: 4px; }
.link-btn { font: inherit; font-size: .85rem; border: 0; background: none; color: var(--brand-strong); text-decoration: underline; cursor: pointer; }
.edit-image { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.edit-image img { max-height: 120px; max-width: 220px; border-radius: 6px; border: 1px solid #e3e3ea; }
.edit-image > .stack { flex: 1; min-width: 220px; }
.preview-image { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.preview-image img { max-height: 90px; max-width: 160px; border-radius: 6px; border: 1px solid #e3e3ea; background: #fff; }
.img-credit { font-size: .8em; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-question { align-self: flex-start; border: 2px dashed #cfcfd6; color: var(--text); }
.editor-bar {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e3e3ea;
  padding: 12px 0 4px; box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; gap: 6px;
}
.editor-bar .error:empty { display: none; }

/* Avatare */
.avatar { display: inline-block; flex-shrink: 0; line-height: 0; }
.avatar svg { width: 100%; height: 100%; overflow: visible; }
.avatar-xs { width: 1.7em; height: 1.85em; vertical-align: middle; margin-right: .35em; }
.avatar-md { width: 84px; height: 92px; }
.avatar-big { width: 160px; height: 172px; margin: 0 auto; animation: wobble 2.4s ease-in-out infinite; }
.avatar-chip { width: 2.1em; height: 2.3em; }
.avatar-podium { width: min(13vh, 7em); height: min(14vh, 7.6em); animation: hop 1s ease-in-out infinite; }
.place-2 .avatar-podium { animation-delay: .2s; } .place-3 .avatar-podium { animation-delay: .4s; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8%); } }
@media (prefers-reduced-motion: reduce) { .avatar-big, .avatar-podium { animation: none; } }

.chip { display: inline-flex; align-items: center; gap: .35em; padding: 4px 16px 4px 8px; }
.lb-name { display: flex; align-items: center; }
.leaderboard li { align-items: center; }
.finished .leaderboard li { padding: .3vh 0; }

.join-avatar { display: flex; align-items: center; gap: 14px; text-align: left; }
.btn-light { background: #ececf1; color: var(--text); box-shadow: none; }
.lobby-view { justify-content: space-between; }
.final-avatar { position: relative; display: inline-block; }
.final-avatar .medal { position: absolute; right: -10px; bottom: 0; font-size: 3.2rem; }

.avatar-editor { display: flex; flex-direction: column; gap: 12px; }
.avatar-top { display: flex; align-items: center; justify-content: center; gap: 16px; }
.avatar-preview .avatar-big { width: 140px; height: 152px; animation: none; }
.avatar-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 4px; }
.avatar-tab {
  font: inherit; font-weight: 700; font-size: .9rem; border: 0; border-radius: 8px; padding: 10px 4px;
  background: transparent; color: rgba(255, 255, 255, .75); cursor: pointer;
}
.avatar-tab[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.avatar-swatches { display: flex; flex-direction: column; gap: 6px; }
.avatar-swatches small { color: rgba(255, 255, 255, .65); font-size: .75rem; text-align: center; }
.avatar-swatches > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--brand); }
.avatar-rows { display: flex; flex-direction: column; gap: 8px; }
.avatar-row { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 4px; }
.avatar-row-label { flex: 1; text-align: center; font-weight: 700; display: flex; flex-direction: column; }
.avatar-row-label small { font-weight: 400; color: rgba(255, 255, 255, .65); font-size: .75rem; }
.arrow {
  font: inherit; font-size: 1.6rem; font-weight: 900; width: 48px; height: 44px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
}
.arrow:active { background: var(--brand); color: var(--brand-ink); }

/* Einrichtungsseite */
.page-simple { background: var(--bg); }
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { padding: 8px 10px; border-radius: 6px; }
.checks .ok { background: #e6f5e1; }
.checks .bad { background: #fde3e7; }
.checks .warn { background: #fff4d6; }
.checks li { overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .preview-answers, .edit-answers { grid-template-columns: 1fr; }
  .join-info { flex-direction: column; }
  .reveal-main { flex-direction: column; }
  .leaderboard { min-width: 0; align-self: stretch; }
}
.preview-order { margin: 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 4px; }
.preview-order li { padding: 4px 8px; border-radius: 6px; background: #e6f5e1; font-weight: 600; }
.preview-solution { margin: 0; padding: 6px 8px; border-radius: 6px; background: #e6f5e1; font-weight: 700; color: var(--good); }
.preview-solution .muted { font-weight: 400; }
select.export-select { appearance: auto; }
/* Spiel sperren */
.lock-btn.is-locked { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pin.pin-locked { opacity: .35; text-decoration: line-through; }
.locked-note { font-weight: 800; font-size: 1.3em; color: var(--brand); margin: .3em 0 0; }
/* Quiz-Einstellungen im Editor */
.quiz-settings { gap: 18px; align-items: flex-end; }
.quiz-settings select { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; }
label.check input { width: 20px; height: 20px; }

/* ---------- Quiz-Auswahl: Bereiche, Ordner, Suche ---------- */
.card.library { width: min(100% - 32px, 1180px); }
.lib { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.lib-side { border-right: 1px solid #e3e3ea; padding-right: 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.lib-side ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.side-head h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-link {
  font: inherit; width: 100%; display: flex; gap: 8px; align-items: center; text-align: left; cursor: pointer;
  border: 0; background: none; color: var(--text); padding: 7px 10px; border-radius: 8px;
}
.side-link.sub { padding-left: 28px; }
.side-link:hover { background: #f1f2f5; }
.side-link.active { background: #e6f5e1; color: var(--brand-strong); font-weight: 700; }
.side-count { font-size: .8rem; color: var(--muted); }
.lib-main { min-width: 0; }
.lib-search { text-align: left; font-size: 1rem; font-weight: 400; padding: 10px 12px; }
.lib-heading h2 { font-size: 1.2rem; }
.lib-heading .row { gap: 6px; }
.lib-empty { padding: 20px 4px; }
.btn-small { font-size: .85rem; padding: 6px 10px; }
.danger { color: var(--bad) !important; }
.badge-shared { background: #e6f5e1; color: var(--brand-strong); }
.user-chip { font-size: .85rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.quiz-info { min-width: 0; }
.quiz-info .muted { overflow-wrap: anywhere; }

/* Menü ⋯ */
details.menu { position: relative; }
details.menu > summary { list-style: none; padding: 8px 14px; font-weight: 900; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px; background: #fff; border: 1px solid #e3e3ea;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; display: flex; flex-direction: column;
}
.menu-list button { font: inherit; text-align: left; border: 0; background: none; color: var(--text); padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: #f1f2f5; outline: none; }

/* Dialog Ordner wählen */
dialog.dialog { border: 0; padding: 24px; width: min(100% - 32px, 460px); color: var(--text); }
dialog.dialog::backdrop { background: rgba(20, 24, 28, .55); }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; border: 1px solid #e3e3ea; border-radius: 8px; padding: 6px; }
label.pick { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
label.pick:hover { background: #f1f2f5; }
label.pick.sub { padding-left: 30px; }
label.pick input { width: 18px; height: 18px; }
input.pick-new { text-align: left; font-size: 1rem; font-weight: 400; padding: 10px; }

/* Verwaltung */
.card.admin { width: min(100% - 32px, 1100px); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid #e3e3ea; }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.admin-table tr.inactive td { background: #fffaf0; }
.admin-table .num { white-space: nowrap; }
/* Lasttest (Verwaltung) */
.lt-hints { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.lt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.lt-form input { text-align: left; font-size: 1rem; padding: 10px; }
.lt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.lt-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #e3e3ea; border-radius: 8px; font-variant-numeric: tabular-nums; }
.lt-stat strong { font-size: 1.4rem; }
.lt-verdict { padding: 12px 14px; border-radius: 8px; display: grid; gap: 4px; }
.lt-good { background: #e6f5e1; }
.lt-warn { background: #fff4d6; }
.lt-bad { background: #fde3e7; }
.lt-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.lt-table th, .lt-table td { padding: 6px 10px; border-bottom: 1px solid #eee; text-align: left; }
.lt-table .num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.admin-transfer select { font: inherit; padding: 6px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; max-width: 260px; }
.admin-transfer { margin-bottom: 6px; }

/* Anmeldung */
.iserv-btn { text-align: center; text-decoration: none; }
.emergency summary { font-size: .85rem; }

@media (max-width: 800px) {
  .lib { grid-template-columns: 1fr; }
  .lib-side { border-right: 0; border-bottom: 1px solid #e3e3ea; padding: 0 0 10px; position: static; }
}
.admin-quizzes-row td { background: #f7f8fa; padding-top: 4px; }
.admin-quizzes .quiz-list li { background: #fff; }
.admin-quizzes { padding: 4px 0 8px; }

/* ---------- Effekte: Live-Rangliste, Erwähnungen, Ansage, Siegerehrung ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
.fx-balloon { position: fixed; bottom: -22vh; width: max(40px, 5vw); z-index: 49; pointer-events: none; animation: fx-rise var(--d, 6s) ease-in forwards; }
.fx-balloon svg { width: 100%; overflow: visible; transform-origin: 50% 100%; animation: fx-sway 1.6s ease-in-out infinite alternate; }
@keyframes fx-rise { to { transform: translateY(-135vh); } }
@keyframes fx-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes fx-pop { from { opacity: 0; transform: translateY(.6em) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes fx-drop { from { opacity: 0; transform: translateY(-4vh); } to { opacity: 1; transform: none; } }
@keyframes fx-stamp { from { transform: rotate(-3deg) scale(0); } to { transform: rotate(-3deg) scale(1); } }

.reveal-side { display: flex; flex-direction: column; gap: 1.4vh; align-self: flex-start; min-width: 28vw; max-width: 38vw; max-height: 100%; min-height: 0; }
/* Zwischenstand nur so lang, wie Platz ist (sonst ragt er unter die Antwortkacheln); unten sanft ausgeblendet */
.reveal-side .leaderboard { align-self: stretch; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.reveal-side .leaderboard ol { min-height: 0; }
.reveal-side .leaderboard ol.cut { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent); }
.reveal-side .fx-notes { flex-shrink: 0; }
.leaderboard.live ol { overflow: hidden; }
.leaderboard.live li { align-items: center; border-radius: 6px; }
.leaderboard li.hl { background: #fff9db; }
.lb-move, .lb-gain { font-size: .7em; font-weight: 900; border-radius: 99px; padding: .1em .55em; white-space: nowrap; align-self: center; transition: .35s; }
.lb-move { color: #fff; background: var(--good); opacity: 0; }
.lb-move:empty { display: none; }
.lb-move.on { opacity: 1; }
.lb-move.down { background: #6c757d; }
.lb-gain { color: var(--good); background: #e6f5e1; opacity: 0; transform: translateX(.8em); }
.lb-gain.on { opacity: 1; transform: none; }
.lb-gain.zero { color: #5f666d; background: #f1f3f5; }
.lb-score { font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }
.fx-notes { display: grid; gap: 1vh; }
.fx-note {
  display: flex; align-items: center; gap: .6em; background: #fff; color: var(--text); border-radius: var(--radius);
  padding: .7vh .9vw; font-size: 1.05em; line-height: 1.2; box-shadow: 0 .3em 1em rgba(0, 0, 0, .25); animation: fx-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.fx-note b { display: block; font-weight: 900; }
.fx-note small { display: block; color: var(--muted); font-weight: 700; font-size: .72em; }
.fx-ic { width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center; flex: none; color: #1e2226; }
.fx-ic .icon { width: 1.3em; height: 1.3em; }
.fx-ic.blitz { background: var(--brand); }
.fx-ic.serie { background: #fff4e6; }
.fx-ic.punkt { background: #e7f5ff; }
.fx-banner {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.6); opacity: 0; z-index: 45; pointer-events: none;
  background: rgba(20, 24, 28, .86); color: #fff; border-radius: 2vw; padding: 2vh 4vw; text-align: center; white-space: nowrap;
  font-weight: 900; font-size: 6vw; line-height: 1.1; transition: .5s cubic-bezier(.2, 1.5, .4, 1);
}
.fx-banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fx-banner small { display: block; font-size: .32em; font-weight: 800; margin-top: .3em; opacity: .9; }
.fx-banner.soft { font-size: 4.5vw; }
.announce {
  background: #fcc419; color: #1e2226; font-weight: 900; font-size: 2.4em; border-radius: .4em; padding: .15em .8em;
  transform: rotate(-3deg); margin-bottom: 2vh;
}
.announce.pop { animation: fx-stamp .6s cubic-bezier(.2, 1.6, .4, 1); }
.fx-btn.is-off { opacity: .75; }

.finished.ceremony .podest { animation: none; }
.podest .podest-block { transition: height .8s cubic-bezier(.2, .9, .3, 1); }
.podest.is-hidden > :not(.podest-block) { visibility: hidden; }
.podest.is-hidden .podest-block { height: 0 !important; overflow: hidden; }
.podest.rise .podest-name, .podest.rise .podest-score { animation: fx-drop .6s .5s both; }
.podest.rise .avatar-podium { animation: fx-drop .6s .4s both, hop 1s 1s ease-in-out infinite; }
.podest .crown { display: none; }
.podest.place-1.is-shown .crown { display: block; width: min(7vh, 4em); height: min(7vh, 4em); margin: 0 auto -1.2vh; }
.podest.place-1.is-shown .crown .icon { width: 100%; height: 100%; }
.podest.rise .crown { animation: fx-drop .6s 1s both; }
.ceremony-sub { font-size: 1.5em; min-height: 1.5em; margin: 0; font-weight: 800; }
.ceremony-dark { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .8s; pointer-events: none; z-index: 40; }
.ceremony-dark.on { opacity: 1; }
.rest.is-hidden { visibility: hidden; }
.rest.rise { animation: fx-pop .6s both; }
.prizes {
  position: fixed; inset: 0; background: rgba(30, 34, 38, .96); z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3vh; padding-bottom: 10vh; animation: fx-pop .5s both;
}
.prizes h2 { font-size: 2.6em; color: #fff; margin: 0; }
.prize-grid { display: flex; gap: 2vw; flex-wrap: wrap; justify-content: center; }
.prize {
  background: #fff; color: var(--text); border-radius: var(--radius); padding: 2.5vh 1.5vw; width: min(20vw, 260px);
  display: flex; flex-direction: column; align-items: center; gap: .6vh; text-align: center;
  opacity: 0; transform: translateY(2vh) scale(.9); transition: .5s cubic-bezier(.2, 1.4, .4, 1);
}
.prize.on { opacity: 1; transform: none; }
.prize b { font-size: 1.4em; }
.prize-name { font-weight: 800; font-size: 1.2em; }
.prize-ic { width: 3.2em; height: 3.2em; border-radius: 50%; background: #f1f3f5; display: grid; place-items: center; }
.prize-ic .icon { width: 2.1em; height: 2.1em; }
.controls { z-index: 36; }
@media (prefers-reduced-motion: reduce) {
  .fx-note, .announce.pop, .podest.rise *, .rest.rise, .prizes { animation: none !important; }
  .prize, .lb-gain, .lb-move, .fx-banner, .podest .podest-block { transition: none !important; }
}

/* Effekte auf dem Handy */
.bar-right { display: inline-flex; align-items: center; gap: 6px; }
.bar-streak { display: inline-flex; align-items: center; gap: 2px; background: rgba(255, 146, 43, .22); border-radius: 99px; padding: 1px 8px 1px 4px; font-weight: 800; }
.bar-streak .icon { width: 1.2em; height: 1.2em; }
.bar-streak.pulse { animation: fx-pulse .6s 2 .8s; }
@keyframes fx-pulse { 50% { transform: scale(1.35); } }
.p-badge {
  display: flex; align-items: center; gap: 8px; background: #fff; color: var(--text); border-radius: 12px; padding: 8px 12px;
  font-weight: 900; text-align: left; animation: fx-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.p-badge .icon { width: 28px; height: 28px; }
.p-up { background: #fff; color: var(--good); border-radius: 99px; padding: 3px 12px; font-weight: 900; animation: fx-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.p-soft { font-size: .95em; opacity: .9; max-width: 26ch; margin: 0 auto; }
.p-prize { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; color: var(--text); border-radius: 14px; padding: 12px 16px; animation: fx-pop .5s both; }
.p-prize .muted { color: var(--muted); }
.medal.pop { animation: fx-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.player .announce { font-size: 1.4em; align-self: center; }
@media (prefers-reduced-motion: reduce) { .p-badge, .p-up, .p-prize, .medal.pop, .bar-streak.pulse { animation: none !important; } }

/* ---------- Gesamtübersicht am Spielende (nur auf Wunsch) ---------- */
.overview {
  position: fixed; inset: 0; z-index: 35; background: #fff; color: var(--text); display: flex; flex-direction: column;
  gap: 1.4vh; padding: 2.5vh 3vw 12vh; animation: fx-pop .3s both;
}
.ov-head { display: flex; align-items: center; gap: 1vw; }
.ov-head h2 { margin: 0; font-size: 1.6em; display: flex; align-items: center; gap: .4em; }
body .overview .btn-ghost, body.styled .overview .btn-ghost { background: #f1f3f5; color: var(--text); }
.ov-scroll { overflow: auto; min-height: 0; flex: 0 1 auto; border: 1px solid #e3e6e8; border-radius: var(--radius); }
.ov-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 1.05em; font-variant-numeric: tabular-nums; }
.ov-table th, .ov-table td { padding: .45em .6em; text-align: center; border-bottom: 1px solid #eef0f2; white-space: nowrap; }
.ov-table thead th { position: sticky; top: 0; background: #f8f9fa; z-index: 2; font-weight: 800; }
.ov-table th small { display: block; font-weight: 700; color: var(--muted); font-size: .72em; }
.ov-table .ov-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 800; }
.ov-table thead .ov-name { background: #f8f9fa; z-index: 3; }
.ov-total { font-weight: 900; }
.ov-good { background: #e6f5e1; color: #1f6b14; font-weight: 800; }
.ov-part { background: #fff4d6; color: #8a5a00; font-weight: 800; }
.ov-bad { background: #fde8e8; color: #a61b1b; }
.ov-none, .ov-poll { color: #adb5bd; }
.ov-questions { list-style: none; margin: 0; padding-left: 0; columns: 2; column-gap: 3vw; font-size: .95em; max-height: 22vh; overflow: auto; }
.ov-questions li { break-inside: avoid; display: flex; gap: 1em; padding: .15em 0; }
.ov-questions .muted { color: var(--muted); white-space: nowrap; }
.ov-legend { margin: 0; font-size: .85em; color: var(--muted); }
.ov-legend span { padding: .05em .5em; border-radius: 6px; }

/* Formeln (KaTeX, siehe assets/formel.js) */
.tex .katex { font-size: 1.08em; }
.tex { display: inline-block; max-width: 100%; vertical-align: middle; }
.tex-display { display: block; margin: 0; padding-block: .3em; max-width: 100%; overflow-x: auto; overflow-y: hidden; } /* Luft für Grenzen von Integral und Summe */
.tex-display .katex-display { margin: 0; }
.answer .tex, .order-item .tex { max-width: 100%; }
.answer .a-text { display: block; min-width: 0; max-width: 100%; } /* Breite als Maß für zu breite Formeln */
/* Fragezeilen dürfen nicht mit einer breiten Formel mitwachsen, sonst kann sie nicht verkleinert werden */
.q-text, .q-big, .q-title, .answer, .answer > span, .order-item, .order-item > span { min-width: 0; }
.answer > span, .order-item > span { max-width: 100%; }
.answer .tex .katex, .order-item .tex .katex, .order-solution .tex .katex { font-size: 1.25em; }
.tex-error { font-family: ui-monospace, Menlo, monospace; font-size: .8em; background: rgba(224, 49, 49, .14); border-radius: 4px; padding: 0 .25em; }
.formula-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.formula-bar .fbtn { min-width: 2.4em; padding: 4px 8px; border-radius: 8px; border: 1px solid #d6dbd5; background: #fff; color: var(--text); font: 700 14px/1.2 inherit; cursor: pointer; }
.formula-bar .fbtn:hover, .formula-bar .fbtn:focus-visible { border-color: var(--brand-strong); background: #f3faf1; }
.formula-bar .fhint { margin-left: 6px; }
.tex-preview { border: 1px dashed #c9d3c6; border-radius: 10px; padding: 8px 12px; display: grid; gap: 6px; background: #fbfcfa; }
.tex-preview .tex-q { font-weight: 700; font-size: 1.1em; }
.tex-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tex-answers li { display: flex; gap: 8px; align-items: center; }
.tex-errors { margin: 0; padding-left: 1.1em; }
.tex-errors:empty { display: none; }
.quiz-settings > .field { min-width: 0; max-width: 100%; }
.style-select { max-width: 100%; min-width: 0; } /* lange Stilnamen dürfen das Handy nicht verbreitern */

/* Startseite: Kurztext unter dem Logo, Link zur Spielseite */
.tagline { margin: 0; font-size: 1.15rem; font-weight: 700; text-wrap: balance; }
.play-link { font-weight: 700; color: var(--brand-strong); margin-top: 4px; }

/* Optionen in der Fußzeile des Beamers: Fenster öffnet sich nach oben */
.opt-wrap { position: relative; display: inline-flex; }
.opt-btn .chev { margin-left: .35em; font-size: .8em; opacity: .8; }
.opt-btn.open { background: rgba(255, 255, 255, .18); }
.opt-pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); width: min(380px, 92vw);
  background: #fff; color: #1e2226; border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  padding: 16px 18px; display: grid; gap: 8px; text-align: left; font-size: 1rem; z-index: 60;
}
.opt-pop::after { content: ''; position: absolute; bottom: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
.opt-pop h4 { margin: 4px 0 0; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #5b646a; display: flex; justify-content: space-between; gap: 8px; }
.opt-pop h4 small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.opt-row { display: flex; align-items: center; gap: 12px; font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 4px 0; text-align: left; width: 100%; cursor: pointer; }
.opt-row:disabled { cursor: default; }
.opt-row .hint { font-weight: 400; color: #5b646a; font-size: .85rem; }
.opt-row select { margin-left: auto; font: inherit; font-weight: 700; padding: 6px 10px; border-radius: 8px; border: 1px solid #cfd4cd; background: #fff; color: #1e2226; }
.sw2 { width: 44px; height: 26px; border-radius: 99px; background: #c6ccc8; position: relative; flex-shrink: 0; transition: background .15s; }
.sw2::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.opt-switch.on .sw2 { background: #4dba38; } .opt-switch.on .sw2::after { left: 21px; }
.opt-switch:focus-visible { outline: 3px solid #2b7a1f; outline-offset: 2px; border-radius: 8px; }
.opt-sec { display: grid; gap: 8px; }
.opt-sec.locked { opacity: .45; }
.opt-pop hr { border: 0; border-top: 1px solid #e3e6e2; margin: 2px 0; }

/* Editor: Kasten „Mischen“ und Schloss pro Frage */
.mix-box { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 10px 12px; border: 1px solid #e3e6e2; border-radius: 10px; background: #fafbf9; }
.mix-box h3 { margin: 0; font-size: .95rem; width: 100%; }
.mix-box select { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid #cfcfd6; background: #fff; margin-left: 6px; }
.mix-lock.is-locked { background: #fff4d6; border-color: #e0b000; }
.mix-lock-note { font-size: .8rem; color: #8a6d00; font-weight: 700; }
.opt-pop label.opt-row { flex-direction: row; justify-content: flex-start; text-align: left; margin: 0; } /* allgemeine label-Regel ordnet sonst untereinander an */
