/* Ausbildung – ruhig, klar; Schriften der Erklärvideos (OFL, selbst gehostet). Mobil zuerst, Hell/Dunkel nach System. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/static/schriften/bricolage-grotesque-v1001.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/static/schriften/hanken-grotesk-v3013.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #eceff3;
  --flaeche: #ffffff;
  --flaeche-2: #f4f6f8;
  --fuellung: rgba(118, 118, 128, 0.12);
  --fuellung-stark: rgba(118, 118, 128, 0.2);
  --text: #0e1620;
  --text-2: #465361;
  --linie: rgba(14, 22, 32, 0.12);
  --linie-stark: rgba(0, 0, 0, 0.16);
  --feld-rand: #6b7785; /* ≥ 3:1 zu Feld und Karte */
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --schatten-hoch: 0 2px 4px rgba(0, 0, 0, 0.05), 0 14px 36px rgba(0, 0, 0, 0.09);
  --gut: #17692f;
  --schlecht: #b3261e;
  --kopf-bg: rgba(236, 239, 243, 0.84);
  --r-l: 22px;
  --r-m: 14px;
  --r-s: 10px;
  --a1: 4px; --a2: 8px; --a3: 12px; --a4: 16px; --a5: 24px; --a6: 32px; --a7: 48px; --a8: 64px;
  --schrift: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --f-display: "Bricolage Grotesque", "SF Pro Display", "Segoe UI Variable Display", system-ui, sans-serif;
  --gross: clamp(2.125rem, 1.55rem + 2.2vw, 3rem);
  --titel-m: 1.375rem;
  --titel-k: 1.25rem;
  --body: 1.0625rem;
  --klein: 0.9375rem;
  --mini: 0.8125rem;
  --kurz: 180ms;
  --kurve: cubic-bezier(0.2, 0.8, 0.2, 1);
  --breite: 1200px;
  /* Baukasten der Videos, in beiden Modi gleich: Bühne, Tinte, Karton, Senf (Hauptaktion). */
  --buehne: #121c27; --tinte: #0e1620; --karton: #f3eee2; --senf: #e8c468;
  --rand: #6b7785; --kontur: #0e1620; --st-f: #7db8e8; --st-t: light-dark(#0a5cad, #8cc4f2);
  --raster: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M30 23v14M23 30h14' stroke='%23F3EEE2' stroke-opacity='.13' stroke-width='2'/%3E%3Cg fill='%23F3EEE2' fill-opacity='.11'%3E%3Ccircle cx='90' cy='30' r='1.6'/%3E%3Ccircle cx='30' cy='90' r='1.6'/%3E%3Ccircle cx='90' cy='90' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b121a;
    --flaeche: #16212d;
    --flaeche-2: #1d2a38;
    --fuellung: rgba(118, 118, 128, 0.24);
    --fuellung-stark: rgba(118, 118, 128, 0.36);
    --text: #f3eee2;
    --text-2: #aeb9c4;
    --linie: rgba(243, 238, 226, 0.14);
    --linie-stark: rgba(255, 255, 255, 0.2);
    --feld-rand: #8391a0;
    --rand: #8391a0;
    --kontur: #04080c;
    --schatten: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --schatten-hoch: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 14px 36px rgba(0, 0, 0, 0.5);
    --gut: #7adb95;
    --schlecht: #ff6961;
    --kopf-bg: rgba(11, 18, 26, 0.8);
  }
}

