/* ============================================================
   Spieltheorie – eine Einführung — gemeinsame Vorlage (v2)
   Eine CSS-Datei für alle Module.
   Grundsätze: ruhige Lesespur, wenige Kästen (Lernziele, MERKE,
   Spielfläche), Matrizen als Abbildungen im Textfluss.
   Spieler 1 = blau (Zeilen) · Spieler 2 = orange (Spalten)
   ============================================================ */

:root {
    --blau: #0055aa;
    --blau-dunkel: #003d7a;
    --blau-hell: #eaf2fa;
    --orange: #c2410c;
    --orange-hell: #fdf0e6;
    --tinte: #1e293b;
    --tinte-tief: #0f172a;
    --grau: #64748b;
    --grau-hell: #94a3b8;
    --linie: #e2e8f0;
    --papier: #ffffff;
    --papier-grau: #f8fafc;
    --merke-bg: #fffbeb;
    --merke-rand: #f59e0b;
    --merke-text: #92400e;
    --gruen: #16a34a;
    --gruen-bg: #f0fdf4;
    --gruen-text: #166534;
    --rot: #dc2626;
    --rot-bg: #fef2f2;
    --rot-text: #991b1b;
    --stage: #0f172a;
    --stage-rand: #1e293b;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    height: 100%;
    display: flex;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--tinte);
    background: var(--papier);
}

/* ---------- Sidebar ---------- */

.sidebar {
    width: 264px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    background: var(--papier-grau);
    border-right: 1px solid var(--linie);
    display: flex;
    flex-direction: column;
    padding-bottom: 32px;
}

.sidebar .logo {
    display: block;
    padding: 24px;
    text-decoration: none;
    color: inherit;
}

.logo-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--tinte-tief);
}

.logo-name svg,
.logo-name i {
    color: var(--blau);
}

.logo-sub {
    font-size: 11px;
    color: var(--grau);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-top: 3px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    font-size: 14px;
    color: var(--grau);
    text-decoration: none;
}

.back-link:hover {
    color: var(--blau);
}

.nav-label {
    padding: 24px 24px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grau-hell);
}

.nav-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 20px 8px 24px;
    border: none;
    border-right: 3px solid transparent;
    background: none;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    text-align: left;
    color: var(--grau);
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
    color: var(--blau);
    background: var(--blau-hell);
}

.nav-link.active {
    color: var(--blau);
    background: var(--blau-hell);
    border-right-color: var(--blau);
    font-weight: 500;
}

.nav-num {
    flex-shrink: 0;
    width: 26px;
    font-size: 12px;
    font-weight: 600;
    color: var(--grau-hell);
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}

.nav-link.active .nav-num {
    color: var(--blau);
}

/* ---------- Mobile Topbar ---------- */

.topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--papier);
    border-bottom: 1px solid var(--linie);
}

.topbar a {
    color: var(--grau);
    text-decoration: none;
    font-size: 14px;
}

.topbar .logo-name {
    font-size: 16px;
}

/* ---------- Navigation auf schmalen Bildschirmen (von engine.js aufgebaut) ----------
   Menü-Symbol in der oberen Leiste, Seitenleiste als Schublade von rechts. */

.burger,
.schublade-zu,
.alle-module-label,
.alle-module {
    display: none;
}

@media (max-width: 900px) {
    .burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: -8px -10px -8px 0;
        border: 0;
        border-radius: 8px;
        background: none;
        color: var(--tinte-tief);
        cursor: pointer;
    }

    .burger:hover {
        background: var(--blau-hell);
    }

    .sidebar.schublade {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        width: 82vw;
        max-width: 340px;
        z-index: 70;
        border-right: 0;
        border-left: 1px solid var(--linie);
        box-shadow: 0 0 40px rgba(15, 23, 42, 0.25);
        overscroll-behavior: contain;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0s linear 0.28s;
    }

    body.nav-offen .sidebar.schublade {
        transform: none;
        visibility: visible;
        transition: transform 0.28s ease;
    }

    .nav-abdeckung {
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.28s ease, visibility 0s linear 0.28s;
    }

    body.nav-offen .nav-abdeckung {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.28s ease;
    }

    body.nav-offen {
        overflow: hidden;
    }

    .sidebar.schublade .logo {
        padding-right: 56px;
    }

    .schublade-zu {
        display: inline-flex;
        position: absolute;
        top: 16px;
        right: 12px;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: none;
        color: var(--grau);
        cursor: pointer;
    }

    .schublade-zu:hover {
        background: var(--blau-hell);
        color: var(--blau);
    }

    .alle-module-label,
    .alle-module {
        display: block;
    }

    .alle-module a {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 7px 20px 7px 24px;
        font-size: 13.5px;
        line-height: 1.45;
        color: var(--grau);
        text-decoration: none;
    }

    .alle-module a[href]:hover {
        color: var(--blau);
        background: var(--blau-hell);
    }

    .alle-module a.aktuell {
        color: var(--blau);
        font-weight: 600;
    }

    .alle-module a.aktuell .nav-num {
        color: var(--blau);
    }

    .alle-module .ml-tag {
        margin-left: auto;
        align-self: center;
        font-size: 10px;
        padding: 0 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar.schublade,
    .nav-abdeckung {
        transition: none !important;
    }
}

/* Fusszeile in einer Zeile (von engine.js aufgebaut): Links · Lizenz · Stand */
.uebersicht-fuss .fz {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 4px;
    max-width: none;
    margin: 0;
}

