/*
 * Teilnehmerseite (index.php) - das Handy als zweiter Bildschirm.
 *
 * Hell und ruhig wie die Leinwand, in derselben Formensprache wie die
 * Folien (folie.css): Haarlinien statt Kaesten, duenne grosse Ziffern,
 * kraeftige kleine Etiketten, Farbe nur als Ton des laufenden Kapitels.
 * Das Handy traegt immer den Kapitelton der Leinwand (body.kap-1 ... kap-8),
 * so gehoeren beide Bildschirme sichtbar zusammen.
 *
 * Setzt die Tokens aus grundlagen.css voraus. Alle Masse in px - die Seite
 * ist fuer 360 bis 430 px Breite gebaut und laeuft auch auf einem Tablet.
 */

:root { color-scheme: light; }

body {
    --tinte:           #18181B;
    --haarlinie:       rgba(0, 0, 0, 0.14);
    --haarlinie-stark: rgba(0, 0, 0, 0.24);

    /* Standardton, solange kein Kapitel laeuft: das Blau der Titelfolie. */
    --ton:         var(--ton-3);
    --ton-satt:    var(--ton-3-satt);
    --ton-flaeche: var(--ton-3-flaeche);
    --ton-tief:    var(--ton-3-tief);
    --ton-hell:    var(--ton-3-hell);
}

/* Dieselbe Zuordnung wie in folie.css: Kapitel 1 und 6 Koralle, 2 und 7
 * Gruen, 3 und 8 Blau, 4 Gelb, 5 Petrol. Gilt fuer body wie fuer einzelne
 * Zeilen der Tagesordnung. */
.ton-1, .kap-1, .kap-6 { --ton: var(--ton-1); --ton-satt: var(--ton-1-satt); --ton-flaeche: var(--ton-1-flaeche); --ton-tief: var(--ton-1-tief); --ton-hell: var(--ton-1-hell); }
.ton-2, .kap-2, .kap-7 { --ton: var(--ton-2); --ton-satt: var(--ton-2-satt); --ton-flaeche: var(--ton-2-flaeche); --ton-tief: var(--ton-2-tief); --ton-hell: var(--ton-2-hell); }
.ton-3, .kap-3, .kap-8 { --ton: var(--ton-3); --ton-satt: var(--ton-3-satt); --ton-flaeche: var(--ton-3-flaeche); --ton-tief: var(--ton-3-tief); --ton-hell: var(--ton-3-hell); }
.ton-4, .kap-4         { --ton: var(--ton-4); --ton-satt: var(--ton-4-satt); --ton-flaeche: var(--ton-4-flaeche); --ton-tief: var(--ton-4-tief); --ton-hell: var(--ton-4-hell); }
.ton-5, .kap-5         { --ton: var(--ton-5); --ton-satt: var(--ton-5-satt); --ton-flaeche: var(--ton-5-flaeche); --ton-tief: var(--ton-5-tief); --ton-hell: var(--ton-5-hell); }

/* ------------------------------------------------------------------ */
/* Grundgeruest                                                        */
/* ------------------------------------------------------------------ */

* { box-sizing: border-box; }
html { height: 100%; overscroll-behavior-y: contain; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--grund);
    color: var(--tinte);
    font-family: var(--schrift);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ton); outline-offset: 3px; }

/* Verbindungshinweis: erscheint erst nach mehreren Fehlversuchen. */
.offline-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    background: var(--schlecht); color: #fff; text-align: center;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    font-size: 13px; font-weight: 700;
    transform: translateY(-100%); transition: transform 0.4s var(--weich);
}
body.offline .offline-banner { transform: none; }

/* ------------------------------------------------------------------ */
/* Kopfzeile: Name der Veranstaltung im Kapitelton, Verbindungspunkt    */
/* ------------------------------------------------------------------ */