/* Akzent je Staffel; Werte auf Kontrast >= 4.5:1 gemessen (Text und Text auf Akzent). */
.akzent-0, .akzent-1 { --akzent: #0066cc; }
.akzent-2 { --akzent: #4f46c8; }
.akzent-3 { --akzent: #00727f; }
.akzent-4 { --akzent: #b04f00; }
.akzent-5 { --akzent: #c01f5b; }
.akzent-6 { --akzent: #476082; }
.akzent-7 { --akzent: #8a36c0; }
.akzent-8 { --akzent: #8a6100; }
/* Staffelfarben aus Entwurf A: --st-f Fläche (trägt Tinte), --st-t Textton je Modus. */
.akzent-0, .akzent-1 { --st-f: #7db8e8; --st-t: light-dark(#0a5cad, #8cc4f2); }
.akzent-2 { --st-f: #aaa5f5; --st-t: light-dark(#4a41c2, #b5b0fa); }
.akzent-3 { --st-f: #6ccad2; --st-t: light-dark(#006b77, #74d2da); }
.akzent-4 { --st-f: #f2a65a; --st-t: light-dark(#a04600, #f5ae66); }
.akzent-5 { --st-f: #f08fb0; --st-t: light-dark(#b81d56, #f59bba); }
.akzent-6 { --st-f: #9fb3cc; --st-t: light-dark(#44597a, #a9bdd8); }
.akzent-7 { --st-f: #c79bf2; --st-t: light-dark(#7e33b3, #cfa6f5); }
.akzent-8 { --st-f: #e8c468; --st-t: light-dark(#775400, #e8c468); }
[class*="akzent-"] {
  --akzent-auf: #ffffff;
  --akzent-weich: color-mix(in srgb, var(--akzent) 11%, transparent);
  --akzent-spur: color-mix(in srgb, var(--akzent) 16%, transparent);
}
@media (prefers-color-scheme: dark) {
  .akzent-0, .akzent-1 { --akzent: #4ea1ff; }
  .akzent-2 { --akzent: #9d97ff; }
  .akzent-3 { --akzent: #3cc8d8; }
  .akzent-4 { --akzent: #ff9f45; }
  .akzent-5 { --akzent: #ff6f9f; }
  .akzent-6 { --akzent: #9fb6dc; }
  .akzent-7 { --akzent: #c792ff; }
  .akzent-8 { --akzent: #e0b44a; }
  [class*="akzent-"] {
    --akzent-auf: #000000;
    --akzent-weich: color-mix(in srgb, var(--akzent) 16%, transparent);
    --akzent-spur: color-mix(in srgb, var(--akzent) 22%, transparent);
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift);
  font-size: var(--body);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere; /* lange deutsche Komposita bei 200 % Text */
}
h1, h2, h3, p { margin: 0; }
/* Silbentrennung nur im Fließtext schmaler Bildschirme und nur bei längeren Wörtern (nicht „DS-GVO“, „Bin-dung“);
   Safari kennt hyphenate-limit-chars nicht, dort greifen die -webkit-Grenzen. */
@media (max-width: 559px) {
  body { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 8 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; }
}
/* Überschriften, Titel und Stichpunkte grundsätzlich nicht automatisch trennen, nur an weichen Trennzeichen;
   overflow-wrap bleibt das Netz. */
h1, h2, h3, .zeile-titel, .sk-titel, .titel-buehne, .bogen li, .lernziel, .blaettern-link { -webkit-hyphens: manual; hyphens: manual; }
/* Schmal: nur sehr lange Komposita (ab 16 Zeichen, je Teil mindestens 7, z. B. „Anwendungs-bereich“) dürfen getrennt
   werden, sonst brächen sie hart mitten im Wort. Nur wo der Browser diese Grenze kennt; sonst bleibt es bei manual. */
@media (max-width: 559px) {
  @supports (hyphenate-limit-chars: 16 7 7) {
    h1, h2, h3, .zeile-titel, .sk-titel, .titel-buehne, .bogen li, .lernziel, .blaettern-link { hyphens: auto; hyphenate-limit-chars: 16 7 7; }
  }
  @supports (-webkit-hyphenate-limit-before: 7) {
    h1, h2, h3, .zeile-titel, .sk-titel, .titel-buehne, .bogen li, .lernziel, .blaettern-link {
      -webkit-hyphens: auto; -webkit-hyphenate-limit-before: 7; -webkit-hyphenate-limit-after: 7;
    }
  }
}
/* Sehr große Textgröße (wenig Platz in em, z. B. 200 % auf dem Handy): lieber mit Trennstrich trennen als mitten im Wort
   hart umbrechen. Container: .lern (lernen.css) sowie Seitenkopf, Videospalte und Blättern. */
.seitenkopf, .video-seite, .blaettern { container-type: inline-size; }
@container (max-width: 15em) {
  h1, h2, h3, .zeile-titel, .sk-titel, .titel-buehne, .bogen li, .lernziel, .blaettern-link {
    -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 10 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4;
  }
}
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon-inline { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-right: 0.25em; }
.icon-gross { width: 44px; height: 44px; color: var(--text-2); }

:focus-visible { outline: 3px solid var(--akzent, #0066cc); outline-offset: 2px; border-radius: 6px; }
.nur-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sprung {
  position: absolute; left: var(--a4); top: var(--a3); z-index: 100; transform: translateY(calc(-100% - 2 * var(--a3) - 40px));
  background: var(--flaeche); color: var(--text); padding: var(--a3) var(--a4);
  border-radius: var(--r-s); box-shadow: var(--schatten-hoch);
}
.sprung:focus { transform: none; }

/* ---------- Kopf und Navigation ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--kopf-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top);
}
.kopf-innen {
  max-width: var(--breite); margin: 0 auto; min-height: 52px;
  padding: 0 max(var(--a5), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: var(--a4);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.015em; min-height: 44px; }
.logo-zeichen, .anmeldung-zeichen { width: 24px; height: 24px; transform: rotate(-90deg); }
.logo-zeichen circle, .anmeldung-zeichen circle { fill: none; stroke: var(--fuellung-stark); stroke-width: 3.2; }
.logo-zeichen .logo-bogen, .anmeldung-zeichen .logo-bogen { stroke: var(--akzent, #0066cc); stroke-linecap: round; }

.nav ul { display: flex; gap: var(--a1); }
.nav a {
  display: inline-flex; align-items: center; gap: var(--a2);
  min-height: 44px; padding: 0 14px; border-radius: 980px;
  color: var(--text-2); font-size: var(--klein); font-weight: 560;
  transition: background-color var(--kurz) var(--kurve), color var(--kurz) var(--kurve);
}
.nav a:hover { color: var(--text); background: var(--fuellung); }
.nav a[aria-current="page"] { color: var(--text); background: var(--fuellung); }

@media (max-width: 719px) {
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--kopf-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--linie);
    padding: 6px var(--a2) calc(6px + env(safe-area-inset-bottom));
  }
  .kopf { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .nav ul { justify-content: space-around; }
  .nav li { flex: 1; min-width: 0; }
  /* Tab-Leiste wächst wie unter iOS nicht mit der Textgröße (sonst seitliches Scrollen bei 200 %). */
  .nav a { flex-direction: column; gap: 2px; width: 100%; padding: 4px 0; border-radius: var(--r-s); font-size: min(0.6875rem, 14px); font-weight: 560; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a .icon { width: 26px; height: 26px; }
  .nav a[aria-current="page"] { background: none; color: var(--akzent); }
  .nav a:hover { background: none; }
  body.mit-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ---------- Inhalt ---------- */
.inhalt {
  flex: 1; width: 100%; max-width: var(--breite); margin: 0 auto;
  padding: var(--a5) max(var(--a5), env(safe-area-inset-left)) var(--a7);
}
.inhalt:focus { outline: none; }
.fuss { text-align: center; padding: var(--a5) var(--a5) var(--a6); font-size: var(--mini); color: var(--text-2); }
.fuss a { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 var(--a3); }
.fuss a:hover { color: var(--text); }

.seitenkopf { padding: var(--a4) 0 var(--a5); display: grid; gap: var(--a2); }
.titel-gross, .titel-mittel, .titel-klein, .abschnitt-titel { font-family: var(--f-display); font-variant-ligatures: no-common-ligatures; }
.titel-gross { font-size: var(--gross); line-height: 1.06; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.titel-video { font-size: min(clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem), max(11cqi, 1.5rem)); }
.titel-mittel { font-size: var(--titel-m); line-height: 1.2; font-weight: 700; letter-spacing: -0.012em; text-wrap: balance; }
.titel-klein { font-size: var(--titel-k); line-height: 1.22; font-weight: 700; letter-spacing: -0.01em; }
.untertitel { font-size: 1.1875rem; line-height: 1.42; color: var(--text-2); max-width: 46ch; text-wrap: pretty; }
.eyebrow { font-size: var(--mini); line-height: 1.38; font-weight: 600; letter-spacing: 0.01em; color: var(--text-2); }
.akzent-text { color: var(--akzent); }
.meta { color: var(--text-2); font-size: var(--klein); }
.zahl { font-variant-numeric: tabular-nums; }
.zahl-dezent { color: var(--text-2); font-weight: 500; margin-left: var(--a1); }
.abschnitt-titel { font-size: var(--titel-k); font-weight: 650; letter-spacing: -0.01em; margin: var(--a7) 0 var(--a3); }
.leer { color: var(--text-2); padding: var(--a5); background: var(--flaeche); border-radius: var(--r-l); }
.hinweis-klein { color: var(--text-2); font-size: var(--klein); text-align: center; }
.zurueck {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -6px;
  color: var(--akzent); font-size: var(--body); width: fit-content;
}
.zurueck:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Karten ---------- */
.karte {
  background: var(--flaeche); border-radius: var(--r-l); box-shadow: var(--schatten);
  padding: var(--a5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a3); align-content: start;
}
@media (min-width: 720px) { .karte { padding: 28px; } }

/* Datenschutzhinweis: Textkarten mit Begriffsliste, gut lesbare Zeilenlänge. */
.text-karte { margin-bottom: var(--a4); max-width: 70ch; }
.text-karte p { line-height: 1.5; text-wrap: pretty; }
.datenliste { display: grid; gap: var(--a1) var(--a4); }
.datenliste dt { font-weight: 600; }
.datenliste dd { color: var(--text-2); line-height: 1.5; margin-bottom: var(--a2); }
@media (min-width: 720px) { .datenliste { grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr); } .datenliste dd { margin-bottom: 0; } }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a2);
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px;
  font-size: var(--body); font-weight: 700; cursor: pointer; text-align: center;
  transition: transform var(--kurz) var(--kurve), filter var(--kurz) var(--kurve), background-color var(--kurz) var(--kurve);
  -webkit-tap-highlight-color: transparent;
}
.knopf:active { transform: scale(0.97); }
.knopf-primaer { background: var(--senf); color: var(--tinte); border: 2.5px solid var(--tinte); box-shadow: 0 4px 0 var(--kontur); }
.knopf-primaer:hover { background: #f0d283; }
.knopf-primaer:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--kontur); background: #ddb752; }
.knopf-zweit { background: var(--fuellung); color: var(--text); }
.knopf-zweit:hover { background: var(--fuellung-stark); }
.knopf-warn { color: var(--schlecht); }
.knopf-klein { min-height: 44px; padding: 0 16px; font-size: var(--klein); }
.knopf-breit { width: 100%; }
.knopf .icon { width: 20px; height: 20px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: var(--a3); align-items: center; }
.knopfreihe form { display: contents; }

/* ---------- Fortschrittsringe und Balken ---------- */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-spur { stroke: var(--akzent-spur, var(--fuellung)); }
.ring-wert { stroke: var(--akzent); stroke-linecap: round; }
.ring-leer .ring-wert { display: none; }
.ring-zahl { position: absolute; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ring-zahl small { font-size: 0.6em; font-weight: 600; margin-left: 1px; color: var(--text-2); }
.ring-s { width: 32px; height: 32px; }
.ring-s circle { stroke-width: 6; }
.ring-m { width: 64px; height: 64px; }
.ring-m .ring-zahl { font-size: min(1rem, 18px); } /* Zahl im Ring wächst nicht über den Ring hinaus */
.ring-l { width: 92px; height: 92px; }
.ring-l .ring-zahl { font-size: min(1.375rem, 24px); }
.ring-xl { width: 148px; height: 148px; }
.ring-xl circle { stroke-width: 4.2; }
.ring-xl .ring-zahl { font-size: min(2.25rem, 40px); }

.balken { display: block; width: 100%; height: 6px; }
.balken svg { width: 100%; height: 6px; overflow: visible; }
.balken-spur { fill: var(--akzent-spur, var(--fuellung)); }
.balken-wert { fill: var(--akzent); }

/* ---------- Start ---------- */
.start-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a4); }
@media (min-width: 820px) { .start-raster { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.gesamt { justify-items: center; text-align: center; align-content: center; gap: var(--a4); }
/* Schmal: Gesamtfortschritt als kompakte Zeile, damit die Staffeln früher sichtbar sind. */
@media (max-width: 819px) {
  .gesamt { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; column-gap: var(--a4); row-gap: 2px; align-items: center; }
  .gesamt > h2 { grid-column: 2; grid-row: 1; align-self: end; }
  .gesamt > .ring { grid-column: 1; grid-row: 1 / span 2; width: 72px; height: 72px; }
  .gesamt > .ring .ring-zahl { font-size: min(1.125rem, 20px); }
  .gesamt > .meta { grid-column: 2; grid-row: 2; align-self: start; }
}

.pfeil { color: var(--text-2); width: 18px; height: 18px; }

/* ---------- Zeilen (gruppierte Listen) ---------- */
.zeilen { background: var(--flaeche); border-radius: var(--r-l); box-shadow: var(--schatten); overflow: hidden; }
.zeilen > li + li { border-top: 1px solid var(--linie); }
.zeile {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px var(--a4) 14px 18px;
  transition: background-color var(--kurz) var(--kurve);
}
a.zeile:hover { background: var(--flaeche-2); }
a.zeile:active { background: var(--fuellung); }
.zeile:focus-visible { outline-offset: -3px; border-radius: 0; }
.zeile-symbol {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--akzent-weich); color: var(--akzent); font-weight: 650; font-size: var(--klein); font-variant-numeric: tabular-nums;
}
.zeile-symbol .icon { width: 18px; height: 18px; }
.ist-fertig .zeile-symbol { background: var(--akzent); color: var(--akzent-auf); }
.ist-gesperrt .zeile-symbol, .ist-vorbereitung .zeile-symbol { background: var(--fuellung); color: var(--text-2); }
.zeile-hinweis { color: var(--text-2); font-size: var(--mini); line-height: 1.38; font-weight: 500; }
.zeile-zusatz { margin: -6px 0 0; padding: 0 var(--a4) 14px 66px; color: var(--text-2); font-size: var(--mini); line-height: 1.38; }
.zeile-zusatz a { color: var(--akzent); font-weight: 560; text-decoration: underline; text-underline-offset: 3px; }
.zeile-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; flex: 1; min-width: 0; }
.zeile-titel { font-weight: 560; line-height: 1.3; }
.zeile-meta { color: var(--text-2); font-size: var(--mini); line-height: 1.38; }
.zeile .balken { margin: 6px 0 2px; max-width: 360px; }
.zeilen-schlicht .zeile { min-height: 56px; }

.zustand { display: inline-flex; align-items: center; gap: 5px; font-size: var(--mini); font-weight: 560; color: var(--text-2); white-space: nowrap; }
.zustand .icon { width: 1.15em; height: 1.15em; }
.zustand-fertig { color: var(--akzent, var(--gut)); }
.vorbereitung-hinweis { display: flex; gap: var(--a2); align-items: flex-start; color: var(--text-2); font-size: var(--klein); line-height: 1.4; margin-top: var(--a2); }
.vorbereitung-hinweis .icon-inline { flex: none; margin: 0.1em 0 0; }
.vorbereitung-karte { display: grid; justify-items: start; gap: var(--a3); max-width: 720px; }
.vorbereitung-karte .platzhalter-symbol { color: var(--text-2); margin-bottom: 0; }
.bester { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; }
@media (max-width: 559px) {
  /* Nur in Zeilen mit Symbol links (Lernlisten); Ergebnis- und Verwaltungslisten behalten den Text. */
  a.zeile:not(.lern-zeile) > .zustand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}

/* ---------- Video ---------- */
.video-raster { display: grid; gap: var(--a4); }
@media (min-width: 980px) { .video-raster { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.video-seite { display: grid; gap: var(--a4); }
.lernziel { font-size: var(--body); line-height: 1.47; }

.spieler {
  position: relative; aspect-ratio: 16 / 9; background: #000; color: #fff;
  border-radius: 18px; overflow: hidden; box-shadow: var(--schatten-hoch);
}
.spieler video { width: 100%; height: 100%; object-fit: contain; transition: opacity 320ms var(--kurve); }
.spieler:fullscreen { border-radius: 0; aspect-ratio: auto; }
/* Nächstes Video im selben Player (Runde 16): kurz schwarz, dann eingeblendet statt hartem Schnitt. */
.spieler.wechselt video { opacity: 0; transition: none; }
.spieler-gross {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(30, 30, 32, 0.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: opacity var(--kurz) var(--kurve), transform var(--kurz) var(--kurve), visibility 0s;
}
/* Zurückgetreten auch nicht im Tab-Ablauf (visibility nach der Blende); den Fokus übergibt player.js an die Leiste. */
.spieler-gross .icon { width: 34px; height: 34px; margin-left: 4px; }
.spieler-gross:hover { transform: scale(1.05); }
.spieler.laeuft .spieler-gross { opacity: 0; pointer-events: none; visibility: hidden; transition-delay: 0s, 0s, var(--kurz); }
.spieler-leiste {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 44px var(--a3) var(--a2);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0));
  transition: opacity 240ms var(--kurve);
}
/* Nur sichtbarer Tastaturfokus hält die Leiste offen; nach einem Mausklick auf einen Knopf blendet sie wieder aus. */
.spieler.laeuft.ruhig:not(:has(:focus-visible)) .spieler-leiste { opacity: 0; }
.spieler.laeuft.ruhig:not(:has(:focus-visible)) { cursor: none; }
.spieler-knoepfe { display: flex; align-items: center; gap: 2px; }
.spieler-knopf {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
.spieler-knopf[hidden] { display: none; }
.spieler-knopf:hover { background: rgba(255, 255, 255, 0.16); }
.spieler-knopf:focus-visible, .spieler-gross:focus-visible, .spieler input:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.spieler-knopf[aria-pressed="true"] { background: rgba(255, 255, 255, 0.24); }
.spieler-tempo { width: auto; min-width: 52px; padding: 0 10px; border-radius: 22px; font-weight: 650; font-size: var(--klein); font-variant-numeric: tabular-nums; }
.spieler-zeitanzeige { font-size: var(--mini); font-variant-numeric: tabular-nums; padding: 0 var(--a2); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.spieler-luft { flex: 1; }
.spieler input[type="range"] {
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; margin: 0;
  --wert: 0%;
}
.spieler-zeit { width: 100%; height: 44px; display: block; } /* Trefferfläche 44 px, Schiene bleibt 4 px */
.spieler-lautstaerke { width: 84px; height: 44px; }
.spieler input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--wert), rgba(255, 255, 255, 0.32) var(--wert));
}
.spieler input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); }
.spieler input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.spieler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.spieler input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
/* Untertitel (Runde 16, untertitel.js): eigene Ebene ohne Balken. Weiße Schrift mit dunkler Kontur (mehrlagiger
   Schatten, in em, damit sie mit der Schrift wächst, mit Untergrenze in px für kleine Schrift am Telefon); gesprochene
   Wörter in Senf. Die Füllung liegt als zweite Schicht (::after) über dem Wort und wird mit --f (0–1) von links
   aufgedeckt. Größe nach Playerbreite (cqi). */
.spieler { container-type: inline-size; }
.spieler-untertitel {
  position: absolute; left: 4%; right: 4%; top: 3%; bottom: 6%; z-index: 1; pointer-events: none;
  display: grid; justify-items: center; align-content: end; align-content: safe end; gap: 0.12em; text-align: center;
  font-family: var(--schrift); font-weight: 650; line-height: 1.3; color: #fff;
  font-size: clamp(0.95rem, 2.2vw, 1.75rem);
  /* Untergrenze folgt der Grundschrift, in sehr kleinen Playern aber höchstens 7 % der Breite, damit die Zeilen bei
     großer Grundschrift noch ins Bild passen (WCAG 1.4.4 nimmt Untertitel aus; abgeschnitten wäre schlechter). */
  font-size: clamp(min(0.95rem, 7cqi), 2.6cqi, 1.9rem);
  --k: max(0.06em, 1.5px); --d: max(0.045em, 1.1px);
  text-shadow:
    var(--k) 0 0 #000, calc(-1 * var(--k)) 0 0 #000, 0 var(--k) 0 #000, 0 calc(-1 * var(--k)) 0 #000,
    var(--d) var(--d) 0 #000, calc(-1 * var(--d)) var(--d) 0 #000, var(--d) calc(-1 * var(--d)) 0 #000,
    calc(-1 * var(--d)) calc(-1 * var(--d)) 0 #000,
    0 0 max(0.22em, 4px) rgba(0, 0, 0, 0.8), 0 0.05em 0.45em rgba(0, 0, 0, 0.5);
  transition: bottom 240ms var(--kurve);
}
/* Die Leiste blendet erst aus, dann sinken die Zeilen (sonst läuft die Zeitschiene kurz durch den Text). */
.spieler.laeuft.ruhig .spieler-untertitel { transition-delay: 160ms; }
.spieler-untertitel[hidden] { display: none; }
/* Sichtbare Bedienleiste (pausiert, Maus bewegt, Tastaturfokus im Player): Zeilen stehen über ihr statt dahinter.
   Reicht der Platz darüber nicht (niedriger Player, große Schrift), beginnen die Zeilen oben (safe) und reichen über
   die Leiste, statt oben abgeschnitten zu werden. */
.spieler:is(:not(.laeuft), :not(.ruhig), :has(:focus-visible)) .spieler-untertitel { bottom: 100px; }
.spieler:fullscreen .spieler-untertitel { font-size: clamp(1.25rem, 3cqi, 3.25rem); }
/* Pausiert steht mittig der große Abspielknopf; in niedrigen Playern (schmal, oder Vollbild quer am Telefon) fänden
   die Zeilen zwischen ihm und der Leiste keinen Platz. Statt die Zeilen nach oben springen zu lassen, tritt der große
   Knopf zurück, solange Untertitel zu sehen sind (.ut-text, untertitel.js); die Leiste hat einen eigenen. Vor dem
   ersten Cue und ohne Untertitel bleibt er. */
@container (max-width: 779px) {
  .spieler.ut-text:not(.laeuft) .spieler-gross { opacity: 0; pointer-events: none; visibility: hidden; transition-delay: 0s, 0s, var(--kurz); }
}
@media (max-height: 560px) {
  .spieler:fullscreen.ut-text:not(.laeuft) .spieler-gross { opacity: 0; pointer-events: none; visibility: hidden; transition-delay: 0s, 0s, var(--kurz); }
}
.ut-block { display: grid; justify-items: center; }
.ut-zeile { display: block; }
.ut-sprecher {
  display: block; font-size: max(0.6em, min(0.75rem, 0.8em)); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; margin-bottom: 0.1em;
}
.ut-wort { position: relative; display: inline-block; white-space: nowrap; }
/* Zweites Merkmal neben der Farbe (WCAG 1.4.1): Der gesprochene Teil ist zusätzlich unterstrichen. Die Schicht erbt
   die Kontur, so trägt auch die Linie auf hellem Bild; der Ausschnitt lässt oben, unten und links Raum für sie. */
.ut-wort::after {
  content: attr(data-w); position: absolute; left: 0; top: 0; color: var(--senf);
  text-decoration: underline max(0.09em, 2px); text-underline-offset: 0.18em; text-decoration-skip-ink: none;
  clip-path: inset(-0.4em calc(100% - var(--f, 0) * 100%) -0.4em -0.4em);
}
/* „Kontrast erhöhen“ am Gerät: Zeilen auf dunklem Balken (nur auf diese ausdrückliche Einstellung). */
@media (prefers-contrast: more) {
  .ut-zeile { background: rgba(0, 0, 0, 0.82); padding: 0 0.3em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}
.spieler-knopf[data-aktion="untertitel"][aria-pressed="true"] { box-shadow: inset 0 -3px 0 #fff; }
@media (max-width: 559px) {
  .spieler-lautstaerke, .spieler-knoepfe [data-aktion="zurueck"] { display: none; }
  .spieler-leiste { padding: 20px var(--a1) 2px; }
  /* Sichtbare Leiste: Zeilen über dem Griff des Reglers (75 px) statt über seiner Trefferfläche; reicht der Platz nicht,
     verkleinert untertitel.js (passe) die Schrift. */
  .spieler:is(:not(.laeuft), :not(.ruhig), :has(:focus-visible)) .spieler-untertitel { bottom: 84px; }
}
/* Schmale Player: Knöpfe behalten 44 px, unter 460 px ohne „10 s vor“. Die Zeitanzeige weicht (sonst gekürzt), sobald
   die Reihe nicht passt: Knöpfe px, Texte rem, Grenze px + rem (16 px Grundschrift 310 px, 32 px 405 px). */
@container (max-width: 459px) {
  .spieler-knoepfe [data-aktion="vor"] { display: none; }
  .spieler-zeitanzeige { padding: 0 var(--a1); }
  .spieler-tempo { min-width: 44px; padding: 0 6px; }
}
@container (max-width: calc(216px + 5.9rem)) { .spieler-zeitanzeige { display: none; } }
/* Ab 560 px Ansicht mit Lautstärke und „10 s zurück“ (16 px: 515 px, 32 px: 610 px). */
@media (min-width: 560px) { @container (max-width: calc(420px + 5.9rem)) { .spieler-zeitanzeige { display: none; } } }
.spieler-tipp { margin-top: var(--a3); color: var(--text-2); font-size: var(--mini); }
@media (hover: none) { .spieler-tipp { display: none; } }

/* ---------- Endfenster und „Nach dem Video“ (Runde 13) ---------- */
.endfenster {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  padding: var(--a3); background: rgba(0, 0, 0, 0.72); overflow: auto;
}
.endfenster[hidden] { display: none; }
.spieler.hat-endfenster .spieler-gross { opacity: 0; pointer-events: none; }
.endfenster-karte {
  position: relative; width: min(100%, 520px); display: grid; gap: var(--a3); text-align: center;
  padding: var(--a5) var(--a5) var(--a4); border-radius: var(--r-l); background: var(--flaeche); color: var(--text);
  box-shadow: var(--schatten-hoch);
}
.endfenster-titel { font-size: var(--titel-k); font-weight: 650; }
.endfenster-text { color: var(--text-2); font-size: var(--klein); }
.endfenster-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--a2); }
.endfenster-knoepfe .knopf { flex: 1 1 200px; }
.endfenster-knoepfe .knopf[hidden], .nach-video .knopf[hidden] { display: none; }
.endfenster-schliessen {
  position: absolute; top: var(--a2); right: var(--a2); width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer;
}
.endfenster-schliessen:hover { background: var(--fuellung); }
@media (max-width: 560px) {
  .endfenster-karte { padding: var(--a4) var(--a3) var(--a3); gap: var(--a2); }
  /* Schmal bleibt das Ziel (Text) sichtbar; der Titel ist nur noch Name des Dialogs für Screenreader. */
  .endfenster-titel {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .endfenster-text { padding-right: 36px; padding-left: 36px; }
  .endfenster-knoepfe .knopf { min-height: 44px; flex-basis: 140px; }
}
/* Übergang zum Test (Runde 16): kurze Blende vor dem Seitenwechsel; mit „Bewegung reduzieren“ setzt endfenster.js
   die Klasse nicht. */
.seite-blende .inhalt { opacity: 0; transition: opacity 260ms var(--kurve); }

.spieler-optionen { margin-top: var(--a3); }
.nach-video { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a3); }
.nach-video-status { margin: 0; color: var(--text-2); font-size: var(--mini); line-height: 1.38; }
.segment { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--a2); }
.segment-titel { font-weight: 600; font-size: var(--klein); padding: 0; }
.segment-optionen { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 12px; background: var(--fuellung); }
.segment-option { position: relative; display: inline-flex; }
.segment-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segment-option span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px;
  font-size: var(--klein); font-weight: 600; color: var(--text-2);
}
.segment-option input:checked + span { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten); }
.segment-option input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 1px; }
.segment-hilfe { margin: var(--a2) 0 0; padding-left: 1.1em; color: var(--text-2); font-size: var(--klein); display: grid; gap: var(--a1); }
.einstellungen-karte { display: grid; gap: var(--a4); max-width: 720px; }
@media (max-width: 559px) {
  /* Schmal: Optionen untereinander in voller Breite statt zweier ungleicher Zeilen. */
  .nach-video .segment { flex: 1 1 100%; }
  .segment-optionen { display: grid; }
  .segment-option span { flex: 1; }
}
.profil-karte .knopfreihe { grid-column: 1 / -1; }
@media (forced-colors: active) {
  .segment-option input:checked + span { border: 2px solid Highlight; }
  .endfenster-karte { border: 1px solid CanvasText; }
}

.platzhalter {
  aspect-ratio: 16 / 9; border-radius: 18px; display: grid; place-content: center; justify-items: center;
  gap: var(--a2); text-align: center; padding: var(--a5);
  background: radial-gradient(90% 120% at 20% 0%, var(--akzent-spur), transparent 60%),
    radial-gradient(70% 90% at 100% 100%, var(--akzent-weich), transparent 70%), var(--flaeche);
  box-shadow: var(--schatten);
}
.platzhalter-symbol {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--flaeche); color: var(--akzent); box-shadow: var(--schatten); margin-bottom: var(--a2);
}
.platzhalter-symbol .icon { width: 30px; height: 30px; }
.platzhalter-titel { font-size: var(--titel-m); font-weight: 650; letter-spacing: -0.012em; }
.platzhalter-text { color: var(--text-2); font-size: var(--klein); max-width: 34ch; }

.stand-liste { display: grid; gap: var(--a3); margin: var(--a1) 0 var(--a2); }
.stand-liste li { display: flex; align-items: center; gap: var(--a3); }
.stand-liste li > span:last-child { display: grid; }
.stand-titel { font-weight: 560; }
.stand-meta { color: var(--text-2); font-size: var(--mini); font-variant-numeric: tabular-nums; }
.stand-icon { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--akzent-weich); color: var(--akzent); }
.stand-icon.ist-fertig { background: var(--akzent); color: var(--akzent-auf); }

.blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: var(--a3); margin-top: var(--a6); }
.blaettern-link {
  display: flex; align-items: center; gap: var(--a2); min-height: 64px; padding: var(--a3) var(--a4);
  background: var(--flaeche); border-radius: var(--r-m); box-shadow: var(--schatten); color: var(--text);
  font-weight: 560; font-size: var(--klein); line-height: 1.3;
}
.blaettern-link small { display: block; color: var(--text-2); font-size: var(--mini); font-weight: 500; }
.blaettern-link .icon { color: var(--akzent); }
.blaettern-link:hover { box-shadow: var(--schatten-hoch); }
.blaettern-nach { justify-content: flex-end; text-align: right; grid-column: 2; }
.blaettern-link.ist-gesperrt { background: var(--flaeche-2); box-shadow: none; color: var(--text-2); }
.blaettern-link.ist-gesperrt .icon { color: var(--text-2); }
.blaettern-grund { display: block; margin-top: 2px; font-size: var(--mini); font-weight: 500; }
@media (max-width: 559px) {
  /* Schmal: „Als Nächstes“ über die volle Breite, Text links, Pfeil rechts. */
  .blaettern { grid-template-columns: minmax(0, 1fr); }
  .blaettern > span:empty { display: none; }
  .blaettern-nach { grid-column: 1; justify-content: space-between; text-align: left; }
}

/* ---------- Tests ---------- */
.test-kopf, .frage-karte, .test-einstieg, .ergebnis-karte, .auswertung { max-width: 720px; }
/* Test-Seiten: schmale Spalte mittig unter der breiten Kopfzeile statt linksbündig mit leerem Rand. */
.inhalt:has(.test-kopf, .test-einstieg, .ergebnis-karte) { max-width: calc(720px + 2 * var(--a5)); }
.test-kopf { display: grid; gap: var(--a2); padding: var(--a3) 0 var(--a5); }
.test-kopf .balken { height: 6px; }
.frage-karte { gap: var(--a5); }
.frage-karte fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--a4); }
.frage-text { font-size: var(--titel-m); line-height: 1.3; font-weight: 650; letter-spacing: -0.012em; padding: 0; text-wrap: pretty; }
.optionen { display: grid; gap: 10px; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 58px;
  padding: 12px var(--a4); border-radius: var(--r-m); border: 1.5px solid var(--linie-stark);
  background: var(--flaeche); cursor: pointer; line-height: 1.38;
  transition: border-color var(--kurz) var(--kurve), background-color var(--kurz) var(--kurve);
}
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option:hover { background: var(--flaeche-2); }
.option:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }
.option:has(input:checked) { border-color: var(--akzent); background: var(--akzent-weich); }
.option-buchstabe {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--fuellung); font-weight: 650; font-size: var(--klein);
}
.option-buchstabe .icon { width: 18px; height: 18px; }
.option:has(input:checked) .option-buchstabe { background: var(--akzent); color: var(--akzent-auf); }
.option-text { display: grid; gap: 2px; }
.option-fest { cursor: default; }
.option-fest:hover { background: var(--flaeche); }
.option-fest.ist-richtig { border-color: var(--gut); }
.option-fest.ist-richtig .option-buchstabe { background: var(--gut); color: var(--flaeche); }
.option-fest.ist-falsch { border-color: var(--schlecht); border-style: dashed; }
.option-marke { font-size: var(--mini); font-weight: 600; color: var(--text-2); }
.ist-richtig .option-marke { color: var(--gut); }
.ist-falsch .option-marke { color: var(--schlecht); }
.rueckmeldung { display: flex; align-items: center; gap: var(--a2); font-weight: 650; font-size: var(--body); }
.rueckmeldung.ist-richtig { color: var(--gut); }
.rueckmeldung.ist-falsch { color: var(--schlecht); }
.rueckmeldung .icon { width: 24px; height: 24px; }

.fakten { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--a3); text-align: center; margin-bottom: var(--a2); }
.fakten li { display: grid; gap: 2px; padding: var(--a4) var(--a2); border-radius: var(--r-m); background: var(--akzent-weich); }
.fakt-zahl { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--akzent); font-variant-numeric: tabular-nums; }
.fakt-text { font-size: var(--mini); color: var(--text-2); line-height: 1.3; }
.test-einstieg form { margin-top: var(--a2); }

.ergebnis-karte { justify-items: center; text-align: center; gap: var(--a4); padding: var(--a6) var(--a5); }
.ergebnis-karte .knopfreihe { justify-content: center; margin-top: var(--a2); }
.ergebnis-karte > .eyebrow { margin-bottom: calc(-1 * var(--a3)); }
.auswertung { display: grid; gap: var(--a3); }
.auswertung-eintrag { gap: var(--a2); }
.auswertung-kopf { display: flex; align-items: center; gap: 6px; font-size: var(--mini); font-weight: 650; }
.auswertung-kopf .icon { width: 18px; height: 18px; }
.auswertung-eintrag.ist-richtig .auswertung-kopf { color: var(--gut); }
.auswertung-eintrag.ist-falsch .auswertung-kopf { color: var(--schlecht); }
.auswertung .frage-text { font-size: var(--body); }
.auswertung-antwort { font-size: var(--klein); }
.erklaerung { font-size: var(--klein); color: var(--text-2); line-height: 1.47; border-left: 3px solid var(--akzent-spur); padding-left: var(--a3); }

/* ---------- Aufgabentypen: Zuordnen, Ampel, Frist (Runde 14; Gestaltung nach demo-aufgabentypen.html) ---------- */
.aufgabe-auswahl {
  width: 100%; min-height: 50px; padding: 0 40px 0 var(--a4); border-radius: 12px; border: 1px solid var(--feld-rand);
  background-color: var(--flaeche-2); color: var(--text); font: inherit; font-size: var(--klein); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a8a8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.aufgabe-auswahl:focus-visible { outline: 3px solid var(--akzent); outline-offset: 1px; }
.zuordnen-zeilen { display: grid; }
.zuordnen-zeile { display: grid; gap: var(--a2); padding: var(--a3) 0; border-top: 1px solid var(--linie); }
.zuordnen-zeile:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 720px) { .zuordnen-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); align-items: center; column-gap: var(--a4); } }
.zuordnen-text { font-size: var(--klein); line-height: 1.45; font-weight: 560; }
.zuordnen-nr { font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.aufgabe-fall { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--r-m); padding: var(--a3) var(--a4); display: grid; gap: var(--a2); font-size: var(--klein); }
.aufgabe-fall-titel { font-size: var(--mini); font-weight: 600; color: var(--text-2); }
.aufgabe-fall-zeile { font-weight: 600; }
.aufgabe-felder { display: grid; gap: var(--a3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .aufgabe-felder { grid-template-columns: repeat(auto-fit, minmax(9rem, 14rem)); } }
.feld-kurz input { max-width: 12rem; }
.ampel { display: grid; gap: var(--a4); }
.ampel .segment-optionen { max-width: 100%; }
.ampel .segment-option { flex: 1 1 auto; }
.ampel .segment-option > span { gap: var(--a2); justify-content: center; width: 100%; font-weight: 650; letter-spacing: 0.02em; }
.segment-option .punkt { display: inline-block; flex: none; width: 10px; height: 10px; min-height: 0; padding: 0; border-radius: 50%; }
.punkt-gruen { background: #34c759; }
.punkt-gelb { background: #f5b400; }
.punkt-rot { background: #ff3b30; }
.ampel .segment-hilfe { font-size: var(--mini); margin-top: 0; }
.ampel-bei { font-weight: 500; color: var(--text-2); }
.frage-karte .ampel-gruende[hidden], .ampel [data-ampel-hinweis][hidden], .ampel [data-ohne-js][hidden] { display: none; }
.option-marke.ist-loesung { color: var(--gut); }
.rechenweg-block { display: grid; gap: var(--a2); }
.rechenweg-titel { font-size: var(--klein); font-weight: 650; }
.rechenweg { margin: 0; padding-left: 1.3em; display: grid; gap: var(--a2); font-size: var(--klein); line-height: 1.5; }
@media (max-width: 400px) { .ampel .segment-optionen { width: 100%; } .ampel .segment-option > span { padding: 0 8px; } }
@media (forced-colors: active) { .punkt { forced-color-adjust: none; border: 1px solid CanvasText; } }

/* ---------- Gesperrt, Fehler ---------- */
.gesperrt-karte { max-width: 560px; margin: var(--a7) auto; justify-items: center; text-align: center; gap: var(--a4); padding: var(--a6); }
.gesperrt-karte p { color: var(--text-2); }
.gesperrt-karte .knopfreihe { justify-content: center; }

/* ---------- Anmeldung ---------- */
.seite-anmeldung .inhalt { display: grid; place-items: center; }
.anmeldung { width: 100%; max-width: 420px; display: grid; gap: var(--a5); }
.anmeldung-karte { justify-items: center; text-align: center; padding: var(--a6) var(--a5); gap: var(--a3); }
.anmeldung-zeichen { width: 56px; height: 56px; margin-bottom: var(--a2); }
.anmeldung .formular { width: 100%; text-align: left; margin-top: var(--a3); }

/* ---------- Formulare ---------- */
.formular { display: grid; gap: var(--a4); }
.feld { display: grid; gap: 6px; }
.feld label { font-weight: 600; font-size: var(--klein); }
.feld input {
  width: 100%; min-height: 50px; padding: 0 var(--a4); border-radius: 12px;
  border: 1px solid var(--feld-rand); background: var(--flaeche-2); font-size: var(--body);
  transition: border-color var(--kurz) var(--kurve), box-shadow var(--kurz) var(--kurve);
}
.feld input:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 4px var(--akzent-spur); }
.feld input[aria-invalid="true"] { border-color: var(--schlecht); }
.hilfetext { font-size: var(--mini); color: var(--text-2); }
.fehlertext { font-size: var(--klein); color: var(--schlecht); font-weight: 500; }
.auswahl { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.auswahl input { width: 22px; height: 22px; accent-color: var(--akzent); }
@media (min-width: 720px) {
  .formular-reihe { grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; }
  .formular-reihe .auswahl, .formular-reihe .knopf { margin-top: 27px; }
  .formular-reihe .knopf { min-height: 50px; }
}
.meldung {
  display: flex; align-items: center; gap: var(--a2); margin-bottom: var(--a4); padding: var(--a3) var(--a4);
  border-radius: var(--r-m); background: var(--akzent-weich); font-weight: 500;
}
.meldung .icon { color: var(--akzent); }
/* Testseite nach automatischem Öffnen (Runde 16): der Weg zurück zum Video steht oben. */
.auto-hinweis {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--a2) var(--a4);
  margin-bottom: var(--a4); padding: var(--a3) var(--a4); border-radius: var(--r-m); background: var(--akzent-weich);
}
.auto-hinweis-text { margin: 0; font-weight: 500; }
.auto-hinweis-links { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--a2) var(--a4); }
.auto-hinweis-einstellung { color: var(--akzent); font-size: var(--klein); font-weight: 600; }
/* Hell etwas dunkler (Kontrast ≥ 4,5:1 auf der getönten Fläche), dunkel unverändert. */
@supports (color: color-mix(in srgb, red, blue)) {
  .auto-hinweis-einstellung { color: light-dark(color-mix(in srgb, var(--akzent) 80%, #000), var(--akzent)); }
}

/* ---------- Profil und Verwaltung ---------- */
.profil-karte { grid-template-columns: auto 1fr; align-items: center; gap: var(--a4); }
.profil-karte form { grid-column: 1 / -1; }
.avatar {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--akzent); color: var(--akzent-auf); font-size: 1.625rem; font-weight: 650;
}
.avatar-klein { width: 40px; height: 40px; font-size: 1.0625rem; flex: none; }
.marke {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 980px; margin-left: 6px;
  background: var(--fuellung); color: var(--text); font-size: var(--mini); font-weight: 560; vertical-align: 1px;
}
.marke-warn { color: var(--schlecht); }
.bloecke { display: grid; gap: var(--a4); }
.lernfreigaben { margin-bottom: var(--a4); }
@media (min-width: 900px) { .bloecke { grid-template-columns: 1fr 1fr; } }
.block-kopf { display: flex; justify-content: space-between; align-items: center; gap: var(--a3); flex-wrap: wrap; }
.bloecke .zeilen { box-shadow: none; border-radius: 0; background: transparent; margin: 0 calc(-1 * var(--a4)); }
.bloecke .zeile { padding-left: var(--a4); }

/* ---------- Bewegung: nur ohne „Bewegung reduzieren“ ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ring-wert { animation: ring-ein 900ms var(--kurve) both; }
  @keyframes ring-ein { from { stroke-dashoffset: 100; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .ring-wert, .balken-wert { stroke: CanvasText; fill: CanvasText; }
  .ut-zeile { background: Canvas; color: CanvasText; }
  .ut-wort::after { color: Highlight; }
  .knopf { border: 1px solid ButtonText; }
}
.spieler.hat-fehler::after {
  content: "Das Video konnte nicht geladen werden. Lade die Seite neu.";
  position: absolute; left: var(--a5); right: var(--a5); top: 50%; transform: translateY(-50%);
  text-align: center; font-weight: 600; color: #fff;
}
.spieler.hat-fehler .spieler-gross { display: none; }