.uebersicht-fuss .fz .grp {
    white-space: nowrap;
}

/* nur für den angemeldeten Admin (engine.js, EL.adminLink) */
.uebersicht-fuss .fz .fz-admin {
    margin-left: auto;
    padding-left: 16px;
    color: var(--grau-hell);
}

.uebersicht-fuss .fz .sep {
    margin: 0 0.45em;
    color: var(--grau-hell);
}

.uebersicht-fuss .fz .meta,
.uebersicht-fuss .fz .meta a {
    color: var(--grau-hell);
}

@media (max-width: 640px) {
    .uebersicht-fuss .fz .sep-meta {
        display: none;
    }

    .uebersicht-fuss .fz .meta {
        flex-basis: 100%;
        font-size: 12px;
    }
}

.stand-druck {
    display: none;
}

/* ---------- Hauptspalte ---------- */

main {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.page {
    max-width: 780px;
    margin: 0 auto;
    padding: 56px 36px 140px;
}

/* ---------- Typografie ---------- */

.kicker {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blau);
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(30px, 5vw, 40px);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--tinte-tief);
    margin: 0 0 18px;
    text-wrap: balance;
}

.intro {
    font-size: 18.5px;
    color: #475569;
    max-width: 62ch;
}

.kap {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--linie);
}

.kap:first-of-type {
    border-top: none;
    padding-top: 32px;
    margin-top: 24px;
}

h2 {
    font-size: 26px;
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--tinte-tief);
    margin: 0 0 20px;
    text-wrap: balance;
}

.knum {
    color: var(--blau);
    font-weight: 600;
    font-size: 0.72em;
    margin-right: 14px;
    vertical-align: 2px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--tinte-tief);
    margin: 30px 0 8px;
}

p {
    margin: 0 0 1.15em;
    max-width: 68ch;
}

ul,
ol {
    max-width: 66ch;
    padding-left: 24px;
    margin: 0 0 1.15em;
}

li {
    margin-bottom: 5px;
}

strong {
    color: var(--tinte-tief);
}

a {
    color: var(--blau);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--blau);
    outline-offset: 2px;
}

/* ---------- Kasten 1: Lernziele ---------- */

.lernziele {
    background: var(--papier-grau);
    border-left: 3px solid var(--blau);
    border-radius: 0 10px 10px 0;
    padding: 20px 26px 16px;
    margin: 30px 0 0;
}

.boxlabel {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blau);
    margin-bottom: 8px;
}

.lernziele ul {
    margin: 0;
    font-size: 15px;
    color: #334155;
}

/* ---------- Kasten 2: MERKE ---------- */

.merke {
    background: var(--merke-bg);
    border-left: 3px solid var(--merke-rand);
    border-radius: 0 10px 10px 0;
    padding: 16px 22px;
    margin: 30px 0;
}

.merke .boxlabel {
    color: var(--merke-text);
}

.merke p {
    margin: 0;
    font-size: 15.5px;
    color: #422006;
}

/* ---------- Kasten 3: Spielfläche ---------- */

.stage {
    background: var(--stage);
    border: 1px solid var(--stage-rand);
    border-radius: 16px;
    padding: 36px 28px;
    margin: 34px 0;
    color: #cbd5e1;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Die globale strong-Farbe ist dunkle Tinte für helle Seiten —
   auf der dunklen Spielfläche muss fetter Text hell bleiben. */
.stage strong {
    color: #e2e8f0;
}

.stage-label {
    position: absolute;
    top: 14px;
    left: 20px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #475569;
}

.stage-score {
    display: flex;
    justify-content: center;
    gap: 56px;
    margin: 8px 0 34px;
    font-family: 'Inter', monospace;
}

.stage-score .num {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
}

.stage-score .num.p1 {
    color: #60a5fa;
    text-shadow: 0 0 14px rgba(59, 130, 246, 0.5);
}

.stage-score .num.p2 {
    color: #f87171;
    text-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

.stage-score .who {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    border-top: 1px solid #334155;
    margin-top: 8px;
    padding-top: 6px;
}

.stage-vs {
    font-size: 26px;
    font-weight: 900;
    font-style: italic;
    color: #334155;
    align-self: center;
}

.stage-hands {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    min-height: 110px;
    margin-bottom: 26px;
}

/* Elfmeter: zwei beschriftete Ecken */

.elf-tor {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}

.elf-ecke {
    width: 156px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 10px 8px 8px;
    transition: border-color 0.25s;
}

.elf-ecke .inhalt {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 36px;
    line-height: 1;
}

.elf-ecke .lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    border-top: 1px solid #334155;
    padding-top: 7px;
    margin-top: 7px;
}

.elf-ecke.tor {
    border-color: #22c55e;
}

.elf-ecke.halt {
    border-color: #ef4444;
}

.stage-hand {
    font-size: 78px;
    line-height: 1;
    transition: all 0.3s;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.stage-hand.dim {
    opacity: 0.45;
    transform: scale(0.85);
}

.stage-hand.win {
    transform: scale(1.18);
}

.stage-msg {
    min-height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 26px;
}

.stage-msg>span {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #334155;
    border-radius: 999px;
    padding: 7px 22px;
    font-size: 14.5px;
    font-weight: 600;
}

.stage-msg .gut {
    color: #60a5fa;
}

.stage-msg .schlecht {
    color: #f87171;
}

.stage-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stage-btn {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #334155;
    color: #94a3b8;
    cursor: pointer;
    font: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s;
}

.stage-btn:hover {
    border-color: #3b82f6;
    background: #24324a;
    transform: translateY(-2px);
}

.stage-btn:active {
    transform: scale(0.95);
}

.stage-btn .emoji {
    font-size: 32px;
    line-height: 1.2;
}

.stage-btn .txt {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stage-restart {
    background: linear-gradient(90deg, #2563eb, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s;
}

.stage-restart:hover {
    transform: translateY(-2px);
}

@keyframes shake {
    0% { transform: rotate(0) scale(1); }
    25% { transform: rotate(-10deg) scale(1.08); }
    50% { transform: rotate(10deg) scale(1.08); }
    75% { transform: rotate(-10deg) scale(1.08); }
    100% { transform: rotate(0) scale(1); }
}

.shake {
    animation: shake 0.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .shake {
        animation: none;
    }
}

/* ---------- Abbildungen ---------- */

figure.abb {
    margin: 38px 0;
    text-align: center;
}

figure.abb figcaption {
    font-size: 13.5px;
    color: var(--grau);
    margin-top: 16px;
}

figure.abb figcaption b {
    color: #475569;
}

/* Breite Matrizen (4 Spalten, zweistellige Zahlen) sollen auf schmalen
   Screens scrollen statt die Seite zu sprengen. */
figure.abb div[id$="-matrix"] {
    overflow-x: auto;
    padding: 4px 2px;
}

figure.abb div[id$="-matrix"] .mx {
    display: grid;
    width: max-content;
    margin: 0 auto;
}

/* ---------- Bilder (Fotos, Gemälde): Bild links, Beschreibung rechts ----------
   --s skaliert die Grösse pro Bild (z. B. style="--s:0.7"). */
figure.bild {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    margin: 32px 0;
}

figure.bild img {
    display: block;
    flex: none;
    width: auto;
    height: auto;
    max-width: calc(64% * var(--s, 1));
    max-height: calc(420px * var(--s, 1));
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
}

figure.bild figcaption {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--grau);
}

figure.bild figcaption b {
    display: block;
    font-size: 14.5px;
    color: var(--tinte-tief);
    margin-bottom: 4px;
}

.bild-quelle {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--grau-hell);
}

.bild-quelle a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--linie);
}