.kopfzeile {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(16px + env(safe-area-inset-top)) 24px 12px;
    background: color-mix(in srgb, var(--grund) 88%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.kopfzeile-name {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ton-satt); transition: color 0.6s;
}
.kopfzeile-name span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopfzeile-name::before {
    content: ''; flex-shrink: 0; width: 22px; height: 3px; border-radius: 2px;
    background: var(--ton); transition: background 0.6s;
}
.verbindung {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    font-size: 11px; font-weight: 600; color: var(--gut); white-space: nowrap;
}
.verbindung::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
body.offline .verbindung { color: var(--schlecht); }
body.offline .verbindung::before { animation: puls 1s ease-in-out infinite; }

/* ------------------------------------------------------------------ */
/* Buehne: eine Ansicht zur Zeit                                       */
/* ------------------------------------------------------------------ */

main { flex: 1; display: flex; flex-direction: column; padding: 0 24px; }
.ansicht { display: none; flex: 1; flex-direction: column; padding: 22px 0 28px; }
.ansicht.aktiv { display: flex; animation: ansichtRein 0.55s var(--weich) both; }
@keyframes ansichtRein { from { opacity: 0; transform: translateY(12px); } }

/* Typografie - dieselbe Leiter wie auf den Folien, in Pixeln. */
.dachzeile {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-gedimmt);
}
.dachzeile--ton { color: var(--ton-satt); }
.dachzeile--ton::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ton); flex-shrink: 0; }
.titel {
    margin: 10px 0 0;
    font-size: 32px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.08;
    text-wrap: balance;
}
.titel--frage { font-size: 28px; }
.text { margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--text-gedimmt); }
.hinweis { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--text-gedimmt); }
.abschnitt { margin-top: 30px; }
.abschnitt--linie { padding-top: 20px; border-top: 1px solid var(--haarlinie); }
.etikett {
    margin-bottom: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-gedimmt);
}

/* Zeilen mit Haarlinien: Tagesordnung, Fragenliste. */
.zeilen { border-bottom: 1px solid var(--haarlinie); }
.zeile {
    display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center;
    padding: 11px 0; border-top: 1px solid var(--haarlinie);
}
.zeile-nr { font-size: 17px; font-weight: 400; letter-spacing: -0.02em; color: var(--ton-satt); font-variant-numeric: tabular-nums; }
.zeile-titel { font-size: 15px; font-weight: 500; line-height: 1.3; }
.zeile--jetzt .zeile-titel { font-weight: 650; }
.zeile--jetzt .zeile-nr { font-weight: 600; }
.zeile--vorbei .zeile-titel, .zeile--vorbei .zeile-nr { color: #A1A1AA; }

/* Status als Punkt und Wort - keine Pille. */
.marke { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ton-satt); }
.marke::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.marke--gut      { color: var(--gut); }
.marke--grau     { color: var(--text-gedimmt); }
.marke--schlecht { color: var(--schlecht); }
.marke--puls::before { animation: puls 2s ease-in-out infinite; }
.marke--haken::before { display: none; }
.marke svg { width: 14px; height: 14px; flex-shrink: 0; }
@keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ------------------------------------------------------------------ */
/* Knoepfe und Eingaben                                                */
/* ------------------------------------------------------------------ */

.knopf {
    width: 100%; min-height: 56px; padding: 0 20px;
    border: 0; border-radius: 16px;
    background: var(--tinte); color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.15s, opacity 0.2s;
}
.knopf:active { transform: scale(0.98); }
.knopf:disabled { opacity: 0.45; cursor: default; }
.knopf--leise { background: var(--flaeche); color: var(--tinte); border: 1.5px solid var(--haarlinie); }
.knopf--rund { width: 58px; height: 58px; min-height: 0; padding: 0; flex-shrink: 0; }
.knopf svg { width: 22px; height: 22px; }

