/* =====================================================================
   Español: Aussehen der App (helles und dunkles Design)
   ===================================================================== */

:root {
  --hg: #FBF7F2;
  --karte: #FFFFFF;
  --text: #1F1A17;
  --text2: #6E645D;
  --rand: #ECE3D9;
  --rot: #C8102E;
  --rot-weich: #FBE7E9;
  /* Fehlerfarbe: bleibt in jedem Kurs rot (--rot wird je Kurs zur Kursfarbe) */
  --fehler: #C8102E;
  --fehler-weich: #FBE7E9;
  --gelb: #F2B300;
  --gelb-weich: #FFF4D6;
  --gruen: #2E7D4F;
  --gruen-weich: #E3F3E9;
  --orange: #C46A00;
  --orange-weich: #FDEEDC;
  --blau: #2C64B8;
  --blau-weich: #E3ECFA;
  --lila: #7046B0;
  --lila-weich: #EFE8FA;
  --schatten: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hg: #171311;
    --karte: #221C19;
    --text: #F4EEE8;
    --text2: #A99E96;
    --rand: #3A302B;
    --rot: #F0525F;
    --rot-weich: #3A1F22;
    --fehler: #F0525F;
    --fehler-weich: #3A1F22;
    --gelb: #F5C542;
    --gelb-weich: #3A3020;
    --gruen: #5CC48A;
    --gruen-weich: #1C3326;
    --orange: #F0A04B;
    --orange-weich: #3A2A18;
    --blau: #7AA7F0;
    --blau-weich: #1D2A40;
    --lila: #B596F0;
    --lila-weich: #2B2140;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--hg);
  color: var(--text);
  font: calc(17px * var(--gr, 1))/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
svg { display: block; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 96px);
}
body.lernmodus #app { padding-bottom: 0; }

h1 { font-size: calc(32px * var(--gr, 1)); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h2 { font-size: calc(18px * var(--gr, 1)); margin: 0 0 12px; }
h3 { font-size: calc(15px * var(--gr, 1)); margin: 0 0 6px; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
.klein { font-size: calc(14px * var(--gr, 1)); color: var(--text2); }
.unterzeile { font-size: calc(14px * var(--gr, 1)); color: var(--text2); margin-bottom: 2px; }

/* ---------- Kopf ---------- */
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 2px 18px; }
.serie { text-align: center; background: var(--gelb-weich); border-radius: 14px; padding: 8px 12px; min-width: 76px; }
.serie b { display: block; font-size: calc(24px * var(--gr, 1)); line-height: 1; color: var(--orange); }
.serie span { font-size: calc(11px * var(--gr, 1)); color: var(--text2); }

/* ---------- Karten ---------- */
.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--schatten);
}
.hinweis-install { background: var(--blau-weich); border-color: transparent; font-size: calc(15px * var(--gr, 1)); }

.zielkarte { display: flex; align-items: center; gap: 18px; }
.zielkarte b { display: block; font-size: calc(22px * var(--gr, 1)); }
.zielkarte span { color: var(--text2); font-size: calc(14px * var(--gr, 1)); }
.ring { width: 76px; height: 76px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 9; }
.ring-grund { stroke: var(--rand); }
.ring-wert { stroke: var(--rot); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }

.startkarte h2 { margin-bottom: 10px; }
.startkarte.erledigt p { color: var(--text2); margin-bottom: 14px; }
.zahlen { display: flex; gap: 10px; margin-bottom: 16px; }
.zahlen > div { flex: 1; background: var(--hg); border-radius: 14px; padding: 12px; text-align: center; }
.zahlen b { display: block; font-size: calc(28px * var(--gr, 1)); line-height: 1.1; }
.zahlen span { font-size: calc(13px * var(--gr, 1)); color: var(--text2); }

.lerntipp { background: var(--gelb-weich); border-color: transparent; }
.lerntipp p { font-size: calc(15px * var(--gr, 1)); }