figure.bild img,
figure.abb img {
    cursor: zoom-in;
}

@media (max-width: 640px) {
    figure.bild {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    figure.bild img {
        max-width: 100%;
        max-height: 60vh;
    }
}

/* ---------- Suche (suche.php) ---------- */
.such-form {
    margin: 22px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.such-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--grau);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.such-zeile {
    display: flex;
    gap: 10px;
}

.such-zeile input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 16px;
    padding: 11px 14px;
    border: 1.5px solid var(--linie);
    border-radius: 10px;
    background: #fff;
    color: var(--tinte);
}

.such-zeile input:focus {
    outline: none;
    border-color: var(--blau);
    box-shadow: 0 0 0 3px var(--blau-hell);
}

.such-knopf {
    flex: none;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--blau);
    color: #fff;
    cursor: pointer;
}

.such-knopf:hover {
    background: var(--blau-dunkel);
}

.such-info {
    color: var(--grau);
    font-size: 15px;
    margin: 14px 0 28px;
}

.such-modul {
    border-top: 1px solid var(--linie);
}

.such-modul:last-of-type {
    border-bottom: 1px solid var(--linie);
    margin-bottom: 36px;
}

.such-modul > summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 14px 0;
    cursor: pointer;
    list-style: none;
}

.such-modul > summary::-webkit-details-marker {
    display: none;
}

.such-modul > summary::before {
    content: "▸";
    color: var(--blau);
    width: 12px;
}

.such-modul[open] > summary::before {
    content: "▾";
}

.such-mnr {
    font-weight: 700;
    font-size: 13px;
    color: var(--blau);
}

.such-mt {
    font-weight: 600;
    font-size: 17px;
    color: var(--tinte-tief);
}

.such-zahl {
    font-size: 13.5px;
    color: var(--grau);
    white-space: nowrap;
}

.such-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--orange-hell);
    color: var(--orange);
}

.such-kapitel {
    margin: 0 0 18px 22px;
}

.such-kt {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.such-kt a {
    color: var(--tinte-tief);
    text-decoration: none;
    border-bottom: 1.5px solid var(--linie);
}

.such-kt a:hover {
    border-bottom-color: var(--blau);
}

.such-liste {
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
    border-left: 2px solid var(--blau-hell);
}

.such-liste li {
    margin: 0 0 10px;
}

.such-stelle {
    display: block;
    color: inherit;
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.55;
    padding: 4px 8px;
    margin-left: -8px;
    border-radius: 6px;
}

.such-stelle:hover {
    background: var(--papier-grau);
}

.such-zusatz {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--grau);
    margin-bottom: 2px;
}

.such-snip {
    color: var(--tinte);
}

.such-n {
    font-size: 12.5px;
    color: var(--grau);
}

.such-snip mark,
mark.such-mark {
    background: #fde68a;
    color: inherit;
    padding: 0 1px;
    border-radius: 3px;
}

/* Hinweis auf der Modulseite nach einem Klick in der Trefferliste */
.such-chip {
    position: fixed;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 4px 12px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 6px 8px 6px 16px;
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .14);
    font-size: 14px;
    color: var(--tinte);
}