.eingabe-zeile { display: flex; gap: 10px; margin-top: 8px; }
.eingabe {
    flex: 1; min-width: 0; height: 58px; padding: 0 18px;
    border: 1.5px solid var(--haarlinie); border-radius: 16px;
    background: var(--flaeche); font-size: 17px; outline: none; -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.eingabe::placeholder, textarea::placeholder { color: #A1A1AA; }
.eingabe:focus, textarea:focus { border-color: var(--ton); box-shadow: 0 0 0 4px var(--ton-flaeche); }
label.etikett { display: block; }

/* Antwortmoeglichkeiten: grosse Zeilen mit feinem Rand, ein Farbpunkt links.
 * Positiv/Neutral/Kritisch und Ja/Nein behalten ihre Bedeutungsfarben,
 * freie Antworten tragen den Kapitelton. */
.optionen { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.option {
    min-height: 76px; padding: 14px 22px;
    display: flex; align-items: center; gap: 16px;
    border: 1.5px solid var(--haarlinie); border-radius: 18px;
    background: var(--flaeche); color: var(--tinte);
    font-size: 19px; font-weight: 600; line-height: 1.25; text-align: left; cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, opacity 0.2s;
}
.option::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--option-farbe, var(--ton)); flex-shrink: 0; }
.option:active { transform: scale(0.985); }
.option:disabled { opacity: 0.5; cursor: default; }
.option--gut, .option--ja      { --option-farbe: var(--gut); }
.option--neutral               { --option-farbe: var(--neutral); }
.option--schlecht, .option--nein { --option-farbe: var(--schlecht); }
.option.gewaehlt { border-color: var(--ton); background: var(--ton-flaeche); opacity: 1; }

/* ------------------------------------------------------------------ */
/* Ergebnis auf dem Handy: nach der eigenen Stimme, live                 */
/* ------------------------------------------------------------------ */

.ergebnis { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.ergebnis-zeile { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 8px 12px; align-items: center; }
.ergebnis-label { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.ergebnis-label::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--option-farbe, var(--ton)); flex-shrink: 0; }
.ergebnis-zeile.meine .ergebnis-label::after {
    content: 'deine Stimme'; margin-left: 8px; flex-shrink: 0;
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ton-satt);
}
.ergebnis-wert { font-size: 20px; font-weight: 400; letter-spacing: -0.02em; text-align: right; font-variant-numeric: tabular-nums; }
.ergebnis-leiste { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #E4E4E7; overflow: hidden; }
.ergebnis-leiste::after {
    content: ''; display: block; height: 100%; width: var(--prozent, 0%); border-radius: 3px;
    background: linear-gradient(90deg, var(--ton), var(--ton-satt));
    transition: width 0.9s var(--weich);
}

/* Ja/Nein: zwei grosse duenne Zahlen nebeneinander. */
.zaehler { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 26px; }
.zaehler-karte { border-left: 1.5px solid var(--haarlinie-stark); padding: 4px 0 4px 18px; display: flex; flex-direction: column; gap: 10px; }
.zaehler-karte.meine {
    border-left: 3px solid var(--ton-satt);
    background: linear-gradient(90deg, color-mix(in srgb, var(--ton) 11%, transparent), transparent 70%);
}
.zaehler-etikett { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-gedimmt); }
.zaehler-etikett::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--option-farbe, var(--ton)); }
.zaehler-zahl { font-size: 64px; font-weight: 300; letter-spacing: -0.06em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.zaehler-karte.meine .zaehler-zahl { color: var(--ton-tief); }
.zaehler-anteil { font-size: 13px; color: var(--text-gedimmt); }
.zaehler-leiste { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #E4E4E7; overflow: hidden; }
.zaehler-leiste::after { content: ''; display: block; height: 100%; width: var(--prozent, 0%); border-radius: 3px; background: var(--ton); transition: width 0.9s var(--weich); }

/* Wortwolke: eigene Begriffe als feine Umrisse, die der anderen als Wolke. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
    border-radius: 999px; border: 1.5px solid var(--ton); background: var(--ton-flaeche);
    font-size: 15px; font-weight: 600; color: var(--ton-tief);
    animation: chipRein 0.45s var(--schwung) both;
}
.chip svg { width: 14px; height: 14px; }
/* Vorschlaege: gleiche Form, aber noch neutral - erst die Wahl faerbt sie. */
.chip--vorschlag { min-height: 44px; border-color: var(--haarlinie-stark); background: var(--flaeche); color: var(--tinte); cursor: pointer; transition: transform 0.15s, border-color 0.2s, background 0.2s; }
.chip--vorschlag:active { transform: scale(0.96); border-color: var(--ton); background: var(--ton-flaeche); }
.chip--vorschlag:disabled { opacity: 0.5; cursor: default; }
@keyframes chipRein { from { opacity: 0; transform: scale(0.85); } }
.wolke-worte { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.wolke-worte span { line-height: 1.25; animation: chipRein 0.5s var(--weich) both; }
.wolke-worte .stark  { font-size: 22px; font-weight: 600; color: var(--tinte); }
.wolke-worte .mittel { font-size: 18px; font-weight: 500; color: var(--ton-satt); }
.wolke-worte .leise  { font-size: 15px; font-weight: 400; color: var(--text-gedimmt); }

/* ------------------------------------------------------------------ */
/* Folien begleiten                                                    */
/* ------------------------------------------------------------------ */

.kapitel-kopf { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 12px; }
.kapitel-nummer { font-size: 58px; font-weight: 300; letter-spacing: -0.06em; line-height: 0.9; color: var(--ton); font-variant-numeric: tabular-nums; transition: color 0.6s; }
.kapitel-name { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; }
.folie-titel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--haarlinie); font-size: 16px; font-weight: 500; line-height: 1.3; }
.folie-titel:empty { display: none; }

/* Miniatur der laufenden Folie: der Rahmen ist 16:9, die Folie laedt in
 * voller Groesse (1280 x 720) und wird per transform verkleinert - so bleibt
 * die Schrift scharf. Tippen oeffnet sie bildschirmfuellend. */
.vorschau { margin-top: 22px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; display: block; }
.vorschau-rahmen {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden;
    border: 1px solid var(--haarlinie); border-radius: 12px; background: var(--flaeche);
}
.vorschau-rahmen iframe {
    position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: 0;
    transform-origin: 0 0; transform: scale(var(--skala, 0.26)); pointer-events: none;
}
.vorschau-hinweis {
    position: absolute; right: 10px; bottom: 10px;
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; color: var(--text-gedimmt);
    background: rgba(255, 255, 255, 0.92); padding: 4px 8px; border-radius: 8px;
}
.vorschau-hinweis svg { width: 14px; height: 14px; }
.vorschau:active .vorschau-rahmen { transform: scale(0.985); }

/* Kapitelleiste wie unten links auf jeder Folie: erledigte Striche dunkler,
 * der laufende im Kapitelton. */
.kapitelleiste { display: flex; gap: 5px; margin-top: 26px; }
.kapitelleiste span { flex: 1; height: 4px; border-radius: 2px; background: #E2E2E6; transition: background 0.5s; }
.kapitelleiste span.vorbei { background: #B4B4BC; }
.kapitelleiste span.jetzt { background: var(--ton); }
.naechstes { margin-top: 12px; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; font-size: 14px; color: var(--text-gedimmt); }
.naechstes .zeile-nr { font-size: 15px; color: #A1A1AA; }
.naechstes:empty { display: none; }

/* Folie bildschirmfuellend. */
.folie-gross { position: fixed; inset: 0; z-index: 100; background: var(--grund); }
.folie-gross iframe { width: 100%; height: 100%; border: 0; display: block; }
.folie-gross .schliessen {
    position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2;
    width: 44px; height: 44px; border-radius: 50%; padding: 0;
    border: 1px solid var(--haarlinie); background: var(--flaeche); cursor: pointer;
    display: grid; place-items: center;
}
.folie-gross .schliessen svg { width: 20px; height: 20px; }
.folie-gross .drehen {
    position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    display: none; align-items: center; gap: 8px; white-space: nowrap;
    font-size: 12px; font-weight: 600; color: var(--text-gedimmt);
    background: rgba(255, 255, 255, 0.92); padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--haarlinie);
}
.folie-gross .drehen svg { width: 16px; height: 16px; }
@media (orientation: portrait) { .folie-gross .drehen { display: flex; } }

/* ------------------------------------------------------------------ */
/* Fussleiste: Frage stellen - immer erreichbar                        */
/* ------------------------------------------------------------------ */

.fuss {
    position: sticky; bottom: 0; z-index: 20;
    padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--linie);
    background: color-mix(in srgb, var(--grund) 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    display: flex; flex-direction: column; gap: 10px;
}
.fuss-status {
    min-height: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 12px; color: var(--text-gedimmt); text-align: center;
}
.fuss-status.ton { color: var(--ton-satt); font-weight: 600; }
.fuss-status.ton::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ton); flex-shrink: 0; }
.fuss-status.gut { color: var(--gut); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Frage stellen: als Blatt von unten oder eingebettet in der Fragenwand */
/* ------------------------------------------------------------------ */

.blatt-hintergrund { position: fixed; inset: 0; z-index: 50; background: rgba(24, 24, 27, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.blatt {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
    max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 24px calc(28px + env(safe-area-inset-bottom));
    background: var(--flaeche); border-radius: 26px 26px 0 0; border-top: 1px solid var(--linie);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.08);
    transform: translateY(105%); transition: transform 0.45s var(--weich);
}
body.blatt-offen { overflow: hidden; }
body.blatt-offen .blatt { transform: none; }
body.blatt-offen .blatt-hintergrund { opacity: 1; pointer-events: auto; }
.blatt-griff { width: 40px; height: 4px; border-radius: 2px; background: #D4D4D8; margin: 0 auto 16px; }
.blatt .schliessen {
    position: absolute; top: 14px; right: 16px;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    background: var(--flaeche-tief); cursor: pointer; display: grid; place-items: center;
}
.blatt .schliessen svg { width: 18px; height: 18px; }

.fragen-bereich h2 { margin: 6px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.fragen-bereich .text { font-size: 14px; }
.fragen-bereich textarea {
    width: 100%; height: 118px; margin-top: 16px; padding: 16px 18px;
    border: 1.5px solid var(--haarlinie); border-radius: 16px;
    background: var(--grund); font-size: 17px; line-height: 1.4;
    resize: none; outline: none; -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#view-qa .fragen-bereich textarea { background: var(--flaeche); }
/* In der Fragenwand-Ansicht traegt die Ansicht schon die Dachzeile. */
#view-qa .fragen-bereich > .dachzeile { display: none; }
#view-qa .fragen-bereich h2 { margin-top: 10px; font-size: 30px; }
.fragen-bereich .knopf { margin-top: 12px; }
.meldung { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--gut); animation: ansichtRein 0.4s var(--weich) both; }
.meldung svg { width: 16px; height: 16px; flex-shrink: 0; }
.meldung--fehler { color: var(--schlecht); }

.meine-fragen { margin-top: 24px; }
.meine-fragen:empty { display: none; }
.meine-frage { display: flex; flex-direction: column; gap: 5px; padding: 12px 0; border-top: 1px solid var(--haarlinie); }
.meine-frage-text { font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.meine-frage.done .meine-frage-text, .meine-frage.rejected .meine-frage-text { color: var(--text-gedimmt); }
.meine-frage .marke { font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Warm-up-Quiz (Logik unveraendert, Gestalt an die Seite angepasst)   */
/* ------------------------------------------------------------------ */

.quiz-kopf { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quiz-kopf h2 { margin: 6px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.quiz-timer {
    --fortschritt: 100%;
    width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border-radius: 50%;
    color: var(--marke-blau); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: radial-gradient(circle, var(--grund) 62%, transparent 64%), conic-gradient(var(--marke-gruen) var(--fortschritt), #E5EDD5 0);
    transition: background 0.25s linear;
}
.quiz-timer.knapp {
    color: #C43F20;
    background: radial-gradient(circle, var(--grund) 62%, transparent 64%), conic-gradient(var(--marke-orange) var(--fortschritt), #F9DDD6 0);
    animation: quizTicken 1s ease-in-out infinite;
}
@keyframes quizTicken { 50% { transform: scale(1.06); } }
.quiz-hud { display: flex; align-items: center; gap: 8px; margin: 18px 0; }
.quiz-score, .quiz-serie, .quiz-platz { padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.quiz-score { color: var(--marke-blau); background: #E9F2F5; }
.quiz-platz { margin-left: auto; color: #567F0D; background: #F1F7E6; }
.quiz-serie { color: #8A6100; background: #FFF4D1; animation: seriePop 0.35s var(--weich); }
@keyframes seriePop { 50% { transform: scale(1.08) rotate(-1deg); } }
.quiz-frage { margin: 0 0 22px; font-size: 24px; font-weight: 650; line-height: 1.25; letter-spacing: -0.02em; }
.quiz-option {
    width: 100%; min-height: 68px; margin-bottom: 12px; padding: 14px 18px;
    display: flex; align-items: center; gap: 12px;
    border: 2px solid var(--haarlinie); border-radius: 16px; background: var(--flaeche); color: var(--tinte);
    font-size: 17px; font-weight: 600; text-align: left; cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option:disabled { cursor: default; }
.quiz-option span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 800; }
.quiz-option.a span { color: #B53D1F; background: #FFF0EA; }
.quiz-option.b span { color: var(--marke-blau); background: #E9F2F5; }
.quiz-option.a.gewaehlt { border-color: var(--marke-orange); background: #FFF9F6; }
.quiz-option.b.gewaehlt { border-color: var(--marke-blau); background: #F6FAFB; }
.quiz-option.richtig { border-color: var(--gut); background: color-mix(in srgb, var(--gut) 10%, var(--flaeche)); }
.quiz-option.richtig > span { color: #fff; background: var(--gut); }
.quiz-option.richtig::after { content: '✓'; margin-left: auto; color: var(--gut); font-size: 21px; font-weight: 800; }
.quiz-option.falsch { border-color: var(--schlecht); background: color-mix(in srgb, var(--schlecht) 8%, var(--flaeche)); }
.quiz-option.falsch > span { color: #fff; background: var(--schlecht); }
.quiz-option.falsch::after { content: '✕'; margin-left: auto; color: var(--schlecht); font-size: 19px; font-weight: 800; }
.quiz-feedback { position: relative; margin-top: 4px; padding: 18px; border-radius: 16px; font-weight: 650; line-height: 1.45; overflow: hidden; background: var(--flaeche-tief); }
.quiz-feedback.richtig { color: var(--gut); background: color-mix(in srgb, var(--gut) 10%, var(--flaeche)); animation: gewinnPop 0.5s var(--weich); }
.quiz-feedback.richtig::after { content: '✦'; position: absolute; right: 14px; top: 8px; color: var(--marke-gelb); font-size: 24px; animation: stern 1.2s ease-in-out infinite alternate; }
.quiz-feedback.falsch { color: var(--schlecht); background: color-mix(in srgb, var(--schlecht) 9%, var(--flaeche)); }
.quiz-feedback .urteil { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.quiz-feedback .gewinn { display: block; margin-top: 4px; font-size: 36px; font-weight: 300; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.quiz-feedback .dazu { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; opacity: 0.82; }
@keyframes gewinnPop { 0% { transform: scale(0.94); opacity: 0.3; } 65% { transform: scale(1.025); } }
@keyframes stern { to { transform: rotate(30deg) scale(1.22); } }
.quiz-ranking { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 9px; }
.quiz-ranking li { display: flex; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid var(--haarlinie); border-radius: 14px; font-weight: 650; animation: rangRein 0.45s both; }
.quiz-ranking li:nth-child(2) { animation-delay: 0.08s; }
.quiz-ranking li:nth-child(3) { animation-delay: 0.16s; }
.quiz-ranking li:first-child { border-color: #d2a13f; background: linear-gradient(135deg, #fff9e9, #fff2cf); transform: scale(1.02); }
@keyframes rangRein { from { opacity: 0; transform: translateY(12px); } }
#quiz-anmelden .knopf { margin-top: 12px; }

/* Kleine Bildschirme: etwas dichter, damit Frage und Antworten ohne
 * Scrollen passen. */
@media (max-height: 700px) {
    .ansicht { padding-top: 14px; }
    .titel { font-size: 28px; }
    .option { min-height: 66px; }
    .kapitel-nummer { font-size: 48px; }
}
@media (min-width: 600px) {
    main, .kopfzeile, .fuss, .blatt { padding-left: max(24px, calc((100vw - 560px) / 2)); padding-right: max(24px, calc((100vw - 560px) / 2)); }
}
