/* Schriften lokal (SIL Open Font License, siehe assets/fonts/OFL-*.txt) – keine Verbindung zu Google */
@font-face { font-family: "Outfit"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/outfit-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/outfit-latin-800.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/inter-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800 900; font-style: normal; font-display: swap; src: url("fonts/inter-latin-800.woff2") format("woff2"); }

:root {
  --grund: #0b1020;
  --karte: #121a33;
  --karte-hell: #19234a;
  --linie: #2a3355;
  --text: #f2f5ff;
  --leise: #aab3d6;
  --fach: #4fd18e;
  --akzent: #ffb547;
  --fehler: #ff5c8a;
  --info: #39d3ff;
  --papier: #fbf7ec;
  --radius: 18px;
  --schrift-titel: "Outfit", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --schrift: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--grund); }
body { margin: 0; background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 17px; line-height: 1.5; }
a { color: var(--info); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: rgba(11,16,32,.92); backdrop-filter: blur(8px); z-index: 10; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-family: var(--schrift-titel); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.logo b { color: var(--fach); font-weight: 800; }
.logo-zeichen { display: block; width: 38px; height: 38px; flex: none; border-radius: 9px; }
.kanal { color: var(--leise); text-decoration: none; font-size: 15px; white-space: nowrap; }
.kanal:hover { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 48px; }
/* Platz für die feste Leiste unten (Höhe setzt app.js), damit sie Fußzeile und Karten nicht verdeckt */
body { padding-bottom: var(--leiste-h, 0px); }
.laden { color: var(--leise); }
.fuss { max-width: 1100px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 48px; color: var(--leise); font-size: 14px; border-top: 1px solid var(--linie); }

h1, h2, h3 { font-family: var(--schrift-titel); letter-spacing: -.015em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; }
h1 em { font-style: normal; color: var(--fach); }
h2 { font-size: 28px; font-weight: 800; }
.unterzeile { color: var(--leise); font-size: 19px; margin: 12px 0 0; max-width: 46em; }
.kicker { font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--fach); margin-bottom: 10px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 24px; background: var(--fach); color: #06200f; font-weight: 800; cursor: pointer; text-decoration: none; }
.knopf:hover { filter: brightness(1.08); }
.knopf[disabled] { opacity: .4; cursor: not-allowed; filter: none; }
.knopf.zweit { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--linie); }
.knopf.zweit:hover { box-shadow: inset 0 0 0 2px var(--leise); }
.knopf.leise { background: transparent; color: var(--leise); padding: 6px 10px; font-weight: 600; }