.such-chip .such-was {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.such-chip .such-n2 {
    color: var(--grau);
}

.such-chip a {
    color: var(--blau);
    white-space: nowrap;
}

.such-chip .such-weg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 1.5px solid #f59e0b;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: var(--tinte);
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .such-kapitel {
        margin-left: 4px;
    }

    .such-chip {
        font-size: 13px;
        gap: 4px 8px;
        padding-left: 12px;
    }

    .such-chip .such-n2,
    .such-chip .such-weg .lang {
        display: none;
    }
}

@media print {
    .such-chip {
        display: none !important;
    }

    mark.such-mark {
        background: none;
    }
}

/* Vergrösserte Ansicht: Klick auf ein Bild öffnet, ein weiterer Klick schliesst */
.bild-zoom {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .97);
    cursor: zoom-out;
}

.bild-zoom img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    border-radius: 6px;
}

.bild-zoom .bz-text {
    max-width: 860px;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #cbd5e1;
}

.bild-zoom .bz-text b {
    color: #fff;
}

.bild-zoom .bild-quelle {
    color: #94a3b8;
}

.bild-zoom a {
    color: #e2e8f0;
    cursor: pointer;
}

body.zoom-offen {
    overflow: hidden;
}

.abb-flex {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 28px;
    flex-wrap: wrap;
}

/* ---------- Bimatrix (Engine) ---------- */

.mx {
    display: inline-grid;
    gap: 6px;
    text-align: initial;
    user-select: none;
}

.mx-p1name {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--blau);
    text-align: center;
    margin-right: 8px;
}

.mx-p2name {
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 4px;
}

.mx-ch {
    background: var(--orange-hell);
    color: var(--orange);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    text-align: center;
}

.mx-rh {
    background: var(--blau-hell);
    color: var(--blau);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 6px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    min-width: 34px;
}

.mx-c {
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: 6px;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.15s;
}

.mx-c .v1 {
    color: var(--blau);
    font-weight: 600;
}

.mx-c .sep {
    color: #cbd5e1;
    margin: 0 7px;
}

/* Im Kringel-Modus bringen die .kx-Pillen eigenes Padding mit —
   der Schrägstrich braucht dann weniger Eigenabstand. */
.mx-c .kx+.sep {
    margin: 0 4px;
}

.mx-c .v2 {
    color: var(--orange);
    font-weight: 600;
}

.mx-c.hoverable:hover {
    border-color: var(--blau);
    background: var(--blau-hell);
    cursor: pointer;
    transform: scale(1.04);
}

/* Kringel-Modus */

.kx {
    position: relative;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
}

.kx:hover {
    background: var(--blau-hell);
}

.kx .kringel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.1rem;
    height: 2.1rem;
    border: 2px solid transparent;
    border-radius: 50%;
    pointer-events: none;
}

.kx.on[data-p="1"] .kringel {
    border-color: var(--blau);
}

.kx.on[data-p="2"] .kringel {
    border-color: var(--orange);
}

/* Panel neben interaktiven Matrizen */

.mx-panel {
    flex: 1;
    min-width: 240px;
    max-width: 320px;
    text-align: left;
    font-size: 14.5px;
    background: var(--papier-grau);
    border: 1px solid var(--linie);
    border-radius: 10px;
    padding: 18px 22px;
    color: #334155;
}

.mx-panel .wert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    padding: 7px 12px;
    margin-top: 8px;
    font-weight: 600;
}

.mx-panel .wert.w1 {
    background: var(--blau-hell);
    color: var(--blau);
}

.mx-panel .wert.w2 {
    background: var(--orange-hell);
    color: var(--orange);
}

.mx-panel .wert .zahl {
    font-size: 20px;
    font-weight: 700;
}

/* ---------- Tabellen im Text ---------- */

.texttabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin: 24px 0 30px;
}

.texttabelle th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grau);
    border-bottom: 2px solid var(--linie);
    padding: 8px 14px 8px 0;
}

.texttabelle td {
    border-bottom: 1px solid var(--linie);
    padding: 10px 14px 10px 0;
    vertical-align: top;
}

.texttabelle td:first-child {
    font-weight: 600;
    color: var(--tinte-tief);
    white-space: nowrap;
}

/* ---------- PDF-Druckfassungen ---------- */
.pdf-link {
    margin: 14px 0 0;
    font-size: 14.5px;
}

.pdf-link a,
.pdf-eintrag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blau);
    text-decoration: none;
    font-weight: 600;
}

.pdf-link a:hover span {
    text-decoration: underline;
}

#pdf-liste {
    display: grid;
    gap: 6px;
    margin: 10px 0 8px;
}

.pdf-eintrag {
    display: flex;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: #fff;
    color: var(--tinte-tief);
    font-weight: 400;
}

.pdf-eintrag:hover {
    border-color: var(--blau);
}

.pdf-eintrag .dk-titel {
    flex: 1;
}

.pdf-eintrag.pdf-gesamt {
    margin-top: 10px;
    border-color: var(--blau);
    background: var(--blau-hell);
}

.pdf-eintrag .pdf-sub {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--grau);
}

.pdf-eintrag .pdf-seiten {
    color: var(--grau);
    font-size: 13.5px;
}

.pdf-eintrag svg {
    color: var(--blau);
}

/* Texttabellen auf dem Handy: umbrechen statt seitlich überlaufen */
@media (max-width: 640px) {
    .texttabelle {
        font-size: 14px;
        display: block;
        overflow-x: auto;
    }

    .texttabelle td:first-child {
        white-space: normal;
    }
}

