/* Vokabel-MJ – Stil B: dunkelgrüner Kopf, helle Fläche, weiße Karten, Lexend */

@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap; src: url("/fonts/lexend-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Lexend"; font-weight: 500; font-display: swap; src: url("/fonts/lexend-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url("/fonts/lexend-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Lexend"; font-weight: 700; font-display: swap; src: url("/fonts/lexend-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap; src: url("/fonts/lexend-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url("/fonts/lexend-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --tief: #065F46;
  --gruen: #047857;
  --gruen-hell: #059669;
  --mint: #D1FAE5;
  --mint-2: #6EE7B7;
  --mint-text: #CFF5E4;
  --grund: #F4FBF7;
  --karte: #FFFFFF;
  --rand: #D5EBDF;
  --segment: #EEF7F2;
  --text: #12332A;
  --text-2: #3F5F55;
  --koralle: #E07A5F;
  --koralle-hell: #FFF1EC;
  --koralle-text: #A33A1D;
  --gold: #B45309;
  --schatten: 0 8px 24px rgba(6, 78, 59, .12);
  --r-gross: 26px;
  --r: 18px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
  background: #E3F2EA;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gruen); }
:focus-visible { outline: 3px solid var(--gruen-hell); outline-offset: 2px; }
.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--grund);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 600px) {
  #app { box-shadow: 0 0 40px rgba(6, 78, 59, .10); }
}
.laden { margin: auto; color: var(--text-2); padding: 40px; }

/* ---------- Kopf */
.kopf {
  background: var(--tief);
  color: #fff;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 28px;
  border-radius: 0 0 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kopf.mit-karte { padding-bottom: 64px; }
.kopf-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kopf-titel { font-size: 17px; font-weight: 600; text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf-klein { font-size: 15px; color: var(--mint-text); }
.kopf-gross { font-size: 28px; font-weight: 700; line-height: 1.15; }
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 14px; border: none;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.icon-btn.rund { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); width: 48px; height: 48px; flex-basis: 48px; font-weight: 700; font-size: 18px; }
.icon-btn.hell { background: var(--mint); color: var(--gruen); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .14);
  padding: 10px 12px; border-radius: 14px;
  font-weight: 600; font-size: 16px; white-space: nowrap;
}
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: rgba(255, 255, 255, .14); border-radius: 18px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; border: none; color: #fff; text-align: left;
}
.stat b { display: block; font-size: 22px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--mint-text); }
.stat svg { flex: 0 0 auto; }

