/* ==========================================================
   Do-matik – Seitenbausteine: Header, Footer, Dialog, Startseite,
   Stufenseiten, Login, Reihen-Kopf
   ========================================================== */

/* ---------- Skip-Link ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--primary); color: var(--on-primary); padding: 0.5rem 1rem; border-radius: var(--radius-s);
}
.skip-link:focus { top: 12px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }
/* Logo-Schriftzug als Bild, je Modus eine Fassung (js/site.js): Hell = dunkle Schrift, Dunkel = weiße Schrift mit Leuchten.
   Die Dunkel-Fassung hat durch das Leuchten mehr Rand → etwas höher + negativer Rand, damit der Schriftzug gleich groß wirkt
   und die Kopfleiste nicht höher wird. */
/* 2026-10-16: neues, breiteres Logo (do-matik-neu-*) → 28 px statt 36 px, passt zur Navigationsschrift */
.logo__bild { display: block; height: 28px; width: auto; transition: filter var(--transition-fast); }
/* Redesign 2.0: Dunkel-Fassung ohne eingebranntes Leuchten (aus der Hell-Fassung, Schriftzug hell; alte Datei do-matik-dunkel.webp) */
.logo__bild--dunkel { display: none; height: 28px; }
:root[data-theme="dark"] .logo__bild--hell { display: none; }
:root[data-theme="dark"] .logo__bild--dunkel { display: block; }
/* Darüberfahren (Nutzer-Wunsch 2026-10-19): Schriftzug wird grün (--color-primary). Grüne Fläche mit dem Logo als Maske
   über dem Bild; lädt die Maske nicht (z. B. file://), bleibt die Fläche unsichtbar und das Logo normal. */
:is(.site-header, .site-footer) .logo { position: relative; }
:is(.site-header, .site-footer) .logo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--transition-fast);
  background: var(--color-primary);
  -webkit-mask: url("../images/logo/do-matik-logo-hell.webp") center / 100% 100% no-repeat;
  mask: url("../images/logo/do-matik-logo-hell.webp") center / 100% 100% no-repeat;
}
:is(.site-header, .site-footer) .logo:is(:hover, :focus-visible)::after { opacity: 1; }
/* 2026-10-19: in Header und Footer kleiner (Nutzer-Wunsch) */
.site-header .logo__bild--hell, .site-header .logo__bild--dunkel,
.site-footer .logo__bild--hell, .site-footer .logo__bild--dunkel { height: 22px; }
@media (max-width: 420px) {
  .site-header .logo__bild--hell, .site-header .logo__bild--dunkel { height: 20px; }
}
/* 375 px (iPhone): Logo etwas kleiner, sonst ragt der Menü-Knopf über den Rand */
@media (max-width: 400px) {
  .site-header .logo__bild--hell, .site-header .logo__bild--dunkel { height: 18px; }
}

/* ---------- Header (Redesign 2.0, 2026-10-11, Anhang/Domatik Design/Entwurf_Herosection.png) ----------
   Logo · Mathematik ▾ · Informatik ▾ · Meine Welt ▾ · Spiele | Suche · XP · Sonne/Mond · Profil.
   Ruhige Leiste ohne Neon: Kartenfarbe, 1px-Rand, aktiver Punkt mit Akzentrahmen. Unter 1100px: Menü-Knopf. */
#site-header { min-height: var(--header-h); position: sticky; top: 0; z-index: 50; }
.site-header {
  position: relative; background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border); box-shadow: none;
}
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 1.25rem; max-width: var(--maxw-weit); }
.site-header__inner > .logo { flex-shrink: 0; }
.hn-svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.haupt-nav { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.hn-drop { position: relative; }
.hn-link {
  display: inline-flex; align-items: center; gap: 0.3rem; height: 38px; padding: 0 0.8rem; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); background: none; border: 1px solid transparent; font: inherit; font-weight: var(--fw-halbfett); font-size: var(--fs-ui);
  white-space: nowrap; text-decoration: none; transition: background var(--transition-fast), border-color var(--transition-fast);
}
.hn-link:hover { color: var(--text); background: var(--color-bg-soft); }
/* Variante C: aktiver Bereich ohne Rahmen – feine Linie unten; Iteration 3: in der einheitlichen Akzentfarbe (--nav-aktiv) */
.hn-link[aria-current], .hn-link[aria-expanded="true"] { color: var(--text); background: var(--color-bg-soft); box-shadow: inset 0 -2px 0 var(--nav-aktiv); }
.hn-pfeil { width: 15px; height: 15px; transition: transform var(--transition-fast); }
.hn-link[aria-expanded="true"] .hn-pfeil { transform: rotate(180deg); }