/* ---------- Selbsttest ---------- */

.aufgabe {
    border-top: 1px dashed var(--linie);
    padding-top: 30px;
    margin-top: 34px;
}

.aufgabe-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grau);
    margin-bottom: 6px;
}

.mc {
    margin: 18px 0 6px;
}

/* Folgen mehrere Teilfragen in derselben Aufgabe aufeinander,
   bekommen sie deutlich Luft zueinander. */
.mc+.mc {
    margin-top: 48px;
}

.mc-q {
    font-weight: 600;
    color: var(--tinte-tief);
    margin-bottom: 12px;
}

.mc-opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: var(--papier);
    font: inherit;
    font-size: 15px;
    line-height: 1.55;
    color: var(--tinte);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.mc-opt:hover {
    background: var(--papier-grau);
}

.mc-dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.mc-opt.ok {
    border-color: var(--gruen);
    background: var(--gruen-bg);
}

.mc-opt.ok .mc-dot {
    background: var(--gruen);
    border-color: var(--gruen);
}

.mc-opt.nope {
    border-color: var(--rot);
    background: var(--rot-bg);
}

.mc-opt.nope .mc-dot {
    background: var(--rot);
    border-color: var(--rot);
}

.mc-fb {
    display: none;
    font-size: 14.5px;
    line-height: 1.6;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 4px;
}

.mc-fb.show {
    display: block;
}

.mc-fb.good {
    background: var(--gruen-bg);
    color: var(--gruen-text);
}

.mc-fb.bad {
    background: var(--rot-bg);
    color: var(--rot-text);
}

.selbsttest-done {
    margin-top: 34px;
    background: var(--gruen-bg);
    border-left: 3px solid var(--gruen);
    border-radius: 0 10px 10px 0;
    padding: 16px 22px;
    font-size: 15.5px;
    color: var(--gruen-text);
}

/* ---------- Mitnahme & Modul-Navigation ---------- */

.mitnahme ul {
    list-style: none;
    padding: 0;
}

.mitnahme li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 9px;
}

.mitnahme li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--gruen);
    font-weight: 700;
}

.ausblick {
    color: var(--grau);
    font-size: 15.5px;
    border-left: 3px solid var(--linie);
    padding-left: 20px;
    margin-top: 26px;
}

.abstand {
    height: 72px;
}

.modnav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid var(--linie);
    margin-top: 72px;
    padding-top: 28px;
    font-size: 15px;
}

.modnav a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--grau);
    text-decoration: none;
}

.modnav a:hover {
    color: var(--blau);
}

.modnav .weiter {
    color: var(--blau);
    font-weight: 600;
}

@media (max-width: 640px) {
    .modnav .mn-titel {
        display: none;
    }
}

/* ---------- Einblendungen ---------- */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none;
    }

    main {
        scroll-behavior: auto;
    }
}

/* ---------- Mobil ---------- */

@media (max-width: 900px) {
    body {
        display: block;
        overflow: auto;
        height: auto;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        display: flex;
    }

    main {
        height: auto;
        overflow: visible;
    }

    .page {
        padding: 32px 18px 100px;
    }

    .stage-score {
        gap: 32px;
    }

    .abb-flex {
        flex-direction: column;
        align-items: center;
    }

    .mx-panel {
        max-width: 100%;
    }

    /* Sprungziele nicht unter der fixierten Topbar verstecken */
    main [id] {
        scroll-margin-top: 64px;
    }
}

/* ============================================================
   Erweiterungen für Module 2–9 und Lernpfad-Übersicht
   ============================================================ */

/* ---------- Entscheidungs-Buttons in der Spielfläche ---------- */