/* ---------- Knöpfe ---------- */
.haupt, .zweit, .gefahr {
  display: block; width: 100%;
  border: 0; border-radius: 14px;
  padding: 15px 18px; min-height: 52px;
  font-weight: 600; font-size: calc(17px * var(--gr, 1));
}
.haupt { background: var(--rot); color: #fff; }
.haupt:active { filter: brightness(.92); }
.haupt:disabled { opacity: .45; }
.zweit { background: var(--hg); border: 1px solid var(--rand); margin-top: 10px; }
.formular .zweit:first-of-type { margin-top: 4px; }
.gefahr { background: transparent; border: 1px solid var(--rot); color: var(--rot); }
.symbol { background: none; border: 0; padding: 8px; margin: -8px; color: var(--text2); }
.symbol svg { width: 26px; height: 26px; }

/* ---------- Balken ---------- */
.balken { position: relative; height: 8px; background: var(--rand); border-radius: 99px; overflow: hidden; flex: 1; }
.balken > div { position: absolute; inset: 0 auto 0 0; background: var(--rot); border-radius: 99px; transition: width .3s ease; }
.balken.gross { height: 12px; margin-bottom: 10px; }
.balken.gross > div { background: var(--gelb); }
.balken.gross > div.sicher { background: var(--gruen); }
.balken.mini { height: 6px; max-width: 90px; }
.legende { font-size: calc(14px * var(--gr, 1)); color: var(--text2); margin-bottom: 8px; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 5px 0 2px; vertical-align: 0; }
.punkt.neu { background: var(--rand); }
.punkt.lernt { background: var(--gelb); }
.punkt.sicher { background: var(--gruen); }

/* ---------- Lernansicht ---------- */
.lernen { min-height: calc(100dvh - env(safe-area-inset-top) - 16px); display: flex; flex-direction: column; }
.lernkopf { display: flex; align-items: center; gap: 14px; padding: 4px 2px 14px; }
.uhr { font-size: calc(13px * var(--gr, 1)); color: var(--text2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lernkarte {
  flex: 1;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: var(--schatten);
  display: flex; flex-direction: column; gap: 14px;
}
.etikett { font-size: calc(13px * var(--gr, 1)); color: var(--text2); text-transform: uppercase; letter-spacing: .05em; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lektionsname { text-transform: none; letter-spacing: 0; margin-left: auto; opacity: .8; }
.marke { background: var(--rot); color: #fff; border-radius: 6px; padding: 2px 7px; font-weight: 700; font-size: calc(11px * var(--gr, 1)); }
.marke.blau { background: var(--blau); }
.marke.grau { background: var(--text2); }
.es { font-weight: 600; }
.gross { font-size: calc(27px * var(--gr, 1)); line-height: 1.25; letter-spacing: -.005em; }
.de { color: var(--text2); font-size: calc(18px * var(--gr, 1)); }
.de.gross { color: var(--text); font-weight: 600; }
.hinweis { margin-top: auto; }

.tippbox { background: var(--blau-weich); border-radius: 14px; padding: 12px 14px; font-size: calc(15px * var(--gr, 1)); }
.tippbox b { display: block; color: var(--blau); font-size: calc(13px * var(--gr, 1)); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

.hoerknoepfe { display: flex; gap: 10px; flex-wrap: wrap; }
.pille {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--rot-weich); color: var(--rot);
  border: 0; border-radius: 99px; padding: 9px 15px; font-size: calc(15px * var(--gr, 1)); font-weight: 600;
}
.pille svg { width: 20px; height: 20px; }

.woerter { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rand); }
.woerter li { padding: 8px 0; border-bottom: 1px solid var(--rand); font-size: calc(15px * var(--gr, 1)); color: var(--text2); }
.woerter b { color: var(--text); font-weight: 600; margin-right: 4px; }

.eingabe { position: relative; }
.eingabe textarea {
  width: 100%; resize: none;
  border: 1.5px solid var(--rand); border-radius: 14px;
  background: var(--hg);
  padding: 14px 64px 14px 14px; font-size: calc(18px * var(--gr, 1)); min-height: 64px;
}
.eingabe textarea:focus { outline: none; border-color: var(--rot); }
.rund {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--rot); color: #fff; display: grid; place-items: center;
}
.rund svg { width: 24px; height: 24px; }
.rund.hoert { animation: puls 1.1s ease-in-out infinite; }
@keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, .45); } 50% { box-shadow: 0 0 0 12px rgba(200, 16, 46, 0); } }

