/* assets/css/app.css – qMem
   Design wie qCircle/qBingo: Nunito, dieselben Grundfarben, Kopfzeile in --ink.
   Keine Inline-Styles (CSP style-src 'self'): alles, was sich ändert, hängt
   an Klassen oder data-Attributen. */

@font-face {
  font-family: 'Nunito';
  src: local('Nunito'), url('/assets/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

/* Überschriften und Name oben links: Didact Gothic wie auf qteach (seit
   Oktober 2026). Nur ein Schnitt (Regular 400) – deshalb normale Stärke,
   sonst rechnet der Browser Fettes künstlich. Lizenz: assets/fonts/OFL.txt.
   Die Schriften der Textbilder liegen getrennt in /fonts/. */
@font-face {
  font-family: 'Didact Gothic';
  src: local('Didact Gothic'), local('DidactGothic-Regular'),
       url('/assets/fonts/didact-gothic.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14213d;
  --bg: #f4f6fb;
  --card: #fff;
  --line: #dde2ec;
  --muted: #667085;
  --accent: #f59e0b;
  --brand: #0f766e;
  --ok: #059669;
  --err: #dc2626;
  --radius: 14px;
  --font-display: 'Didact Gothic', 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

a { color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #eef1f6; padding: 1px 5px; border-radius: 5px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.topbar-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; align-items: center; font-size: 14px; }
.tb-role { background: rgba(255,255,255,.15); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tb-link { color: #fff; opacity: .8; }
.tb-link:hover { opacity: 1; }

/* ---------- Menü am Handy ----------
   Angemeldet hat die Kopfzeile viele Einträge; unter 600 px stapelten sie
   sich neben dem Logo bis zu sechs Zeilen hoch, je Link nur 22 px zum
   Tippen. Dann: Logo links, „Menü“ rechts, die Einträge klappen als Liste
   über die volle Breite auf (je 44 px). js-menu setzt erst menu.js – ohne
   Skript bleibt alles sichtbar wie vorher. Breit ändert sich nichts. */
.brand { flex: none; }
.topbar-right { min-width: 0; }
.tb-menu-knopf, .tb-name { display: none; }
.tb-wer { display: contents; }
@media (max-width: 599px) {
  /* 7 px oben und unten: mit dem 44-px-Knopf bleibt die Kopfzeile 58 px hoch */
  .topbar.js-menu { flex-wrap: wrap; row-gap: 0; padding-top: 7px; padding-bottom: 7px; }
  .topbar.js-menu .tb-menu-knopf {
    display: inline-flex; align-items: center; gap: 9px;
    min-height: 44px; padding: 0 14px; border-radius: 10px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35);
    color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  }
  .topbar.js-menu .tb-menu-knopf::before {
    content: ''; width: 18px; height: 12px;
    background:
      linear-gradient(currentColor 0 0) top / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) center / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat;
  }
  .topbar.js-menu.offen .tb-menu-knopf { background: rgba(255,255,255,.24); }
  .topbar.js-menu .tb-menu-knopf:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
  .topbar.js-menu .topbar-right { display: none; }
  .topbar.js-menu.offen .topbar-right {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
    flex-basis: calc(100% + 40px); margin: 7px -20px -7px; padding: 0 20px 6px;
    border-top: 1px solid rgba(255,255,255,.15); font-size: 16px;
  }
  .topbar.js-menu.offen .topbar-right > * {
    display: flex; align-items: center; min-height: 44px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .topbar.js-menu.offen .topbar-right > :last-child { border-bottom: 0; }
  .topbar.js-menu.offen .tb-link { text-decoration: none; opacity: .92; }
  /* Wer angemeldet ist, steht oben – Rolle und Name */
  .topbar.js-menu.offen .tb-wer { order: -2; gap: 10px; }
  .topbar.js-menu.offen .tb-name { display: inline; font-weight: 700; overflow-wrap: anywhere; }
}

/* ---------- Grundgerüst ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 16px 64px; }
/* Didact Gothic in normaler Stärke – die Größe trägt den Rang (vorher fett, 34/20px). */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; }
h1 { font-size: 36px; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 23px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.lead { font-size: 19px; color: #3a4660; max-width: 38em; }
.hint { color: var(--muted); font-size: 15px; margin-top: 0; }
.hint.block, .block { display: block; }
.note { border-left: 4px solid var(--accent); background: #fffbeb; padding: 10px 14px; border-radius: 0 10px 10px 0; max-width: 46em; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-top: 28px;
}
.flash { padding: 12px 16px; border-radius: 10px; margin-top: 20px; border: 1px solid var(--line); }
.flash.error { border-color: var(--err); background: #fef2f2; }
.flash.ok { border-color: var(--ok); background: #ecfdf5; }

/* ---------- Knöpfe ----------
   Höhe über Polsterung, NICHT über inline-flex: sonst werden die Textstücke
   eines Knopfes zu Flex-Elementen und die Zwischenräume verschwinden. */
.btn {
  display: inline-block; padding: 11px 18px; min-height: 44px; border-radius: 10px;
  text-decoration: none; font: inherit; font-weight: 700; border: 2px solid var(--ink);
  background: transparent; color: var(--ink); cursor: pointer;
  margin: 0 8px 8px 0;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { filter: brightness(1.25); }
.btn.small { font-size: 15px; padding: 9px 14px; border-width: 1px; border-color: var(--line); }

/* ---------- Startseite ---------- */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 18px; }
.pair figure, .shots figure { margin: 0; }
.pair img, .shots img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
}

/* ---------- Bildvorschau ---------- */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-layout .card { margin-top: 12px; }
.preview-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.preview-form textarea {
  width: 100%; font: 15px/1.5 ui-monospace, Consolas, monospace; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; resize: vertical; margin: 4px 0 12px;
}
.preview-form select { font: inherit; font-size: 15px; padding: 9px 10px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.preview-form .row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.syntax dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 12px; font-size: 15px; }
.syntax dt { font-weight: 700; white-space: nowrap; }
.syntax dd { margin: 0; color: #3a4660; }
.errors { color: var(--err); margin: 6px 0 0; }

table.fit { border-collapse: collapse; width: 100%; margin-top: 12px; font-size: 15px; }
table.fit th, table.fit td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); }
table.fit thead th { border-top: 0; color: var(--muted); font-size: 13px; }
table.fit td.yes { color: var(--ok); font-weight: 700; }
table.fit td.part { color: #b45309; font-weight: 700; }
table.fit td.no { color: var(--err); font-weight: 700; }
table.fit .hint { font-weight: 400; font-size: 13px; }

.shots-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.shots { display: grid; gap: 16px; }
.shots.quer { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.shots.hoch { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: start; }
.shots figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

@media (max-width: 900px) {
  .preview-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  table.fit { display: block; overflow-x: auto; }
}

/* ---------- Prüfseite ---------- */
.ok { color: #067647; }
.bad { color: #b42318; font-weight: 700; }
.probe { margin: 10px 0 20px; }
.probe img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.probe figcaption { font-size: 14px; color: var(--muted); }

/* ---------- Fuß, Impressum ---------- */
.foot { text-align: center; padding: 8px 16px 32px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }
.rechtstext { max-width: 760px; }
.rechtstext h2 { margin-top: 22px; }

/* ---------- Verwaltung: Listen und Formulare (Bauschritt 2) ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.page-head h1 { margin: 0; }
.crumbs { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.narrow { max-width: 520px; }

.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 18px 0 8px; }
.filter label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.field .hint { font-weight: 400; }
.filter select, .filter input, .field input[type="text"], .field input[type="number"], .field input[type="search"],
.field select, .field textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 44px;
}
.field textarea { width: 100%; resize: vertical; line-height: 1.5; }
.text-form textarea[name="body"] { font: 15px/1.5 ui-monospace, Consolas, monospace; }
.field input[type="text"] { width: 100%; }
fieldset.field input[type="text"] { margin-bottom: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.row > .field { flex: 1 1 140px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 15px; min-height: 36px; }
.check input { width: 20px; height: 20px; }

/* Auswahlkarten: Radio versteckt, nur input:checked + span gestaltet (Lehre aus qBingo) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 44px;
  color: var(--ink); font-weight: 400; cursor: pointer;
}
.choice small { display: block; color: var(--muted); font-size: 12px; }
.choice input:checked + span { border-color: var(--brand); background: #ecfdf5; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table.list { border-collapse: collapse; width: 100%; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
table.list th, table.list td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); }
table.list thead th { border-top: 0; color: var(--muted); font-size: 13px; }
table.list tr.st-retired td { opacity: .55; }
.tag { display: inline-block; font-size: 12px; background: #eef1f6; color: #3a4660; border-radius: 999px; padding: 0 8px; margin-left: 4px; }
.status { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; }
.status.active { background: #dcfce7; color: #166534; }
.status.draft { background: #fef3c7; color: #92400e; }
.status.retired { background: #e5e7eb; color: #4b5563; }
.fitcell span { font-size: 12px; font-weight: 700; margin-right: 6px; }
.yes { color: var(--ok); }
.no { color: var(--err); }

.text-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.text-layout > .card, .text-layout > div > .card:first-child, .text-layout > aside > .card:first-child { margin-top: 16px; }
.body-view { white-space: pre-wrap; font: 14px/1.5 ui-monospace, Consolas, monospace; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 520px; overflow: auto; margin: 0; }
.fitline { font-size: 15px; }
.mini-shots { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mini-shots a.hoch { max-width: 60%; }
.mini-shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.inline-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; }
.inline-buttons .btn[disabled] { opacity: .45; cursor: not-allowed; }

.qlist { padding-left: 22px; }
.qlist li { margin-bottom: 10px; }
.qlist li.st-retired { opacity: .55; }
.danger-zone { border-color: #fecaca; }
.danger-zone form + form { margin-top: 10px; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger[disabled] { opacity: .45; cursor: not-allowed; }
.btn.big { font-size: 19px; padding: 13px 26px; }

@media (max-width: 900px) {
  .text-layout { grid-template-columns: 1fr; }
}

/* ---------- Probedurchgang ---------- */
.probe-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.probe-head form { margin: 0; }
.reading { margin-top: 12px; text-align: center; }
.reading .textbild, .solution-layout .textbild {
  display: block; width: 100%; height: auto; margin: 12px auto; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.reading.hoch .textbild { max-width: 560px; }
/* Querformat (Beamer, PC) immer ganz im Fenster – beim Lesen soll niemand scrollen müssen */
.reading.quer .textbild { width: auto; max-width: 100%; max-height: calc(100vh - 170px); }
.timebar { position: relative; height: 28px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.timebar-fill { height: 100%; width: 100%; background: var(--brand); transition: width .2s linear; }
.timebar.is-low .timebar-fill { background: var(--accent); }
.timebar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--ink); }
/* Breite in 5-%-Schritten über Klassen (CSP style-src 'self', siehe seite.js) */
.timebar-fill.w0 { width: 0; } .timebar-fill.w5 { width: 5%; } .timebar-fill.w10 { width: 10%; }
.timebar-fill.w15 { width: 15%; } .timebar-fill.w20 { width: 20%; } .timebar-fill.w25 { width: 25%; }
.timebar-fill.w30 { width: 30%; } .timebar-fill.w35 { width: 35%; } .timebar-fill.w40 { width: 40%; }
.timebar-fill.w45 { width: 45%; } .timebar-fill.w50 { width: 50%; } .timebar-fill.w55 { width: 55%; }
.timebar-fill.w60 { width: 60%; } .timebar-fill.w65 { width: 65%; } .timebar-fill.w70 { width: 70%; }
.timebar-fill.w75 { width: 75%; } .timebar-fill.w80 { width: 80%; } .timebar-fill.w85 { width: 85%; }
.timebar-fill.w90 { width: 90%; } .timebar-fill.w95 { width: 95%; } .timebar-fill.w100 { width: 100%; }

.question .prompt { font-size: 24px; line-height: 1.3; margin: 4px 0 16px; }
.options { display: grid; gap: 8px; margin-bottom: 14px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: block; border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 48px; cursor: pointer; font-size: 18px; }
.option input:checked + span { border-color: var(--brand); background: #ecfdf5; }
.option input:focus-visible + span { outline: 3px solid var(--accent); }
.answer-form textarea, .answer-line input {
  font: inherit; font-size: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 48px;
}
.answer-form textarea { width: 100%; margin-bottom: 12px; }
.answer-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.answer-line input { flex: 1 1 auto; min-width: 0; max-width: 360px; }
.unit { font-weight: 700; }
.your-answer, .model-answer { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.your-answer { background: #f8fafc; border: 1px solid var(--line); }
.model-answer { background: #ecfdf5; border: 1px solid #a7f3d0; }
.your-answer p, .model-answer p { margin: 4px 0 0; }

.solution-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.solution-layout.hoch { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.solution-layout .textbild { margin: 0; }
.results { margin: 0; padding-left: 22px; }
.results li { margin-bottom: 12px; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--line); background: var(--card); }
.results li.right, .results li.self-yes { border-left-color: var(--ok); }
.results li.wrong, .results li.self-no { border-left-color: var(--err); }
.results li.self-partly { border-left-color: var(--accent); }
@media (max-width: 760px) {
  .solution-layout, .solution-layout.hoch { grid-template-columns: 1fr; }
  .question .prompt { font-size: 20px; }
}

/* ---------- Üben (Bauschritt 3) ---------- */
.note-card { border-color: var(--accent); background: #fffbeb; }
.start-form .row { margin-bottom: 4px; }
.next-row { margin-top: 18px; }
.pause-card { text-align: center; border-color: var(--brand); }
.pause-card .inline-buttons { justify-content: center; margin-top: 12px; }
.pause-card .lead { margin-left: auto; margin-right: auto; }
.result-card .summary { padding-left: 22px; }
.result-card .summary li { margin-bottom: 8px; }
.result-card .summary .hint { display: block; }

/* ---------- Import (Bauschritt 5) ---------- */
.tabs { display: flex; gap: 6px; }
.tabs a {
  display: inline-block; min-height: 44px; padding: 10px 16px; border-radius: 999px; line-height: 1.4;
  border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 700; font-size: 15px;
}
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
table.doc th { white-space: nowrap; width: 1%; }
table.doc td:nth-child(2) { white-space: nowrap; color: var(--muted); font-size: 13px; width: 1%; }
.nowrap { white-space: nowrap; }
.flash.note-list { border-color: var(--accent); background: #fffbeb; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.per-text { padding-left: 20px; margin: 0 0 12px; }
.per-text li { margin-bottom: 4px; }
details.card summary { cursor: pointer; min-height: 32px; }
details.card[open] summary { margin-bottom: 10px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  /* Spaltenbeschreibung: Name, Pflicht und Erklärung untereinander statt drei enger Spalten */
  table.doc, table.doc tbody, table.doc tr, table.doc th, table.doc td { display: block; width: auto; }
  table.doc tr { padding: 10px 12px; border-top: 1px solid var(--line); }
  table.doc tr:first-child { border-top: 0; }
  table.doc th, table.doc td { border: 0; padding: 0; white-space: normal; }
  table.doc th { display: inline; margin-right: 8px; }
  table.doc td:nth-child(2) { display: inline; }
  table.doc td:nth-child(3) { margin-top: 4px; }
}

/* ---------- Klassenrunde (Bauschritt 6) ---------- */
form.inline { display: inline; margin: 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.series-list { padding-left: 24px; margin: 0; }
.series-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.series-list li:first-child { border-top: 0; }
.series-list li.st-retired > div:first-child { opacity: .6; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.row-actions .btn { margin: 0; }

.pult-join { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin: 24px 0 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pult-join .qr { width: 220px; max-width: 60vw; }
.pult-join .qr svg { display: block; width: 100%; height: auto; }
.pult-join.small .qr { width: 110px; }
.pult-code-label { margin: 0; font-size: 18px; }
.pult-code { margin: 4px 0; font-size: clamp(48px, 9vw, 96px); font-weight: 900; letter-spacing: 4px; line-height: 1.05; }
.pult-join.small .pult-code { font-size: 40px; }
.pult-status { font-size: 19px; font-weight: 700; margin: 16px 0 4px; }
.pult-board tr.done td { color: var(--muted); }
.pult-board td .btn { margin: 0; }

.code-input { font-size: 28px !important; letter-spacing: 3px; text-align: center; max-width: 220px; }
.waiting { text-align: left; }

.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kind { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kind-value { font-size: 32px; font-weight: 900; line-height: 1.1; }
table.stats td.no { color: var(--err); font-weight: 700; }
.open-answers { padding-left: 18px; margin: 8px 0 0; }
.open-answers li { margin-bottom: 8px; }
.tag.self-yes { background: #dcfce7; color: #166534; }
.tag.self-partly { background: #fef3c7; color: #92400e; }
.tag.self-no { background: #fee2e2; color: #991b1b; }

/* ---------- Verlauf, Spielercode, Verwaltung (Bauschritt 7) ---------- */
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 10px; border-radius: 999px; background: #eef1f6; overflow: hidden; margin-right: 6px; }
.bar-fill { display: block; height: 100%; background: var(--brand); }
.bar-fill.w0 { width: 0%; } .bar-fill.w5 { width: 5%; } .bar-fill.w10 { width: 10%; } .bar-fill.w15 { width: 15%; } .bar-fill.w20 { width: 20%; } 
.bar-fill.w25 { width: 25%; } .bar-fill.w30 { width: 30%; } .bar-fill.w35 { width: 35%; } .bar-fill.w40 { width: 40%; } .bar-fill.w45 { width: 45%; } 
.bar-fill.w50 { width: 50%; } .bar-fill.w55 { width: 55%; } .bar-fill.w60 { width: 60%; } .bar-fill.w65 { width: 65%; } .bar-fill.w70 { width: 70%; } 
.bar-fill.w75 { width: 75%; } .bar-fill.w80 { width: 80%; } .bar-fill.w85 { width: 85%; } .bar-fill.w90 { width: 90%; } .bar-fill.w95 { width: 95%; } 
.bar-fill.w100 { width: 100%; } 
.bar-num { font-weight: 700; }
table.history td { white-space: nowrap; }
.code-card { border-color: var(--accent); background: #fffbeb; }
.player-code { font: 900 clamp(32px, 7vw, 48px)/1.1 ui-monospace, Consolas, monospace; letter-spacing: 3px; margin: 8px 0; }
.review { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.review-shot { flex: 0 0 240px; max-width: 100%; }
.review-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.review > div { flex: 1 1 320px; min-width: 0; }
.review-title { margin-top: 0; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 18px; }
.reject-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reject-form input[type="text"] { font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 44px; min-width: 200px; }
.reject-form .btn { margin: 0; }
.field input.short { max-width: 140px; }

/* ---------- Reihenfolge und Lückensatz (Bauschritt 8) ---------- */
.order-list { list-style: none; counter-reset: platz; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.order-list li { counter-increment: platz; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 14px; background: var(--card); font-size: 18px; }
.order-list li::before { content: counter(platz) "."; font-weight: 900; color: var(--muted); min-width: 1.6em; }
.order-text { flex: 1 1 200px; }
.order-ctl { display: flex; align-items: center; gap: 6px; }
.order-ctl .btn { margin: 0; min-width: 44px; }
.order-ctl .btn[disabled] { opacity: .35; cursor: default; }
.order-pos { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.order-pos select { font: inherit; font-size: 16px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; }
.gap-text { font-size: 20px; line-height: 2.3; margin: 0 0 14px; }
.gap-text input.gap { font: inherit; font-size: 18px; border: 0; border-bottom: 2px solid var(--ink); background: #f8fafc; padding: 2px 6px; margin: 0 4px; min-height: 40px; max-width: 70vw; }
.gap-text input.gap:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.wordbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wordbox .word { border: 1px dashed var(--muted); border-radius: 8px; padding: 2px 10px; font-size: 17px; }

/* ---------- Gemeinsam am Beamer (Bauschritt 8) ---------- */
body[data-mode="beamer"] .wrap { max-width: 1500px; padding-top: 14px; }
.beamer-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.beamer-head .inline-buttons .btn { margin-bottom: 0; }
.names { list-style: none; padding: 0; margin: 8px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip { font: inherit; font-size: 20px; font-weight: 800; border: 2px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); padding: 6px 16px; min-height: 44px; cursor: pointer; }
.names li.away .name-chip { opacity: .45; }
.beamer-question .prompt { font-size: clamp(26px, 3.2vw, 44px); }
.show-options { list-style: upper-alpha; padding-left: 1.6em; margin: 0 0 16px; font-size: clamp(20px, 2.2vw, 30px); }
.show-options li { margin-bottom: 8px; padding-left: 6px; }
.show-order { padding-left: 1.2em; margin: 0 0 16px; font-size: clamp(20px, 2.2vw, 30px); }
.show-order li { margin-bottom: 6px; }
.gap-text.show { font-size: clamp(20px, 2.2vw, 30px); }
.blank { display: inline-block; width: 6em; border-bottom: 2px solid var(--ink); margin: 0 .3em; height: 1.1em; vertical-align: baseline; }
.blank.wide { width: 14em; }
.beamer-results li { font-size: 18px; }
.spread { list-style: none; padding: 0; margin: 6px 0 0; font-size: 15px; }
.spread li { margin: 2px 0; }
.spread li.is-right { font-weight: 800; }
.spread .bar { width: 120px; }
.saved { font-size: 20px; font-weight: 700; color: var(--ok); }
.look-up { text-align: center; }
.look-up .lead { margin: 0 auto 16px; }

/* ---------- Papierfassung (Bauschritt 8) ----------
   Blatt 1 (Text) A4 quer, Blatt 2 (Fragen) A4 hoch – über benannte Seiten.
   Am Bildschirm stehen die Blätter verkleinert untereinander. */
@page { size: A4 portrait; margin: 14mm; }
@page quer { size: A4 landscape; margin: 10mm; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; margin: 22px auto 0; max-width: 820px; }
.sheet-text { max-width: 1100px; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.sheet-img { display: block; width: 100%; height: auto; }
.sheet-foot { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.sheet-title { font-size: 20px; margin: 10px 0 12px; }
.paper-questions { padding-left: 24px; margin: 0; }
.paper-questions > li { margin-bottom: 18px; break-inside: avoid; }
.paper-prompt { font-weight: 700; margin: 0 0 6px; }
.show-options.boxes, .show-order.boxes { list-style: none; padding-left: 0; font-size: 16px; }
.show-options.boxes { counter-reset: opt; }
.show-options.boxes li { counter-increment: opt; }
.show-options.boxes li::before { content: "☐ " counter(opt, upper-alpha) ")  "; }
.show-order.boxes li::before { content: "____  "; }
.sheet .gap-text.show, .sheet .show-options, .sheet .show-order { font-size: 16px; line-height: 2.2; }
/* Schreiblinien als Rahmen: Hintergründe druckt der Browser meist nicht */
.lines span { display: block; height: 2em; border-bottom: 1px solid #9aa3b2; }
.answer-blank { margin: 8px 0 0; }
.paper-key { padding-left: 24px; }
.paper-key li { margin-bottom: 8px; break-inside: avoid; }
@media print {
  .topbar, .foot, .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  .sheet { border: 0; border-radius: 0; padding: 0; margin: 0; max-width: none; break-after: page; }
  .sheet-text { page: quer; }
  .sheet-img { max-height: 172mm; width: auto; max-width: 100%; margin: 0 auto; }
}

/* ---------- Fragen aus der Klasse (Bauschritt 8) ---------- */
.collect-list { padding-left: 22px; margin: 0; }
.collect-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.collect-list > li:first-child { border-top: 0; }
.collect-list > li.st-retired > div:first-child { opacity: .55; }
.collect-list > li > div:first-child { flex: 1 1 360px; min-width: 0; }
.collect-shot { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; margin-top: 16px; }
.filter label.check { flex-direction: row; align-self: center; }

/* ---------- Bauschritt 9: Fragen vorher, Rangliste, Lesezeitfaktor ---------- */
.preview-list { padding-left: 24px; margin: 8px 0 14px; font-size: 19px; }
.preview-list li { margin-bottom: 10px; }
.preview-list .gap-text.show { font-size: 17px; line-height: 2; margin: 2px 0 0; }
.beamer-question .preview-list { font-size: clamp(20px, 2.4vw, 32px); }
.ranking { padding-left: 0; list-style: none; margin: 6px 0 10px; }
.ranking li { padding: 6px 0; border-top: 1px solid var(--line); }
.ranking li:first-child { border-top: 0; }
.ranking.big li { font-size: clamp(18px, 2vw, 26px); }
.ranking .place { display: inline-block; min-width: 2.2em; font-weight: 900; }
.rank-me { font-size: 19px; }
.beamer-settings { margin: 8px 0 0; font-size: 15px; }
.beamer-settings summary { cursor: pointer; color: var(--muted); min-height: 32px; }
.beamer-settings select, .pct-select { font: inherit; font-size: 15px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: #fff; }

/* ---------- Import „Texte mit Fragen“, Sammellöschen (10.10.2026) ---------- */
.steps { padding-left: 22px; margin: 0 0 12px; }
.steps li { margin-bottom: 4px; }
.pkg-text { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; background: var(--card); }
.pkg-text.skipped { opacity: .5; }
.pkg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pkg-head .check strong { font-size: 17px; }
.pkg-meta { margin: 4px 0 8px; }
.pkg-meta .fitcell span { margin-right: 4px; }
.pkg-body summary { cursor: pointer; font-weight: 700; font-size: 15px; min-height: 32px; }
.pkg-bodytext { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; font-size: 15px; max-height: 360px; overflow: auto; }
.pkg-notes { margin: 6px 0; padding-left: 20px; font-size: 14px; color: #92400e; }
.pkg-q { padding-left: 22px; margin: 10px 0; }
.pkg-q li { margin-bottom: 8px; }
.pkg-q .check { align-items: flex-start; }
.pkg-q .check input { margin-top: 3px; flex: none; }
.pkg-q .hint.block { padding-left: 28px; }
.pkg-q .warn { color: #92400e; }
.pkg-errors { margin: 6px 0; padding-left: 20px; font-size: 14px; color: var(--err); }
.pkg-status { margin: 8px 0 0; font-size: 15px; font-weight: 700; }
th.pick, td.pick { width: 1%; padding-right: 0; }
th.pick input, td.pick input { width: 20px; height: 20px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.ai-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ai-box summary { cursor: pointer; min-height: 32px; }
.ai-box form { margin-top: 12px; }

/* ---------- Liste: Sortieren und Freigabe (10.10.2026) ---------- */
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover, th a.sort:focus { text-decoration: underline; }
th[aria-sort] a.sort { color: var(--brand); }
td.share { white-space: nowrap; }
td.share .btn { margin-top: 4px; display: block; min-height: 30px; padding: 3px 10px; font-size: 13px; }
.vis { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; }
.vis.school { background: #eef1f6; color: #3a4660; }
.vis.requested { background: #fef3c7; color: #92400e; }
.vis.public { background: #dbeafe; color: #1e40af; }
