/* LernKit - fürs Handy gebaut: große Tippflächen, klare Farben je Fach */
:root {
  /* Gestaltung nach Design-Review (ChatGPT, 11.10.2026): ruhige helle
     Fläche, EINE kräftige Akzentfarbe, Fachfarben nur als Kennung */
  --blau: #6d28d9;
  --blau-dunkel: #5b21b6;
  --akzent-zart: #ede9fe;
  --linie: #dedee8;
  --flaeche: #f7f6fb;
  --text: #202238;
  --grau: #5f6477;
  --gruen: #16a34a;
  --rot: #dc2626;
  --farbe: var(--blau);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--flaeche);
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
  padding-bottom: calc(84px + env(safe-area-inset-bottom)); /* Leiste unten */
}
.kopf {
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid var(--linie);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}
.marke { color: var(--blau); font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.01em; }
.abmelden { color: var(--grau); font-size: 14px; text-decoration: none; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: clamp(26px, 5vw, 32px); line-height: 1.15; letter-spacing: -0.02em; margin: 8px 0 16px; }
h2 { font-size: 21px; line-height: 1.3; margin: 24px 0 10px; }
button, input, textarea, select { font: inherit; }
h3 { font-size: 17px; margin: 14px 0 6px; }
a { color: var(--blau-dunkel); }
.mini { color: var(--grau); font-size: 14px; }
.mitte { text-align: center; }
.karte {
  background: #fff;
  border-radius: 18px;
  padding: clamp(16px, 4vw, 26px);
  margin-bottom: 16px;
  border: 1px solid var(--linie);
}
.schmal { max-width: 420px; margin: 24px auto; }
.meldung { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.meldung.ok { background: #dcfce7; color: #14532d; }
.meldung.fehler { background: #fee2e2; color: #7f1d1d; }
.meldung.hinweis { background: #e0f2fe; color: #0c4a6e; }

label { display: block; margin-bottom: 14px; font-weight: 600; }
input, select, textarea {
  display: block; width: 100%; min-width: 0; margin-top: 4px; padding: 12px;
  font-size: 17px; font-family: inherit; font-weight: 400;
  border: 2px solid #cbd5e1; border-radius: 12px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blau); }

/* Knöpfe tragen immer die Aktionsfarbe, nie die Feldoptik */
.knopf {
  display: inline-block; background: var(--farbe); color: #fff; border: 0;
  border-radius: 14px; padding: 12px 20px; min-height: 48px; font-size: 17px; font-weight: 700;
  text-decoration: none; cursor: pointer; text-align: center; font-family: inherit;
  transition: transform 120ms ease, background-color 120ms ease;
}
.knopf:active, .wahlknopf:active, .fachkachel:active { transform: scale(0.98); }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; }
.knopf.gross { font-size: 20px; padding: 16px 22px; }
.knopf.breit { display: block; width: 100%; margin: 10px 0; }
.knopf.hell { background: #fff; color: var(--text); border: 1px solid var(--linie); }
.knopf.gruen { background: var(--gruen); }
.knopf.rot { background: var(--rot); }
.knopf .zahl { background: #fff; color: var(--blau); border-radius: 99px; padding: 0 10px; margin-left: 6px; }
button.link { background: none; border: 0; color: var(--grau); text-decoration: underline; font-size: 15px; padding: 10px 0; cursor: pointer; }
button.link.rot { color: var(--rot); }

/* Startseite */
.heute { margin-bottom: 18px; }
.heute .knopf { width: 100%; }
.lob { background: #fff; border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; margin: 0; color: var(--grau); }
.serie { font-size: 15px; color: var(--grau); margin: 10px 0 0; }
.faecher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .faecher { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fachkachel {
  background: #fff; border-radius: 18px; padding: 16px; text-decoration: none; color: var(--text);
  border: 1px solid var(--linie);
  display: flex; flex-direction: column; gap: 8px; min-height: 132px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .fachkachel:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(32,34,56,.08); }
}
.fachkachel .symbol {
  font-size: 28px; line-height: 1; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; background: color-mix(in srgb, var(--farbe) 14%, #fff);
}
.fachkachel .stand { font-size: 13px; color: var(--grau); }
.fachkachel .name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.balken { display: block; height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: auto; }
.balken i { display: block; height: 100%; background: var(--farbe); border-radius: 99px; }

/* Fach- und Themenseiten */
.fachkopf { border-left: 8px solid var(--farbe); padding-left: 12px; margin-bottom: 12px; }
.fachkopf h1 { margin-bottom: 4px; }
.zurueck { color: var(--grau); text-decoration: none; font-size: 15px; }
.sterne { white-space: nowrap; margin: 0; }
.themen { list-style: none; padding: 0; margin: 0; }
.themen li a {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; min-height: 56px;
  text-decoration: none; color: var(--text); font-weight: 600;
  border: 1px solid var(--linie); border-left: 6px solid var(--farbe);
}
.themen li a span:first-child { min-width: 0; overflow-wrap: anywhere; }
.themen li a.neu { color: var(--blau-dunkel); border-left-color: #cbd5e1; }
.liste { padding-left: 20px; }

.notiztext h2, .notiztext h3 { margin-top: 14px; }
.notiztext ul { padding-left: 22px; }
.notiztext { max-width: 65ch; }
.notiztext p { margin: 0 0 1em; }
.notiztext ul { padding-inline-start: 1.3em; }
.notiztext mark { background: #fef3c7; color: #713f12; border-radius: 4px; padding: 0.05em 0.2em; }
.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: left; }
th { background: #f8fafc; }
.verweis { background: var(--akzent-zart); border-radius: 6px; padding: 0 4px; text-decoration: none; }
.verweis.neu { background: none; border-bottom: 2px dashed #93c5fd; border-radius: 0; color: var(--grau); }

/* Karteikarten zum Umdrehen */
.kartenstapel { display: grid; gap: 10px; margin-bottom: 16px; }
.lernkarte { background: #fff; border-radius: 14px; border: 1px solid var(--linie); }
.lernkarte summary {
  list-style: none; cursor: pointer; padding: 16px; font-weight: 600; min-height: 56px;
}
.lernkarte summary::-webkit-details-marker { display: none; }
.lernkarte[open] summary { border-bottom: 2px dashed var(--linie); }
.rueckseite { padding: 14px 16px; background: #f5f3ff; border-radius: 0 0 14px 14px; }
.sprechen { background: none; border: 0; font-size: 20px; cursor: pointer; padding: 0 4px; vertical-align: middle; }

/* Quiz */
.quizkopf { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.quizkopf span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quizkopf .zurueck { font-size: 24px; padding: 4px 8px; }
.fortschritt { height: 10px; background: #e2e8f0; border-radius: 99px; margin: 10px 0 16px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; background: var(--blau); border-radius: 99px; transition: width 300ms ease; }
.quizkarte .frage { font-size: 21px; font-weight: 700; margin: 4px 0 18px; overflow-wrap: anywhere; }
.wahl { display: grid; gap: 10px; }
.wahlknopf {
  width: 100%; text-align: left; font-size: 18px; padding: 14px 16px; min-height: 52px; border-radius: 14px;
  border: 1px solid var(--linie); background: #fff; color: var(--text); cursor: pointer; font-family: inherit;
  transition: transform 120ms ease, background-color 120ms ease;
}
.wahlknopf:active { background: var(--akzent-zart); border: 2px solid var(--blau); }
.eingabezeile { display: flex; gap: 8px; align-items: stretch; margin: 6px 0; }
.eingabezeile input { flex: 1; margin: 0; }
.aufdecken summary { list-style: none; }
.aufdecken summary::-webkit-details-marker { display: none; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rueckmeldung { border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.rueckmeldung.richtig { background: #ecfdf5; color: #065f46; }
.rueckmeldung.falsch { background: #fffbeb; color: #92400e; }
.rueckmeldung .antwort { color: var(--text); }
.rueckmeldung .gross { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.antwort { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.erklaerung { margin-bottom: 0; }
.riesig { font-size: 48px; margin: 8px 0; }
p.gross { font-size: 22px; font-weight: 700; }
.hilfe { background: #f8fafc; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.hilfe summary { cursor: pointer; font-weight: 600; }
code { background: #e2e8f0; border-radius: 4px; padding: 1px 4px; font-size: 15px; }

/* Leiste unten - mit dem Daumen erreichbar */
.unten {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; background: #fff;
  border-top: 1px solid var(--linie); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.unten a {
  flex: 1; text-align: center; min-height: 56px; padding: 6px 0; border-radius: 12px;
  text-decoration: none; color: var(--grau); font-size: 13px; font-weight: 600;
}
.unten a span { display: block; font-size: 22px; }
.unten a.an { color: var(--blau); background: var(--akzent-zart); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .knopf:active, .wahlknopf:active, .fachkachel:active, .fachkachel:hover { transform: none; }
}

/* Handyzeit */
.handyzeit {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--linie); border-radius: 14px; padding: 12px 16px;
  margin-top: 10px; text-decoration: none; color: var(--text); min-height: 52px;
}
.handyzeit strong { color: var(--blau); white-space: nowrap; }
.anfrage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.anfrage span { flex: 1 1 100%; }
.anfrage form { margin: 0; }
label.haken { display: flex; gap: 10px; align-items: center; font-weight: 600; }
label.haken input { width: auto; margin: 0; }

/* Vokabelheft */
.reiterzeile { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 4px 0 8px; }
.reiterzeile a { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--linie);
  background: #fff; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; }
.reiterzeile a.an { background: var(--akzent-zart); border-color: var(--blau); color: var(--blau); }
.uebungen { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.uebungen .knopf.breit, .uebungen form { margin: 0; }
.vokabelliste { list-style: none; padding: 0; margin: 0; }
.vokabelliste li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--linie);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.vokabelliste li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vokabelliste .sterne { color: var(--blau); font-size: 12px; letter-spacing: 1px; }
.vokabelliste form { margin: 0; }
.zwei label { margin-bottom: 8px; min-width: 0; }
.geuebt { text-align: left; display: inline-block; margin: 0 auto 8px; }
.nebenrunde { margin-top: 8px; }
.paare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paare button { min-height: 56px; border-radius: 14px; border: 1px solid var(--linie); background: #fff;
  font-size: 17px; font-weight: 600; color: var(--text); padding: 10px; overflow-wrap: anywhere; cursor: pointer; }
.paare button.gewaehlt { background: var(--akzent-zart); border: 2px solid var(--blau); }
.paare button.fertig { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.paare button.daneben { animation: wackeln 300ms; border-color: #fbbf24; }
@keyframes wackeln { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hoerknopf { font-size: 44px; width: 96px; height: 96px; border-radius: 50%; border: 0;
  background: var(--akzent-zart); cursor: pointer; display: block; margin: 8px auto 16px; }
