/* Vokabeln (v1.74.0) – alle Farben über Variablen, Dunkel folgt dem System */
:root {
  --bg: #f6f4ef; --karte: #ffffff; --karte2: #f0eee8; --rand: #e3dfd5; --tx: #1d2030; --tx2: #5d6275; --tx3: #8b8f9e;
  --akzent: #3b5bdb; --akzent-tx: #2f4ac0; --akzent-weich: #e7ecff; --auf-akzent: #ffffff;
  --gut: #2f9e44; --gut-weich: #e3f6e7; --gut-tx: #237a35; --schlecht: #e03131; --schlecht-weich: #fde8e8; --schlecht-tx: #c92a2a;
  --fast: #f08c00; --fast-weich: #fff3dc; --fast-tx: #b35c00; --gold: #f2b705;
  --p1: #ff6b6b; --p2: #ff922b; --p3: #fcc419; --p4: #94d82d; --p5: #40c057; --p6: #12b886; --p7: #f2b705;
  --schatten: 0 1px 2px rgba(20, 24, 40, .06), 0 6px 20px rgba(20, 24, 40, .06);
  --rund: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c; --karte: #1d2029; --karte2: #262a35; --rand: #323745; --tx: #eceef4; --tx2: #a9aec0; --tx3: #7b8094;
    --akzent: #4c6ef5; --akzent-tx: #91a7ff; --akzent-weich: #222c4f; --auf-akzent: #ffffff;
    --gut: #37b24d; --gut-weich: #18321f; --gut-tx: #8ce99a; --schlecht: #f03e3e; --schlecht-weich: #3a1d1f; --schlecht-tx: #ffa8a8;
    --fast: #f59f00; --fast-weich: #3a2c12; --fast-tx: #ffd43b;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; touch-action: manipulation; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--tx); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; min-height: 100vh; }
a { color: var(--akzent-tx); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
.laedt { color: var(--tx3); text-align: center; padding: 3em 1em; }
.leise { color: var(--tx2); }
.klein { font-size: .85rem; }
.hinweis { color: var(--tx2); font-size: .88rem; }

/* Kopf */
#kopf { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rand); }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--tx); }
.marke img { border-radius: 8px; }
#spNav { display: flex; gap: 4px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
#spNav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--tx2); white-space: nowrap; font-size: .92rem; }
#spNav a.aktiv { background: var(--akzent-weich); color: var(--akzent-tx); font-weight: 600; }
@media (max-width: 560px) { .marke span { display: none; } #kopf { gap: 6px; } #spNav a { padding: 6px 9px; } #spNav { justify-content: flex-start; } }

main { max-width: 860px; margin: 0 auto; padding: 18px 16px 90px; }

/* Bausteine */
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--rund); padding: 16px; box-shadow: var(--schatten); }
.karte + .karte { margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--rand); background: var(--karte); color: var(--tx);
  padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; text-decoration: none; min-height: 44px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.btn.gut { background: var(--gut); border-color: var(--gut); color: #fff; }
.btn.schlecht { background: var(--schlecht); border-color: var(--schlecht); color: #fff; }
.btn.gross { width: 100%; font-size: 1.08rem; min-height: 54px; border-radius: 14px; }
.btn.flach { background: transparent; border-color: transparent; color: var(--akzent-tx); }
.btn.scharf { background: var(--schlecht); border-color: var(--schlecht); color: #fff; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dreh { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: dreh .7s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.seg button { border: 1px solid var(--rand); background: var(--karte); padding: 8px 13px; border-radius: 999px; cursor: pointer; font-size: .92rem; min-height: 38px; }
.seg button.an { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); font-weight: 600; }
.feldname { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tx3); font-weight: 700; margin-top: 4px; }
label.feld { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--tx2); }
label.feld input, label.feld select, label.feld textarea, .eingabe { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; border: 1px solid var(--rand); border-radius: 12px; background: var(--karte); font-size: 16px; color: var(--tx); }
select { padding: 9px 10px; border: 1px solid var(--rand); border-radius: 10px; background: var(--karte); font-size: 16px; }

/* Start: Sprachen */
.sprachen { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sprache { display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: transform .15s; }
.sprache:active { transform: scale(.98); }
.sprache .flagge { font-size: 2.6rem; line-height: 1; }
.sprache h2 { margin: 8px 0 2px; }
.sprache .faellig { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .88rem; background: var(--akzent-weich); color: var(--akzent-tx); }
.sprache .faellig.null { background: var(--gut-weich); color: var(--gut-tx); }
.phasenband { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--karte2); margin-top: 12px; }
.phasenband span { display: block; height: 100%; }
.p1 { background: var(--p1); } .p2 { background: var(--p2); } .p3 { background: var(--p3); } .p4 { background: var(--p4); } .p5 { background: var(--p5); } .p6 { background: var(--p6); } .p7 { background: var(--p7); }
.begruessung { margin-bottom: 18px; }
.begruessung p { color: var(--tx2); margin: 0; }

/* Sprache: Kopf + Zahlen */
.held { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.held .flagge { font-size: 2.8rem; line-height: 1; }
.held p { margin: 0; color: var(--tx2); }
.zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.zahl { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 12px; text-align: center; }
.zahl b { display: block; font-size: 1.6rem; line-height: 1.1; }
.zahl small { color: var(--tx2); font-size: .8rem; }
.zahl.akzent b { color: var(--akzent-tx); }
.leer-hinweis { text-align: center; padding: 26px 16px; }
.leer-hinweis .gross { font-size: 2.4rem; }

/* Kategorien */
.kats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kat { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; padding: 13px 14px; }
.kat .sym { font-size: 1.8rem; width: 40px; text-align: center; flex: none; }
.kat b { display: block; }
.kat small { color: var(--tx2); }
.kat .fortschritt { height: 5px; border-radius: 9px; background: var(--karte2); margin-top: 6px; overflow: hidden; }
.kat .fortschritt span { display: block; height: 100%; background: var(--akzent); }
.kat.neu { border-style: dashed; justify-content: center; color: var(--akzent-tx); font-weight: 600; box-shadow: none; background: transparent; cursor: pointer; }
.titelzeile { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.titelzeile h1 { flex: 1; margin: 0; min-width: 0; }
.werkzeuge { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* Vokabel-Liste */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--rand); cursor: pointer; }
.liste li:last-child { border-bottom: 0; }
.liste .wort { flex: 1; min-width: 0; }
.liste .wort b { display: block; overflow-wrap: anywhere; }
.liste .wort span { color: var(--tx2); font-size: .92rem; overflow-wrap: anywhere; }
.liste input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--akzent); }
.pille { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 7px; border-radius: 999px; font-size: .76rem; font-weight: 800; color: #1d2030; flex: none; }
.pille.leer { background: var(--karte2); color: var(--tx3); font-weight: 600; }
.pillen { display: flex; gap: 4px; flex: none; }
.pillen small { font-size: .65rem; color: var(--tx3); display: block; text-align: center; }
.auswahlleiste { position: sticky; bottom: 12px; margin-top: 12px; display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--tx); color: var(--bg); border-radius: 14px; padding: 8px 8px 8px 16px; box-shadow: var(--schatten); }
.auswahlleiste .btn { min-height: 40px; }