.stage-choice {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px;
    padding: 14px 22px;
    border-radius: 12px;
    border: 2px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font: inherit;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.stage-choice:hover {
    border-color: #3b82f6;
    background: #24324a;
    transform: translateY(-1px);
}

.stage-choice small {
    display: block;
    font-weight: 400;
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: 2px;
}

.stage-note {
    font-size: 13px;
    color: #94a3b8;
    max-width: 52ch;
    margin: 14px auto 0;
}

.stage-result {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px 22px;
    margin: 18px auto 0;
    max-width: 460px;
    font-size: 14.5px;
    text-align: center;
}

.stage-result .gross {
    font-size: 19px;
    font-weight: 700;
    color: #e2e8f0;
}

.stage-stats {
    display: flex;
    justify-content: center;
    gap: 34px;
    margin: 14px 0;
    flex-wrap: wrap;
}

.stage-stats .stat .z {
    font-size: 26px;
    font-weight: 700;
    color: #e2e8f0;
}

.stage-stats .stat .l {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

/* ---------- Verlaufsanzeige (wiederholte Spiele) ---------- */

.hist {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 16px 0 4px;
}

.hist .runde {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hist .z {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.hist .z.k {
    background: #14532d;
    color: #86efac;
}

.hist .z.v {
    background: #7f1d1d;
    color: #fca5a5;
}

.hist-legende {
    font-size: 11.5px;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
}

/* ---------- Balken ---------- */

.bar-out {
    height: 14px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.stage .bar-out {
    background: #1e293b;
}

.bar-in {
    height: 100%;
    background: var(--blau);
    border-radius: 99px;
    transition: width 0.35s;
}

.bar-in.gruen {
    background: var(--gruen);
}

.bar-in.rot {
    background: var(--rot);
}

input[type="range"] {
    width: 100%;
    max-width: 420px;
    accent-color: var(--blau);
}

/* ---------- Klickbare Matrixzellen & Zustände ---------- */

.mx-c.pick {
    cursor: pointer;
}

.mx-c.pick:hover {
    border-color: var(--blau);
    background: var(--blau-hell);
}

.mx-c.gut {
    border: 2px solid var(--gruen) !important;
    background: var(--gruen-bg) !important;
}

.mx-c.halb {
    border: 2px solid var(--merke-rand) !important;
    background: var(--merke-bg) !important;
}

.mx-c.schlecht {
    border: 2px solid var(--rot) !important;
    background: var(--rot-bg) !important;
}

.mx-c.aus,
.mx-ch.aus,
.mx-rh.aus {
    opacity: 0.22;
}

.mx-c.aus .v1,
.mx-c.aus .v2 {
    text-decoration: line-through;
}

/* ---------- Rechenaufgaben mit Eingabefeld ---------- */

.rechnen-zeile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0 6px;
}

.rechnen-input {
    width: 130px;
    font: inherit;
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid var(--linie);
    border-radius: 8px;
    background: #fff;
    color: var(--tinte-tief);
}

.rechnen-input:focus {
    outline: 2px solid var(--blau);
    outline-offset: 1px;
}

.rechnen.ok .rechnen-input {
    border-color: var(--gruen);
    background: var(--gruen-bg);
}

.rechnen-einheit {
    color: var(--grau);
}

/* Abschlusstest: Fragenpool erst nach dem Ziehen zeigen */
.selbsttest.pool:not(.gezogen) .aufgabe {
    display: none;
}

.pool-neu {
    margin-top: 28px;
}

/* Zentrierte Formelzeile (z. B. in Vertiefungen) */
.formel {
    text-align: center;
    font-size: 16px;
    margin: 14px 0 18px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Prüf-Button & Übungs-Feedback ---------- */

.pruef-btn {
    background: var(--blau);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.pruef-btn:hover {
    background: var(--blau-dunkel);
}

.pruef-btn.sekundaer {
    background: var(--papier);
    color: var(--grau);
    border: 1px solid var(--linie);
}

.pruef-btn.sekundaer:hover {
    background: var(--papier-grau);
    color: var(--tinte);
}

.pruef-zeile {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.uebung-fb {
    text-align: center;
    font-size: 14.5px;
    margin-top: 14px;
    min-height: 24px;
}

.uebung-fb .gut-txt {
    color: var(--gruen-text);
    font-weight: 600;
}

.uebung-fb .schlecht-txt {
    color: var(--rot-text);
    font-weight: 600;
}

.uebung-fb .neutral-txt {
    color: var(--grau);
}

/* Enthält das Feedback ein Urteil, wird es als farbige Box hervorgehoben —
   im selben Stil wie das Feedback der Multiple-Choice-Fragen. */
.uebung-fb:has(.gut-txt),
.uebung-fb:has(.schlecht-txt) {
    border-radius: 10px;
    padding: 12px 16px;
    line-height: 1.6;
}

.uebung-fb:has(.gut-txt) {
    background: var(--gruen-bg);
    color: var(--gruen-text);
}

.uebung-fb:has(.schlecht-txt) {
    background: var(--rot-bg);
}

.uebung-fb:has(.gut-txt) .neutral-txt {
    color: var(--gruen-text);
}

.uebung-fb:has(.schlecht-txt) .neutral-txt {
    color: var(--rot-text);
}

.pruef-btn.aktiv {
    background: var(--blau);
    color: #fff;
    border-color: var(--blau);
}

/* ---------- Spielbäume (Modul 6) ---------- */

.baum-box {
    position: relative;
    border: 1px solid var(--linie);
    border-radius: 14px;
    padding: 56px 20px 24px;
    margin: 30px 0;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

.baum-status {
    position: absolute;
    top: 14px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    color: var(--grau);
}

.baum-status button {
    background: none;
    border: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--blau);
    cursor: pointer;
    font-weight: 600;
}

.baum-fb {
    margin-top: 14px;
    max-width: 520px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    min-height: 22px;
}

.baum-box .action-label {
    pointer-events: none;
}

.end-node.richtig {
    outline: 2px solid var(--gruen);
    background: var(--gruen-bg);
}

.end-node.falsch {
    outline: 2px solid var(--rot);
    background: var(--rot-bg);
}

.tree-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 400px;
}

svg.tree-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.tree-line {
    stroke: #cbd5e1;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.3s, stroke-width 0.3s;
}

.interactive-branch {
    cursor: pointer;
    pointer-events: auto;
    stroke-width: 6px;
}

.interactive-branch:hover {
    stroke: #94a3b8;
    stroke-width: 8px;
}

.correct-path {
    stroke: var(--gruen) !important;
    stroke-width: 8px !important;
}

.node {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    position: absolute;
    z-index: 20;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.node:hover {
    transform: scale(1.06);
}

.node.p1 {
    background: var(--blau-hell);
    border: 3px solid #3b82f6;
    color: var(--blau-dunkel);
}

.node.p2 {
    background: var(--orange-hell);
    border: 3px solid #f97316;
    color: #9a3412;
}

.node-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: #475569;
}

.node-label.blau {
    color: var(--blau);
}

.node-label.orange {
    color: var(--orange);
}

.end-node {
    position: absolute;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--papier);
    border: 2px solid var(--linie);
    font-size: 13px;
    color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
    min-width: 90px;
    cursor: pointer;
    transition: transform 0.2s;
}

.end-node:not(.richtig):hover {
    transform: scale(1.06);
    outline: 2px solid var(--blau);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.end-node .pl {
    font-weight: 600;
    font-size: 10px;
    color: var(--grau-hell);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.end-node .pv {
    font-size: 17px;
}

.end-node .pv .b {
    color: var(--blau);
    font-weight: 600;
}

.end-node .pv .o {
    color: var(--orange);
    font-weight: 600;
}

.action-label {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    background: var(--papier);
    padding: 4px 9px;
    border-radius: 12px;
    color: var(--grau);
    border: 1px solid var(--linie);
    z-index: 15;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-label:hover {
    border-color: var(--grau-hell);
    background: var(--papier-grau);
}

/* ---------- Aufklapp-Aufgaben ---------- */

details.loesung {
    border: 1px solid var(--linie);
    border-radius: 10px;
    padding: 12px 18px;
    margin: 14px 0;
    font-size: 15px;
}

details.loesung summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--blau);
    font-size: 14px;
}

details.loesung[open] summary {
    margin-bottom: 8px;
}

/* ---------- Vertiefungen (Exkurse & Fallstudien, eingeklappt) ---------- */

details.vertiefung {
    border: 1px solid var(--linie);
    border-left: 3px solid var(--blau);
    border-radius: 0 10px 10px 0;
    padding: 14px 22px;
    margin: 28px 0;
}

details.vertiefung summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--tinte-tief);
}

details.vertiefung[open] summary {
    margin-bottom: 12px;
}

details.vertiefung p,
details.vertiefung ul {
    font-size: 15px;
}

details.vertiefung p:last-child {
    margin-bottom: 4px;
}

.vlabel {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blau);
    background: var(--blau-hell);
    border-radius: 999px;
    padding: 2px 10px;
    margin-right: 10px;
    vertical-align: 1.5px;
}

.vlabel.fall {
    color: var(--orange);
    background: var(--orange-hell);
}

.vlabel.blick {
    color: var(--gruen-text);
    background: var(--gruen-bg);
}

details.vertiefung details.loesung {
    margin: 12px 0 8px;
}

/* ---------- Zum Weiterlesen ---------- */

.weiterlesen {
    list-style: none;
    padding: 0;
    font-size: 14.5px;
}

.weiterlesen li {
    padding-left: 26px;
    position: relative;
    margin-bottom: 8px;
    color: var(--grau);
}

.weiterlesen li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--blau);
    font-weight: 600;
}

.weiterlesen b {
    color: var(--tinte);
}

/* ---------- Hotelling-Strand ---------- */

.strand {
    position: relative;
    height: 54px;
    background: linear-gradient(180deg, #fef9c3, #fde68a);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    margin: 18px 0 6px;
}

.strand .stand {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    transition: left 0.4s;
    line-height: 1;
}

.strand .marktlinie {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(15, 23, 42, 0.25);
    transition: left 0.4s;
}

.marktanteile {
    display: flex;
    height: 12px;
    border-radius: 99px;
    overflow: hidden;
    margin: 10px 0 4px;
}

.marktanteile .a1 {
    background: var(--blau);
    transition: width 0.4s;
}

.marktanteile .a2 {
    background: var(--orange);
    transition: width 0.4s;
}

/* ---------- Chicken-Duell (Modul 4) ---------- */

.cg-strasse {
    position: relative;
    max-width: 520px;
    height: 104px;
    margin: 0 auto 18px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
}

.cg-strasse::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 3px dashed #475569;
}

.cg-auto {
    position: absolute;
    top: 50%;
    width: 64px;
    margin-top: -15px;
    transition: left 0.9s ease-in, right 0.9s ease-in, transform 0.9s ease-in;
}

.cg-auto svg {
    display: block;
}

.cg-auto.keine-animation {
    transition: none;
}

.cg-crash {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    z-index: 2;
}

@keyframes cg-beben {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-4px, 2px);
    }

    40% {
        transform: translate(4px, -2px);
    }

    60% {
        transform: translate(-3px, -1px);
    }

    80% {
        transform: translate(3px, 1px);
    }
}

