/* Lern-App § 34a. Zuerst fürs Telefon gebaut: gelernt wird unterwegs,
   die Antwortknöpfe müssen mit dem Daumen zu treffen sein. Am Rechner
   wird die Spalte breiter, sonst ändert sich nichts. */

:root {
    --grund: #f4f5f7;
    --karte: #ffffff;
    --linie: #dfe2e7;
    --text: #1a1d21;
    --leise: #6b7280;
    --marke: #1f4e79;
    --richtig: #1a7f45;
    --richtig-hell: #e8f5ed;
    --falsch: #b3261e;
    --falsch-hell: #fdecea;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--grund);
    color: var(--text);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* ---------------------------------------------------------------- Kopf */

.kopf {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--marke);
    color: #fff;
}
.marke {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.marke span { font-weight: 400; opacity: 0.85; }
.kopf-stand { font-size: 12px; opacity: 0.85; }

.buehne {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 14px 40px;
}

h1 { font-size: 1.45em; margin: 6px 0 10px; }
h2 { font-size: 1.1em; margin: 26px 0 10px; }
.vorwort { color: #3d4551; margin: 0 0 20px; }

/* --------------------------------------------------------------- Wege */

.wege { display: flex; flex-direction: column; gap: 10px; }

.weg {
    display: block;
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.05s ease;
}
.weg:hover { border-color: var(--marke); }
.weg:active { transform: translateY(1px); }
.weg strong { display: block; font-size: 1.05em; }
.weg span { display: block; font-size: 0.86em; color: var(--leise); margin-top: 2px; }
.weg.gross { background: var(--marke); border-color: var(--marke); color: #fff; }
.weg.gross span { color: rgba(255, 255, 255, 0.8); }
.weg[disabled] { opacity: 0.5; cursor: default; }

/* --------------------------------------------------------- Sachgebiete */

.gebiete { list-style: none; margin: 0; padding: 0; }
.gebiete li { margin-bottom: 8px; }
.gebiet {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 10px;
    cursor: pointer;
}
.gebiet:hover { border-color: var(--marke); }
.gebiet-nr {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--marke);
    background: #e8eef5;
    border-radius: 50%;
}
.gebiet-text { flex: 1; min-width: 0; }
.gebiet-titel { display: block; font-size: 0.95em; line-height: 1.3; }
.gebiet-zahl { display: block; font-size: 0.78em; color: var(--leise); margin-top: 2px; }
.gebiet-ring {
    flex-shrink: 0;
    font-size: 0.78em;
    color: var(--leise);
    text-align: right;
    min-width: 44px;
}

/* -------------------------------------------------------------- Lauf */

.lauf-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.lauf-stand { font-size: 0.85em; color: var(--leise); }
.uhr {
    font-variant-numeric: tabular-nums;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--marke);
}
.uhr.knapp { color: var(--falsch); }

.leise {
    padding: 6px 2px;
    font: inherit;
    font-size: 0.88em;
    color: var(--leise);
    background: none;
    border: none;
    cursor: pointer;
}
.leise:hover { color: var(--text); }

.balken {
    height: 4px;
    background: #e3e6ea;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 14px;
}
.balken-fuell {
    height: 100%;
    width: 0;
    background: var(--marke);
    transition: width 0.2s ease;
}

.karte {
    padding: 16px;
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 12px;
}
.karte-gebiet {
    margin: 0 0 6px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--leise);
}
.karte-frage { margin: 0 0 16px; font-size: 1.12em; line-height: 1.4; }

.antworten { display: flex; flex-direction: column; gap: 8px; }
.antwort {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: #fbfcfd;
    border: 1px solid var(--linie);
    border-radius: 9px;
    cursor: pointer;
}
.antwort:hover:not(:disabled) { border-color: var(--marke); background: #f4f8fc; }
.antwort:disabled { cursor: default; }
.antwort-zeichen {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--leise);
    background: #eceff3;
    border-radius: 50%;
}
.antwort.richtig {
    background: var(--richtig-hell);
    border-color: var(--richtig);
}
.antwort.richtig .antwort-zeichen { background: var(--richtig); color: #fff; }
.antwort.falsch {
    background: var(--falsch-hell);
    border-color: var(--falsch);
}
.antwort.falsch .antwort-zeichen { background: var(--falsch); color: #fff; }
.antwort.gewaehlt { box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.15); }

.aufloesung {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--linie);
}
.urteil { margin: 0 0 8px; font-weight: 700; }
.urteil.gut { color: var(--richtig); }
.urteil.schlecht { color: var(--falsch); }
.erklaerung { margin: 0 0 8px; font-size: 0.95em; }
.fundstelle { margin: 0; font-size: 0.85em; color: var(--leise); }