.vergleich { border-radius: 14px; padding: 12px 14px; font-size: calc(16px * var(--gr, 1)); }
.vergleich b { display: block; margin-bottom: 4px; }
.vergleich.gut { background: var(--gruen-weich); }
.vergleich.gut b { color: var(--gruen); }
.vergleich.fast { background: var(--orange-weich); }
.vergleich.fast b { color: var(--orange); }
.vergleich.falsch { background: var(--fehler-weich); }
.vergleich.falsch b { color: var(--fehler); }
.vergleich p + p { margin-top: 6px; }
span.fehlt { text-decoration: underline wavy var(--orange); text-underline-offset: 5px; text-decoration-thickness: 2px; }
span.falsch { color: var(--fehler); text-decoration: line-through; }
span.vertippt { text-decoration: underline dotted var(--orange); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.note { font-weight: 700; }
.note.n1 { color: var(--fehler); }
.note.n2 { color: var(--orange); }
.note.n3 { color: var(--gruen); }
.bewertungen.zwei { grid-template-columns: 1fr 1fr; }

/* Grammatik-Tabellen */
.tabellenrahmen { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
.tabelle { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--karte); border-radius: 10px; overflow: hidden; }
.tabelle caption { text-align: left; font-size: calc(13px * var(--gr, 1)); color: var(--text2); padding: 0 2px 6px; caption-side: top; }
.tabelle th, .tabelle td { padding: 6px 7px; text-align: left; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle thead th { font-size: calc(12px * var(--gr, 1)); color: var(--text2); font-weight: 600; text-transform: none; }
.tabelle tbody th { font-weight: 500; color: var(--text2); min-width: 5.5em; }
.tabelle tbody th.kurz { white-space: nowrap; min-width: 0; }
.tabelle td { font-weight: 600; }
.tabelle td.deutsch { font-weight: 400; color: var(--text2); }
.tabelle tr:last-child th, .tabelle tr:last-child td { border-bottom: 0; }
.tabellenhinweis { font-size: calc(12px * var(--gr, 1)); color: var(--text2); margin-top: 5px; }

/* Satz bauen */
.bauzeile {
  min-height: 64px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
  padding: 10px; border: 1.5px dashed var(--rand); border-radius: 14px; background: var(--hg);
}
.bauzeile.leer { align-items: center; justify-content: center; }
.kacheln { display: flex; flex-wrap: wrap; gap: 8px; }
.kachel {
  border: 1.5px solid var(--rand); border-bottom-width: 3px; border-radius: 12px;
  background: var(--karte); padding: 8px 13px; font-size: calc(17px * var(--gr, 1)); font-weight: 600; min-height: 44px;
}
.kachel:active { transform: translateY(1px); }
.kachel.leer { visibility: hidden; }
.bauzeile .kachel { border-color: var(--blau); color: var(--blau); background: var(--blau-weich); }

/* Lesen und Hören */
.texttitel { font-size: calc(22px * var(--gr, 1)); margin: 0; }
.text { display: flex; flex-direction: column; gap: 4px; }
.zeile { padding: 9px 12px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.zeile:active, .zeile.offen { background: var(--hg); }
.zeile.aktiv { background: var(--gelb-weich); }
.zeile .es { font-weight: 500; font-size: calc(18px * var(--gr, 1)); line-height: 1.4; }
.zeile .de { font-size: calc(15px * var(--gr, 1)); margin-top: 3px; }
.sprecher { display: block; font-size: calc(12px * var(--gr, 1)); color: var(--blau); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
.textkasten summary { cursor: pointer; color: var(--text2); font-size: calc(15px * var(--gr, 1)); padding: 4px 0; }
.textkasten .zeile { cursor: default; padding: 6px 4px; }
.textkasten .zeile .es { font-size: calc(16px * var(--gr, 1)); }
.fragetext { font-size: calc(21px * var(--gr, 1)); font-weight: 600; line-height: 1.3; }
.option.richtig { border-color: var(--gruen); background: var(--gruen-weich); color: var(--gruen); font-weight: 600; }
.option.daneben { border-color: var(--fehler); background: var(--fehler-weich); color: var(--fehler); }
.option:disabled { cursor: default; }
.lernkarte.mitte { text-align: center; justify-content: center; align-items: center; }

/* Üben */
.liste { display: flex; flex-direction: column; }
.zeilenknopf {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; border-top: 1px solid var(--rand); padding: 13px 2px; text-align: left; font-size: calc(16px * var(--gr, 1));
}
.zeilenknopf:first-child { border-top: 0; }
.zeilenknopf small { color: var(--text2); font-size: calc(13px * var(--gr, 1)); white-space: nowrap; }
.zeilenknopf:active { background: var(--hg); }
.abstand { margin-bottom: 12px; }

/* Mikrofon: deutlich zeigen, wann man sprechen kann */
.eingabe.hoert textarea { border-color: var(--rot); background: var(--rot-weich); }
.mikrostatus {
  display: flex; align-items: center; gap: 9px;
  margin: -4px 2px 0; font-size: calc(15px * var(--gr, 1)); font-weight: 600; color: var(--rot);
}
.mikrostatus[hidden] { display: none; }
.mikrostatus::before {
  content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--rot); animation: blinken 1s ease-in-out infinite;
}
@keyframes blinken { 50% { opacity: .25; } }

/* Grammatik und weitere richtige Lösungen */
.grammatik { background: var(--gruen-weich); border-radius: 14px; padding: 12px 14px; font-size: calc(15px * var(--gr, 1)); }
.grammatik > b, .grammatik summary { display: block; color: var(--gruen); font-size: calc(13px * var(--gr, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.grammatik > b { margin-bottom: 4px; }
.grammatik summary { list-style: none; cursor: pointer; }
.grammatik summary::-webkit-details-marker { display: none; }
.grammatik summary::after { content: " ▸"; }
.grammatik[open] summary::after { content: " ▾"; }
.grammatik[open] summary { margin-bottom: 4px; }
.auchrichtig span { color: var(--text); font-weight: 600; }
.tonknopf.aus { color: var(--rot); }

.lernfuss {
  position: sticky; bottom: 0;
  padding: 14px 0 calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to bottom, transparent, var(--hg) 22%);
}
.frage { text-align: center; margin-bottom: 8px; }
.bewertungen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bewertung {
  border: 0; border-radius: 14px; padding: 10px 4px; min-height: 60px;
  font-weight: 700; font-size: calc(15px * var(--gr, 1)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.bewertung small { font-weight: 500; font-size: calc(12px * var(--gr, 1)); opacity: .8; }
.b1 { background: var(--fehler-weich); color: var(--fehler); }
.b2 { background: var(--orange-weich); color: var(--orange); }
.b3 { background: var(--gruen-weich); color: var(--gruen); }
.b4 { background: var(--blau-weich); color: var(--blau); }
.bewertung.vorschlag { box-shadow: 0 0 0 2.5px currentColor inset; }

/* ---------- Fertig ---------- */
.fertigansicht { min-height: calc(100dvh - 120px); display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; padding: 20px 4px calc(env(safe-area-inset-bottom) + 20px); }
.medaille {
  align-self: center; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFD75E, var(--gelb) 60%, #D99400);
  color: #5A1B00; font-weight: 800; font-size: calc(24px * var(--gr, 1)); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(242, 179, 0, .35);
  transform: rotate(-8deg);
  animation: rein .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes rein { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
.fertigansicht .zahlen { margin: 8px 0; }
.fertigansicht .zahlen > div { background: var(--karte); border: 1px solid var(--rand); }

/* ---------- Einstufung beim ersten Start ---------- */
.einstufung {
  min-height: calc(100dvh - env(safe-area-inset-top) - 16px);
  display: flex; flex-direction: column; gap: 14px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
}
.einstufung > h1 { margin-top: 4px; }
.einstufung .es.gross { margin: 10px 0 6px; }
.lernweg { margin: 0; padding: 0; list-style: none; counter-reset: schritt; display: flex; flex-direction: column; gap: 10px; }
.lernweg li {
  counter-increment: schritt; position: relative;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 14px;
  padding: 12px 14px 12px 50px; font-size: calc(15px * var(--gr, 1));
}
.lernweg li::before {
  content: counter(schritt); position: absolute; left: 13px; top: 11px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--rot); color: #fff; font-weight: 700; font-size: calc(14px * var(--gr, 1));
}
.medaille.klein { width: 96px; height: 96px; font-size: calc(19px * var(--gr, 1)); margin-top: 12px; }
.optionen { display: flex; flex-direction: column; gap: 10px; }
.option {
  text-align: left; background: var(--karte); border: 1.5px solid var(--rand); border-radius: 14px;
  padding: 14px 16px; min-height: 54px; font-size: calc(16px * var(--gr, 1)); box-shadow: var(--schatten);
}
.option:active { border-color: var(--rot); background: var(--rot-weich); }
.leise { background: none; border: 0; color: var(--text2); text-decoration: underline; text-underline-offset: 3px; padding: 10px; font-size: calc(15px * var(--gr, 1)); align-self: center; }
.einstufung.ergebnis { justify-content: center; text-align: center; }
.niveau {
  align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--gelb-weich); border-radius: 22px; padding: 20px 28px; min-width: 220px;
  animation: auftauchen .4s ease-out;
}
@keyframes auftauchen { from { transform: scale(.85); opacity: 0; } }
.einstufung.ergebnis .etikett { justify-content: center; }
.niveau b { font-size: calc(28px * var(--gr, 1)); line-height: 1.15; }
.niveau span { background: var(--rot); color: #fff; border-radius: 8px; padding: 2px 10px; font-weight: 700; font-size: calc(15px * var(--gr, 1)); }
.niveauzeile { margin-top: 6px; }

/* ---------- Sätze ---------- */
.stufe { flex: none; background: var(--rot-weich); color: var(--rot); border-radius: 8px; padding: 3px 8px; font-weight: 700; font-size: calc(13px * var(--gr, 1)); white-space: nowrap; }
.stufe.klein { font-size: calc(11px * var(--gr, 1)); padding: 1px 6px; margin-right: 8px; }
.stand { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.stand b { display: block; }
.block summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.block summary::-webkit-details-marker { display: none; }
.blocktitel { flex: 1; }
.blocktitel b { display: block; font-size: calc(17px * var(--gr, 1)); }
.pfeil::after { content: "▸"; color: var(--text2); }
.block[open] .pfeil::after { content: "▾"; }
.block .balken.gross { margin: 12px 0 8px; }
.block.fertig .stufe { background: var(--gruen-weich); color: var(--gruen); }
.blockinhalt-text { margin-bottom: 4px; }
.blockinhalt .lektion { border-top: 1px solid var(--rand); padding: 12px 0 0; margin-top: 12px; }
.listenkopf { display: flex; align-items: center; font-size: calc(13px * var(--gr, 1)); font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; padding: 14px 0 6px; }
.listenkopf:first-child { padding-top: 0; }
.lektion summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.lektion summary::-webkit-details-marker { display: none; }
.lektion summary b { display: block; }
.lektion[open] summary { margin-bottom: 12px; }
.satzliste { list-style: none; margin: 12px 0 0; padding: 0; }
.satzliste li { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-top: 1px solid var(--rand); cursor: pointer; }
.satzliste li:active { background: var(--hg); }
.satzliste .punkt { margin-top: 7px; flex: none; }
.satzliste div { flex: 1; }
.satzliste .es { font-size: calc(16px * var(--gr, 1)); }
.satzliste .de { font-size: calc(14px * var(--gr, 1)); }
.satzliste small { color: var(--text2); font-size: calc(12px * var(--gr, 1)); white-space: nowrap; margin-top: 3px; }

/* ---------- Einstellungen ---------- */
.formular label { display: block; margin-bottom: 16px; }
.regler { display: grid !important; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.regler input { grid-column: 1 / -1; width: 100%; accent-color: var(--rot); }
.regler output { font-weight: 700; color: var(--rot); }
.schalter { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.schalter input { width: 22px; height: 22px; accent-color: var(--rot); flex: none; }
.auswahl select { display: block; width: 100%; margin-top: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--rand); background: var(--hg); }
.formular .klein { margin-top: 12px; }
.fusszeile { text-align: center; font-size: calc(13px * var(--gr, 1)); color: var(--text2); margin: 18px 0; }

/* ---------- Menü unten ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  background: color-mix(in srgb, var(--karte) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--rand);
}
.tabs[hidden] { display: none; }
.tabs button {
  flex: 1; max-width: 160px; background: none; border: 0; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: calc(11px * var(--gr, 1)); color: var(--text2);
}
.tabs svg { width: 24px; height: 24px; }
.tabs button.aktiv { color: var(--rot); }

/* ---------- Meldung ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--hg);
  padding: 12px 18px; border-radius: 14px; font-size: calc(15px * var(--gr, 1)); max-width: calc(100% - 32px); width: max-content;
  transition: opacity .25s, transform .25s;
}
#toast.sichtbar { opacity: 1; transform: translate(-50%, 0); }

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

/* ---------- Kurse ---------- */
/* Jeder Kurs hat seine eigene Hauptfarbe (Spanisch rot, Englisch blau, Italienisch grün) */
html.ziel-en { --rot: #1D4F91; --rot-weich: #E1E9F5; }
html.ziel-it { --rot: #00804A; --rot-weich: #DFF2E8; }
@media (prefers-color-scheme: dark) {
  html.ziel-en { --rot: #7FA6E8; --rot-weich: #1D2A40; }
  html.ziel-it { --rot: #4CC48A; --rot-weich: #1C3326; }
}
.kurswahl { justify-content: center; }
.kurswahl .medaille.klein { width: 120px; height: 120px; font-size: calc(18px * var(--gr, 1)); text-align: center; line-height: 1.2; }
.kursliste { display: flex; flex-direction: column; gap: 12px; margin: 6px 0; }
.kurswahl-knopf {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--karte); border: 1.5px solid var(--rand); border-left: 6px solid var(--kursfarbe);
  border-radius: 14px; padding: 14px 16px; min-height: 64px; box-shadow: var(--schatten);
}
.kurswahl-knopf .kursname { font-weight: 700; font-size: calc(19px * var(--gr, 1)); }
.kurswahl-knopf small { color: var(--text2); font-size: calc(14px * var(--gr, 1)); }
.kurswahl-knopf:active { background: var(--rot-weich); }

/* ---------- Große Schrift und Knöpfe ---------- */
body.grossschrift { --gr: 1.2; }
body.grossschrift .haupt, body.grossschrift .zweit, body.grossschrift .gefahr { min-height: 60px; }
body.grossschrift .option { min-height: 62px; }
body.grossschrift .kachel { padding: 10px 14px; }
body.grossschrift .bewertungen { grid-template-columns: 1fr 1fr; }

/* ---------- Verbformen im Lückentext ---------- */
.marke.lila { background: var(--lila); }
.luecke { display: inline-block; min-width: 3.2em; border-bottom: 2.5px solid var(--lila); color: var(--lila); text-align: center; margin: 0 2px; line-height: 1.1; }
mark.verbform { background: var(--lila-weich); color: var(--lila); font-weight: 700; border-radius: 6px; padding: 0 4px; }
.verbhilfe { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: calc(15px * var(--gr, 1)); color: var(--text2); }
.verbhilfe b { color: var(--lila); font-size: calc(19px * var(--gr, 1)); }
.verbfeld { width: 100%; border: 1.5px solid var(--rand); border-radius: 14px; background: var(--hg); padding: 14px; font-size: calc(18px * var(--gr, 1)); }
.verbfeld:focus { outline: none; border-color: var(--lila); }
.liste.abstand-oben { margin-top: 12px; }

/* ---------- Grammatik-Übersicht ---------- */
.grammatiklink { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; width: 100%; text-align: left; cursor: pointer; }
.grammatiklink b { flex: 1 1 60%; font-size: calc(17px * var(--gr, 1)); }
.grammatiklink .pfeil { order: 2; }
.grammatiklink .klein { order: 3; flex-basis: 100%; }
.zurueckknopf { background: none; border: 0; padding: 4px 0; color: var(--rot); font-size: calc(15px * var(--gr, 1)); cursor: pointer; }
.thema summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.thema summary::-webkit-details-marker { display: none; }
.thema[open] .pfeil::after { content: "▾"; }
.thema[open] summary { margin-bottom: 12px; }
.themainhalt { display: flex; flex-direction: column; gap: 12px; }
.themasatz { margin: 0; }

/* ---------- Hören und schreiben ---------- */
.eingabe.ohne-mikro textarea { padding-right: 14px; }
.lernfuss .leise { display: block; margin: 6px auto 0; }

/* ---------- Wochenrückblick ---------- */
.wochenbalken { display: flex; gap: 6px; height: calc(120px * var(--gr, 1)); margin: 10px 0 12px; }
.tagsaeule { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.saeule { flex: 1; width: 100%; max-width: 36px; position: relative; display: flex; align-items: flex-end; background: var(--hg); border-radius: 8px; overflow: hidden; }
.saeule > div { width: 100%; background: var(--gelb); border-radius: 8px 8px 0 0; }
.saeule > div.voll { background: var(--gruen); }
.saeule::after { content: ''; position: absolute; left: 0; right: 0; bottom: var(--ziel); border-top: 2px dashed var(--text2); opacity: .45; }
.tagsaeule span { font-size: calc(12px * var(--gr, 1)); color: var(--text2); white-space: nowrap; }
.tagsaeule.heute span { color: var(--text); font-weight: 700; }
.woche p:last-child { margin: 0; }
.punkt.voll { background: var(--gruen); }
.strich { display: inline-block; width: 14px; border-top: 2px dashed var(--text2); opacity: .7; vertical-align: middle; margin-right: 6px; }

/* ---------- Formen trainieren ---------- */
.formzeit { color: var(--text2); font-size: calc(15px * var(--gr, 1)); margin: 2px 0 0; }
.formaufgabe { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 2px; }
.formaufgabe .person { font-size: calc(22px * var(--gr, 1)); color: var(--text2); }
.formaufgabe b { font-size: calc(26px * var(--gr, 1)); color: var(--lila); }

/* ---------- Suche unter „Sätze“ ---------- */
.suchfeld { margin: 0 0 10px; }
.suchfeld input { width: 100%; border: 1.5px solid var(--rand); border-radius: 14px; background: var(--karte); color: var(--text); padding: 12px 14px; font-size: calc(17px * var(--gr, 1)); }
.suchfeld input:focus { outline: none; border-color: var(--rot); }
.suchergebnis .satzliste { margin-top: 6px; }

/* ---------- Verstehen unter „Üben“ ---------- */
.marke.gruen { background: #2E7D4F; }

/* ---------- Erinnerung ans Sichern ---------- */
.sicherungskarte .leise { display: block; margin: 4px auto 0; }
.sicherungsstand { margin-top: 6px; font-weight: 600; }

/* ---------- Akzent-Tasten unter dem Eingabefeld ---------- */
.zeichenleiste { display: flex; gap: 6px; margin-top: -6px; }
.zeichen { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 0; border: 1px solid var(--rand); border-radius: 10px; background: var(--hg); color: var(--text); font-size: calc(19px * var(--gr, 1)); font-weight: 600; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.zeichen:active { background: var(--rot-weich); border-color: var(--rot); }