.cg-strasse.beben {
    animation: cg-beben 0.4s;
}

/* ---------- Lernpfad-Übersicht (index) ---------- */

body.uebersicht {
    display: block;
    overflow: auto;
    height: auto;
}

body.uebersicht main {
    height: auto;
    overflow: visible;
}

.chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--linie);
    color: var(--grau);
    white-space: nowrap;
}

.chip.kern {
    background: var(--blau-hell);
    border-color: transparent;
    color: var(--blau);
}

.chip.vert {
    background: transparent;
}

.chip.fertig {
    background: var(--gruen-bg);
    border-color: transparent;
    color: var(--gruen-text);
}

.block-titel {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 44px 0 12px;
}

.block-titel .bid {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blau);
}

.block-titel .bt {
    font-size: 15px;
    font-weight: 600;
    color: var(--tinte-tief);
}

.pfad {
    margin: 0 0 0 15px;
    padding: 0;
    list-style: none;
    border-left: 2px solid var(--linie);
}

.pfad li {
    position: relative;
    padding: 4px 0 4px 24px;
}

.pfad li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 26px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blau);
    border: 2px solid var(--papier);
}

.pfad a.modul-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    padding: 10px 14px;
    margin-left: -6px;
    transition: background-color 0.15s;
}

.pfad a.modul-link:hover {
    background: var(--papier-grau);
}