.fortschritt-segmente { display: flex; gap: 5px; }
.fortschritt-segmente i { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.fortschritt-segmente i.voll { background: var(--mint-2); }
.fortschritt-linie { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.fortschritt-linie > i { display: block; height: 100%; background: var(--mint-2); border-radius: 99px; transition: width .3s; }

/* ---------- Inhalt */
.inhalt { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.inhalt + .inhalt { padding-top: 26px; }
.h2 { font-size: 20px; font-weight: 700; margin: 0; }
.h2-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.klein { font-size: 14px; color: var(--text-2); }
.leer { color: var(--text-2); font-size: 16px; background: var(--karte); border: 2px dashed var(--rand); border-radius: var(--r); padding: 16px; }
.platz { flex: 1 1 auto; min-height: 24px; }

.karte {
  background: var(--karte); border: 2px solid var(--rand); border-radius: 22px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.karte.aktiv { border-color: var(--gruen); }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: none; border: none; padding: 0; text-align: left; }
.karte-kopf .titel { font-size: 18px; font-weight: 600; }
.karte-kopf .titel small { display: block; font-size: 14px; font-weight: 400; color: var(--text-2); }
.prozent { font-size: 14px; font-weight: 600; color: var(--gruen); white-space: nowrap; }

.balken { height: 10px; border-radius: 99px; background: #E3F2EA; overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--gruen-hell); border-radius: 99px; }

.zeile-link {
  text-decoration: none; background: var(--karte); border: 2px solid var(--gruen);
  border-radius: 22px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; color: var(--text);
  width: 100%; text-align: left;
}
.zeile-link .sym { width: 48px; height: 48px; border-radius: 14px; background: var(--mint); color: var(--gruen); display: flex; align-items: center; justify-content: center; flex: 0 0 48px; }
.zeile-link .txt { flex: 1; min-width: 0; }
.zeile-link .txt b { display: block; font-size: 18px; font-weight: 600; }
.zeile-link .txt span { font-size: 15px; color: var(--text-2); }
.zeile-link.test { border-color: var(--rand); }
.zeile-link.test .sym { background: #FEF3C7; color: var(--gold); }

.kachel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kachel {
  text-align: left; background: var(--karte); border: 2px solid var(--rand); border-radius: 20px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--text);
}
.kachel b { font-size: 26px; font-weight: 700; color: var(--gruen); line-height: 1.1; }
.kachel b.rot { color: #C2492A; }
.kachel strong { font-size: 16px; font-weight: 600; }
.kachel span { font-size: 13px; color: var(--text-2); }
.kachel:disabled { opacity: .55; cursor: default; }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.chip {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 4px 8px; border-radius: 14px; background: var(--karte);
  border: 2px solid var(--rand); color: var(--text); font-size: 16px; font-weight: 500; text-align: center; line-height: 1.15;
}
.chip input { width: 20px; height: 20px; accent-color: var(--gruen); margin: 0; flex: 0 0 auto; }
.chip.an { background: var(--mint); border-color: var(--gruen); color: #065F46; font-weight: 600; }
.chip small { display: block; font-size: 11px; font-weight: 400; color: var(--text-2); }
.chip-zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.text-btn { background: none; border: none; color: var(--gruen); font-weight: 600; font-size: 15px; padding: 8px 4px; min-height: 44px; }

/* ---------- Unten fixiert */
.unten {
  position: sticky; bottom: 0; z-index: 5;
  padding: 16px 20px calc(20px + var(--sicher-unten));
  background: var(--karte); border-top: 1px solid var(--rand);
  display: flex; flex-direction: column; gap: 10px; margin-top: 24px;
}
.unten.ohne-rand { background: transparent; border-top: none; position: static; margin-top: 0; }
.segment { display: grid; gap: 6px; background: var(--segment); padding: 5px; border-radius: 16px; }
.segment.s2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segment.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segment button { min-height: 44px; border: none; border-radius: 12px; background: transparent; color: var(--text-2); font-size: 15px; font-weight: 500; }
.segment button[aria-pressed="true"] { background: #fff; color: #065F46; font-weight: 600; box-shadow: 0 1px 4px rgba(6, 78, 59, .15); }
.schalter { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); min-height: 40px; }
.schalter input { width: 22px; height: 22px; accent-color: var(--gruen); }

.btn {
  min-height: 60px; border: none; border-radius: 18px; background: var(--tief); color: #fff;
  font-size: 20px; font-weight: 600; padding: 0 20px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.sek { background: var(--karte); color: var(--tief); border: 2px solid var(--rand); }
.btn.klein { min-height: 48px; font-size: 17px; }
.btn.warn { background: #fff; color: var(--koralle-text); border: 2px solid #F3C4B5; }
.btn-reihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- Abfrage */
.wortkarte {
  margin: -44px 20px 0; background: var(--karte); border-radius: var(--r-gross);
  padding: 26px 22px; box-shadow: var(--schatten);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; position: relative;
}
.wort { font-size: 40px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.wort.lang { font-size: 30px; }
.wort.sehr-lang { font-size: 23px; line-height: 1.3; }
.wort.riesig { font-size: 19px; line-height: 1.35; font-weight: 600; }
.frage { font-size: 16px; color: var(--text-2); }
.sprechen { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--mint); color: var(--gruen); display: flex; align-items: center; justify-content: center; }

.antworten { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.opt {
  font-size: 20px; font-weight: 500; text-align: left; min-height: 62px; padding: 10px 20px; border-radius: var(--r);
  border: 2px solid var(--rand); background: var(--karte); color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; line-height: 1.25;
}
.opt.richtig { border-color: var(--gruen); background: var(--mint); color: #065F46; font-weight: 600; animation: ploepp .35s ease; }
.opt.falsch { border-color: var(--koralle); background: var(--koralle-hell); color: var(--koralle-text); }
.opt:disabled { cursor: default; }
.opt:disabled:not(.richtig):not(.falsch) { opacity: .6; }

.eingabe-feld {
  font-size: 26px; padding: 14px 18px; border-radius: var(--r); border: 2px solid var(--rand);
  background: #fff; width: 100%; outline: none;
  resize: none; overflow: hidden; line-height: 1.3; min-height: 64px; display: block;
  font-family: inherit; overflow-wrap: anywhere;
}
.eingabe-feld.lang { font-size: 21px; }
.eingabe-feld:focus { border-color: var(--gruen); }
.eingabe-feld.richtig { border-color: var(--gruen); background: var(--mint); }
.eingabe-feld.falsch { border-color: var(--koralle); }
.feld-label { font-size: 16px; font-weight: 500; color: var(--text-2); }

.rueck {
  border-radius: 16px; padding: 14px 16px; font-size: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.rueck svg { flex: 0 0 auto; margin-top: 1px; }
.rueck.ok { background: var(--mint); color: #065F46; animation: ploepp .35s ease; }
.rueck.fast, .rueck.nein { background: var(--koralle-hell); color: var(--koralle-text); }
.rueck b { font-weight: 700; }
.rueck .loesung { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; color: var(--text); }
.rueck .mehr { display: block; margin-top: 6px; color: var(--text-2); font-size: 15px; }
.doch-richtig { background: none; border: none; color: var(--text-2); text-decoration: underline; font-size: 14px; padding: 6px 0; min-height: 36px; text-align: left; }

@keyframes ploepp { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Ergebnis */
.ergebnis-kreis {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto;
  background: rgba(255,255,255,.14); display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ergebnis-kreis b { font-size: 40px; line-height: 1; }
.ergebnis-kreis span { font-size: 14px; color: var(--mint-text); }
.liste { display: flex; flex-direction: column; gap: 8px; }
.liste-eintrag { background: var(--karte); border: 2px solid var(--rand); border-radius: 16px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.liste-eintrag .en { font-weight: 600; }
.liste-eintrag .de { color: var(--text-2); text-align: right; }
.neu-abz { background: #FEF3C7; border: 2px solid #FCD34D; border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }

/* ---------- Abzeichen */
.abz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.abz { background: var(--karte); border: 2px solid var(--rand); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.abz .medaille { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #E8EFEB; color: #8AA399; }
.abz.an { border-color: #FCD34D; }
.abz.an .medaille { background: #FEF3C7; color: var(--gold); }
.abz b { font-size: 16px; }
.abz span { font-size: 13px; color: var(--text-2); }

/* ---------- Anmeldung */
.profil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.profil-kachel { background: var(--karte); border: 2px solid var(--rand); border-radius: 22px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--text); }
.avatar { width: 64px; height: 64px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.avatar.klein { width: 40px; height: 40px; font-size: 18px; flex: 0 0 40px; }
.pin-punkte { display: flex; gap: 14px; justify-content: center; padding: 6px 0 4px; }
.pin-punkte i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mint-2); }
.pin-punkte i.voll { background: var(--mint-2); }
.pinpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 24px 20px 0; max-width: 380px; margin: 0 auto; width: 100%; }
.pinpad button { min-height: 68px; border-radius: 20px; border: 2px solid var(--rand); background: var(--karte); font-size: 28px; font-weight: 600; color: var(--text); }
.pinpad button.leise { border-color: transparent; background: transparent; font-size: 16px; color: var(--text-2); }
.fehler-text { color: var(--koralle-text); background: var(--koralle-hell); border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.fehler-text:empty { display: none; }

/* ---------- Formulare / Eltern */
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld label { font-size: 15px; font-weight: 500; color: var(--text-2); }
.feld input, .feld select, .feld textarea {
  font-size: 18px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--rand); background: #fff; width: 100%;
}
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--gruen); outline: none; }
.formular { display: flex; flex-direction: column; gap: 14px; }
.reiter { display: flex; gap: 6px; overflow-x: auto; padding: 0 20px; margin-top: -22px; position: relative; z-index: 2; scrollbar-width: none; }
.reiter button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--rand); background: #fff; font-size: 15px; font-weight: 600; color: var(--text-2); }
.reiter button[aria-selected="true"] { border-color: var(--gruen); background: var(--mint); color: #065F46; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle th { font-size: 13px; color: var(--text-2); font-weight: 500; }
.tabellen-box { overflow-x: auto; background: #fff; border: 2px solid var(--rand); border-radius: 18px; padding: 4px 8px; }
.saeulen { display: flex; gap: 6px; align-items: flex-end; height: 90px; padding-top: 6px; }
.saeulen div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.saeulen i { display: block; width: 100%; max-width: 22px; background: var(--gruen-hell); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.saeulen span { font-size: 11px; color: var(--text-2); }
.marke { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--segment); color: var(--text-2); }
.marke.gruen { background: var(--mint); color: #065F46; }
.marke.rot { background: var(--koralle-hell); color: var(--koralle-text); }
.such { display: flex; gap: 8px; }
.vok-zeile { width: 100%; text-align: left; background: #fff; border: 2px solid var(--rand); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.vok-zeile b { font-weight: 600; }
.vok-zeile span { font-size: 14px; color: var(--text-2); }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--sicher-unten)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 50;
}
#toast.an { opacity: 1; transform: translateX(-50%) translateY(0); }

.offline-hinweis { background: #FEF3C7; color: #78350F; font-size: 14px; padding: 8px 14px; border-radius: 12px; }

@media (min-width: 600px) {
  .wort { font-size: 46px; }
  .wort.lang { font-size: 34px; }
}
