/* Vokabelfuchs - kindgerechtes, ruhiges Farbsystem.
   Kontraste gerechnet: Text #2a2340 auf #fff8ee 14:1, Weiß auf #5b4bdb 6,0:1,
   Weiß auf #c93a27 5,1:1, #0f3d2a auf #d6f5e6 10:1, #6a1d12 auf #fde3df 9:1. */
:root {
  color-scheme: light;
  --bg: #fff8ee;
  --karte: #ffffff;
  --text: #2a2340;
  --text-leise: #5e5878;
  --linie: #ece4f7;
  --lila: #5b4bdb;
  --lila-dunkel: #4436b8;
  --lila-hell: #ece9ff;
  --koralle: #c93a27;
  --sonne: #ffc83d;
  --sonne-hell: #fff1c7;
  --minze: #2bc48a;
  --gut-bg: #d6f5e6;
  --gut-text: #0f3d2a;
  --fehler-bg: #fde3df;
  --fehler-text: #6a1d12;
  --fast-bg: #fff1c7;
  --fast-text: #5a4300;
  --radius: 20px;
  --schatten: 0 2px 0 rgba(42, 35, 64, .08), 0 8px 24px rgba(91, 75, 219, .08);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 900; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.leise { color: var(--text-leise); }
.klein { font-size: 14px; }
.stapel > * + * { margin-top: 14px; }
.zeile { display: flex; align-items: center; gap: 10px; }
.zeile.zwischen { justify-content: space-between; }
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Karten und Knöpfe ---------- */
.karte {
  background: var(--karte);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 18px;
}
.knopf {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px;
  border: 0; border-radius: 16px;
  padding: 12px 18px;
  font-weight: 800; font-size: 18px;
  background: var(--lila); color: #fff;
  box-shadow: 0 4px 0 var(--lila-dunkel);
  transition: transform .08s ease, box-shadow .08s ease;
}
.knopf:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lila-dunkel); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.zweit { background: var(--karte); color: var(--lila-dunkel); box-shadow: 0 4px 0 var(--linie), inset 0 0 0 2px var(--linie); }
.knopf.zweit:active { box-shadow: 0 1px 0 var(--linie), inset 0 0 0 2px var(--linie); }
.knopf.sonne { background: var(--sonne); color: var(--text); box-shadow: 0 4px 0 #d9a21a; }
.knopf.gross { min-height: 72px; font-size: 21px; border-radius: 20px; }
.knopf.klein { min-height: 44px; font-size: 15px; width: auto; }
.textknopf { background: none; border: 0; padding: 10px; color: var(--lila-dunkel); font-weight: 800; }
.icon-knopf {
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--lila-hell); color: var(--lila-dunkel);
  font-size: 20px; display: inline-grid; place-items: center; flex: none;
}
.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kachel {
  border: 0; text-align: left;
  background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 16px; min-height: 108px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.kachel .emoji { font-size: 30px; line-height: 1; }
.kachel strong { font-size: 17px; }
.kachel:active { transform: scale(.98); }

/* ---------- Kopf ---------- */
.kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--sonne-hell); display: grid; place-items: center;
  font-size: 32px; flex: none; border: 0;
}
.kopf .name { font-weight: 900; font-size: 22px; }
.chips { display: flex; gap: 8px; margin-left: auto; }
.chip {
  background: var(--karte); border-radius: 999px; padding: 6px 12px;
  font-weight: 800; font-size: 15px; box-shadow: var(--schatten); white-space: nowrap;
}

/* ---------- Fortschritt ---------- */
.balken { height: 14px; background: var(--lila-hell); border-radius: 999px; overflow: hidden; }
.balken > span { display: block; height: 100%; background: var(--lila); border-radius: 999px; transition: width .4s ease; }
.balken.sonne > span { background: var(--sonne); }
.balken.minze > span { background: var(--minze); }
.stufen { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--lila-hell); }
.stufen span { display: block; height: 100%; }
.st-arbeit { background: #b9b0f5; }
.st-sicher { background: var(--lila); }
.st-meister { background: var(--minze); }

.ziel-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--sonne) calc(var(--p) * 1%), var(--sonne-hell) 0);
  display: grid; place-items: center; }
.ziel-ring > div { width: 64px; height: 64px; border-radius: 50%; background: var(--karte);
  display: grid; place-items: center; font-weight: 900; font-size: 15px; text-align: center; line-height: 1.1; }