/* Module in Arbeit: deaktivierte Einträge auf dem Lernpfad */
.pfad div.modul-link {
    display: block;
    border-radius: 12px;
    padding: 10px 14px;
    margin-left: -6px;
}

.pfad .modul-link.inaktiv {
    opacity: 0.55;
}

.pfad li.inaktiv::before {
    background: var(--grau-hell);
}

.ml-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.6;
    color: var(--merke-text);
    background: var(--merke-bg);
    border: 1px solid var(--merke-rand);
    border-radius: 99px;
    padding: 2px 11px;
    white-space: nowrap;
}

.pfad .ml-kopf {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.pfad .ml-num {
    font-weight: 700;
    font-size: 13px;
    color: var(--blau);
    font-variant-numeric: tabular-nums;
}

.pfad .ml-titel {
    font-weight: 600;
    font-size: 16px;
    color: var(--tinte-tief);
}

.pfad .ml-sub {
    display: block;
    font-size: 13.5px;
    color: var(--grau);
    margin-top: 1px;
    max-width: 58ch;
}

.uebersicht-fuss {
    border-top: 1px solid var(--linie);
    margin-top: 64px;
    padding-top: 20px;
    text-align: left;
    font-size: 13px;
    color: var(--grau-hell);
}

.uebersicht-fuss a {
    color: var(--grau);
    text-decoration: none;
}

.uebersicht-fuss a:hover {
    color: var(--blau);
    text-decoration: underline;
}

/* ---------- Meta-Seiten (About, Kontakt, Datenschutz, Rechtliches) ---------- */

.meta h3 {
    margin-top: 36px;
}

.meta p,
.meta ul {
    color: #334155;
}

.adresse {
    border-left: 3px solid var(--linie);
    padding-left: 20px;
    line-height: 1.9;
}

.btc-box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: var(--papier-grau);
    border: 1px solid var(--linie);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0;
}

.btc-box code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12.5px;
    word-break: break-all;
    color: var(--tinte-tief);
    flex: 1;
    min-width: 220px;
}

/* ---------- Fortschritt auf dem Lernpfad ---------- */

.weiter-zeile {
    margin: 6px 0 10px;
}

.weiter-zeile a {
    display: inline-block;
    background: var(--blau);
    color: #fff;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.weiter-zeile a:hover {
    background: var(--blau-dunkel);
}

/* ---------- Glossar ---------- */

.glossar dt {
    font-weight: 600;
    color: var(--tinte-tief);
    margin-top: 20px;
}

.glossar dt .en {
    font-weight: 400;
    font-style: italic;
    color: var(--grau);
}

.glossar dd {
    margin: 3px 0 0;
    font-size: 15px;
    color: #334155;
    max-width: 68ch;
}

.gmod {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    background: var(--blau-hell);
    color: var(--blau);
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 8px;
    text-decoration: none;
    vertical-align: 1.5px;
    letter-spacing: 0.03em;
}

.gmod:hover {
    background: var(--blau);
    color: #fff;
}

/* Links auf gesperrte Module («in Arbeit»), gesetzt von engine.js */
.link-inaktiv {
    opacity: 0.55;
    cursor: default;
}

.gmod.link-inaktiv:hover {
    background: var(--blau-hell);
    color: var(--blau);
}

.modnav .link-inaktiv:hover {
    color: inherit;
}

.modnav .link-inaktiv .ml-tag {
    margin-left: 4px;
}

/* ---------- Repetitorium & Druck ---------- */

.rep h3 {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--linie);
}

.rep h3 .repnum {
    color: var(--blau);
    margin-right: 10px;
}

.rep ul {
    margin-bottom: 0;
}

.rep li {
    font-size: 15px;
    color: #334155;
}

@media print {

    .topbar,
    .uebersicht-fuss,
    .no-print,
    .weiter-zeile {
        display: none !important;
    }

    .stand-druck {
        display: block;
        margin-top: 24px;
        padding-top: 8px;
        border-top: 1px solid #ccc;
        font-size: 8.5pt;
        color: #666;
    }

    body {
        font-size: 10.5pt;
        line-height: 1.5;
    }

    .page {
        padding: 0;
        max-width: 100%;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .rep h3 {
        break-after: avoid;
        margin-top: 18px;
        padding-top: 10px;
    }

    .rep li {
        font-size: 10pt;
    }
}

/* ---------- Strategie-Steckbriefe (Strategie-Duell + Modul 7) ---------- */

.sb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 640px) {
    .sb-grid { grid-template-columns: 1fr; }
}

.sb-karte {
    border: 1px solid var(--linie);
    border-radius: 14px;
    padding: 14px 16px;
}

.sb-kopf {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sb-kopf b { font-size: 15px; }

.sb-fach {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--grau-hell);
    line-height: 1.3;
}

.sb-karte p {
    font-size: 13.5px;
    line-height: 1.55;
    margin: 0 0 10px;
    color: var(--tinte);
}

.eig-zeile {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.eig {
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 99px;
    padding: 3px 9px;
}

.eig.ja { background: var(--gruen-bg); color: var(--gruen-text); border: 1px solid #bbf7d0; }
.eig.teils { background: var(--merke-bg); color: var(--merke-text); border: 1px solid #fde68a; }
.eig.nein { background: var(--papier); color: var(--grau-hell); border: 1px solid var(--linie); text-decoration: line-through; }

/* Strategie-Icon (rund, farbig) */
.strat-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.strat-icon svg { display: block; }
