/* Pub-Quiz-Generator – Werkzeug-Oberfläche (Startseite, Bibliothek, Editor, Moderation).
   Der Beamer (stage.css) und die Handy-Seite (play.css) haben eigene Farben – die Show ist von diesem Werkzeug getrennt.

   Gestaltungssystem: drei Erscheinungsbilder (data-look) × hell/dunkel (data-theme) auf <html>.
   appearance.js setzt beide Attribute (data-theme ist immer aufgelöst: „System“ wird dort zu light/dark).
   Alles unten greift nur über die Tokens; Alt-Namen (--panel, --border, --text, --blue, --danger, --ok) bleiben als Alias. */

/* ---------- Schriften (liegen im Repo, damit alles offline läuft; alle unter SIL Open Font License) ---------- */
@font-face { font-family: "Bricolage Grotesque"; src: url(../fonts/bricolage-grotesque.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(../fonts/source-sans-3.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Sora"; src: url(../fonts/sora.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/ibm-plex-mono-500.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(../fonts/archivo.woff2) format("woff2"); font-weight: 400 800; font-stretch: 112%; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(../fonts/public-sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url(../fonts/roboto-mono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

/* ---------- Tokens: Form und Schrift je Erscheinungsbild ---------- */
:root {
  --radius: 10px; --radius-sm: 7px; --line-w: 1px; --title-case: none; --title-track: -0.01em;
  --fd: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;   /* Titel, Zahlen */
  --fb: "Source Sans 3", "Segoe UI", system-ui, Roboto, sans-serif;                /* Text, Formulare */
  --fm: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;                /* Codes, Zeiten, Tasten */
  --shadow: 0 8px 30px #0003;
  --overlay: #0009;
}
:root[data-look="studio"] {
  --radius: 8px; --radius-sm: 6px;
  --fd: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --fb: "IBM Plex Sans", "Segoe UI", system-ui, Roboto, sans-serif;
  --fm: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
:root[data-look="buehne"] {
  --radius: 4px; --radius-sm: 3px; --line-w: 1.5px; --title-case: uppercase; --title-track: 0.01em;
  --fd: "Archivo", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --fb: "Public Sans", "Segoe UI", system-ui, Roboto, sans-serif;
  --fm: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- Tokens: Farben – Werkstatt (Standard) ---------- */
:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface-2: #ecebe5; --surface-3: #fbfaf8;
  --fg: #1d2324; --muted: #5d6668; --line: #d6d4cc;
  --accent: #245d4e; --accent-ink: #ffffff; --accent-soft: #dcebe4;
  --link: #1f5fbf; --good: #2e7d4f; --good-soft: #dcebe4; --warn: #9a6a14; --warn-soft: #f6ead0;
  --bad: #b23a3a; --bad-soft: #f6dcdc; --live: #1f5fbf; --live-soft: #dde8f8;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16191a; --surface: #1f2425; --surface-2: #272d2e; --surface-3: #121516;
  --fg: #e8e6df; --muted: #a3aaa9; --line: #343b3c;
  --accent: #5fb597; --accent-ink: #0f1d18; --accent-soft: #203b33;
  --link: #7aa7f0; --good: #6cc392; --good-soft: #1f3a2c; --warn: #e0a84a; --warn-soft: #3a2f17;
  --bad: #e07070; --bad-soft: #3d1f1f; --live: #7aa7f0; --live-soft: #1f2a40;
  --shadow: 0 8px 30px #0008; --overlay: #000b;
  color-scheme: dark;
}
/* ---------- Studio ---------- */
:root[data-look="studio"] {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #e6eaf0; --surface-3: #fafbfd;
  --fg: #161b22; --muted: #58626f; --line: #cfd6df;
  --accent: #1d4ed8; --accent-ink: #ffffff; --accent-soft: #dbe4fb;
  --link: #1d4ed8; --good: #15803d; --good-soft: #d9f0e1; --warn: #9a5b00; --warn-soft: #f8ebd3;
  --bad: #b91c1c; --bad-soft: #f8dada; --live: #0f766e; --live-soft: #d5efeb;
}
:root[data-look="studio"][data-theme="dark"] {
  --bg: #121519; --surface: #1a1f26; --surface-2: #232a33; --surface-3: #0e1114;
  --fg: #e6e9ee; --muted: #9aa5b4; --line: #2f3844;
  --accent: #7aa2ff; --accent-ink: #0b1430; --accent-soft: #1d2a4d;
  --link: #7aa2ff; --good: #5fcf8a; --good-soft: #163325; --warn: #e3a94b; --warn-soft: #3a2d14;
  --bad: #f07575; --bad-soft: #3f1d1d; --live: #5cc9bd; --live-soft: #15302d;
}
/* ---------- Bühne ---------- */
:root[data-look="buehne"] {
  --bg: #f4f4f5; --surface: #ffffff; --surface-2: #e8e8ea; --surface-3: #fafafa;
  --fg: #18181b; --muted: #5b5b63; --line: #d4d4d8;
  --accent: #be185d; --accent-ink: #ffffff; --accent-soft: #fbe2ee;
  --link: #1d4ed8; --good: #1f7a3f; --good-soft: #d9f0e1; --warn: #8f5a00; --warn-soft: #f7ead0;
  --bad: #b91c1c; --bad-soft: #f8dada; --live: #1d4ed8; --live-soft: #dde6fb;
}
:root[data-look="buehne"][data-theme="dark"] {
  --bg: #141416; --surface: #1c1c20; --surface-2: #26262c; --surface-3: #0f0f11;
  --fg: #ececef; --muted: #a1a1aa; --line: #34343b;
  --accent: #f472b6; --accent-ink: #2a0a1a; --accent-soft: #3b1a2c;
  --link: #8ab0ff; --good: #5fcf8a; --good-soft: #163325; --warn: #e3a94b; --warn-soft: #3a2d14;
  --bad: #f07575; --bad-soft: #3f1d1d; --live: #8ab0ff; --live-soft: #1e2a45;
}
/* Alt-Namen, damit bestehende Regeln (auch print.css) weiter greifen */
:root {
  --panel: var(--surface); --panel-2: var(--surface-2); --border: var(--line); --text: var(--fg);
  --blue: var(--link); --danger: var(--bad); --ok: var(--good);
  --line-strong: color-mix(in srgb, var(--fg) 30%, var(--line));
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--fb);
}
a { color: var(--link); }
:is(h1, h2, h3):not(.stage *) { line-height: 1.2; font-family: var(--fd); letter-spacing: var(--title-track); } /* nicht im Beamer-Vorschaubild */
:is(h1, h2):not(.stage *) { text-transform: var(--title-case); }
kbd { font-family: var(--fm); background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font-size: .85em; }
code { font-family: var(--fm); font-size: .92em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--warn); }
.error { color: var(--bad); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Status-Chip: Zustand auf einen Blick (gespeichert, Beamer verbunden, ohne Medium, bewertet) */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.sm { padding: 1px 6px; font-size: 11.5px; }
.chip.ok { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.live { background: var(--live-soft); color: var(--live); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.mono { font-family: var(--fm); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Icons (icons.js): Linienicons, laufen in der Textfarbe mit */
.ico { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

/* Erscheinungsbild-Umschalter (appearance.js) */
.appearance { position: relative; }
.appearance-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.appearance-pop .field-label { margin: 0; }
.appearance-pop .seg { align-self: flex-start; flex-wrap: nowrap; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--fg); border: var(--line-w) solid var(--line);
  border-radius: var(--radius-sm); padding: 7px 13px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn.big { padding: 10px 22px; font-size: 17px; }
.btn:disabled, .icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 5px; font: inherit; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }

input[type=text], input[type=number], input[type=datetime-local], input[type=date], textarea, select {
  width: 100%; background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; font: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; flex: 1; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { min-width: 160px; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { flex: 1; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); border: none; padding: 6px 12px; cursor: pointer; font: inherit; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
details.box > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.box[open] > summary { margin-bottom: 12px; }

/* Toasts & Modal */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--ok); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); transition: opacity .4s, transform .4s; }
.toast.error { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(10px); }
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 999; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; max-width: 420px; width: calc(100% - 32px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Startseite ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 32px 20px 60px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.home-head h1 { margin: 0; font-size: 34px; }
.home-head p { margin: 6px 0 0; color: var(--muted); }
.home-actions { display: flex; gap: 10px; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.quiz-card { background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.qc-main { padding: 18px 18px 10px; color: inherit; text-decoration: none; flex: 1; }
.qc-main h3 { margin: 0 0 4px; font-size: 20px; }
.qc-main p { margin: 0 0 10px; }
.qc-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.qc-stats span { background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 13px; }
.qc-actions { display: flex; gap: 6px; padding: 12px 18px 16px; flex-wrap: wrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: var(--radius); }
.help { margin-top: 40px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 22px 18px; }
.help h2 { font-size: 18px; margin-top: 20px; }
.type-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 20px; }
.type-list > div { display: grid; grid-template-columns: 30px auto; column-gap: 6px; }
.type-list .ti { grid-row: span 2; font-size: 20px; }
.type-list span:last-child { color: var(--muted); font-size: 13px; }
.help li { margin: 6px 0; }
.error-page { max-width: 600px; margin: 80px auto; text-align: center; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.top-title { flex: 1; display: flex; align-items: baseline; gap: 14px; min-width: 200px; }
.top-title strong { font-size: 18px; }
.save-status { font-size: 13px; color: var(--muted); }
.save-status.ok { color: var(--ok); }
.save-status.err { color: var(--danger); }
.menu { position: relative; }
.menu-items { display: none; position: absolute; right: 0; top: 100%; padding-top: 4px; z-index: 50; min-width: 240px; }
.menu:hover .menu-items, .menu:focus-within .menu-items { display: block; }
.menu-items a { display: block; padding: 9px 14px; background: var(--panel-2); border: 1px solid var(--border); border-top: none; color: var(--text); text-decoration: none; }
.menu-items a:first-child { border-top: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.menu-items a:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.menu-items a:hover { background: var(--surface-2); }

.ed-body { flex: 1; display: flex; min-height: 0; }
.ed-side { width: 330px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--border); padding: 12px; background: var(--bg); }
.ed-main { flex: 1; overflow-y: auto; padding: 20px 26px 60px; }

.side-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 1px solid transparent; color: var(--text); padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.side-item:hover { background: var(--panel-2); }
.side-item.active { background: var(--accent-soft); border-color: var(--accent); }
.side-item.quiz { font-weight: 600; margin-bottom: 10px; }
.side-item.q { font-size: 13.5px; }
.side-item.dragging { opacity: .4; }
.side-item.drop { border-top: 2px solid var(--accent); }
.side-item.warn .q-no { background: var(--warn); color: var(--bg); }
.q-no { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.q-icon { flex-shrink: 0; }
.q-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-text em { color: var(--muted); }
.warn-dot { color: var(--warn); font-weight: 700; }
.side-round { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; background: var(--panel); }
.side-round-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; border: 1px solid transparent; }
.side-round-head:hover { background: var(--panel-2); }
.side-round-head.active { background: var(--accent-soft); border-color: var(--accent); }
.side-round-head.drop { border-color: var(--accent); }
.round-no { background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 0 7px; font-size: 13px; }
.round-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-actions { display: flex; }
.side-add { width: 100%; background: none; border: 1px dashed var(--border); color: var(--muted); padding: 6px; border-radius: var(--radius-sm); cursor: pointer; margin-top: 4px; font: inherit; }
.side-add:hover { color: var(--text); border-color: var(--blue); }
.side-add.round { padding: 10px; }

.ed-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 0.95fr); gap: 26px; align-items: start; max-width: 1600px; }
.ed-preview { position: sticky; top: 0; }
.ed-form h2 { margin: 0 0 16px; }
.ed-form h3 { font-size: 15px; color: var(--muted); margin: 22px 0 10px; }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.form-head h2 { margin: 0; }
.form-actions { display: flex; gap: 6px; }
.form-actions select { width: auto; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-bottom: 6px; }
.type-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; font: inherit; font-size: 12.5px; text-align: center; }
.type-tile .ti { font-size: 22px; }
.type-tile:hover { border-color: var(--blue); }
.type-tile.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.type-grid.small .type-tile { flex-direction: row; justify-content: flex-start; padding: 8px 10px; }
.type-grid.small .ti { font-size: 18px; }
.type-desc { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.stats span { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; font-size: 13px; }
.danger-zone { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); }

.list-editor { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.list-editor > .btn { align-self: flex-start; }
.list-row { display: flex; align-items: center; gap: 6px; }
.elem-media { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.elem-media img { height: 38px; max-width: 64px; object-fit: cover; border-radius: 6px; }
.elem-media audio { width: 150px; height: 32px; }
.mash-edit { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.mash-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mash-head .icon-btn { margin-left: auto; }
.list-row .row-letter { width: 26px; flex-shrink: 0; text-align: center; font-weight: 700; color: var(--accent); }
.correct-pick { display: flex; align-items: center; gap: 2px; color: var(--ok); cursor: pointer; font-weight: 700; }
.correct-pick input { accent-color: var(--ok); }

.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 10px; cursor: pointer; position: relative; margin-bottom: 12px; text-align: center; }
.dropzone.has { cursor: default; border-style: solid; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy::after { content: attr(data-msg); position: absolute; inset: 0; background: var(--overlay); display: grid; place-items: center; border-radius: var(--radius); }
.dz-empty { display: flex; flex-direction: column; gap: 3px; padding: 22px 0; color: var(--muted); }
.dz-empty strong { color: var(--text); }
.dz-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dz-name { flex: 1; text-align: left; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-focus { position: relative; display: inline-block; max-width: 100%; }
.img-focus img { display: block; max-width: 100%; max-height: 300px; border-radius: 6px; }
.img-focus.pick img { cursor: crosshair; }
.focus-marker { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 2px #000a; pointer-events: none; }
.media-preview { width: 100%; max-height: 260px; border-radius: 6px; background: #000; }
audio.media-preview { background: none; }
.media-settings { margin-top: 4px; }

.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.preview-ctrl { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.preview-ctrl .seg button .ico { width: 14px; height: 14px; vertical-align: -2px; }
/* Handy-Vorschau: play.html in einem Telefonrahmen, 390 px breit gerendert und verkleinert */
.phone-frame { width: 300px; height: 600px; margin: 0 auto; border: 10px solid var(--surface-3); border-radius: 30px; background: #0c0e1c; overflow: hidden; box-shadow: var(--shadow); }
.phone-frame iframe { width: 390px; height: 780px; border: 0; display: block; transform: scale(calc(280 / 390)); transform-origin: 0 0; }

/* Auswahl-Dialog */
.modal h3 { margin: 0 0 14px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-btn { flex-direction: column; align-items: flex-start; gap: 2px; white-space: normal; text-align: left; padding: 10px 14px; }
.choice-btn span { color: var(--muted); font-size: 13px; }

/* „Wer bin ich?“-Abgaben in der Moderation */
.clue-subs { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.clue-subs h4 { margin: 0 0 6px; font-size: 14px; }
.clue-subs table { width: 100%; border-collapse: collapse; font-size: 14px; }
.clue-subs td { padding: 3px 4px; }
.clue-subs select { width: auto; padding: 4px 6px; }
.clue-subs .ok.active { background: var(--good-soft); border-color: var(--ok); }
.clue-subs .no.active { background: var(--bad-soft); border-color: var(--danger); }
.clue-subs .pts { font-weight: 700; color: var(--accent); text-align: right; }
.clue-pts-input { width: 70px !important; flex: none; }
.step-points { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 2px; }
.step-points label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* Runden-Bibliothek */
.home-head .btn.ghost { padding-left: 0; margin-bottom: 6px; }
.lib-filter { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.lib-filter input[type=text] { max-width: 520px; }
.tag-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.tag { background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; border-radius: 20px; padding: 1px 10px; font-size: 12.5px; font: inherit; font-size: 12.5px; }
button.tag { cursor: pointer; }
button.tag.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lib-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 16px; }
.modal.wide { max-width: 640px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 9px 12px; cursor: pointer; font: inherit; }
.pick-item:hover { border-color: var(--blue); }

/* ---------- Online: Anmeldung, Konten, Freigaben ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 26px 18px; display: flex; flex-direction: column; gap: 4px; }
.login-box h1 { margin: 0; font-size: 24px; }
.login-box > p { margin: 4px 0 12px; }
.login-box .error:empty { display: none; }
.login-box .btn.big { justify-content: center; margin: 8px 0 6px; }
.home-actions { flex-wrap: wrap; justify-content: flex-end; }
.user-bar { order: -1; flex-basis: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 4px; flex-wrap: wrap; }
.user-name { color: var(--muted); margin-right: 6px; }
.owner-badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.badge { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 10px; font-size: 12.5px; color: var(--muted); }
.badge.share-read, .badge.share-edit { color: var(--ok); border-color: var(--good); }
.grid-heading { grid-column: 1 / -1; margin: 22px 0 0; font-size: 20px; }
fieldset.read-only { border: 0; margin: 0; padding: 0; min-width: 0; opacity: .75; }
.lib-info.ro-banner { border-left-color: var(--warn); }
.modal form, form.modal { display: flex; flex-direction: column; gap: 4px; }
form.modal .error:empty { display: none; }
pre.secret { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.user-new { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.user-new .field { margin: 0; min-width: 220px; }
.users-table td.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Rundenformen & neue Fragetypen (Editor, Moderation) ---------- */
.jeo-grid { display: grid; gap: 6px; margin-top: 8px; }
.jeo-cat { font-weight: 700; font-size: 13px; text-align: center; padding: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; }
.jeo-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 6px 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; overflow: hidden; }
.jeo-cell strong { color: var(--accent); font-size: 15px; }
.jeo-cell span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jeo-cell.empty { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
.jeo-cell:hover { border-color: var(--blue); }
.combo-edit { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.combo-edit input[type=text] { max-width: 220px; }
.combo-edit details { flex: 1; margin: 0; }
.mod-board { display: grid; gap: 6px; margin: 8px 0; }
.mod-board-cat { font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); }
.mod-board-cell { justify-content: center; font-weight: 800; color: var(--accent); }
.mod-board-cell.played { opacity: .35; text-decoration: line-through; }
.mark-teams { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* Handy-Spiel (Tab „📱 Handys“) */
.phone-panel { display: flex; flex-direction: column; gap: 12px; }
.phone-intro p { margin: 0 0 10px; }
.phone-game { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qr-box.small { display: flex; gap: 12px; align-items: center; }
.qr-box.small .qr-svg { width: 110px; height: 110px; }
.qr-box.small .qr-svg svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.qr-box.small .qr-title { font-weight: 700; }
.qr-box.small .qr-url { font-size: 12px; color: var(--muted); word-break: break-all; }
.qr-box.small .qr-code strong { font-size: 20px; letter-spacing: .1em; color: var(--accent); }
.phone-actions { display: flex; flex-direction: column; gap: 6px; }
.btn.active { border-color: var(--accent); }
.phone-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.phone-team { background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.phone-team i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.phone-team.online i { background: var(--ok); }
.phone-team.idle i { background: var(--warn); }
.phone-team small { color: var(--muted); }
.away { display: inline-flex; align-items: center; gap: 1px; color: var(--warn); font-size: 12px; font-weight: 700; margin-left: 4px; vertical-align: middle; cursor: help; }
.away .ico { width: 14px; height: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.net-help { max-width: 720px; }
.net-help .net-topic { margin-top: 10px; }
.net-help h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.net-help ol { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.phone-test { width: 100%; }
.phone-test .test-steps { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.phone-test .test-steps li .ico { color: var(--muted); }
.phone-test .test-steps li.ok .ico { color: var(--ok); }
.phone-test .test-teams { margin: 4px 0 0 20px; padding: 0; }
.phone-test .test-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.phone-rounds { display: flex; flex-wrap: wrap; gap: 4px; }
.pending-dot { background: var(--warn); color: var(--bg); border-radius: var(--radius); font-size: 11px; font-weight: 700; padding: 0 6px; margin-left: 6px; }
.phone-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.phone-q.running { border-style: dashed; }
.phone-q-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.phone-q-prompt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-answers { width: 100%; border-collapse: collapse; font-size: 14px; }
.phone-answers td { padding: 4px; border-top: 1px solid var(--border); vertical-align: top; }
.phone-answers td.team { font-weight: 600; width: 28%; }
.phone-answers td.grade { white-space: nowrap; text-align: right; }
.phone-answers td.grade .btn { margin-left: 2px; }
.phone-answers input.pts { width: 52px; padding: 4px; margin-left: 4px; text-align: right; }
.phone-answers tr.pending td.team { color: var(--warn); }
.phone-answers .sug { font-size: 12px; }
.phone-answers .sug.yes { color: var(--ok); }
.phone-answers .sug.no { color: var(--danger); }
.phone-answers .ok.active { background: var(--good-soft); border-color: var(--ok); }
.phone-answers .half.active { background: var(--warn-soft); border-color: var(--warn); }
.phone-answers .no.active { background: var(--bad-soft); border-color: var(--danger); }
.estimate-box { font-size: 13px; }
.estimate-paper { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.estimate-paper input.pts { width: 80px; padding: 3px 6px; }
.estimate-rank { margin: 6px 0; padding-left: 22px; }
.estimate-rank .winner { color: var(--accent); font-weight: 700; }
.phone-count { margin-top: 6px; }
.phone-answer { color: var(--blue); font-size: 12px; font-weight: 400; }
.team-cell { white-space: nowrap; }
.duel-teams { display: flex; gap: 14px; font-weight: 600; }
.duel-presses { margin: 6px 0; padding-left: 22px; }
.duel-presses .turn { color: var(--accent); font-weight: 700; }
.duel-presses .out { color: var(--muted); text-decoration: line-through; }
.duel-presses .won { color: var(--ok); font-weight: 700; }
.duel-result { font-weight: 700; color: var(--accent); }
.duel .mark-teams { margin-top: 8px; }
.duel .mark-teams .btn.ok { border-color: var(--ok); }
.duel .mark-teams .btn.no { border-color: var(--danger); }

/* Beamer auf einem zweiten Gerät: Status in der Moderation, Quiz-Auswahl nach dem QR-Scan */
.screen-link.on { border-color: var(--ok); color: var(--ok); }
.screen-link.off { border-color: var(--warn); color: var(--warn); }
.code-in { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; font-size: 22px; }
.pair-page { max-width: 560px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 14px; }
.pair-page h1 { margin: 0; }
.pair-list { display: flex; flex-direction: column; gap: 8px; }
.pair-quiz { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; white-space: normal; }

/* Welche Seite? / Lüge / Wer würde gewinnen? / Tauziehen */
.emoji-in { width: 56px !important; flex: none; text-align: center; font-size: 20px; }
.lie-edit { margin-bottom: 8px; }
.lie-note-in { margin: 4px 0 0 32px; width: calc(100% - 32px); font-size: 13px; }
.camp-edit { align-items: flex-end; }
.camp-edit input[type=color] { width: 56px; height: 36px; padding: 2px; }
.vote-box .vote-btns { white-space: nowrap; }
.vote-box .vote-btns .btn { min-width: 34px; padding: 3px 6px; }
.vote-box .vote-btns .btn.active { background: var(--good-soft); border-color: var(--ok); }
.camp-standing { font-size: 14px; margin: 0 0 8px; }

.bonus-box .vote-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

.mod-lines { margin: 6px 0 8px; padding-left: 22px; }
.mod-lines li { color: var(--muted); margin: 2px 0; }
.mod-lines li.done { color: inherit; }
.mod-lines li.current { font-weight: 700; color: var(--accent); }

/* Frühere Abende (Archiv) */
.modal.wide { max-width: 900px; }
.archive-scroll { overflow-x: auto; max-height: 60vh; }
.archive-table, .archive-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.archive-table th, .archive-table td, .archive-list td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.archive-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.archive-table .strong { font-weight: 700; }
.archive-list .actions { text-align: right; }

/* Gegenlesen: Freigabe an Personen, Anmerkungen */
.share-row .share-name { min-width: 120px; font-weight: 600; }
.notes-box { margin-top: 14px; }
.notes-box textarea { width: 100%; margin: 8px 0 6px; }
.note { border-left: 3px solid var(--accent); background: var(--surface-2); padding: 6px 10px; margin: 6px 0; border-radius: 6px; }
.note.done { border-left-color: var(--good); opacity: .6; }
.note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-head .check { margin-left: auto; }
.note-text { white-space: pre-wrap; margin-top: 2px; }
.note-dot { font-size: 11px; background: var(--accent); color: var(--bg); border-radius: var(--radius); padding: 0 6px; margin-left: 4px; font-weight: 700; }

/* QR-Code auf dem Beamer: Aus · Klein · Groß */
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.seg .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.seg .btn + .btn { margin-left: -1px; }

/* Lösung im Moderationspanel verbergen (Taste L): verschwommen, antippen/Maus darüber zeigt sie kurz */
.hide-solution :is(.mod-a, .mod-info, .sol, .preview.next.spoils .stage-wrap) { filter: blur(9px); transition: filter .15s; cursor: help; user-select: none; }
.hide-solution :is(.mod-a, .mod-info, .sol, .preview.next.spoils .stage-wrap):is(:hover, :active) { filter: none; }
.host-top .btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.heading-in { resize: vertical; min-height: 0; font: inherit; }

/* Nur-Icon-Knopf (Kopfleisten): quadratisch, Beschriftung über title/aria-label */
.btn.icon-only { padding: 7px 9px; }
.btn .ico { width: 1.15em; height: 1.15em; }
.seg button.active, .seg .btn.active { background: var(--accent); color: var(--accent-ink); }

/* ⋯-Menü (ui.js menuButton) */
.menu-wrap { position: relative; display: inline-flex; }
.pop-menu { position: absolute; top: calc(100% + 6px); z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.pop-menu.right { right: 0; } .pop-menu.left { left: 0; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radius-sm); padding: 8px 10px; color: var(--fg); font: inherit; cursor: pointer; text-decoration: none; }
.pop-item:hover, .pop-item:focus-visible { background: var(--surface-2); }
.pop-item.danger { color: var(--bad); }
.pop-item small { margin-left: auto; }
.pop-item .ico { color: var(--muted); }

/* Startseite: Nächster Abend, kompakte Karten, frühere Abende */
.home-head h1 { font-size: 30px; }
.hero { grid-column: 1 / -1; background: var(--surface); border: var(--line-w) solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; justify-content: space-between; }
.hero-main { flex: 1 1 360px; min-width: 0; }
.hero .kicker { font-family: var(--fm); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .kicker .when { color: var(--muted); letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.hero h2 { margin: 0 0 4px; font-size: 26px; }
.hero h2 a { color: inherit; text-decoration: none; }
.hero p.sub { margin: 0 0 10px; color: var(--muted); }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quiz-card.compact { padding: 0; }
.quiz-card.compact .qc-main { padding: 14px 16px 8px; }
.quiz-card.compact h3 { font-size: 17px; }
.quiz-card.compact .qc-actions { padding: 8px 12px 12px; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 4px; }
.qc-when { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.section-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin: 18px 0 -4px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head .muted { font-size: 13.5px; }
.nights { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
.night { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.night:first-child { border-top: 0; }
.night .d { font-family: var(--fm); font-size: 13px; color: var(--muted); min-width: 9ch; }
.night .t { font-weight: 600; }
.night .t a { color: inherit; text-decoration: none; }
.night .w { color: var(--muted); }
.night .w b { color: var(--fg); font-weight: 600; }
details.help { margin-top: 30px; padding: 4px 22px 6px; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.help summary::-webkit-details-marker { display: none; }
details.help[open] summary { color: var(--fg); }
.btn .ico + span, .btn .ico + * { margin-left: 0; }
@media (max-width: 640px) {
  .hero { padding: 16px; }
  .hero h2 { font-size: 22px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.quiz-card.hero, .quiz-card.compact { overflow: visible; } /* ⋯-Menü darf über den Kartenrand */

/* ---------- Editor (10c): Typ-Kopfzeile, Typ-Dialog, Seitenleiste mit Chips, Abschnitte, Mobil ---------- */
.ed-grid { grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr); }
.ed-preview { top: 8px; }
.form-head h2 { font-size: 24px; }
.type-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.type-line .chip { font-size: 13.5px; padding: 4px 10px; }
.type-line .chip .ico { color: var(--accent); }
.type-line .desc { color: var(--muted); font-size: 13.5px; flex: 1 1 240px; min-width: 0; }
.type-dialog { max-width: 820px; }
.type-dialog h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-family: var(--fm); font-weight: 500; }
.type-dialog .type-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.type-dialog .type-tile { flex-direction: row; align-items: flex-start; text-align: left; gap: 8px; padding: 9px 10px; }
.type-dialog .type-tile .ico { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.type-dialog .type-tile b { display: block; font-size: 13.5px; }
.type-dialog .type-tile small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.type-dialog .modal-actions { margin-top: 14px; }
.form-section { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 10px; }
.form-section > h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-family: var(--fm); font-weight: 500; }
/* Seitenleiste */
.side-item.quiz .ico { color: var(--muted); }
.side-round-head .meta { margin-left: auto; font-family: var(--fm); font-size: 11px; color: var(--muted); white-space: nowrap; }
.side-item.q { padding: 5px 7px; gap: 7px; }
.side-item.q .q-icon .ico { width: 15px; height: 15px; color: var(--muted); vertical-align: -3px; }
.side-item.q.active .q-icon .ico { color: var(--accent); }
.q-meta { display: flex; gap: 3px; flex: none; }
.q-meta .chip { padding: 0 5px; font-size: 10.5px; font-weight: 600; }
.q-meta .chip .ico { width: 11px; height: 11px; }
.side-item.warn .q-no { background: var(--warn); color: var(--bg); }
.mix { display: flex; align-items: center; gap: 5px; padding: 6px 8px 2px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.mix .sq { width: 9px; height: 9px; border-radius: 2px; background: var(--line); display: inline-block; }
.mix .sq.media { background: var(--accent); }
.mix .sq.game { background: var(--live); }
.mix .chip { margin-left: auto; }
.side-add .ico { width: 14px; height: 14px; vertical-align: -2px; }
.side-toggle { display: none; }
@media (max-width: 900px) {
  .side-toggle { display: inline-flex; }
  .ed-body { position: relative; }
  .ed-side { position: absolute; inset: 0 auto 0 0; width: min(86vw, 340px); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .editor.side-open .ed-side { transform: none; }
  .ed-main { padding: 14px 16px 60px; }
  .topbar .top-title strong { font-size: 16px; }
}
.step-ctrl .step-label:disabled { opacity: 1; color: var(--muted); font-family: var(--fm); font-size: 12.5px; cursor: default; }
.step-ctrl button .ico { width: 14px; height: 14px; vertical-align: -2px; }
.add-question { align-self: flex-start; }

/* ---------- Moderation: das Regiepult ----------
   Regie: Folie groß, daneben Vorschau + Lösung/Notiz, darunter Ablauf/Teams/Handys. Wertung: Tabellen groß, Folie klein.
   Transportleiste unter der Folie, auf Tablet/Handy fest am unteren Rand. */
.host { display: flex; flex-direction: column; height: 100vh; }
.host-top { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.host-top h1 { font-size: 17px; margin: 0; min-width: 0; max-width: 30ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-top .grow { flex: 1; }
.counter { color: var(--muted); font-size: 13px; font-family: var(--fm); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 24ch; }
.host-top .seg button { padding: 6px 11px; font-size: 13px; }
.host-top .btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.host-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); grid-template-rows: auto auto minmax(140px, 1fr); gap: 12px; padding: 12px 14px; }
.host-stage { grid-column: 1; grid-row: 1; display: flex; justify-content: center; min-width: 0; }
.host-stage .preview.current { width: min(100%, calc(50vh * 16 / 9)); }
.host-main > .controls { grid-column: 1; grid-row: 2; }
.host-side { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.next-wrap { display: flex; flex-direction: column; gap: 4px; }
.preview.next { width: min(100%, 320px); opacity: .85; }
.next-toggle { align-self: flex-start; background: none; border: 0; padding: 2px 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.next-toggle:hover { color: var(--fg); }
.host-side .mod-card { flex: 1 1 auto; min-height: 120px; overflow-y: auto; }
.host-panel { grid-column: 1 / -1; grid-row: 3; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.host-panel .tabs { padding: 0 10px; }
.host-panel .tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 12px; }
.host.wertung .host-main { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); grid-template-rows: auto auto minmax(0, 1fr); }
.host.wertung .host-stage .preview.current { width: 100%; }
.host.wertung .host-side { grid-column: 1; grid-row: 3; }
.host.wertung .next-wrap { display: none; }
.host.wertung .host-panel { grid-column: 2; grid-row: 1 / -1; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.controls .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.controls .btn .ico { width: 15px; height: 15px; }
.mod-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.mod-label { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.mod-q { font-size: 16px; margin-bottom: 8px; }
.mod-a { font-size: 22px; font-weight: 700; color: var(--good); margin-bottom: 6px; font-family: var(--fd); }
.mod-a span { color: var(--muted); font-size: 14px; font-weight: 600; font-family: var(--fb); }
.mod-notes, .mod-info { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); }
.mod-notes { border-left: 3px solid var(--warn); }
.mod-info { border-left: 3px solid var(--link); }
.mod-reveal { margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--muted); }
.mod-reveal.running { color: var(--fg); border-left: 3px solid var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { display: inline-flex; align-items: center; gap: 2px; background: none; border: none; color: var(--muted); padding: 9px 12px; cursor: pointer; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button .ico { width: 15px; height: 15px; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab-body { flex: 1; min-height: 200px; overflow-y: auto; }
.slide-list { display: flex; flex-direction: column; gap: 2px; }
.slide-item { display: flex; gap: 8px; text-align: left; background: none; border: none; border-radius: 6px; color: var(--fg); padding: 5px 8px; cursor: pointer; font: inherit; font-size: 13.5px; }
.slide-item:hover { background: var(--surface-2); }
.slide-item.active { background: var(--accent-soft); outline: 1px solid var(--accent); }
.slide-item .idx { color: var(--muted); width: 28px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; font-family: var(--fm); font-size: 12px; }
.slide-item.kind-round { font-weight: 700; color: var(--accent); margin-top: 6px; }
.slide-item.kind-answer { color: var(--good); }
.slide-item.kind-scores, .slide-item.kind-collect { color: var(--muted); font-style: italic; }
.add-team { display: flex; gap: 8px; margin: 10px 0; }
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.score-table .twist-mark { color: var(--accent); font-weight: 700; text-transform: none; letter-spacing: 0; }
.score-table th { color: var(--muted); font-weight: 600; text-align: left; padding: 4px; font-family: var(--fm); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.score-table td { padding: 3px 4px; }
.table-scroll { overflow-x: auto; }
.score-table input.pts { width: 48px; padding: 5px 4px; text-align: right; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.score-table input.pts::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-table input.team-name { width: 130px; padding: 5px 8px; }
.score-table select { width: auto; padding: 5px; }
.score-table .total { font-weight: 700; color: var(--accent); font-size: 16px; text-align: right; font-family: var(--fd); font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .ed-grid { grid-template-columns: 1fr; }
  .ed-side { width: 260px; }
  .ed-preview { position: static; }
  /* Moderation auf Tablet/Handy: eine Spalte, die Seite scrollt, Transportleiste fest unten (Daumenbereich) */
  .host { height: auto; min-height: 100vh; padding-bottom: 130px; }
  .host-main, .host.wertung .host-main { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  /* Miniatur der Live-Folie bleibt oben kleben – darunter haben Lösung, Notiz und Ablauf Platz */
  .host-stage { position: sticky; top: 0; z-index: 30; justify-content: flex-start; margin: -10px -10px 0; padding: 8px 10px;
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
  .host-stage .preview.current, .host.wertung .host-stage .preview.current { width: min(52%, 320px); box-shadow: none; }
  .host-side .mod-card { overflow: visible; }
  .host.wertung .next-wrap { display: flex; }
  .host-panel { min-height: 0; }
  .host-panel .tab-body { max-height: 65vh; }
  .host .controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .host .controls .btn.big { flex: 1; min-height: 48px; }
  .host-top { flex-wrap: wrap; }
  .host-top h1 { max-width: none; }
}
@media (max-width: 640px) {
  .host-top { gap: 6px; padding: 6px 10px; }
  .host-top h1 { flex-basis: 100%; order: -1; font-size: 15px; }
  .host-top .btn { font-size: 13px; padding: 6px 9px; }
  .host-top .clock, .host-top .host-mode { display: none; }
  .counter { min-width: 0; }
  .host-main { padding: 8px; gap: 8px; }
  .host-stage { margin: -8px -8px 0; padding: 6px 8px; }
  .host-stage .preview.current, .host.wertung .host-stage .preview.current { width: min(46%, 220px); }
  .host .controls { gap: 6px; }
  .host .controls .sep { display: none; }
  .host .controls .btn { padding: 8px 10px; }
  .host .controls .btn:first-child { min-height: 48px; }
  .host { padding-bottom: 170px; }
}
@media (max-width: 1200px) { .ed-grid { grid-template-columns: 1fr; } .ed-preview { position: static; } } /* Vorschau unter dem Formular, bevor sie abgeschnitten würde */
.lan-box { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin: 6px 0 10px; font-size: 14px; }
.lan-box p { margin: 0 0 4px; }
.lan-box.compact { margin: 8px 0 0; }
.lan-box select { width: auto; display: inline-block; padding: 2px 6px; font-size: 13px; }
.accent-pick input[type=color] { width: 56px; height: 36px; padding: 2px; flex: none; }
.brand-editor > details { margin-bottom: 14px; }
.slide-item .plan { margin-left: auto; font-family: var(--fm); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.host-top .clock.ok { background: var(--good-soft); color: var(--good); }
.host-top .clock.warn { background: var(--warn-soft); color: var(--warn); }
.host-top .clock.bad { background: var(--bad-soft); color: var(--bad); }
/* Moderationsskript: groß lesbar; Teleprompter blendet Folie und Tabellen aus */
.mod-script { font-size: 19px; line-height: 1.55; white-space: pre-line; padding: 12px 16px; margin: 0 0 12px; border-left: 3px solid var(--accent); background: var(--surface-3); border-radius: var(--radius-sm); }
.host.prompter .host-stage, .host.prompter .host-panel, .host.prompter .next-wrap { display: none; }
.host.prompter .host-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
.host.prompter .host-side { grid-column: 1; grid-row: 1; }
.host.prompter .host-main > .controls { grid-column: 1; grid-row: 2; }
.host.prompter .mod-card { font-size: 22px; padding: 24px 32px; }
.host.prompter .mod-script { font-size: 34px; line-height: 1.5; padding: 20px 26px; }
.host.prompter .mod-q { font-size: 30px; }
.host.prompter .mod-a { font-size: 40px; }
.host.prompter .mod-notes, .host.prompter .mod-info { font-size: 24px; }
.host-top .btn.prompter-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.host-top h1 { flex: 0 1 auto; min-width: 8ch; }
.host-top .seg button { white-space: nowrap; }
@media (max-width: 1100px) { .host-top { flex-wrap: wrap; } .host-top .grow { display: none; } }
/* Fragen-Import: Dialog mit Vorschau */
.import-dialog { max-width: 860px; }
.import-dialog textarea { width: 100%; font-family: var(--fm); font-size: 13px; line-height: 1.45; }
.import-bar { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0; }
.import-help { flex: 1 1 100%; }
.import-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.import-help pre { font-family: var(--fm); font-size: 12px; line-height: 1.5; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; margin: 6px 0 0; }
.import-summary { font-size: 13.5px; margin: 6px 0; }
.import-preview { max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 0; }
.import-preview:empty { display: none; }
.import-round { font-family: var(--fd); font-weight: 700; padding: 8px 12px 4px; }
.import-row { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 13.5px; }
.import-row.warn { background: var(--warn-soft); }
.import-row .import-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-row .chip.warn { white-space: normal; max-width: 50%; }
/* Saison & Liga */
.season-title { display: flex; align-items: center; gap: 12px; }
.season-title .kicker { font-family: var(--fm); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.season-title input { font: inherit; font-family: var(--fd); font-weight: 700; font-size: 26px; width: min(100%, 520px); background: transparent; border: 1px solid transparent; padding: 2px 6px; }
.season-title input:hover, .season-title input:focus { border-color: var(--line); background: var(--surface); }
.season-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr); gap: 18px; align-items: start; }
.season-grid h3 { margin: 14px 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-family: var(--fm); font-weight: 500; }
.season-grid h3:first-child { margin-top: 0; }
.season-night { display: flex; gap: 6px; padding: 4px 0; align-items: baseline; }
.season-night .mono { font-family: var(--fm); font-size: 12.5px; color: var(--muted); }
.alias-row { padding: 3px 0; }
.alias-row .alias-name { font-weight: 600; min-width: 140px; }
.alias-row select { width: auto; padding: 3px 6px; }
.score-table.season td, .score-table.season th { padding: 6px 8px; }
.score-table.season tbody tr:nth-child(1) td { font-weight: 700; }
@media (max-width: 900px) { .season-grid { grid-template-columns: 1fr; } }
@media print { .season-page .home-head, .season-page .box:not(.season-right), .toasts { display: none !important; } .season-page .season-right { border: 0; } }
/* Fragen-Historie: wann gespielt, Trefferquote */
.history-chip { background: var(--surface-2); color: var(--muted); }
.history-chip .ico { width: 12px; height: 12px; }
.q-meta .chip.history-chip { padding: 0 5px; }
/* Onboarding: Willkommen, Tour, Demo-Quiz */
.empty.welcome { text-align: left; padding: 28px 32px; border-style: solid; background: var(--surface); }
.empty.welcome h2 { margin: 0 0 6px; }
.empty.welcome p { color: var(--muted); margin: 0 0 16px; max-width: 60ch; }
.welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.help-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.modal.tour { max-width: 560px; }
.tour-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.tour-icon .ico { width: 26px; height: 26px; }
.tour-step { font-family: var(--fm); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.modal.tour h3 { margin: 4px 0 8px; font-size: 22px; }
.modal.tour p { margin: 0 0 12px; line-height: 1.5; }
.tour-dots { display: flex; gap: 6px; margin-top: 6px; }
.tour-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); cursor: pointer; }
.tour-dot.on { background: var(--accent); }
.empty.welcome { grid-column: 1 / -1; }
/* Protokoll (⋯ → Protokoll) */
.modal.log { max-width: 960px; width: calc(100vw - 32px); }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.log-head h3 { margin: 0; }
.log-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.log-tools .field.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.log-body { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th { text-align: left; font-family: var(--fm); font-weight: 500; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.log-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.log-table .mono { font-family: var(--fm); font-size: 12px; white-space: nowrap; color: var(--muted); }
.chip.lvl-error { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.chip.lvl-warn { background: color-mix(in srgb, #d9a400 22%, transparent); }

/* Kennzahlen zum Ansagen (Wertung) */
.insight-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.insight-head { font-weight: 700; margin-bottom: 6px; }
.insight-box ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.insight-box .ins-ico { display: inline-block; width: 1.6em; }