.team { background: linear-gradient(135deg, #5b4bdb, #7d5fe0); color: #fff; }
.team .balken { background: rgba(255,255,255,.25); }
.team .balken > span { background: var(--sonne); }
.team .leise { color: #e6e1ff; }

/* ---------- Übung ---------- */
.uebung-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.uebung-kopf .balken { flex: 1; }
.frage { text-align: center; padding: 26px 18px; }
.frage .art { font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-leise); }
.frage .wort { font-size: 32px; font-weight: 900; margin: 10px 0 4px; word-break: break-word; }
.frage .satz { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.optionen { display: grid; gap: 12px; margin-top: 16px; }
.option {
  min-height: 60px; border: 0; border-radius: 16px; padding: 12px 16px;
  background: var(--karte); box-shadow: 0 4px 0 var(--linie), inset 0 0 0 2px var(--linie);
  font-weight: 800; font-size: 18px; text-align: left;
}
.option.richtig { background: var(--gut-bg); color: var(--gut-text); box-shadow: inset 0 0 0 3px var(--minze); }
.option.falsch { background: var(--fehler-bg); color: var(--fehler-text); box-shadow: inset 0 0 0 3px var(--koralle); }
.eingabe {
  width: 100%; min-height: 60px; border-radius: 16px; border: 3px solid var(--linie);
  padding: 12px 16px; font-size: 22px; font-weight: 800; background: var(--karte); text-align: center;
}
.eingabe:focus { outline: none; border-color: var(--lila); }
.hilfe-text { font-size: 22px; letter-spacing: .18em; font-weight: 800; color: var(--lila-dunkel); min-height: 32px; }
.hoer-knopf { width: 112px; height: 112px; border-radius: 50%; font-size: 48px; margin: 6px auto; display: grid; place-items: center;
  border: 0; background: var(--lila); color: #fff; box-shadow: 0 6px 0 var(--lila-dunkel); }
.hoer-knopf:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lila-dunkel); }

.salat-ziel { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 54px; margin: 14px 0; }
.salat-ziel .slot { width: 38px; height: 48px; border-bottom: 4px solid var(--linie); display: grid; place-items: center; font-size: 24px; font-weight: 900; }
.salat-ziel .slot.voll { border-color: var(--lila); }
.salat-ziel .luecke { width: 14px; }
.salat-steine { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stein { width: 48px; height: 52px; border-radius: 12px; border: 0; background: var(--sonne-hell);
  box-shadow: 0 4px 0 #ecd08a; font-size: 24px; font-weight: 900; }
.stein:disabled { visibility: hidden; }

.rueckmeldung { border-radius: var(--radius); padding: 18px; margin-top: 18px; animation: hoch .25s ease; }
.rueckmeldung.gut { background: var(--gut-bg); color: var(--gut-text); }
.rueckmeldung.fast { background: var(--fast-bg); color: var(--fast-text); }
.rueckmeldung.falsch { background: var(--fehler-bg); color: var(--fehler-text); }
.rueckmeldung .titel { font-weight: 900; font-size: 20px; }
.rueckmeldung .loesung { font-weight: 900; font-size: 22px; margin-top: 6px; }
.tipp { background: var(--sonne-hell); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 15px; }

/* Lernkarte */
.lernkarte { text-align: center; padding: 28px 20px; }
.lernkarte .wort { font-size: 36px; font-weight: 900; }
.lernkarte .de { font-size: 22px; font-weight: 800; color: var(--lila-dunkel); margin-top: 6px; }
.lernkarte .satz { font-size: 18px; margin-top: 16px; font-style: italic; }
.dreh { perspective: 900px; }
.dreh-innen { position: relative; min-height: 240px; transition: transform .45s ease; transform-style: preserve-3d; }
.dreh.gedreht .dreh-innen { transform: rotateY(180deg); }
.dreh .seite { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; }
.dreh .hinten { transform: rotateY(180deg); }

/* Paare */
.paare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paar-spalte { display: grid; gap: 10px; align-content: start; }
.paar { min-height: 62px; border: 0; border-radius: 14px; padding: 8px 10px; font-weight: 800; font-size: 16px;
  background: var(--karte); box-shadow: 0 4px 0 var(--linie), inset 0 0 0 2px var(--linie); }
.paar.aktiv { box-shadow: inset 0 0 0 3px var(--lila); background: var(--lila-hell); }
.paar.weg { visibility: hidden; }
.paar.wackel { animation: wackel .35s ease; background: var(--fehler-bg); }

/* Abzeichen */
.abzeichen { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.abzeichen .karte { text-align: center; padding: 16px 10px; }
.abzeichen .gross { font-size: 40px; }
.abzeichen .gesperrt { opacity: .45; filter: grayscale(1); }

/* Wortliste */
.wortliste { list-style: none; padding: 0; margin: 0; }
.wortliste li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.wortliste li:last-child { border-bottom: 0; }
.wortliste .en { font-weight: 800; flex: 1; }
.wortliste .de { flex: 1; color: var(--text-leise); font-size: 15px; }
.punkte { display: flex; gap: 3px; }
.punkte i { width: 8px; height: 8px; border-radius: 50%; background: var(--linie); }
.punkte i.an { background: var(--lila); }

/* Eltern */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--karte); border-radius: 16px; box-shadow: var(--schatten); padding: 14px; }
.kpi .zahl { font-size: 28px; font-weight: 900; }
.kpi .bez { font-size: 14px; color: var(--text-leise); font-weight: 700; }
.saeulen { display: flex; align-items: flex-end; gap: 4px; height: 120px; position: relative; padding-top: 6px; }
.saeulen .s { flex: 1; background: var(--lila); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.saeulen .s.erreicht { background: var(--minze); }
.saeulen .ziellinie { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--sonne); }
.achse { display: flex; gap: 4px; font-size: 11px; color: var(--text-leise); }
.achse span { flex: 1; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--linie); }
th { font-size: 13px; color: var(--text-leise); }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.feld { display: grid; gap: 6px; }
.feld label { font-weight: 800; font-size: 15px; }
.feld input[type=text], .feld input[type=number], .feld input[type=password] {
  min-height: 48px; border-radius: 12px; border: 2px solid var(--linie); padding: 8px 12px; font-size: 17px; background: #fff;
}
.feld input:focus { outline: none; border-color: var(--lila); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--lila); }

.tiere { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tiere button { font-size: 40px; aspect-ratio: 1; border-radius: 18px; border: 0; background: var(--karte); box-shadow: var(--schatten); }
.tiere button.gewaehlt { box-shadow: inset 0 0 0 4px var(--lila); background: var(--lila-hell); }

.maskottchen { font-size: 64px; text-align: center; line-height: 1; }
.sprechblase { background: var(--karte); border-radius: 18px; padding: 14px 16px; box-shadow: var(--schatten); font-weight: 700; position: relative; }

#konfetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
#konfetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fallen linear forwards; }

@keyframes fallen { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes hoch { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wackel { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 520px) {
  .optionen.zwei { grid-template-columns: 1fr 1fr; }
}

/* Fächer-Umschalter */
.faecher { display: flex; gap: 6px; background: var(--lila-hell); padding: 5px; border-radius: 16px; }
.fach { flex: 1; min-height: 48px; border: 0; border-radius: 12px; background: transparent; font-weight: 800; font-size: 17px; color: var(--lila-dunkel); display: flex; align-items: center; justify-content: center; gap: 6px; }
.fach.an { background: var(--karte); color: var(--text); box-shadow: var(--schatten); }
.fach .punkt { background: var(--koralle); color: #fff; border-radius: 999px; font-size: 13px; padding: 1px 8px; }
.feld select { min-height: 48px; border-radius: 12px; border: 2px solid var(--linie); padding: 8px 12px; font-size: 17px; background: #fff; }
.feld select:focus { outline: none; border-color: var(--lila); }

/* Grammatik */
.art-klein { font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--lila-dunkel); }
.regel { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 16px; }
.regel strong { color: var(--lila-dunkel); }
.bsp { background: var(--lila-hell); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; font-size: 16px; }
.satz-ziel { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 52px; margin: 14px 0; padding: 8px; border-bottom: 3px solid var(--linie); font-size: 20px; font-weight: 800; }
.wort-gelegt { background: var(--lila-hell); color: var(--lila-dunkel); border-radius: 10px; padding: 4px 10px; }
.satz-steine { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wortstein { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 0; background: var(--sonne-hell); box-shadow: 0 4px 0 #ecd08a; font-size: 18px; font-weight: 800; }
.wortstein:disabled { visibility: hidden; }