.karte-fuss {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}
.vorlesen {
    padding: 9px 14px;
    font: inherit;
    font-size: 0.88em;
    color: var(--marke);
    background: #eef3f8;
    border: 1px solid #cfdcea;
    border-radius: 8px;
    cursor: pointer;
}
.vorlesen:hover:not(:disabled) { background: #e3ecf5; }
.vorlesen:disabled { opacity: 0.6; cursor: default; }
.weiter {
    margin-left: auto;
    padding: 11px 20px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--marke);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.weiter:hover { background: #17395a; }
.karte audio { display: block; width: 100%; margin-top: 12px; }

/* ----------------------------------------------------------- Ergebnis */

.ergebnis-zahl { font-size: 1.15em; margin: 0 0 4px; }
.ergebnis-gebiete { list-style: none; margin: 16px 0 22px; padding: 0; }
.ergebnis-gebiete li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--linie);
    font-size: 0.92em;
}
.ergebnis-gebiete .zahl { flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--leise); }
.bestanden { color: var(--richtig); }
.durchgefallen { color: var(--falsch); }

/* -------------------------------------------------------------- Rest */

.fortschritt-fuss { margin-top: 18px; }

.hinweis {
    margin-top: 26px;
    padding: 12px 14px;
    font-size: 0.85em;
    color: #48505b;
    background: #eef0f3;
    border: 1px solid var(--linie);
    border-radius: 10px;
}
.hinweis summary { cursor: pointer; font-weight: 600; color: var(--text); }
.hinweis p { margin: 10px 0 0; }

.fuss {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 14px 26px;
    font-size: 0.76em;
    color: var(--leise);
    text-align: center;
}

@media (min-width: 700px) {
    .buehne { padding-top: 24px; }
    h1 { font-size: 1.7em; }
    .wege { flex-direction: row; flex-wrap: wrap; }
    .weg { flex: 1 1 200px; }
    .weg.gross { flex-basis: 100%; }
}

/* ------------------------------------------------------------ Wischen */
/* Karten wie beim Vokabellernen: eine Behauptung, nach rechts für „ja“,
   nach links für „nein“. Die Karte folgt dem Finger und kippt leicht —
   ohne diese Rückmeldung fühlt sich Wischen wie Raten an. */

.stapel {
    position: relative;
    /* Feste Höhe, damit die Karte beim Wechsel nicht springt. */
    min-height: 340px;
    margin: 6px 0 14px;
    touch-action: pan-y;
}

.wischkarte {
    position: relative;
    padding: 20px 18px;
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
    cursor: grab;
    user-select: none;
    will-change: transform;
}
.wischkarte.zieht { cursor: grabbing; }
.wischkarte.faehrt { transition: transform 0.28s ease, opacity 0.28s ease; }

.wisch-gebiet {
    margin: 0 0 10px;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--leise);
}
.wisch-frage {
    margin: 0 0 14px;
    font-size: 0.95em;
    color: #3d4551;
}
.wisch-behauptung {
    margin: 0 0 16px;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.35;
}
.wisch-anleitung {
    margin: 0;
    padding-top: 12px;
    font-size: 0.85em;
    color: var(--leise);
    border-top: 1px solid var(--linie);
}

/* Die beiden Marken liegen hinter der Karte und werden beim Ziehen
   sichtbar — so sieht man, wohin man gerade entscheidet. */
.wisch-marke {
    position: absolute;
    top: 24px;
    z-index: 0;
    padding: 6px 14px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.1s linear;
    pointer-events: none;
}
.wisch-marke.links { left: 10px; color: var(--falsch); background: var(--falsch-hell); }
.wisch-marke.rechts { right: 10px; color: var(--richtig); background: var(--richtig-hell); }