/* Themenauswahl */
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.chip { border: 2px solid var(--linie); background: transparent; color: var(--leise); border-radius: 999px; padding: 6px 16px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--fach); color: var(--text); background: rgba(79,209,142,.12); }
.reihe { margin-top: 32px; }
.reihe-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.reihe-kopf span { color: var(--leise); font-size: 15px; }
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.thema { position: relative; background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, transform .15s; }
.thema:hover { border-color: #3b4775; }
.thema.gewaehlt { border-color: var(--fach); background: linear-gradient(180deg, rgba(79,209,142,.10), rgba(79,209,142,0) 60%), var(--karte); }
.thema input { position: absolute; opacity: 0; pointer-events: none; }
.thema-nr { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--schrift-titel); font-weight: 800; font-size: 22px; background: var(--karte-hell); color: var(--fach); }
.thema.gewaehlt .thema-nr { background: var(--fach); color: #06200f; }
.thema h3 { font-size: 21px; font-weight: 700; }
.thema p { margin: 0; color: var(--leise); font-size: 15px; }
.thema-fuss { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--leise); }
.haken { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--linie); display: grid; place-items: center; font-weight: 900; color: transparent; }
.thema.gewaehlt .haken { background: var(--fach); border-color: var(--fach); color: #06200f; }

.leiste { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(18,26,51,.97); border-top: 1px solid var(--linie); padding: 14px clamp(16px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; z-index: 9; }
.leiste-info { color: var(--leise); }
.leiste-info b { color: var(--text); }
.umfang { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.umfang span { color: var(--leise); margin-right: 4px; }

/* Klassenarbeit */
.arbeit-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.uhr { font-variant-numeric: tabular-nums; color: var(--leise); }
.fortschritt { height: 8px; background: var(--karte-hell); border-radius: 99px; overflow: hidden; margin: 8px 0 28px; }
.fortschritt div { height: 100%; background: var(--fach); width: 0; transition: width .25s; }
.thema-trenner { margin: 36px 0 14px; color: var(--fach); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.aufgabe { background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.aufgabe.beantwortet { border-color: #2f4f5e; }
.aufgabe-kopf { display: flex; justify-content: space-between; gap: 12px; color: var(--leise); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.aufgabe legend, .aufgabe .frage { font-family: var(--schrift-titel); font-size: 22px; font-weight: 700; line-height: 1.25; margin-bottom: 14px; padding: 0; }
.aufgabe fieldset { border: 0; margin: 0; padding: 0; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--linie); margin-bottom: 8px; cursor: pointer; }
.option:hover { border-color: #3b4775; }
.option:has(input:checked) { border-color: var(--fach); background: rgba(79,209,142,.08); }
.option input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--fach); flex: none; }
.lueckentext { font-size: 19px; line-height: 2.2; }
select { background: var(--karte-hell); color: var(--text); border: 2px solid var(--linie); border-radius: 10px; padding: 6px 10px; }
select:focus { border-color: var(--fach); }
.zuordnung { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr); gap: 10px 16px; align-items: center; }
.zuordnung label { font-weight: 700; }
.reihenfolge { list-style: none; margin: 0; padding: 0; counter-reset: schritt; }
.reihenfolge li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--linie); border-radius: 12px; margin-bottom: 8px; background: var(--karte-hell); counter-increment: schritt; }
.reihenfolge li::before { content: counter(schritt); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grund); color: var(--fach); font-weight: 800; flex: none; }
.reihenfolge li span { flex: 1; }
.reihenfolge button { background: var(--grund); color: var(--text); border: 1px solid var(--linie); border-radius: 8px; width: 36px; height: 32px; cursor: pointer; }
.reihenfolge button:disabled { opacity: .3; cursor: default; }
.textantwort { width: 100%; max-width: 480px; background: var(--karte-hell); color: var(--text); border: 2px solid var(--linie); border-radius: 12px; padding: 12px 14px; }
.textantwort:focus { border-color: var(--fach); outline: none; }

.hinweis { background: rgba(255,181,71,.1); border: 2px solid var(--akzent); color: var(--text); border-radius: 14px; padding: 14px 18px; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* Ergebnis */
.ergebnis-kopf { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; background: var(--karte); border: 2px solid var(--linie); border-radius: 24px; padding: 28px; }
.note { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; font-family: var(--schrift-titel); font-size: 76px; font-weight: 800; color: #06200f; background: var(--fach); }
.note.n3, .note.n4 { background: var(--akzent); color: #2a1700; }
.note.n5, .note.n6 { background: var(--fehler); color: #2a0010; }
.note small { display: block; font-size: 15px; font-family: var(--schrift); font-weight: 700; margin-top: -18px; }
.ergebnis-zahlen { font-size: 20px; color: var(--leise); margin: 10px 0 14px; }
.ergebnis-zahlen b { color: var(--text); }
.schluessel { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--leise); }
.schluessel span { border: 1px solid var(--linie); border-radius: 8px; padding: 3px 8px; }
.schluessel span.aktiv { border-color: var(--text); color: var(--text); font-weight: 700; }
.balken-liste { display: grid; gap: 14px; margin-top: 16px; }
.balken-zeile { background: var(--karte); border: 2px solid var(--linie); border-radius: 16px; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.balken { grid-column: 1 / -1; height: 10px; background: var(--karte-hell); border-radius: 99px; overflow: hidden; }
.balken div { height: 100%; border-radius: 99px; }
.auswertung { margin-top: 12px; }
.auswertung details { background: var(--karte); border: 2px solid var(--linie); border-radius: 14px; margin-bottom: 10px; }
.auswertung summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 12px; align-items: center; list-style: none; }
.auswertung summary::-webkit-details-marker { display: none; }
.marke { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex: none; font-size: 15px; }
.marke.ok { background: var(--fach); color: #06200f; }
.marke.teil { background: var(--akzent); color: #2a1700; }
.marke.falsch { background: var(--fehler); color: #2a0010; }
.auswertung summary .p { margin-left: auto; color: var(--leise); white-space: nowrap; font-size: 15px; }
.auswertung .inhalt { padding: 0 18px 16px 58px; color: var(--leise); }
.auswertung .inhalt p { margin: 6px 0; }
.auswertung .inhalt b { color: var(--text); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.abschnitt { margin-top: 40px; }

.video-dialog { width: min(960px, 94vw); background: var(--karte); color: var(--text); border: 2px solid var(--linie); border-radius: 20px; padding: 14px; }
.video-dialog::backdrop { background: rgba(5,7,15,.8); }
.video-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.video-dialog video { width: 100%; border-radius: 12px; background: #000; }

@media (max-width: 640px) {
  .ergebnis-kopf { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .schluessel { justify-content: center; }
  .zuordnung { grid-template-columns: 1fr; }
  .zuordnung label { margin-top: 6px; }
  .kanal { display: none; }
  .auswertung .inhalt { padding-left: 18px; }
  .leiste { padding: 10px 16px; gap: 8px; }
  .leiste-info { font-size: 14px; width: 100%; }
  .umfang { width: 100%; flex-wrap: nowrap; }
  .umfang span { display: none; }
  .umfang .chip { flex: 1 1 auto; padding: 5px 6px; font-size: 14px; white-space: nowrap; }
  #starten { width: 100%; padding: 10px 16px; }
}

/* Rechtliche Informationen */
.rechtliche-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.rechtliches { max-width: 840px; }
.rechtliches section { margin-block: 28px; }
.rechtliches h2 { font-size: 1.35rem; }
.rechtliches p { margin-block: 8px 12px; overflow-wrap: anywhere; }