/* Übersicht */
.phasen { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px; margin: 8px 0 4px; }
.phase { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: pointer; border: 0; background: none; padding: 0; color: var(--tx); }
.phase .saeule { width: 100%; border-radius: 8px 8px 4px 4px; min-height: 4px; transition: height .3s; }
.phase b { font-size: .95rem; margin-bottom: 3px; }
.phase small { font-size: .72rem; color: var(--tx2); margin-top: 4px; white-space: nowrap; }
.phase.aus { opacity: .35; }
.phase.gewaehlt small { color: var(--akzent-tx); font-weight: 800; }
.vorschau { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; align-items: end; height: 60px; margin-top: 8px; }
.vorschau { margin-top: 22px; }
.vorschau div { background: var(--akzent); border-radius: 3px 3px 1px 1px; opacity: .8; min-height: 2px; position: relative; }
.vorschau i { position: absolute; bottom: 100%; left: 0; right: 0; text-align: center; font-style: normal; font-size: .68rem; color: var(--tx2); margin-bottom: 2px; }
.vorschau-achse { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; font-size: .62rem; color: var(--tx3); text-align: center; }
.filterzeile { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.filterzeile input { flex: 1; min-width: 160px; }
.faelligtext { font-size: .78rem; color: var(--tx3); white-space: nowrap; }
.faelligtext.jetzt { color: var(--akzent-tx); font-weight: 700; }

/* Lernen */
.lernkopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lernkopf .balken { flex: 1; height: 8px; border-radius: 999px; background: var(--karte2); overflow: hidden; }
.lernkopf .balken span { display: block; height: 100%; background: var(--akzent); transition: width .3s; }
.lernkopf small { color: var(--tx2); white-space: nowrap; }
.lernkarte { perspective: 1400px; }
.lk-innen { position: relative; min-height: 300px; transition: transform .45s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.lk-innen.gedreht { transform: rotateY(180deg); }
.lk-seite { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px 20px; }
.lk-hinten { transform: rotateY(180deg); }
.lk-wort { font-size: clamp(1.6rem, 7vw, 2.5rem); font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.lk-sprache { position: absolute; top: 14px; left: 16px; font-size: .78rem; color: var(--tx3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.lk-phase { position: absolute; top: 12px; right: 14px; }
.lk-zusatz { color: var(--tx2); margin-top: 8px; }
.lk-frage { color: var(--tx3); font-size: 1rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.lk-beispiel { margin-top: 14px; font-size: .95rem; color: var(--tx2); font-style: italic; max-width: 520px; }
.lk-beispiel span { display: block; font-style: normal; font-size: .85rem; color: var(--tx3); margin-top: 2px; }
.sprechen { border: 0; background: var(--akzent-weich); color: var(--akzent-tx); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 1.15rem; margin-top: 12px; flex: none; }
.lk-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.lk-knoepfe .btn { min-height: 58px; font-size: 1.05rem; }
.tippen { margin-top: 14px; }
.tippen .eingabe { font-size: 1.25rem; text-align: center; padding: 14px; }
.tippen .eingabe.gut { border-color: var(--gut); background: var(--gut-weich); }
.tippen .eingabe.schlecht { border-color: var(--schlecht); background: var(--schlecht-weich); }
.rueck { margin-top: 12px; border-radius: 14px; padding: 12px 14px; }
.rueck.gut { background: var(--gut-weich); color: var(--gut-tx); }
.rueck.schlecht { background: var(--schlecht-weich); color: var(--schlecht-tx); }
.rueck.fast { background: var(--fast-weich); color: var(--fast-tx); }
.rueck b.loesung { font-size: 1.15rem; color: var(--tx); }
.rueck mark { background: var(--fast); color: #fff; border-radius: 3px; padding: 0 1px; }
.rueck .phasenwechsel { font-size: .85rem; margin-top: 4px; opacity: .9; }
.tastenhilfe { text-align: center; color: var(--tx3); font-size: .78rem; margin-top: 12px; }
@media (hover: none) { .tastenhilfe { display: none; } }
.ende { text-align: center; }
.ende .ring { font-size: 3rem; font-weight: 800; color: var(--akzent-tx); }
.ende .liste { text-align: left; margin-top: 10px; }

/* Blatt (Dialog) */
#blatt { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 20, .45); display: flex; align-items: flex-end; justify-content: center; }
#blatt[hidden] { display: none; }
.blatt-innen { background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: hoch .22s ease-out; }
@media (min-width: 700px) { #blatt { align-items: center; } .blatt-innen { border-radius: 20px; } }
@keyframes hoch { from { transform: translateY(30px); opacity: 0; } }
.blatt-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.blatt-kopf h2 { flex: 1; margin: 0; }
.zu { border: 0; background: var(--karte2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--tx2); }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .zweispaltig { grid-template-columns: 1fr; } }

/* Start (nicht angemeldet) */
.anmelden { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.anmelden img { width: 84px; height: 84px; border-radius: 20px; }
.anmelden form { text-align: left; margin-top: 18px; }
.fehlertext { color: var(--schlecht-tx); font-size: .9rem; min-height: 1.2em; margin-bottom: 6px; }

#toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--tx); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .92rem; transition: .25s; max-width: calc(100% - 32px); text-align: center; }
#toast.zeigen { opacity: 1; transform: translate(-50%, 0); }
#toast.fehler { background: var(--schlecht); color: #fff; }
.banner { padding: 12px 14px; border-radius: 12px; background: var(--schlecht-weich); color: var(--schlecht-tx); }