/* Kurze Rückmeldung nach der Entscheidung. */
.wisch-echo {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    border-radius: 14px;
}
.wisch-echo[hidden] { display: none; }
.wisch-echo.gut { background: var(--richtig-hell); border: 1px solid var(--richtig); }
.wisch-echo.schlecht { background: var(--falsch-hell); border: 1px solid var(--falsch); }
.wisch-echo .urteil-gross { font-size: 1.5em; font-weight: 700; margin: 0; }
.wisch-echo.gut .urteil-gross { color: var(--richtig); }
.wisch-echo.schlecht .urteil-gross { color: var(--falsch); }
.wisch-echo .richtige-antwort { margin: 0; font-size: 0.95em; color: #2c3340; }
.wisch-echo .naechste { margin: 0; font-size: 0.8em; color: var(--leise); }

.wisch-knoepfe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.wisch-knopf {
    flex: 1;
    max-width: 170px;
    padding: 14px 10px;
    font: inherit;
    font-size: 1em;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
}
.wisch-knopf.nein { color: var(--falsch); background: var(--falsch-hell); border: 1px solid #f0c4c0; }
.wisch-knopf.ja { color: var(--richtig); background: var(--richtig-hell); border: 1px solid #bfe0cd; }
.wisch-knopf:active { transform: translateY(1px); }
#wisch-vorlesen { flex-shrink: 0; padding: 13px 14px; }

.wisch-hilfe {
    margin: 14px 0 0;
    font-size: 0.82em;
    color: var(--leise);
    text-align: center;
}


/* -------------------------------------------------------------- Wissen */
/* Merkblätter zum Nachschlagen: Schema, Definitionen, Tabellen. Bewusst
   ruhig gesetzt — hier wird gelesen, nicht geklickt. */

.wissen-block {
    margin: 0 0 18px;
    padding: 16px;
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 12px;
}
.wissen-block h2 { margin: 0 0 10px; font-size: 1.05em; }
.wissen-block p { margin: 0 0 10px; }
.wissen-vorspann { font-size: 0.92em; color: #3d4551; }

.wissen-schritt {
    margin: 0 0 12px;
    padding-left: 34px;
    position: relative;
}
.wissen-schritt-nr {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--marke);
    border-radius: 50%;
}
.wissen-schritt strong { display: block; margin-bottom: 3px; }
.wissen-schritt ul { margin: 0; padding-left: 18px; font-size: 0.92em; color: #3d4551; }

.merksatz {
    margin: 14px 0 0;
    padding: 12px 14px;
    font-weight: 600;
    background: #eef3f8;
    border-left: 4px solid var(--marke);
    border-radius: 0 8px 8px 0;
}

.wissen-def { list-style: none; margin: 0; padding: 0; }
.wissen-def li {
    padding: 9px 0;
    border-bottom: 1px solid var(--linie);
    font-size: 0.93em;
}
.wissen-def li:last-child { border-bottom: none; }
.wissen-def dt { font-weight: 700; }
.wissen-def dd { margin: 2px 0 0; color: #3d4551; }

/* Tabellen rollen waagerecht, statt die Seite zu sprengen. */
.wissen-tabelle { overflow-x: auto; }
.wissen-tabelle table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.88em; }
.wissen-tabelle th, .wissen-tabelle td {
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--linie);
}
.wissen-tabelle th { font-size: 0.92em; color: var(--leise); background: #f7f8fa; }
.wissen-tabelle td:first-child { font-weight: 600; }

.wissen-paar {
    padding: 9px 0;
    border-bottom: 1px solid var(--linie);
    font-size: 0.93em;
}
.wissen-paar:last-child { border-bottom: none; }
.wissen-paar strong { display: block; }
.wissen-paar span { color: #3d4551; }

.wissen-norm { margin: 0 0 14px; }
.wissen-norm > strong { display: block; margin-bottom: 6px; font-size: 1em; color: var(--marke); }
.wissen-norm ul { margin: 0 0 8px; padding-left: 20px; font-size: 0.92em; }
.wissen-norm .praxis {
    margin: 0;
    padding: 9px 12px;
    font-size: 0.88em;
    background: #f7f8fa;
    border-radius: 8px;
}
.wissen-liste { margin: 0; padding-left: 20px; font-size: 0.93em; }
.wissen-liste li { margin-bottom: 4px; }
#wissen audio { display: block; width: 100%; margin: 10px 0 16px; }
.wissen-blattkopf {
    margin: 26px 0 8px;
    padding-bottom: 6px;
    font-size: 1.15em;
    border-bottom: 2px solid var(--marke);
}
.wissen-sprung { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.wissen-sprung a {
    padding: 6px 12px;
    font-size: 0.85em;
    color: var(--marke);
    text-decoration: none;
    background: #eef3f8;
    border-radius: 14px;
}
.wissen-sprung a:hover { background: var(--marke); color: #fff; }

/* ---------------------------------------------------- Startseite (Menü) */
/* Alles auf einen Blick: Auf dem Telefon soll die Wahl ohne Rollen
   sichtbar sein. Deshalb vier Kacheln im Quadrat, darunter der Weg zu
   den Sachgebieten — und mehr nicht. Was erklärt werden muss, liegt
   hinter „Über diese App“. */

.stand-zeile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
    font-size: 0.85em;
    color: var(--leise);
}
.stand-balken {
    flex: 1;
    height: 6px;
    background: #e3e6ea;
    border-radius: 3px;
    overflow: hidden;
}
.stand-balken > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--richtig);
    transition: width 0.3s ease;
}

.kachelfeld {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.kachel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 104px;
    padding: 14px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.05s ease;
}
.kachel:hover { border-color: var(--marke); }
.kachel:active { transform: translateY(1px); }
.kachel[disabled] { opacity: 0.45; cursor: default; }
.kachel-zeichen { font-size: 1.3em; line-height: 1; color: var(--marke); }
.kachel strong { font-size: 1.05em; }
.kachel span:last-child { font-size: 0.8em; color: var(--leise); line-height: 1.3; }

.kachel.haupt {
    background: var(--marke);
    border-color: var(--marke);
    color: #fff;
}
.kachel.haupt .kachel-zeichen { color: rgba(255, 255, 255, 0.9); }
.kachel.haupt span:last-child { color: rgba(255, 255, 255, 0.85); }

.kachel.breit {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    width: 100%;
}
.kachel.breit span:last-child { text-align: right; }

.start-fuss {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 0;
}

.hinweis.offen { display: block; }
.hinweis.offen p:first-child { margin-top: 0; }

@media (min-width: 700px) {
    .kachelfeld { grid-template-columns: repeat(4, 1fr); }
    .kachel { min-height: 120px; }
}

/* Sachgebiete und Merkblätter liegen direkt im Menü — keine
   Zwischenseite. Als Chips, weil sieben Zeilen den Bildschirm sprengen
   würden und die Nummer zum Wiedererkennen genügt. */
.reihe-titel {
    margin: 14px 0 6px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--leise);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font: inherit;
    font-size: 0.85em;
    color: var(--text);
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 999px;
    cursor: pointer;
}
.chip:hover { border-color: var(--marke); color: var(--marke); }
.chip .nr {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    color: var(--marke);
    background: #e8eef5;
    border-radius: 50%;
}
.chip .anteil { font-size: 0.85em; color: var(--leise); font-variant-numeric: tabular-nums; }
.chip.voll .nr { color: #fff; background: var(--richtig); }
.chip.blatt { background: #f4f7fb; border-color: #d8e3ee; }

/* Kleine Telefone (und niedrige Fenster): Das Menü soll auch auf
   360 × 640 ohne Rollen passen. Gekürzt wird an den Abständen, nicht
   an der Treffergröße der Knöpfe. */
@media (max-width: 420px), (max-height: 720px) {
    .buehne { padding: 10px 12px 16px; }
    .stand-zeile { margin: 2px 0 10px; }
    .kachelfeld { gap: 8px; margin-bottom: 6px; }
    .kachel { min-height: 82px; padding: 10px 12px; }
    .kachel-zeichen { font-size: 1.1em; }
    .kachel strong { font-size: 0.98em; }
    .kachel span:last-child { font-size: 0.74em; }
    .reihe-titel { margin: 10px 0 4px; }
    .chips { gap: 5px; }
    .chip { padding: 6px 10px; font-size: 0.8em; }
    .start-fuss { margin-top: 10px; }
    .fuss { padding-bottom: 10px; font-size: 0.68em; }
}

/* ------------------------------------------------- Ohne Farbe lesbar */
/* Gelernt wird auch auf Schwarzweiß-Anzeigen. Dort sind Rot und Grün
   dasselbe Grau — deshalb trägt kein Zustand seine Bedeutung allein in
   der Farbe. Jede Markierung hat zusätzlich ein Symbol, ein Wort und
   eine eigene Form der Umrandung. */

.antwort.richtig { border-width: 2px; border-style: solid; }
.antwort.falsch { border-width: 2px; border-style: dashed; }

.antwort-marke {
    margin-left: auto;
    padding-left: 10px;
    flex-shrink: 0;
    align-self: center;
    font-size: 0.78em;
    font-weight: 700;
    white-space: nowrap;
}
.marke-richtig { color: var(--richtig); }
.marke-falsch { color: var(--falsch); }

/* Auch das Echo im Wischmodus unterscheidet sich in der Form, nicht nur
   im Ton: durchgezogener Rahmen bei richtig, gestrichelt bei falsch. */
.wisch-echo.gut { border-style: solid; border-width: 2px; }
.wisch-echo.schlecht { border-style: dashed; border-width: 2px; }

.wisch-marke.links { border: 2px dashed currentColor; }
.wisch-marke.rechts { border: 2px solid currentColor; }

/* Ergebnis: Das Wort steht ohnehin da, die Linie darunter macht den
   Unterschied auch ohne Farbe sichtbar. */
#ergebnis-titel.bestanden { border-bottom: 3px solid var(--richtig); display: inline-block; }
#ergebnis-titel.durchgefallen { border-bottom: 3px dashed var(--falsch); display: inline-block; }

.chip.voll { border-width: 2px; }
.chip.voll .anteil { color: var(--richtig); font-weight: 700; }

.uhr.knapp { font-weight: 700; text-decoration: underline; }