.hn-drop__panel {
  position: absolute; z-index: 70; top: calc(100% + 8px); left: 0; min-width: 230px; padding: 0.6rem;
  background: var(--color-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lift);
  animation: xp-pop 160ms ease-out;
}
.hn-drop__panel[hidden] { display: none; }
.hn-drop__titel { margin: 0.1rem 0.4rem 0.45rem; font-family: var(--font-label); font-size: var(--fs-meta); letter-spacing: 0.02em; text-transform: none; color: var(--text-muted); }
.hn-drop__alle { display: block; margin: 0.45rem 0.4rem 0.1rem; font-size: var(--fs-hilfe); font-weight: var(--fw-halbfett); text-decoration: none; color: var(--primary); }
.hn-klassen { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hn-klassen a {
  display: block; padding: 0.45rem 0.65rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); font-size: var(--fs-ui); white-space: nowrap;
}
/* Dropdown: 3 Spalten (Mathe 3×3, Informatik 3×2, Sek II jeweils letzte Zeile) */
.hn-drop__panel .hn-klassen { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 300px; }
.hn-klassen a:hover { background: var(--color-bg-soft); color: var(--text); }
.hn-klassen a[aria-current] { background: var(--nav-aktiv-soft); color: var(--text); font-weight: var(--fw-halbfett); box-shadow: inset 2px 0 0 var(--nav-aktiv); }
.hn-drop__panel--welt { min-width: 300px; }
.hn-welt { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hn-welt a { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.55rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.hn-welt .icon { width: var(--icon-inhalt); height: var(--icon-inhalt); flex: none; }
.hn-welt .icon.icon--flaeche { width: 2.1rem; height: 2.1rem; padding: 0.34rem; }
.hn-welt strong { display: block; font-size: var(--fs-ui); line-height: 1.2; }
.hn-welt small { display: block; font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.25; }
.hn-welt--extra { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid var(--border); }
.hn-welt a:hover { background: var(--color-bg-soft); color: var(--text); }
/* Feinschliff 2026-10-20: aktueller Eintrag wie in den Klassen-Menüs (Akzentfläche + Linie links) */
.hn-welt a[aria-current] { background: var(--nav-aktiv-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--nav-aktiv); }

.site-header__actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; flex-shrink: 0; }
/* Suche */
.hn-suche { position: relative; width: clamp(180px, 18vw, 280px); }
.hn-suche input {
  width: 100%; height: 38px; padding: 0 2.2rem 0 0.85rem; border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-hilfe);
  color: var(--text); background: var(--color-bg-soft); border: 1px solid var(--border);
}
.hn-suche input::placeholder { color: var(--text-muted); }
.hn-suche input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent); }
.hn-suche input::-webkit-search-cancel-button { display: none; }
.hn-suche__lupe { position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.hn-suche__liste {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; right: 0; min-width: 280px; margin: 0; padding: 0.35rem; list-style: none;
  background: var(--color-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lift);
}
.hn-suche__liste[hidden] { display: none; }
.hn-suche__liste a { display: block; padding: 0.4rem 0.55rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.hn-suche__liste a:hover, .hn-suche__liste a:focus { background: var(--color-bg-soft); color: var(--text); }
.hn-suche__liste strong { display: block; font-size: var(--fs-ui); }
.hn-suche__liste small { display: block; font-size: var(--fs-meta); color: var(--text-muted); }
.hn-suche__leer { padding: 0.5rem; font-size: var(--fs-hilfe); color: var(--text-muted); }
/* XP-Anzeige + Lernfortschritt */
.xp-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 38px; padding: 0 0.75rem 0 0.45rem; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-weight: var(--fw-halbfett); font-size: var(--fs-hilfe); white-space: nowrap; color: var(--text);
  background: transparent; border: 1px solid transparent;   /* Variante C: XP sichtbar, aber ohne eigenen Goldrahmen */
}
.xp-pill .icon { width: var(--icon-nav); height: var(--icon-nav); }
.xp-pill__lv { padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-family: var(--font-label); font-size: var(--fs-meta); background: var(--color-bg-soft); color: var(--text-secondary); }
/* XP im Level + Balken bis zum nächsten Level (Entwurf_Unterrichtsreihe: „Lv 12 · 1.680 / 2.000 XP“) */
.xp-pill__werte { display: grid; gap: 3px; min-width: 0; }
.xp-pill__zahl { font-family: var(--font-label); font-size: var(--fs-meta); line-height: 1; font-variant-numeric: tabular-nums; }
.xp-pill__balken { display: block; width: 100%; min-width: 84px; height: 5px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--color-gold-bright) 18%, var(--border)); }
.xp-pill__balken[hidden] { display: none; }
.xp-pill__balken i { display: block; height: 100%; border-radius: inherit; background: var(--reward); transition: width var(--transition-base, 300ms) ease; }
.xp-pill:hover, .xp-pill[aria-expanded="true"] { background: var(--color-bg-soft); }
.hn-drop__panel--xp { left: auto; right: 0; width: 300px; padding: 0.9rem 1rem; }
.xp-pop__kopf { display: flex; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.5rem; font-size: var(--fs-ui); }
.xp-pop__kopf span { font-weight: var(--fw-halbfett); color: var(--primary); }
.xp-pop__rest { margin: 0.4rem 0 0; font-size: var(--fs-meta); color: var(--text-muted); }
.xp-pop__titel { margin: 0.8rem 0 0.35rem; font-weight: var(--fw-halbfett); font-size: var(--fs-hilfe); }
.xp-pop__wege { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.3rem; font-size: var(--fs-meta); }
.xp-pop__wege li { display: flex; align-items: center; gap: 0.45rem; }
.xp-pop__wege .icon { width: 1.3rem; height: 1.3rem; }
/* Hell/Dunkel: nur ein Symbol – das Ziel (Nutzer-Vorgabe 2026-10-11): im Hellmodus der Mond, im Dunkelmodus die Sonne */
.theme-schalter {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; border: 1px solid transparent;
}
.theme-schalter[hidden] { display: none; }
.theme-schalter__teil { display: none; grid-area: 1 / 1; place-items: center; }
.theme-schalter img { width: 24px; height: 24px; object-fit: contain; }
/* Icon-System 2026-10-19: Sonne/Mond als Linien-Icon in Textfarbe – keine helle Kachel mehr im Dunkelmodus */
.theme-schalter .icon { width: 22px; height: 22px; color: var(--text); }
:root:not([data-theme-current="dark"]) .theme-schalter .i-dunkel,
[data-theme-current="dark"] .theme-schalter .i-hell { display: grid; }
.theme-schalter:hover { background: var(--color-bg-soft); border-color: var(--border); }
/* Profil */
.held-chip {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 38px; white-space: nowrap; padding: 0 0.9rem; border-radius: var(--radius-sm);
  font-weight: var(--fw-halbfett); font-size: var(--fs-hilfe); background: transparent; color: var(--text); border: 1px solid transparent;
  text-decoration: none; transition: border-color var(--transition-fast);
}
.held-chip:hover, .held-chip.is-aktiv { background: var(--color-bg-soft); color: var(--text); }
/* Feinschliff 2026-10-20: aktiver Profil-Bereich wie aktive Hauptnavigation (Linie unten in --nav-aktiv) */
.held-chip.is-aktiv { box-shadow: inset 0 -2px 0 var(--nav-aktiv); }
.held-chip--profil { padding: 0 0.85rem 0 0.25rem; gap: 0.55rem; }
/* Fokus in der Kopfzeile: nur bei Tastaturbedienung, dünn in der Akzentfarbe (kein Ring nach Mausklick) */
.site-header :is(button, a, input):focus:not(:focus-visible) { outline: none; }
.site-header :is(button, a):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); box-shadow: none; }
.held-chip__bild { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; flex: none; background: var(--color-bg-soft); border: 1px solid var(--border); }
.held-chip__bild--leer { display: grid; place-items: center; }
.held-chip__text { display: grid; line-height: 1.15; }
.held-chip__text strong { font-size: var(--fs-hilfe); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.held-chip__text small { font-size: var(--fs-meta); font-weight: var(--fw-halbfett); color: var(--text-muted); }
.held-chip__text small .icon { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.held-chip__muenzen { color: var(--color-gold); }
/* Werkzeug-Knöpfe (auch in Seiten genutzt) */
.tool-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color var(--transition-fast);
}
.tool-btn:hover { border-color: var(--primary); }
.tool-btn[hidden] { display: none; }
a.tool-btn { text-decoration: none; font-size: 1.05rem; line-height: 1; }
.tool-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tool-btn .icon { width: var(--icon-nav); height: var(--icon-nav); vertical-align: middle; }
.tool-btn--linie { color: var(--text-muted); background: transparent; border-color: transparent; }
.tool-btn--linie:hover { color: var(--primary); }
.tool-btn__text { display: none; }
@media (min-width: 1480px) {
  .tool-btn--text { width: auto; border-radius: var(--radius-pill); padding: 0 0.8rem 0 0.65rem; gap: 0.35rem; grid-auto-flow: column; }
  .tool-btn__text { display: inline; font-size: var(--fs-hilfe); font-weight: var(--fw-halbfett); }
}
/* Fach-Umschalter auf anderen Seiten (z. B. Startseiten-Reiter) */
.fach-wahl { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--color-bg-deep); }
.fach-wahl a { padding: 0.25rem 0.8rem; font-size: var(--fs-meta); font-weight: var(--fw-halbfett); border-radius: var(--radius-pill); color: var(--text); text-decoration: none; }
.fach-wahl a[aria-current="true"] { background: var(--color-surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.fach-wahl a:not([aria-current]):hover { background: var(--color-primary-soft); color: var(--text); }
/* Menü (schmale Bildschirme) */
.menu-btn {
  display: none; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); background: var(--color-surface); color: var(--text);
}
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { border-color: var(--primary); }
.site-nav {
  position: absolute; z-index: 60; top: calc(var(--header-h) - 2px); right: 16px;
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - var(--header-h) - 16px); overflow-y: auto; padding: 0.9rem;
  border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  animation: xp-pop 160ms ease-out;
}
.site-nav[hidden] { display: none; }
.site-nav .hn-suche { width: 100%; }
.site-nav .hn-klassen { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.menue-titel { margin: 0.9rem 0.3rem 0.35rem; font-family: var(--font-label); font-size: var(--fs-meta); letter-spacing: 0.02em; text-transform: none; color: var(--text-muted); }

/* Mittlere Breite: zu wenig Platz für Navigation + volles Suchfeld (überlappte „Meine Welt“) → Suche als Lupe,
   die sich beim Antippen über die rechten Knöpfe aufklappt */
@media (max-width: 1360px) and (min-width: 1101px) {
  .site-header__actions { position: relative; }
  .site-header__actions > .hn-suche { width: 38px; flex: none; }
  .site-header__actions > .hn-suche input { padding: 0; color: transparent; cursor: pointer; }
  .site-header__actions > .hn-suche input::placeholder { color: transparent; }
  .site-header__actions > .hn-suche .hn-suche__lupe { right: 50%; transform: translate(50%, -50%); }
  .site-header__actions > .hn-suche:focus-within { position: absolute; z-index: 80; right: 0; top: 50%; transform: translateY(-50%); width: min(340px, 40vw); }
  .site-header__actions > .hn-suche:focus-within input { padding: 0 2.2rem 0 0.85rem; color: var(--text); cursor: text; background: var(--color-surface); }
  .site-header__actions > .hn-suche:focus-within input::placeholder { color: var(--text-muted); }
  .site-header__actions > .hn-suche:focus-within .hn-suche__lupe { right: 0.7rem; transform: translateY(-50%); }
  .hn-link { padding: 0 0.6rem; }
}
@media (max-width: 1100px) {
  .haupt-nav, .site-header__actions > .hn-suche { display: none; }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 640px) {
  .site-header__inner { gap: 0.5rem; }
  .site-header__actions { gap: 0.35rem; }
  .held-chip__text, .held-chip__anmelden { display: none; }
  .held-chip, .held-chip--profil { padding: 0 0.45rem; }
  .held-chip--profil { padding: 0.2rem; }
  .xp-pill { padding: 0 0.55rem 0 0.35rem; gap: 0.35rem; }
  /* Handy: Level + Balken bleiben, die Zahl steht im Fenster beim Antippen */
  .xp-pill__lv:not([hidden]) ~ .xp-pill__werte .xp-pill__zahl { display: none; }
  .xp-pill__balken { min-width: 44px; }
}
@media (max-width: 420px) {
  .site-header__actions { gap: 0.25rem; }
  .xp-pill__lv[hidden] ~ .xp-pill__werte { display: none; }
  .xp-pill .icon { width: 1.3rem; height: 1.3rem; }
  /* schmale Handys (390 px): Stern weg, kürzerer Balken – sonst wird der Menü-Knopf abgeschnitten */
  .xp-pill:has(.xp-pill__lv:not([hidden])) > .icon { display: none; }
  .xp-pill__balken { min-width: 30px; }
  /* Abmelden steht dann nur auf der Begleiterseite (Profilbild führt dorthin) – sonst ist die Leiste zu breit */
  .site-header [data-abmelden-kopf] { display: none; }
  .hn-drop__panel--xp { position: fixed; top: calc(var(--header-h) + 4px); left: 16px; right: 16px; width: auto; }
  .save-btn__label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hn-drop__panel, .site-nav { animation: none; } .hn-pfeil { transition: none; } }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: 1.4rem 1.2rem;
  font-size: var(--fs-ui);
}
/* schlank (2026-10-11): Logo links, Stufen als eine Zeile rechts; darunter © + Links */
.site-footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.3rem; }
.site-footer ul a { color: var(--text-muted); text-decoration: none; }
.site-footer ul a:hover { color: var(--primary); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; color: var(--text-muted); font-size: var(--fs-hilfe);
  margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border);
}
.site-footer__bottom > span { margin-right: auto; }
.site-footer__bottom a { color: var(--text-muted); }
.footer-link { padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; text-decoration: underline; cursor: pointer; }
.footer-link:hover { color: var(--text); }

