/* Bio 5 – Gestaltung
   Naturgrün als Grundton, Orange für Punkte und Klassenarbeit, runde Schriften. */

@font-face {
  font-family: 'Fredoka';
  src: url('../fonts/fredoka-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --papier: #f4f7f2;
  --flaeche: #ffffff;
  --flaeche-2: #eef1ee;
  --linie: #dde7df;
  --tinte: #1e2a22;
  --tinte-2: #4b5b50;
  --gruen: #2e7d4f;
  --gruen-dunkel: #1f5c39;
  --gruen-hell: #e8f3ec;
  --gruen-rand: #bfdcc9;
  --orange: #b45309;
  --orange-dunkel: #92400e;
  --orange-hell: #fff4e5;
  --orange-rand: #f5d7b0;
  --blau: #1d4e89;
  --blau-hell: #e6f0fa;
  --rot: #b42318;
  --rot-dunkel: #9a1c12;
  --rot-hell: #fdf0ec;
  --gold: #ffd08a;

  --kopf: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --text: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 17px/1.5 var(--text);
}
h1, h2, h3 { font-family: var(--kopf); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; font-weight: 500; }
p { margin: 0; }
a { color: var(--gruen); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.leise { color: var(--tinte-2); }
.klein { font-size: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopfzeile ---------- */
.kopf {
  position: sticky; top: 0; z-index: 10;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  padding: 12px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinte); min-height: 44px; }
.logo-zeichen { width: 40px; height: 40px; border-radius: 12px; background: var(--gruen); color: #fff; display: grid; place-items: center; }
.logo span { font-family: var(--kopf); font-weight: 600; font-size: 24px; }
.kopf-rechts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pille {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 15px;
}
.pille.punkte { background: var(--orange-hell); color: var(--orange-dunkel); }
.pille.serie { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.profil-knopf {
  width: 44px; height: 44px; border-radius: 999px; border: 2px solid var(--linie); background: var(--flaeche);
  font-family: var(--kopf); font-weight: 600; font-size: 17px; color: var(--gruen);
  display: grid; place-items: center; text-decoration: none;
}
.zurueck { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; text-decoration: none; }

/* ---------- Layout ---------- */
.seite { max-width: 1120px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 32px; }
.seite.schmal { max-width: 780px; }
.reihe { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.haupt { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.seitenleiste { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; }
.stapel { display: flex; flex-direction: column; gap: 12px; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ueberzeile { font-weight: 800; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--gruen); }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Karten ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; }
.karte-link { text-decoration: none; color: var(--tinte); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.karte-link:hover { border-color: var(--gruen-rand); transform: translateY(-2px); }
.karte-link.gesperrt { opacity: .7; }
.karte-link.gesperrt:hover { transform: none; border-color: var(--linie); }

.held { background: var(--gruen); color: #fff; border-radius: 24px; padding: 30px; display: flex; flex-direction: column; gap: 12px; flex: 2 1 480px; }
.held .ueberzeile { color: #cfe9d8; }
.held p { color: #e3f2e8; }
.held .balken { background: rgba(255,255,255,.25); }
.held .balken > div { background: var(--gold); }
.test-karte { flex: 1 1 280px; border: 2px solid var(--orange-rand); border-radius: 24px; background: var(--flaeche); padding: 26px; display: flex; flex-direction: column; gap: 12px; }

.nr-kachel {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-family: var(--kopf); font-weight: 600; font-size: 18px;
}
.ton-0 { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.ton-1 { background: var(--blau-hell); color: var(--blau); }
.ton-2 { background: var(--orange-hell); color: var(--orange-dunkel); }
.ton-aus { background: var(--flaeche-2); color: var(--tinte-2); }

.balken { height: 8px; background: #e4ecE6; border-radius: 999px; overflow: hidden; }
.balken > div { height: 100%; background: var(--gruen); border-radius: 999px; transition: width .4s; }
.balken.dick { height: 12px; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 14px; border: none;
  background: var(--gruen); color: #fff; font-weight: 800; font-size: 17px; text-decoration: none;
}
.knopf:hover { background: var(--gruen-dunkel); }
.knopf.weiss { background: #fff; color: var(--gruen-dunkel); }
.knopf.orange { background: var(--orange); }
.knopf.orange:hover { background: var(--orange-dunkel); }
.knopf.dunkel { background: var(--tinte); }
.knopf.rahmen { background: var(--flaeche); color: var(--tinte); border: 2px solid var(--linie); }
.knopf.rahmen:hover { border-color: var(--gruen-rand); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Kapitel ---------- */
.video { border-radius: var(--radius); overflow: hidden; background: var(--flaeche); border: 1px solid var(--linie); }
.video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-platzhalter {
  aspect-ratio: 16 / 9; background: var(--gruen-dunkel); color: #e3f2e8; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px;
}
.video-platzhalter .kreis1 { position: absolute; left: 8%; bottom: -18%; width: 220px; height: 220px; border-radius: 999px; background: var(--gruen); }
.video-platzhalter .kreis2 { position: absolute; right: 10%; top: 12%; width: 110px; height: 110px; border-radius: 999px; background: var(--gold); opacity: .85; }
.video-platzhalter > * { position: relative; }
.video-unterzeile { padding: 14px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }

.merksatz { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px; padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.merksatz.gelernt { border-color: var(--gruen-rand); }
.merksatz .nummer { flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; font-family: var(--kopf); font-weight: 600; background: var(--flaeche-2); color: var(--tinte-2); }
.merksatz.gelernt .nummer { background: var(--gruen); color: #fff; }
.merksatz .inhalt { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.merksatz .inhalt strong { font-family: var(--kopf); font-weight: 500; font-size: 19px; }
.kann-ich {
  flex: none; min-height: 40px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--linie);
  background: var(--flaeche); font-weight: 800; font-size: 14px; color: var(--tinte-2); display: inline-flex; gap: 6px; align-items: center;
}
.kann-ich[aria-pressed="true"] { background: var(--gruen-hell); border-color: var(--gruen-rand); color: var(--gruen-dunkel); }

.uebung { display: flex; align-items: center; gap: 14px; }
.uebung .symbol { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.uebung .texte { display: flex; flex-direction: column; gap: 2px; }
.uebung .texte strong { font-size: 17px; }
.punkte-box { background: var(--gruen); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.punkte-box .zahl { font-family: var(--kopf); font-weight: 600; font-size: 30px; }

.themen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.themen li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.themen .art { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--blau); margin-right: 6px; }

/* ---------- Übungs-Kopf ---------- */
.uebungs-kopf { position: sticky; top: 0; z-index: 10; background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 12px 24px; display: flex; align-items: center; gap: 18px; }
.schliessen { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--tinte-2); flex: none; }
.uebungs-kopf .mitte { flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Quiz ---------- */
.frage { font-size: 28px; line-height: 1.3; }
.antworten { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.antwort {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 72px; border-radius: 18px;
  border: 2px solid var(--linie); background: var(--flaeche); font-weight: 700; font-size: 18px; text-align: left;
}
.antwort:hover:not(:disabled) { border-color: var(--gruen-rand); }
.antwort .taste { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche-2); display: grid; place-items: center; font-family: var(--kopf); font-weight: 600; }
.antwort.gewaehlt { border-color: var(--blau); background: var(--blau-hell); }
.antwort.richtig { border-color: var(--gruen); background: var(--gruen-hell); }
.antwort.richtig .taste { background: var(--gruen); color: #fff; }
.antwort.falsch { border-color: var(--rot); background: var(--rot-hell); }
.antwort.falsch .taste { background: var(--rot); color: #fff; }
.antwort.blass { opacity: .55; }
.antwort:disabled { cursor: default; }

.rueckmeldung { border-radius: 20px; padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border: 2px solid; }
.rueckmeldung .texte { flex: 1 1 340px; display: flex; flex-direction: column; gap: 4px; }
.rueckmeldung .titel { font-family: var(--kopf); font-weight: 600; font-size: 22px; }
.rueckmeldung.gut { background: var(--gruen-hell); border-color: var(--gruen); }
.rueckmeldung.gut .titel { color: var(--gruen-dunkel); }
.rueckmeldung.schlecht { background: var(--rot-hell); border-color: var(--rot); }
.rueckmeldung.schlecht .titel { color: var(--rot-dunkel); }

.ergebnis { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; }
.ergebnis .gross { font-family: var(--kopf); font-weight: 600; font-size: 64px; color: var(--gruen); line-height: 1; }
.fehlerliste { display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.fehlerliste .karte { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Karteikarten ---------- */
.lernkarte {
  min-height: 300px; border-radius: 24px; border: 2px solid var(--linie); background: var(--flaeche);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center;
  width: 100%;
}
.lernkarte.rueckseite { background: var(--gruen-hell); border-color: var(--gruen-rand); }
.lernkarte .vorne { font-family: var(--kopf); font-weight: 600; font-size: 30px; line-height: 1.25; }
.lernkarte .hinten { font-size: 21px; line-height: 1.45; max-width: 560px; }
.boxen { display: flex; gap: 8px; flex-wrap: wrap; }
.box { flex: 1 1 80px; text-align: center; padding: 10px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); font-size: 14px; }
.box strong { display: block; font-family: var(--kopf); font-size: 22px; }

/* ---------- Lückentext ---------- */
.lueckentext { font-size: 20px; line-height: 2.3; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 24px; }
.luecke {
  display: inline-block; min-width: 120px; padding: 2px 10px; margin: 0 2px; border: 2px solid var(--linie); border-radius: 10px;
  background: var(--papier); font-size: 18px; line-height: 1.6; text-align: center;
}
.luecke.ok { border-color: var(--gruen); background: var(--gruen-hell); }
.luecke.nein { border-color: var(--rot); background: var(--rot-hell); }
.loesung { font-size: 15px; font-weight: 800; color: var(--gruen-dunkel); margin: 0 4px; }
.wortspeicher { display: flex; flex-wrap: wrap; gap: 8px; }
.wort { padding: 6px 12px; border-radius: 999px; background: var(--blau-hell); color: var(--blau); font-weight: 700; font-size: 15px; }

/* ---------- Beschriften ---------- */
.beschriften { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.beschriften .bild { flex: 2 1 420px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.beschriften .bild svg { width: 100%; height: auto; display: block; }
.beschriften .felder { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.feld { display: flex; align-items: center; gap: 10px; }
.feld .marke { width: 34px; height: 34px; border-radius: 999px; background: var(--tinte); color: #fff; display: grid; place-items: center; font-family: var(--kopf); font-weight: 600; flex: none; }
.feld select { flex: 1; min-height: 44px; border-radius: 12px; border: 2px solid var(--linie); background: var(--flaeche); padding: 6px 10px; }
.feld.ok select { border-color: var(--gruen); background: var(--gruen-hell); }
.feld.nein select { border-color: var(--rot); background: var(--rot-hell); }

/* ---------- Abzeichen ---------- */
.abzeichen-reihe { display: flex; flex-wrap: wrap; gap: 14px; }
.abzeichen { width: 150px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 20px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.abzeichen .medaille { width: 60px; height: 60px; border-radius: 999px; display: grid; place-items: center; background: var(--orange-hell); color: var(--orange); }
.abzeichen.offen .medaille { background: var(--flaeche-2); color: #8a968d; }
.abzeichen.offen { opacity: .75; }
.abzeichen strong { font-size: 14px; line-height: 1.3; }
.abzeichen small { font-size: 12px; color: var(--tinte-2); line-height: 1.3; }

/* ---------- Test-Auswahl ---------- */
.auswahl { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--linie); background: var(--flaeche); cursor: pointer; }
.auswahl input { width: 22px; height: 22px; accent-color: var(--gruen); }
.auswahl.an { border-color: var(--gruen-rand); background: var(--gruen-hell); }
.segment { display: inline-flex; border: 2px solid var(--linie); border-radius: 14px; overflow: hidden; }
.segment button { border: none; background: var(--flaeche); padding: 10px 18px; font-weight: 800; min-height: 44px; }
.segment button[aria-pressed="true"] { background: var(--gruen); color: #fff; }

/* ---------- Anmeldung ---------- */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.anmeldung form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.anmeldung label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.anmeldung input { min-height: 48px; border-radius: 12px; border: 2px solid var(--linie); padding: 8px 12px; background: var(--flaeche); }

/* ---------- Hinweise ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--tinte); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px);
}
.toast.abzeichen-toast { background: var(--orange); }
.update-hinweis { position: fixed; right: 16px; bottom: 16px; z-index: 40; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.update-hinweis button { border: none; background: var(--gruen); color: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.fehler-leiste { background: var(--rot-hell); color: var(--rot-dunkel); padding: 10px 24px; font-weight: 700; margin: 0; }
.laden { min-height: 60vh; display: grid; place-items: center; color: var(--tinte-2); }
.leer { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

@media (max-width: 600px) {
  h1 { font-size: 28px; }
  .frage { font-size: 23px; }
  .seite { padding: 20px 16px 48px; }
  .kopf, .uebungs-kopf { padding: 10px 16px; }
  .held { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