/* ---------- Sichern-Dialog ---------- */
.save-dialog { width: min(520px, calc(100vw - 32px)); padding: 1.6rem; color: var(--text); margin: auto; }
.save-dialog::backdrop { background: rgb(10 14 24 / 0.55); backdrop-filter: blur(2px); }
.save-dialog h2 { font-size: 1.4rem; margin-right: 2rem; }
.save-dialog__close { position: absolute; top: 0.8rem; right: 0.8rem; margin: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 1rem;
}
.field { display: grid; gap: 0.35rem; margin: 1rem 0 1.2rem; font-weight: var(--fw-halbfett); font-size: var(--fs-ui); }
.field input {
  font: inherit; font-weight: 400; padding: 0.7rem 0.9rem; border-radius: var(--radius-s);
  border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
}
.field input:focus { outline: none; border-color: var(--primary); }
.save-dialog__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.save-dialog__load { cursor: pointer; }
.save-dialog__load:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.save-dialog__info { margin-top: 1.4rem; padding: 0.9rem 1rem; border-radius: var(--radius-s); background: var(--primary-soft); font-size: var(--fs-ui); }
.save-dialog__info p { margin: 0 0 0.3rem; }
.save-dialog__info ol { margin: 0; padding-left: 1.2rem; }

/* ---------- Zurück-Link ---------- */
.back { display: block; width: fit-content; margin-bottom: 1rem; font-weight: var(--fw-halbfett); text-decoration: none; color: var(--text-muted); }
.back:hover { color: var(--c, var(--primary)); }

/* ---------- Startseite: Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); }
.hero__accent { color: var(--color-cyan); }
.hero__lead { font-size: 1.15rem; color: var(--text-muted); max-width: 540px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
.hero__art { max-width: 460px; justify-self: center; width: 100%; aspect-ratio: 1; }
.hero__art img { width: 88%; height: auto; animation: float 7s ease-in-out infinite; }
.hero__bubble { position: absolute; top: 6%; left: -4%; z-index: 1; font-weight: var(--fw-halbfett); font-size: var(--fs-ui); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Ferien-Countdown im Hero (HUD-Kästchen) */
.hero__timer { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; align-items: stretch; }
.ferien-timer {
  display: inline-grid; gap: 0.35rem; padding: 0.8rem 1.1rem; align-content: start;
  border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-cyan) 35%, var(--border)); box-shadow: var(--shadow-card);
}
.ferien-timer[hidden] { display: none; }
.ferien-timer p { margin: 0; }
.ferien-timer__label { font-size: var(--fs-meta); font-weight: var(--fw-fett); letter-spacing: 0.02em; text-transform: none; color: var(--color-cyan); }
.ferien-timer__zeit { display: flex; gap: 0.5rem; }
.ferien-timer__zeit span {
  display: grid; justify-items: center; min-width: 3.6rem; padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm); background: var(--color-bg-deep); border: 1px solid var(--border);
}
.ferien-timer__zeit strong { font-family: var(--font-label); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ferien-timer__zeit small { font-size: var(--fs-meta); color: var(--text-muted); text-transform: none; letter-spacing: 0.02em; }
.ferien-timer__info { font-size: var(--fs-meta); color: var(--text-muted); }
.ferien-timer.is-ferien { border-color: color-mix(in srgb, var(--color-gold-bright) 50%, var(--border)); }
.ferien-timer.is-ferien .ferien-timer__label { color: var(--color-gold); }
/* Klausur-Countdown: Violett (wichtiger Termin), am Klausurtag golden */
.klausur-timer { border-color: color-mix(in srgb, var(--color-purple) 45%, var(--border)); }
.klausur-timer .ferien-timer__label { color: var(--color-purple); }
.klausur-timer.is-heute { border-color: color-mix(in srgb, var(--color-gold-bright) 55%, var(--border)); }
.klausur-timer.is-heute .ferien-timer__label { color: var(--color-gold); }
/* Im Hero kompakt als schmale Zeile, damit der Hauptknopf „Jahrgangsstufe wählen“ im Vordergrund bleibt */
.hero__timer { margin-top: 1.2rem; gap: 0.6rem; }
.hero__timer .ferien-timer {
  grid-template-columns: auto auto; align-items: center; column-gap: 0.9rem; row-gap: 0.1rem;
  padding: 0.45rem 0.6rem 0.45rem 0.85rem; background: transparent; box-shadow: none;
}
.hero__timer .ferien-timer__label { grid-column: 1; font-size: var(--fs-meta); }
.hero__timer .ferien-timer__info { grid-column: 1; font-size: var(--fs-meta); }
.hero__timer .ferien-timer__zeit { grid-column: 2; grid-row: 1 / span 2; gap: 0.3rem; }
.hero__timer .ferien-timer__zeit span { min-width: 2.5rem; padding: 0.15rem 0.35rem; }
.hero__timer .ferien-timer__zeit strong { font-size: 1.05rem; }
.hero__timer .ferien-timer__zeit small { font-size: var(--fs-meta); }
/* Ferien als ruhige Textzeile (2026-10-11): kein Kasten, keine Uhr – Klausur-Countdown bleibt als Kästchen */
.ferien-timer.ferien-timer--zeile, .hero__timer .ferien-timer.ferien-timer--zeile {
  display: inline-flex; padding: 0; border: 0; background: none; box-shadow: none;
}
.ferien-timer__zeile { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: var(--fs-hilfe); color: var(--text-muted); }
.ferien-timer__zeile strong { color: var(--text); font-weight: var(--fw-halbfett); }
.ferien-timer__zeile .icon { width: 1.15rem; height: 1.15rem; opacity: .8; }
.ferien-timer__zeile .ferien-timer__info { font-size: inherit; }

/* ---------- Widgets: binäre Uhr, Informatik-Kalender ---------- */
.section--tight { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }

/* Binäre Uhr: 6 Stellenwert-Spalten, eine Zeile je Std/Min/Sek */
.uhr__hinweis { font-size: var(--fs-ui); margin: 0 0 0.8rem; }
.uhr { display: grid; gap: 0.45rem; width: fit-content; max-width: 100%; }
.uhr__zeile { display: grid; grid-template-columns: 2.6rem repeat(6, 1.9rem) 2.4rem; gap: 0.4rem; align-items: center; }
.uhr__kopf span { text-align: center; font: 700 0.72rem var(--font-label); color: var(--text-muted); }
.uhr__name { font-size: var(--fs-meta); font-weight: var(--fw-fett); color: var(--text-muted); text-transform: none; letter-spacing: 0.02em; }
.uhr__zeile i {
  width: 1.9rem; aspect-ratio: 1; border-radius: 50%;
  background: var(--color-bg-deep); border: 1px solid var(--color-border-strong);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.uhr__zeile i.an {
  background: radial-gradient(circle at 40% 35%, #b9f5ff, var(--color-cyan) 60%);
  border-color: var(--color-cyan); box-shadow: 0 0 10px color-mix(in srgb, var(--color-cyan) 55%, transparent);
}
.uhr__wert { font: 800 1.05rem var(--font-label); text-align: right; font-variant-numeric: tabular-nums; visibility: hidden; }
.uhr.zeigt-werte .uhr__wert { visibility: visible; }
.uhr__knopf { margin-top: 0.9rem; }
@media (max-width: 380px) {
  .uhr__zeile { grid-template-columns: 2.2rem repeat(6, 1.55rem) 2rem; gap: 0.3rem; }
  .uhr__zeile i { width: 1.55rem; }
}
.widget { padding: 1.2rem 1.4rem; }
.widget .eyebrow { margin-bottom: 0.6rem; }
.kal { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.kal li { display: grid; gap: 0.1rem; padding-left: 0.8rem; border-left: 3px solid var(--border); }
.kal li.ist-heute { border-left-color: var(--color-gold-bright); }
.kal__wann { font-weight: var(--fw-fett); font-size: var(--fs-ui); color: var(--color-cyan); }
.kal li.ist-heute .kal__wann { color: var(--color-gold); }
.kal__wann small { font-weight: 500; color: var(--text-muted); margin-left: 0.3rem; }
.kal__text { font-size: var(--fs-ui); line-height: 1.45; }
.kal__info { font-size: var(--fs-hilfe); line-height: 1.45; color: var(--text-muted); }
.kal[hidden] { display: none; }  /* sonst überschreibt display:grid das hidden-Attribut */
/* Aufgeklappte Termine scrollen im Kasten, damit er nicht weit über die binäre Uhr hinauswächst */
.kal--mehr { margin-top: 0.7rem; max-height: 14rem; overflow-y: auto; overscroll-behavior: contain; padding-right: 0.4rem; scrollbar-width: thin; }
.kal__knopf { margin-top: 0.9rem; }


/* ---------- Stufenkarten ---------- */
/* Jede Stufe ist eine „Welt“ mit eigenem Tierkreis-Begleiter */
.stufen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.stufe-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
  /* 2.5D: Anheben (--hub) + Kippen zur Maus (--rx/--ry aus site.js) */
  --hub: 0px;
  transform: perspective(900px) translateY(var(--hub)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.stufe-card.is-kippt .stufe-card__img img { transition: transform var(--transition-normal), translate 140ms ease-out; }
.stufe-card.is-kippt { transition: transform 140ms ease-out, border-color var(--transition-normal), box-shadow var(--transition-normal); }
.stufe-card:hover, .stufe-card:focus-visible {
  --hub: -4px; border-color: var(--c); color: var(--text);
  box-shadow: 0 0 0 1px var(--c), 0 14px 34px color-mix(in srgb, var(--c) var(--glow-strength), transparent);
}
.stufe-card__img {
  /* feste Rasterzeile (100 %), damit height: % am Bild greift – sonst wird das Motiv in voller Breite gezeichnet und oben/unten
     abgeschnitten. Motiv unten angesetzt: oben bleibt Platz für Status und Level. */
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; grid-template-rows: minmax(0, 100%);
  place-items: end center; padding-bottom: 3%;
  background:
    radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 34%, transparent), transparent 58%),
    repeating-conic-gradient(from 0deg at 50% 60%, transparent 0deg 9deg, var(--rays-karte) 9deg 10deg),
    var(--color-bg-deep);
}
.stufe-card__img img {
  height: 80%; width: auto; max-width: 92%; object-fit: contain; transform-origin: 50% 100%;
  transition: transform var(--transition-normal), translate var(--transition-slow);
  filter: drop-shadow(0 8px 16px rgb(0 0 0 / 0.45));
}
.stufe-card:hover .stufe-card__img .stufe-card__tier { transform: scale(1.06); }
.stufe-card.is-locked .stufe-card__img img { filter: grayscale(0.8) brightness(0.6) drop-shadow(0 8px 16px rgb(0 0 0 / 0.45)); }
/* Design-Pass 2: Eingang in eine Wissenswelt (Ebenen aus js/start.js) – höheres Bild, weniger leere Fläche */
.stufe-card__img { aspect-ratio: 4 / 3; isolation: isolate;
  background: radial-gradient(70% 60% at 50% 62%, color-mix(in srgb, var(--c) 30%, #12195a), #080d26 78%); }
.stufe-card__img > img { grid-area: 1 / 1; }
.stufe-card__img .stufe-card__inseln { position: absolute; inset: 4% -10% auto; width: 120%; max-width: none; height: auto; opacity: 0.55; z-index: -2; filter: none; }
.stufe-card__img .stufe-card__glow { position: absolute; left: 12%; top: 14%; width: 76%; max-width: none; height: auto; opacity: 0.5; mix-blend-mode: screen; z-index: -1; filter: none; transition: opacity var(--transition-normal); }
.stufe-card__img .stufe-card__tier { height: 88%; }
.stufe-card__img .stufe-card__wolken { position: absolute; left: -8%; right: -8%; bottom: -12%; width: 116%; max-width: none; height: auto; opacity: 0.45; mix-blend-mode: screen; pointer-events: none; filter: none; }
.stufe-card:hover .stufe-card__glow { opacity: 0.85; }
.stufe-card.is-locked .stufe-card__img .stufe-card__inseln, .stufe-card.is-locked .stufe-card__img .stufe-card__wolken,
.stufe-card.is-locked .stufe-card__img .stufe-card__glow { filter: grayscale(1); opacity: 0.25; }
.stufe-card__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Weltkarten im Stil der Tierkreis-Karten (js/start.js, Nutzer-Wunsch 2026-10-08) ----------
   Format 63 : 88 wie eine Sammelkarte, Maße in cqw (wachsen mit der Kartenbreite). Rahmen je Seltenheit = Fortschritt der Welt:
   normal (silber, matt) · selten (blau) · einzigartig (gold, Funkeln) · mythisch (Regenbogen, schimmert). */
@property --winkel { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.stufen-grid:has(.welt-karte) { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.8rem 1.4rem; }
.welt-karte {
  --rahmen: linear-gradient(150deg, #c3c9d2, #9aa2ae 50%, #868e9b); --zier: #aab3c0; --glow: rgb(200 210 225 / 0.25);
  position: relative; display: block; width: 100%; max-width: 340px; justify-self: center; align-self: start; aspect-ratio: 63 / 88; container-type: inline-size;
  /* Kein padding/radius in cqw am Container selbst – cqw bezieht sich dort auf den Vorfahren (bei großen Fenstern riesig).
     Die Rahmenbreite entsteht über den Abstand des Innenteils (cqw = Kartenbreite). */
  padding: 0; border-radius: var(--radius-lg); background: var(--rahmen); color: #e8ecf6; text-decoration: none;
  box-shadow: 0 18px 36px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06);
  --hub: 0px; transform: perspective(900px) translateY(var(--hub)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.welt-karte:hover, .welt-karte:focus-visible { --hub: -5px; color: #fff; box-shadow: 0 26px 50px rgb(0 0 0 / 0.65), 0 0 28px var(--glow); }
.welt-karte.is-kippt { transition: transform 140ms ease-out, box-shadow var(--transition-normal); }
.welt-karte--selten { --rahmen: linear-gradient(150deg, #c6ecff, #2c6df0 35%, #d6f1ff 52%, #1e3fae 75%, #7cc8ff); --zier: #4d9bff; --glow: rgb(70 160 255 / 0.45); }
.welt-karte--einzigartig { --rahmen: linear-gradient(150deg, #fff6c9, #d29a12 32%, #fffbe6 50%, #a46d08 72%, #ffd968); --zier: #f0b429; --glow: rgb(255 200 70 / 0.5); }
.welt-karte--mythisch { --rahmen: conic-gradient(from var(--winkel), #b46cff, #ff5fd2, #ffd36b, #5ee7ff, #7c5cff, #b46cff); --zier: #c48bff; --glow: rgb(190 110 255 / 0.6);
  animation: welt-karte-kreisen 6s linear infinite; }
@keyframes welt-karte-kreisen { to { --winkel: 360deg; } }
.welt-karte__innen {
  position: absolute; inset: 3cqw; display: flex; flex-direction: column; gap: 2cqw; padding: 2.6cqw 2.8cqw 2.4cqw; border-radius: 2.6cqw;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #1d2740) 0%, #0f1424 38%, #0b0f1c 100%);
  box-shadow: inset 0 0 0 0.5cqw rgb(0 0 0 / 0.35), inset 0 0 0 0.9cqw color-mix(in srgb, var(--zier) 45%, transparent);
}
.welt-karte__kopf { display: flex; align-items: center; gap: 2.4cqw; }
.welt-karte__kuerzel { flex: none; min-width: 11cqw; height: 9.5cqw; padding: 0 1.8cqw; border-radius: 2cqw; display: grid; place-items: center;
  font-family: Georgia, "Times New Roman", serif; font-weight: var(--fw-fett); font-size: 4.4cqw; white-space: nowrap; color: #0b0f1c; background: var(--rahmen); }
.welt-karte__name { flex: 1; min-width: 0; line-height: 1.08; }
.welt-karte__name b { display: block; font-size: 6cqw; font-weight: var(--fw-fett); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0.4cqw 0 rgb(0 0 0 / 0.5); }
.welt-karte__name small { display: block; margin-top: 0.6cqw; font-family: var(--font-mono); font-size: 3.1cqw; letter-spacing: 0.12em; text-transform: uppercase; color: #94a0b8; }
.welt-karte__zeichen { flex: none; width: 11.5cqw; height: 11.5cqw; border-radius: 50%; display: grid; place-items: center;
  font-family: "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", serif; font-weight: var(--fw-halbfett); font-size: 6.2cqw; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 85%, #fff), color-mix(in srgb, var(--c) 40%, #000) 75%);
  box-shadow: 0 0 0 0.6cqw rgb(0 0 0 / 0.4), 0 0 0 1cqw var(--zier); text-shadow: 0 0.3cqw 0.6cqw rgb(0 0 0 / 0.6); }
/* Bildfenster: dieselben Ebenen wie zuvor (Inseln → Lichtschein → Tier → Wolken) */
.welt-karte__bild.stufe-card__img { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; border-radius: 1.8cqw; padding-bottom: 2%;
  box-shadow: 0 0 0 0.7cqw rgb(0 0 0 / 0.55), 0 0 0 1.2cqw var(--zier); }
.welt-karte__bild .stufe-card__tier { height: 92%; }
.welt-karte:hover .welt-karte__bild .stufe-card__tier { transform: scale(1.05); }
.welt-karte__status { position: absolute; top: 2.4cqw; left: 2.4cqw; z-index: 1; font-size: 2.9cqw; }
.welt-karte__typ { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 3.5cqw; line-height: 1.35;
  font-style: italic; color: #b9c2d6; text-align: center; padding: 0 1cqw; min-height: calc(3.5cqw * 1.35 * 2); }
.welt-karte__werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqw; }
.welt-karte__werte > span { display: grid; gap: 0.3cqw; padding: 1.4cqw 1.6cqw; border-radius: 1.6cqw; text-align: center;
  background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.08); }
.welt-karte__werte small { font-family: var(--font-mono); font-size: 2.6cqw; letter-spacing: 0.1em; text-transform: uppercase; color: #94a0b8; }
.welt-karte__werte b { font-size: 4.6cqw; font-variant-numeric: tabular-nums; color: #fff; }
.welt-karte__balken { display: block; height: 1.4cqw; border-radius: 1cqw; background: rgb(255 255 255 / 0.09); overflow: hidden; }
.welt-karte__balken span { display: block; height: 100%; width: 0; background: var(--c); border-radius: inherit; transition: width 0.6s ease; }
.welt-karte__fuss { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 2.9cqw;
  letter-spacing: 0.08em; text-transform: uppercase; color: #94a0b8; }
.welt-karte__fuss [data-stufe-seltenheit] { color: var(--zier); font-weight: var(--fw-halbfett); }
.welt-karte__los { color: var(--c); font-weight: var(--fw-halbfett); text-transform: none; letter-spacing: 0.02em; font-family: var(--font); font-size: 3.4cqw; }
.welt-karte:hover .welt-karte__los { text-decoration: underline; text-underline-offset: 3px; }
/* Funkeln/Schimmer erst ab „einzigartig“ */
.welt-karte--einzigartig .welt-karte__bild::after, .welt-karte--mythisch .welt-karte__bild::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.16) 45%, transparent 60%); mix-blend-mode: screen; }
.welt-karte.is-locked { --rahmen: linear-gradient(150deg, #5d6472, #3c424e); }
.welt-karte.is-locked .stufe-card__tier { filter: grayscale(0.8) brightness(0.55); }
@media (prefers-reduced-motion: reduce) { .welt-karte--mythisch { animation: none; } }
.stufe-card__los { font-weight: var(--fw-fett); color: var(--c); }
.stufe-card:hover .stufe-card__los { text-decoration: underline; text-underline-offset: 3px; }
.stufe-card__status { position: absolute; top: 0.7rem; left: 0.7rem; z-index: 1; }
.stufe-card__body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.stufe-card__head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.stufe-card__head h3 { margin: 0; font-size: 1.45rem; color: var(--c); }
.stufe-card__name { margin: 0; font-weight: var(--fw-halbfett); }
.stufe-card__desc { font-size: var(--fs-ui); margin: 0 0 0.5rem; flex: 1; }
.stufe-card__meta { margin: 0.2rem 0 0; font-size: var(--fs-hilfe); color: var(--text-muted); display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- So lernst du hier ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { position: relative; padding: 1.6rem 1.5rem 1.2rem; }
.step__nr { position: absolute; top: 1rem; right: 1.2rem; font-family: var(--font-label); font-weight: var(--fw-fett); font-size: 1.6rem; color: var(--border); }
.center-cta { text-align: center; margin-top: 2.5rem; }

/* ---------- Spielstand ---------- */
.continue { display: grid; grid-template-columns: 220px 1fr; overflow: hidden; }
.continue__stats {
  padding: 1.6rem; border-right: 1px solid var(--border);
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--color-gold-bright) 14%, transparent), transparent 70%), var(--primary-soft);
}
.continue__xp { font-size: 3rem; font-weight: var(--fw-fett); line-height: 1; font-family: var(--font-display); color: var(--color-gold); }
.continue__xp small { font-size: 1rem; margin-left: 0.3rem; color: var(--text-muted); }
.continue__main { padding: 1.6rem 1.8rem; }
.continue__main h2 { font-size: 1.5rem; }

/* ---------- Bottom-CTA ---------- */
.bottom-cta { background-color: var(--primary-soft); text-align: center; }
.bottom-cta__inner { max-width: 640px; }
.bottom-cta p { color: var(--text-muted); font-size: 1.1rem; }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { max-width: 280px; order: -1; }   /* Mobil: Figur klein, Inhalt bleibt vorn */
  .hero__bubble { display: none; }
  .steps { grid-template-columns: 1fr; }
  .continue { grid-template-columns: 1fr; }
  .continue__stats { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ---------- Stufenseite (Welt) ---------- */
.stufe-hero { padding-block: clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--border); overflow: hidden; }
.stufe-hero__inner { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 2.5rem; align-items: center; }
.stufe-hero__lead { font-size: 1.12rem; color: var(--text-muted); max-width: 520px; }
.stufe-hero__stats { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.stufe-hero__bar { max-width: 420px; margin-top: 1rem; }
.stufe-hero__art { width: min(100%, 340px); aspect-ratio: 1; justify-self: center; }
.stufe-hero__art img { width: 80%; height: auto; }
/* Redesign 2.0 (2026-10-11): ruhiger Stufen-Kopf ohne Weltbild-Ebenen – Text links, Welt-Tier (Meister-Form) rechts,
   dezenter Lichtschein in der Weltfarbe. Alte Ebenen (Himmel, Inseln, Landmarken, Wolken) archiviert. */
/* Variante C (2026-10-19): kompakter Kopf ohne Lichtschein; dezentes Rastermotiv rechts (wie .muster-raster in style.css) */
.stufe-hero { position: relative; isolation: isolate; min-height: 0; display: grid; align-items: center; padding-block: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--color-bg); }
/* Iteration 3: Muster = gemeinsames geometrisches Hintergrundsystem (.muster-geo in style.css, Selektor dort mitgeführt) */
.stufe-hero .stufe-hero__inner { position: relative; }
.stufe-hero h1 { margin-bottom: 0.4rem; }
.stufe-hero__art { width: min(100%, 380px); filter: drop-shadow(0 14px 20px rgb(0 0 0 / 0.28)); }
.stufe-hero__art img { width: 100%; height: auto; }
.stufe-hero__los { margin: 0.3rem 0 1rem; }
/* „Dein Stand“ rechts im Stufen-Kopf (ersetzt Welt-Tier und den Kasten „Aktuelle Reihe“, 2026-10-11) */
.stufe-stand { display: grid; gap: 0.9rem; padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.stufe-stand__kopf { display: flex; align-items: center; gap: 1rem; }
.stufe-stand__ring {
  --p: 0; flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--progress) calc(var(--p) * 1%), var(--color-bg-soft) 0);
}
.stufe-stand__ring > span { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--color-surface); line-height: 1.05; }
.stufe-stand__ring strong { font-family: var(--font-label); font-weight: var(--fw-mittel); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stufe-stand__ring small { font-size: var(--fs-meta); color: var(--text-muted); }
.stufe-stand__titel { margin: 0 0 0.35rem; font-weight: var(--fw-halbfett); }
.stufe-stand__werte { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.stufe-stand__aktuell {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; border-radius: var(--radius-md); text-decoration: none; color: var(--text);
  background: var(--color-surface-raised); border: 1px solid var(--border); border-left: 2px solid var(--nav-aktiv);
}
.stufe-stand__aktuell:hover { color: var(--text); border-color: var(--nav-aktiv); }
.stufe-stand__symbol { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: none; }
.stufe-stand__symbol .icon { width: var(--icon-inhalt); height: var(--icon-inhalt); }
.stufe-stand__text { display: grid; gap: 0.1rem; flex: 1; min-width: 0; }
.stufe-stand__text small { font-size: var(--fs-meta); font-weight: var(--fw-halbfett); color: var(--text-muted); text-transform: none; letter-spacing: 0.02em; }
.stufe-stand__text strong { font-size: 0.98rem; }
.stufe-stand__text .muted { font-size: var(--fs-meta); }
.stufe-stand__wege { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.stufe-stand__wege a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-hilfe); font-weight: var(--fw-mittel); text-decoration: none; color: var(--text); }
.stufe-stand__wege a:hover { text-decoration: underline; }
.stufe-stand__wege .icon { width: 1.3rem; height: 1.3rem; }
.stufe-hero--ruhig { min-height: 0; }
/* Lernort-Bühne: aktuelle Mission als Übergang von der Welt in den Unterricht (js/stufe.js) */
.lernort-buehne { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; max-width: 980px; margin: 0 0 2.4rem;
  padding: 1rem 1.6rem 1rem 1rem; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--panel-border));
  background: radial-gradient(60% 90% at 25% 50%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), var(--panel-bg);
  box-shadow: var(--shadow-lift), 0 0 30px color-mix(in srgb, var(--c) 14%, transparent); }
.lernort-buehne__bild { position: relative; display: grid; place-items: center; min-height: 240px; }
.lernort-buehne__bild img { grid-area: 1 / 1; max-width: 100%; }
/* Icon der Reihe auf Fläche in Regionsfarbe (statt Lernort-Insel) */
.lernort-buehne__bild--icon { min-height: 220px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: radial-gradient(70% 80% at 50% 100%, color-mix(in srgb, var(--r, var(--c)) 34%, transparent), transparent 70%), var(--color-bg-soft); }
.lernort-buehne__bild--icon .icon { width: 120px; height: 120px; }
.lernort-buehne__ort { width: 100%; max-height: 300px; object-fit: contain; filter: drop-shadow(0 16px 22px rgb(0 0 20 / 0.5)); animation: welt-schweben 11s ease-in-out infinite; }
.lernort-buehne__text h2 { margin: 0 0 0.3rem; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.lernort-buehne__text .eyebrow { color: var(--c); }
.lernort-buehne__stand { display: flex; align-items: center; gap: 0.6rem; font-size: var(--fs-hilfe); color: var(--text-muted); }
@media (max-width: 760px) { .lernort-buehne { grid-template-columns: 1fr; padding: 1rem; } .lernort-buehne__bild { min-height: 180px; } }

/* Quest-Stationen: Regionssymbole und Status-Symbole, leuchtender Pfad */
.quest__symbol { width: 72%; height: 72%; object-fit: contain; }
.quest--locked .quest__symbol { filter: grayscale(0.9) brightness(0.6); }
.quest__st { display: inline-block; width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.35em; }
.map-legend img.quest__st { margin-right: 0.15rem; }
.notice { margin-bottom: 2.8rem; max-width: 620px; }
.map-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 1.5rem; max-width: 820px; margin-bottom: 1.6rem; }
.map-title { margin: 0; }
.map-legend { display: flex; gap: 1rem; font-size: var(--fs-hilfe); margin: 0; }

/* Quest-Karte: vertikaler Pfad mit Knoten */
.quest-map { --node: 48px; list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 0.9rem; max-width: 820px; }
.quest-map::before {
  content: ""; position: absolute; left: calc(var(--node) / 2 - 1px); top: 18px; bottom: 120px; width: 2px; border-radius: 2px;
  /* ruhiger Pfad (2026-10-11): schlichte Linie in Rahmenfarbe, kein Leuchten, kein Farbverlauf */
  background: var(--color-border-strong);
}
.quest-start { display: grid; grid-template-columns: var(--node) 1fr; }
.quest-start__node {
  justify-self: center; position: relative; z-index: 1;
  padding: 0.25rem 0.7rem; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--c); color: var(--c);
  font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); text-transform: none;
}
.quest {
  position: relative; display: grid; grid-template-columns: var(--node) 1fr auto; align-items: center; gap: 1rem;
  color: var(--text); text-decoration: none; border-radius: var(--radius);
}
.quest:hover { color: var(--text); }
.quest__node {
  position: relative; z-index: 1; width: var(--node); height: var(--node); display: grid; place-items: center; font-size: 1.3rem;
  background: var(--background); border: 2px solid var(--border-strong); border-radius: 50%;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.quest__check {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-meta); font-weight: var(--fw-fett);
  background: var(--color-success); color: var(--color-bg-deep); border: 2px solid var(--bg);
}
/* Design System 2.0 (2026-10-19): Reihe = Zeile an der Linie, keine eigene Karte; Zustand über Knoten-Form + Statustext */
.quest__body {
  display: grid; gap: 0.15rem; background: none; border: 0; border-radius: var(--radius-md); padding: 0.5rem 0.75rem;
  transition: background var(--transition-fast);
}
a.quest:hover .quest__body { background: var(--surface); }
a.quest:hover .quest__title { color: var(--nav-aktiv); }
.quest:focus-visible { outline-offset: 4px; }
.quest__nr { font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.quest__title { font-weight: var(--fw-halbfett); font-size: 1.0625rem; transition: color var(--transition-fast); }
.quest__status .status { padding: 0; border: 0; background: none; }
.quest__kurz { font-size: var(--fs-ui); color: var(--text-muted); }
.quest__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin-top: 0.35rem; font-size: var(--fs-meta); color: var(--text-muted); }

/* Zustände */
/* abgeschlossen zurückhaltend (grüner Haken), aktuell deutlich (blauer Ring, ohne Puls/Leuchten) */
/* Formen: nicht begonnen = Ring · aktuell = kräftiger blauer Ring + Hof · abgeschlossen = grüner Ring + Haken · gesperrt = gestrichelt */
.quest.is-done .quest__node { border-color: var(--color-success); }
/* Variante C: aktuelle Reihe = dezente Fläche + schmale Akzentlinie links, Knoten ohne Hof (Iteration 3: --nav-aktiv statt Blau) */
.quest.is-current .quest__node { border-color: var(--nav-aktiv); border-width: 2px; box-shadow: none; }
.quest.is-current .quest__body { background: var(--surface); box-shadow: inset 2px 0 0 var(--nav-aktiv); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.quest.is-current .quest__nr { color: var(--nav-aktiv); }
@keyframes quest-puls { from { transform: scale(0.95); opacity: 0.8; } to { transform: scale(1.3); opacity: 0; } }
.quest--locked .quest__node { background: var(--background); border-style: dashed; border-color: var(--border-strong); font-size: 1.1rem; box-shadow: none; }
.quest--locked .quest__body { background: none; box-shadow: none; }
.quest--locked .quest__title, .quest--locked .quest__nr { color: var(--text-muted); }

/* Kapitel: eigene Abschnitte mit kurzem Pfad, untereinander unabhängig */
.map-hinweis { max-width: 820px; margin: -0.8rem 0 1.4rem; font-size: var(--fs-ui); }
.quest-kapitel-liste { display: grid; gap: 2rem; max-width: 820px; }
.quest-kapitel { padding: 1.25rem 0 0; border-top: 1px solid var(--border-strong); }
.quest-kapitel.is-done { border-top-color: var(--color-success); }
.quest-kapitel__kopf {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.3rem 0.9rem; margin-bottom: 1rem;
}
.quest-kapitel__icon { width: var(--icon-reihe); height: var(--icon-reihe); display: grid; place-items: center; font-size: 1.4rem; }
.quest-kapitel__nr { margin: 0; font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.quest-kapitel__kopf > .status { padding: 0; border: 0; background: none; font-family: var(--font-label); }
.quest-kapitel__text h3 { margin: 0; font-size: 1.25rem; }
.quest-kapitel__bar { grid-column: 1 / -1; height: 4px; border: 0; }
.quest-map--kapitel { max-width: none; }
.quest-map--kapitel::before { top: 24px; bottom: 24px; }
.quest-map--kapitel:has(> li:only-child)::before { display: none; }
.quest-kapitel-liste > .quest-boss { margin-top: 0.4rem; }
.quest-kapitel__icon img { width: 100%; height: 100%; object-fit: contain; }

/* Wissensprüfung am Ende des Pfads (2026-10-11): Elementarhüter, ruhiger Rahmen; Elementfarbe nur als Schein hinter der Figur */
.quest-boss { margin-top: 0.8rem; }
.boss {
  position: relative; display: grid; grid-template-columns: 180px 1fr; gap: 1.4rem; align-items: center;
  padding: 1.2rem 1.4rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.quest-boss.is-ready .boss { border-color: color-mix(in srgb, var(--color-primary) 55%, var(--border)); }
.boss__art { position: relative; aspect-ratio: 1; display: grid; place-items: center; isolation: isolate; }
.boss__art::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%; z-index: -1;
  background: none;   /* Variante C: Figur ohne Lichtschein, die Prüfung selbst steht im Vordergrund */
}
.boss__art img { width: 100%; height: auto; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgb(0 0 0 / 0.28)); }
.quest-boss:not(.is-ready) .boss__art img { filter: saturate(0.55) drop-shadow(0 8px 14px rgb(0 0 0 / 0.22)); opacity: 0.85; }
.boss__platzhalter { display: none; }
.boss__art.is-leer::after {
  content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 2px dashed var(--border); z-index: -1;
}
.boss__art.is-leer .boss__platzhalter { display: block; color: var(--text-muted); font-size: var(--fs-meta); font-weight: var(--fw-halbfett); text-align: center; padding: 1rem; }
.boss__label { margin: 0 0 0.2rem; font: 500 var(--fs-meta) var(--font-label); text-transform: none; color: var(--text-secondary); }
.boss__text h3 { font-size: 1.45rem; margin-bottom: 0.3rem; }
.boss__text .progress { max-width: 360px; margin-top: 0.4rem; }
.boss__meta { margin: 0.7rem 0 0; }

@media (max-width: 860px) {
  .stufe-hero__inner { grid-template-columns: 1fr; }
  .stufe-hero__art { width: min(55%, 220px); order: -1; }
}
@media (max-width: 560px) {
  .quest-map { --node: 40px; }
  .quest { grid-template-columns: var(--node) 1fr; gap: 0.75rem; }
  .quest__node { font-size: 1.25rem; }
  .quest__status { grid-column: 2; }
  .boss { grid-template-columns: 1fr; text-align: center; padding: 1.2rem; }
  .boss__art { width: 150px; justify-self: center; }
  .boss__text .progress { margin-inline: auto; }
}

/* ---------- Login ---------- */
.gate {
  min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; padding-block: 3rem;
  position: relative; isolation: isolate; overflow: hidden;
}
/* Kein Tier im Hintergrund der Passwortseite (Nutzer 2026-10-11) */
.gate__card { width: min(440px, 100%); padding: 2rem 1.8rem; text-align: center; margin-inline: auto; }
.gate__card h1 { font-size: 1.8rem; }
.gate__field input {
  width: 100%; font: inherit; font-size: 1.1rem; text-align: center;
  padding: 0.85rem 1rem; border-radius: var(--radius-pill);
  border: 2px solid var(--border); background: var(--surface-2); color: var(--text);
}
.gate__field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-cyan) 45%, transparent); }
.gate__error { color: var(--error); font-weight: var(--fw-halbfett); font-size: var(--fs-ui); margin: 0.7rem 0 0; }
.gate__btn { width: 100%; margin-top: 1rem; }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- Rechtliches ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }

/* ---------- Reihen-Kopf & Kapitel-Navigation ---------- */
.reihe-hero { padding-block: clamp(2rem, 5vw, 3.2rem) 2rem; border-bottom: 1px solid var(--border); }
.reihe-hero__sub { font-size: 1.15rem; color: var(--text-muted); max-width: 640px; }
.chapters {
  position: sticky; top: var(--header-h); z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.chapters ol { list-style: none; margin: 0; padding: 0.55rem 0; display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: thin; counter-reset: kap; }
.chapters a {
  counter-increment: kap;
  display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: var(--fs-hilfe); font-weight: var(--fw-halbfett);
}
.chapters a::before {
  content: counter(kap);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c, var(--primary)); color: var(--bg); font-size: var(--fs-meta); font-weight: var(--fw-fett);
}
.chapters a:hover { border-color: var(--c, var(--primary)); }
.reihe-content { max-width: 880px; padding-bottom: 4rem; }
.reihe-content section[id] { scroll-margin-top: calc(var(--header-h) + 64px); }

/* ---------- Reihen-Navigation links (Kurs-Layout und ältere Reihen, js/reihe-nav.js) ---------- */
.kn-gruppe {
  /* Iteration 2: Hierarchie über Typografie – Etappe (Einheit) = Überschrift halbfett, Kapitel = mittel, Unterkapitel = normal.
     Mono-Kennung „E1“ steht in derselben Spalte wie die Kapitelnummern → keine zusätzliche Einrückung. */
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: baseline; gap: 0.6rem; margin: 1rem 0 0.25rem; padding: 0.85rem 0.55rem 0.15rem;
  border-top: 1px solid var(--border-divider);
  font-size: var(--fs-hilfe); font-weight: var(--fw-halbfett); letter-spacing: 0; text-transform: none; color: var(--text); line-height: 1.4;
}
.kn-gruppe:first-child { border-top: 0; padding-top: 0; margin-top: 0.4rem; }
.kn-gruppe span { flex: none; font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); color: var(--text-muted); }
.kn-kap {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 0.6rem; min-height: 40px;
  padding: 0.4rem 0.55rem; border-radius: var(--radius-s); color: var(--text); text-decoration: none;
  font-size: var(--fs-ui); font-weight: var(--fw-mittel); line-height: var(--lh-ui);
}
.kn-kap:hover { background: var(--surface-2); color: var(--text); }
.kn-nr {
  width: 28px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel);
}
/* Variante C: aktives Kapitel nur mit schmaler Akzentlinie und leichter neutraler Fläche (Iteration 3: --nav-aktiv statt Blau) */
.kn-kap.is-active { background: var(--surface-elevated); color: var(--text); font-weight: var(--fw-halbfett); box-shadow: inset 2px 0 0 var(--nav-aktiv); }
.kn-kap.is-active .kn-nr { background: none; color: var(--nav-aktiv); box-shadow: inset 0 0 0 1px var(--nav-aktiv); }
.kn-ok { color: var(--success); font-weight: var(--fw-fett); }
.kn-ok .icon { width: var(--icon-status); height: var(--icon-status); vertical-align: -0.15em; }
/* Unterkapitel: Linie genau unter der Kapitelnummer, weniger Einrückung, normale Schriftstärke */
.kn-subs { list-style: none; margin: 0.1rem 0 0.5rem calc(0.55rem + 13px); padding: 0 0 0 0.5rem; border-left: 1px solid var(--border); }
.kn-subs a {
  display: grid; grid-template-columns: 2.3rem 1fr; gap: 0.25rem; min-height: 36px; align-items: baseline; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; font-size: var(--fs-hilfe); line-height: 1.4;
}
.kn-subs a span { color: var(--text-muted); font-family: var(--font-label); font-size: var(--fs-meta); padding-top: 0.1em; }
.kn-subs a:hover { background: var(--surface-2); color: var(--text); }
.kn-subs a[aria-current="page"] { background: var(--surface-elevated); color: var(--text); font-weight: var(--fw-halbfett); box-shadow: inset 2px 0 0 var(--nav-aktiv); }
.kn-subs a[aria-current="page"] span { color: var(--nav-aktiv); }
.kn-optional { display: inline-block; margin-left: 0.35rem; padding: 0; border: 0;
  font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); text-transform: none; color: var(--text-muted); vertical-align: baseline; }
.kn-trenner { position: relative; margin: 1.6rem 0.3rem 0.4rem; border-top: 1px dashed var(--border-strong); text-align: center; }
.kn-trenner span { position: relative; top: -0.75em; padding: 0 0.5rem; background: var(--bg); color: var(--text-muted);
  font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); text-transform: none; white-space: nowrap; }
.kn-kap:has(.kn-optional) { color: var(--text-secondary); }
/* Gesperrt (Iteration 2): lesbar in Sekundärfarbe + Schloss statt halbtransparent */
.kn-kap.is-gesperrt, .kn-subs a.is-gesperrt { color: var(--text-muted); font-weight: var(--fw-normal); }
.kn-kap.is-gesperrt .kn-ok .icon { opacity: 0.7; }
.kn-kap.is-gesperrt .kn-ok { font-size: 0.8rem; }
.kn-subs a.is-gesperrt { cursor: not-allowed; }
.kn-sub-schloss { margin-left: auto; padding-left: 0.4rem; flex-shrink: 0; }
.kn-sub-schloss .icon { width: var(--icon-xs, 14px); height: var(--icon-xs, 14px); opacity: 0.7; }
/* Gesperrte Etappe: nur die Kopfzeile mit Kapitelzahl und Schloss (js/kurs.js) */
.kn-gruppe.is-zu { color: var(--text-muted); font-weight: var(--fw-mittel); }
.kn-gruppe.is-zu span { color: var(--text-muted); }
.kn-gruppe .kn-gruppe__zu { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem;
  font-style: normal; font-size: var(--fs-meta); font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.kn-gruppe .kn-gruppe__zu[hidden], .kn-kap[hidden] { display: none; }
.kn-gruppe__zu .icon { width: var(--icon-status); height: var(--icon-status); opacity: 0.6; }
.kn-kap.kn-neu { animation: kn-auf 300ms ease-out; }
@keyframes kn-auf { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kn-kap.kn-neu { animation: none; } }

/* Einklappen (Knopf oben in der Navigation) und Ausklappen (Lasche am linken Rand) */
.nav-einklappen {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 0.4rem; width: 100%;
  margin: -0.4rem 0 0.4rem; padding: 0.45rem 0.5rem; border: 0; border-radius: var(--radius-s);
  background: var(--bg); color: var(--text-muted); font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-halbfett); cursor: pointer;
}
.nav-einklappen:hover { background: var(--surface-2); color: var(--text); }
.nav-griff {
  position: fixed; z-index: 45; left: 0; top: 50%; transform: translateY(-50%); display: none;
  writing-mode: vertical-rl; align-items: center; gap: 0.5rem; padding: 1rem 0.5rem;
  border: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-card);
  font: inherit; font-size: var(--fs-ui); font-weight: var(--fw-fett); letter-spacing: 0.04em; cursor: pointer;
}
.nav-griff:hover { background: var(--interactive-hover); color: var(--on-primary); }
@media (min-width: 901px) {
  .nav-zu { --nav-w: 0px; }
  .nav-zu .kurs__nav, .nav-zu .rn__nav { visibility: hidden; overflow: hidden; padding: 0; border: 0; }
  .nav-zu > .nav-griff { display: flex; }
  .nav-zu .kurs__menu { display: inline-flex; }
  .nav-zu .kurs__main { padding-left: 3rem; }
  .nav-zu .rn > .reihe-content { padding-left: max(3rem, var(--gutter, 16px)); }
}

/* Ältere Reihen (Blöcke + Lektionen): Navigation links statt Leiste oben */
.rn { max-width: 1640px; margin-inline: auto; display: grid; grid-template-columns: var(--nav-w, 250px) minmax(0, 1fr); align-items: start; }
.rn__nav {
  position: sticky; top: var(--header-h); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 1rem 0.6rem 2.5rem; border-right: 1px solid var(--border); scrollbar-width: thin;
}
.rn > .reihe-content { width: 100%; }
.rn .reihe-content section[id], .rn .lektion[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (max-width: 1280px) { .rn { grid-template-columns: var(--nav-w, 240px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .rn { grid-template-columns: minmax(0, 1fr); }
  .rn__nav {
    position: fixed; z-index: 60; top: var(--header-h); left: 0; bottom: 0; width: min(310px, 86vw); max-height: none;
    background: var(--bg); border-right: 1px solid var(--border); box-shadow: var(--shadow-overlay);
    transform: translateX(-105%); transition: transform 0.25s ease; visibility: hidden;
  }
  .nav-open .rn__nav { transform: none; visibility: visible; }
  /* Handy: runder Knopf unten links öffnet die Navigation */
  .nav-griff {
    display: flex; writing-mode: horizontal-tb; top: auto; transform: none; left: 12px; bottom: 12px; padding: 0.55rem 0.9rem;
    border-radius: var(--radius-pill); box-shadow: var(--shadow-overlay);
  }
  .nav-open > .nav-griff { display: none; }
  /* nur EIN Kapitel-Knopf: der schwebende bleibt beim Scrollen erreichbar, der in der Kopfleiste entfällt */
  main:has(> .nav-griff) .kurs__menu { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rn__nav { transition: none; } }

/* ---------- Navigation der Spielwelt (D.spielNav, js/begleiter.js): Begleiter, Trainingshalle, Hüter, Album, Spiele ---------- */
.spiel-nav { margin: 0 0 1.2rem; }
.spiel-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.spiel-nav a {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.85rem 0.25rem 0.3rem; border-radius: var(--radius-pill); text-decoration: none;
  color: var(--color-text); background: var(--panel-bg); border: 1px solid var(--panel-border); font-weight: var(--fw-halbfett); font-size: var(--fs-ui);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.spiel-nav__bild { width: 1.9rem; height: 1.9rem; object-fit: contain; }
@media (max-width: 640px) {
  .spiel-nav { overflow-x: auto; margin-inline: -16px; padding: 0 16px 0.3rem; scrollbar-width: none; }
  .spiel-nav ul { flex-wrap: nowrap; width: max-content; }
  .spiel-nav a { font-size: var(--fs-hilfe); }
}
.spiel-nav a:hover { border-color: var(--color-primary); color: var(--color-text); }
.spiel-nav a[aria-current="page"] { border-color: var(--nav-aktiv); background: var(--nav-aktiv-soft); }
.spiel-nav small { color: var(--color-text-muted); font-weight: 500; }
/* ---------- Hellmodus für Spielwelt-Flächen (Nutzer-Wunsch 2026-10-11: „nicht stimmig“) ----------
   Begleiter-Bühne, Album-Sammlung, Kartenfunde folgen dem Modus. Dunkel bleiben nur die Spielfelder (arena/duell|gogyo),
   die Entwicklungs-Feier und die Hüter-Kampfbühne mit Hintergrundbild. */
/* Design System 2.0: Bühne in beiden Modi ruhige Fläche (css/held.css), hier nur der weichere Schatten der Figur */
:root:not([data-theme-current="dark"]) .beg-buehne-gross__figur img { filter: drop-shadow(0 14px 18px rgb(23 38 61 / 0.28)); }
:root:not([data-theme-current="dark"]) .beg-buehne-gross__glow, :root:not([data-theme-current="dark"]) .beg-buehne-gross__partikel { mix-blend-mode: multiply; opacity: 0.18; }
:root:not([data-theme-current="dark"]) .beg-buehne-gross__hinweis { background: rgb(255 255 255 / 0.9); color: var(--color-text); }
/* Album: Sammlung und neue Funde als helle Fläche – die Karten selbst behalten ihr Papier-Design */
:root:not([data-theme-current="dark"]) .album-platz.ist-leer .hk { filter: grayscale(1) opacity(0.38); }
:root:not([data-theme-current="dark"]) .album-platz.ist-leer:hover .hk { filter: grayscale(.5) opacity(0.65); }

/* Ranglisten (2026-10-19, js/rangliste.js): Begleiter-Seite, Spiele, Lehrerbereich */
.rangliste-box { margin-top: 1.5rem; }
.rangliste-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.rangliste-mehr { margin-top: 0.9rem; }
.rangliste { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.rangliste__zeile { display: grid; grid-template-columns: 2.4rem auto 1fr auto; align-items: center; gap: 0.6rem;
  padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--color-surface); min-width: 0; }
.rangliste__zeile.ist-vorn .rangliste__platz { color: var(--color-gold); }
.rangliste__zeile.ist-ich { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
.rangliste__platz { font-weight: var(--fw-fett); text-align: right; font-variant-numeric: tabular-nums; }
.rangliste__bild { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; }
.rangliste__bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rangliste__name { min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.rangliste__name small { color: var(--color-text-muted); font-size: var(--fs-meta); }
.rangliste__wert { font-weight: var(--fw-halbfett); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rangliste__luecke { text-align: center; color: var(--color-text-muted); line-height: 1; }
.rangliste__hinweis, .rangliste__mein { font-size: var(--fs-hilfe); margin: 0.3rem 0; }

/* ---------- Rechtliches (datenschutz/, 2026-10-20) ----------
   Lesespalte max. 800 px; oben „Auf einen Blick“ als Panel, Abschnitte nur mit Trennlinie (keine Fläche in der Fläche). */
.recht { max-width: 800px; }
.recht p, .recht li { line-height: var(--lh-lern); }
.recht ul { padding-left: 1.3rem; margin: 0 0 0.9rem; }
.recht li { margin-bottom: 0.35rem; }
.recht__kurz { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.recht__kurz li { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; padding: 1rem 1.1rem; line-height: var(--lh-ui); border-left: 1px solid var(--border-divider); }
.recht__kurz li:first-child { border-left: 0; }
.recht__kurz .muted { font-size: var(--fs-hilfe); }
@media (max-width: 719px) {
  .recht__kurz li { border-left: 0; border-top: 1px solid var(--border-divider); }
  .recht__kurz li:first-child { border-top: 0; }
}
.recht__inhalt { margin: 0 0 2rem; }
.recht__inhalt .eyebrow { margin-bottom: 0.4rem; }
.recht__inhalt ol { margin: 0; padding-left: 1.4rem; columns: 2 14rem; column-gap: 2rem; }
.recht__inhalt li { margin-bottom: 0.2rem; }
.recht__abschnitt { padding-top: 1.75rem; margin-top: 1.75rem; border-top: 1px solid var(--border-divider); scroll-margin-top: 5rem; }
.recht__abschnitt h2 { font-size: 1.3rem; margin: 0 0 0.75rem; display: flex; align-items: baseline; gap: 0.6rem; }
.recht__nr { font-family: var(--font-label); font-size: var(--fs-meta); font-weight: var(--fw-mittel); color: var(--text-secondary); min-width: 1.4rem; }
.recht__hinweis { padding: 0.9rem 1.1rem; border-left: 3px solid var(--link); background: var(--surface-sunken); border-radius: var(--radius-sm); }
.recht__stand { font-size: var(--fs-meta); margin-top: 1.5rem; }

