
:root {
  --bg: #f4f3fb;
  --surface: #ffffff;
  --surface-2: #eeecf8;
  --text: #17142e;
  --muted: #5b5878;
  --line: #e3e0f2;
  --primary: #5b36f2;
  --primary-ink: #ffffff;
  --primary-soft: #ebe6ff;
  --accent: #ffb020;
  --accent-soft: #fff3d6;
  --mint: #0fbf94;
  --mint-soft: #dcf8ef;
  --ok: #0b7a5c;
  --ok-soft: #dcf8ef;
  --bad: #b8283f; /* ≥ 5:1 auf --bad-soft (WCAG AA) */
  --bad-soft: #ffe3e8;
  --info: #3150b8;
  --info-soft: #e6ebff;
  --focus: #2f6bff;
  --star: #ffb800;
  --star-off: #dedbee;

  --tone-1: #fff1c7; --tone-1-b: #ffd166;
  --tone-2: #e3ecff; --tone-2-b: #9db5ff;
  --tone-3: #ffe4ee; --tone-3-b: #ff9fbf;
  --tone-4: #dbf7ec; --tone-4-b: #6fdcb7;
  --tone-5: #ece6ff; --tone-5-b: #b09cff;
  --tone-6: #ffe8d9; --tone-6-b: #ffb27d;

  --aurora: linear-gradient(135deg, #5b36f2 0%, #7b4dff 38%, #3b82f6 72%, #10c9a0 100%);
  --aurora-soft: linear-gradient(135deg, #efeaff 0%, #e6efff 55%, #dcf8ef 100%);
  --cta: linear-gradient(135deg, #6a3dff 0%, #4f46e5 100%);
  --glow: 0 10px 30px -10px rgba(91, 54, 242, 0.55);

  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 1px 2px rgba(23, 20, 46, 0.05), 0 10px 30px -12px rgba(23, 20, 46, 0.16);
  --shadow-lift: 0 2px 4px rgba(23, 20, 46, 0.06), 0 18px 40px -14px rgba(23, 20, 46, 0.28);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --nav-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b1e;
    --surface: #17142e;
    --surface-2: #221e40;
    --text: #f3f1ff;
    --muted: #aca7cf;
    --line: #2e2954;
    --primary: #9d87ff;
    --primary-ink: #120d2b;
    --primary-soft: #2a2257;
    --accent: #ffc04d;
    --accent-soft: #3a2f17;
    --mint: #3fe0b8;
    --mint-soft: #123a33;
    --ok: #5fe0b4;
    --ok-soft: #123a33;
    --bad: #ff8fa3;
    --bad-soft: #3d1a26;
    --info: #a9b9ff;
    --info-soft: #1d2350;
    --focus: #8fb0ff;
    --star: #ffc933;
    --star-off: #3a3560;
    --tone-1: #3a3118; --tone-1-b: #7a6420;
    --tone-2: #1a2550; --tone-2-b: #3c55a8;
    --tone-3: #3d1a2c; --tone-3-b: #8a3a5e;
    --tone-4: #0f3a30; --tone-4-b: #23806a;
    --tone-5: #2a2257; --tone-5-b: #5e4bc2;
    --tone-6: #3d2616; --tone-6-b: #8c5527;
    --aurora: linear-gradient(135deg, #4a2ad8 0%, #6a3dff 38%, #2563eb 72%, #0e9f84 100%);
    --aurora-soft: linear-gradient(135deg, #221a4d 0%, #182448 55%, #0f3330 100%);
    --cta: linear-gradient(135deg, #7357f0 0%, #5452d9 100%);
    --glow: 0 10px 30px -10px rgba(140, 110, 255, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -14px rgba(0, 0, 0, 0.7);
  }
}

/* ═════════════ Grundlayout & Schrift ═════════════ */
body {
  background:
    radial-gradient(900px 500px at -10% -10%, color-mix(in srgb, #7b4dff 16%, transparent), transparent 60%),
    radial-gradient(800px 520px at 110% -5%, color-mix(in srgb, #10c9a0 14%, transparent), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, color-mix(in srgb, #3b82f6 10%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .greet, .big, .tile-title, .card-title, .brand-name, .stat-num, .fb-head, .ex-question, .cc-title, .section-title {
  font-family: var(--font-display);
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem); font-weight: 700; }
h2 { font-weight: 600; }
.card-title { font-weight: 600; font-size: 1.15rem; }
.section-title { font-weight: 600; font-size: 1.25rem; margin: 26px 0 12px; }
.eyebrow { color: var(--primary); letter-spacing: 0.08em; font-weight: 900; }
a { color: var(--primary); text-underline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }

.page, .onboarding, .lesson { padding-left: 16px; padding-right: 16px; }

/* ═════════════ Kopfleiste ═════════════ */
.topbar {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand-mark { width: 38px; height: 38px; border-radius: 12px; box-shadow: var(--glow); }
.brand-name {
  font-size: 1.25rem; font-weight: 700;
  background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .brand-name { background-image: linear-gradient(135deg, #c3b5ff, #8fb4ff 55%, #7fe9cf); }
}
.pill { border: 1px solid var(--line); background: var(--surface); font-weight: 800; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.pill-link { text-decoration: none; color: var(--primary); }
.streak-pill { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.icon-btn { border-radius: 14px; }
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn .ui-x { display: block; width: 20px; height: 20px; pointer-events: none; }
/* ▶ ⏸ ↺ in Knöpfen schlicht als Zeichen zeigen, nicht als bunte System-Emojis */
.btn, .icon-btn, .find-mark { font-variant-emoji: text; }
.help-btn { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--primary); background: var(--primary-soft); }
.account-dot { border-color: var(--bg); }
.net-banner { background: var(--accent-soft); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }

/* ═════════════ Navigation: schwebendes Dock (Handy/Tablet), Seitenleiste (Computer) ═════════════ */
.bottomnav {
  left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 620px; margin: 0 auto;
  padding: 6px; gap: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  box-shadow: var(--shadow-lift);
}
.bottomnav a {
  position: relative; border-radius: 20px; min-height: 58px; padding: 6px 2px;
  color: var(--muted); font-weight: 800; font-size: 0.72rem;
}
.bottomnav a:hover { background: var(--surface-2); color: var(--text); }
.bottomnav a.active { background: var(--primary-soft); color: var(--primary); }
.bottomnav a.active::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; width: 18px; height: 4px; margin-left: -9px;
  border-radius: 4px; background: var(--aurora);
}
.bottomnav a .nav-ico { width: 26px; height: 26px; }
body.with-chrome { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.toast-region { bottom: calc(100px + env(safe-area-inset-bottom)); }

@media (min-width: 1024px) {
  body.with-chrome { padding-left: 112px; padding-bottom: 32px; }
  .bottomnav {
    top: 84px; bottom: 16px; left: 16px; right: auto; width: 84px; max-width: none; margin: 0;
    grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start;
    padding: 10px 8px; gap: 6px; border-radius: 28px;
  }
  .bottomnav a { min-height: 70px; font-size: 0.74rem; }
  .bottomnav a.active::after { bottom: auto; top: 50%; left: -8px; width: 4px; height: 26px; margin: -13px 0 0; }
  .bottomnav a .nav-ico { width: 30px; height: 30px; }
  .toast-region { bottom: 28px; }
  .page { max-width: 880px; }
  .lesson, .onboarding, .page.lesson-intro, .page.account { max-width: 720px; }
}

/* ═════════════ Schaltflächen ═════════════ */
.btn {
  border-radius: 18px; font-weight: 900; letter-spacing: 0.005em; border-width: 2px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}
.btn.primary {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--cta); color: #fff; border-color: transparent;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
@media (prefers-color-scheme: dark) { .btn.primary { color: #fff; } }
.btn.primary:hover:not([disabled]) { background: var(--cta); filter: brightness(1.07); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); border-color: transparent; border-bottom-width: 2px; }
.btn.secondary:hover:not([disabled]) { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.btn.ghost { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn.ghost:hover:not([disabled]) { border-color: var(--primary); }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.xl { border-radius: 22px; }
.btn[disabled] { opacity: 0.5; filter: grayscale(0.4); box-shadow: none; }
.cta { font-size: 1.2rem; }

.audio-btn { background: var(--cta); color: #fff; box-shadow: var(--glow); }
.audio-btn.secondary { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.say-btn { background: var(--primary-soft); color: var(--primary); }
.term-say:hover { background: var(--primary-soft); }

/* ═════════════ Karten & Flächen ═════════════ */
.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  background: var(--surface); box-shadow: var(--shadow);
}
.settings fieldset { border: 1px solid var(--line); }
.linkcard, .lesson-row, .game-row { transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.linkcard:hover, .lesson-row:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid transparent; }
.notice-warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.notice-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.notice-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }

/* Farbige Kacheln: weiche Verläufe statt flacher Flächen */
.tone-1, .tone-2, .tone-3, .tone-4, .tone-5, .tone-6 { --tone-c: var(--tone-1); --tone-cb: var(--tone-1-b); }
.tone-2 { --tone-c: var(--tone-2); --tone-cb: var(--tone-2-b); }
.tone-3 { --tone-c: var(--tone-3); --tone-cb: var(--tone-3-b); }
.tone-4 { --tone-c: var(--tone-4); --tone-cb: var(--tone-4-b); }
.tone-5 { --tone-c: var(--tone-5); --tone-cb: var(--tone-5-b); }
.tone-6 { --tone-c: var(--tone-6); --tone-cb: var(--tone-6-b); }
.tone-1, .tone-2, .tone-3, .tone-4, .tone-5, .tone-6 {
  background: linear-gradient(150deg, var(--tone-c) 0%, color-mix(in srgb, var(--tone-c) 45%, var(--surface)) 100%) !important;
  border-color: color-mix(in srgb, var(--tone-cb) 70%, transparent) !important;
}

/* Startseite */
.home-hero {
  position: relative; overflow: hidden; align-items: center; gap: 10px;
  margin: 4px 0 14px; padding: 18px 16px 18px 8px;
  border-radius: 28px; background: var(--aurora); box-shadow: var(--glow);
}
.home-hero::before, .home-hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, 0.14);
}
.home-hero::before { width: 220px; height: 220px; right: -60px; top: -90px; }
.home-hero::after { width: 140px; height: 140px; left: 30%; bottom: -80px; background: rgba(255, 255, 255, 0.08); }
.hero-mascot { position: relative; z-index: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25)); }
.hero-bubble {
  z-index: 1; margin-bottom: 0; border: 0; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.35);
}
.hero-bubble::before { border: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); left: -8px; bottom: auto; top: 44%; }
.hero-bubble .greet { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; }
.home-meta { font-weight: 800; }

.grid-2 .card { border-radius: 24px; }
.goal-card, .streak-card { min-height: 108px; }
.ring circle { stroke-width: 10; }
.ring-fg { stroke: var(--mint); }
.big { font-family: var(--font-display); font-weight: 700; }

.tile-grid { gap: 14px; }
.tile {
  border: 1px solid; border-bottom-width: 1px; border-radius: 26px; min-height: 168px;
  box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile .ico { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15)); transition: transform 0.25s ease; }
.tile-title { font-weight: 600; font-size: 1.2rem; }
.tile-sub { color: color-mix(in srgb, var(--text) 70%, transparent); }

.challenge { background: linear-gradient(150deg, var(--accent-soft), var(--surface) 70%); }
.challenge.done { border-color: var(--ok); background: linear-gradient(150deg, var(--ok-soft), var(--surface) 70%); }
.celebrate { background: var(--aurora-soft); }

/* Fortschrittsbalken: Verlauf mit sanftem Glanz */
.bar { height: 14px; background: var(--surface-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); }
.bar > span { position: relative; overflow: hidden; background: linear-gradient(90deg, var(--primary), #3b82f6 60%, var(--mint)); }
.challenge .bar > span { background: linear-gradient(90deg, #ff9d00, var(--accent)); }
.ob-progress span { height: 8px; background: var(--surface-2); }
.ob-progress span.on { background: var(--aurora); }

/* Kurs & Lektionen */
.unit-head h2 { font-size: 1.2rem; }
.lesson-row { border: 1px solid var(--line); border-bottom-width: 1px; border-radius: 22px; box-shadow: var(--shadow); background: var(--surface); }
.lesson-row.is-next {
  border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--aurora) border-box;
  box-shadow: var(--glow);
}
.lesson-icon { border: 1px solid var(--line); border-bottom-width: 1px; border-radius: 18px; }
.big-icon { border-radius: 26px; box-shadow: var(--shadow); }
.status.next { color: var(--primary); background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; }
.status.ok { color: var(--ok); }
.game-icon { border-radius: 16px; }
.game-row.is-off { background: var(--surface-2); }

/* Szenenbilder harmonisch einbetten */
.scene-canvas { border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Wörter & Bilder */
.word-cards .word-item { border: 1px solid var(--line) !important; border-radius: 20px; box-shadow: var(--shadow); }
.picto { border-radius: 18px; border-width: 1px; }
.word-example { border-radius: 14px; }

/* Aufgaben */
.ex-type { color: var(--primary); letter-spacing: 0.08em; }
.ex-question { font-weight: 600; font-size: 1.3rem; }
.ex-source { border-radius: 20px; box-shadow: var(--shadow); }
.option {
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 20px;
  background: var(--surface); transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.option:hover:not([disabled]) { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option .key { border-radius: 10px; font-weight: 900; }
.option.selected .key { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.option.is-right { border-color: var(--ok); background: var(--ok-soft); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.chip { border-radius: 16px; border-bottom-width: 3px; }
.match-btn { border-radius: 20px; }
.lesson-foot { border-top-width: 2px; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px -16px rgba(0, 0, 0, 0.3); }
.fb-head { font-weight: 600; }
.bubble { border-radius: 20px; }
.dialog-lines .bubble.me { background: var(--primary-soft); border-color: transparent; }

/* Ergebnis & Erfolge */
.stat { border: 1px solid var(--line); border-bottom-width: 1px; border-radius: 22px; box-shadow: var(--shadow); }
.stat-num { color: var(--primary); font-weight: 700; }
.badge-card { border: 1px solid var(--tone-1-b); border-bottom-width: 1px; border-radius: 22px; box-shadow: var(--shadow); background: linear-gradient(150deg, var(--tone-1), var(--surface)); }
.badge-card.open { background: var(--surface-2); box-shadow: none; }

/* Einrichtung */
.onboarding .hero { padding-top: 12px; }
.onboarding .hero .mascot { filter: drop-shadow(0 12px 18px rgba(91, 54, 242, 0.25)); }
.choice-card { border: 2px solid var(--line); border-bottom-width: 2px; border-radius: 20px; box-shadow: var(--shadow); transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--glow); }
.cc-title { font-weight: 600; }

/* Eingabefelder */
.text-input, .settings select, .settings input[type="text"] {
  border: 2px solid var(--line); border-radius: 16px; background: var(--surface); min-height: 52px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input:focus, .settings select:focus, .settings input[type="text"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* Konto */
.account-head {
  padding: 16px; border-radius: 28px; background: var(--aurora-soft); border: 1px solid var(--line);
}
.account-profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.account-profile > div { padding: 10px 12px; border-radius: 16px; background: var(--surface-2); }
.account-profile dt { font-size: 0.78rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.account-profile dd { margin: 2px 0 0; font-weight: 800; }
.account-progress .stats { margin: 12px 0 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.danger-zone > summary { color: var(--bad); list-style-position: inside; min-height: 32px; }
.danger-zone[open] > summary { margin-bottom: 8px; }
.btn.danger.block { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger.block { color: #2a0b14; } }
.seg { background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn.on { background: var(--surface); color: var(--primary); }

/* Laden */
.boot p { font-weight: 800; }
.spinner { border-color: var(--primary-soft); border-top-color: var(--primary); }

/* Toasts */
.toast { border-radius: 16px; background: #17142e; color: #fff; box-shadow: var(--shadow-lift); }
.toast.error { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .toast { background: #f3f1ff; color: #17142e; } .toast.error { background: #ff8fa3; color: #2a0b14; } }

/* ═════════════ Bildschirmgrößen ═════════════ */
@media (max-width: 420px) {
  .home-hero { padding: 14px 12px 14px 4px; border-radius: 24px; }
  .hero-mascot { width: 88px; }
  .tile { min-height: 148px; }
  .card { padding: 16px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .page { max-width: 760px; }
}

/* ═════════════ Animationen (nur ohne „Weniger Bewegung“) ═════════════ */
@media (prefers-reduced-motion: no-preference) {
  .btn:hover:not([disabled]) { transform: translateY(-2px); }
  .btn:active:not([disabled]) { transform: translateY(1px) scale(0.98); }
  .btn.primary::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
  }
  .btn.primary:hover:not([disabled])::after { transition: transform 0.7s ease; transform: translateX(120%); }

  .tile:hover, .lesson-row:hover, .linkcard:hover, .game-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
  .tile:hover .ico { transform: scale(1.1) rotate(-6deg); }
  .option:active:not([disabled]) { transform: scale(0.985); }
  .choice-card:hover { transform: translateY(-1px); }

  .bottomnav a { transition: background-color 0.2s ease, color 0.2s ease; }
  .bottomnav a .nav-ico { transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .bottomnav a:hover .nav-ico { transform: translateY(-2px); }
  .bottomnav a.active .nav-ico { transform: scale(1.12); }
  .bottomnav a.active::after { animation: nav-dot 0.3s ease-out both; }

  .bar > span::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%); animation: bar-shine 2.8s ease-in-out 0.6s infinite;
  }
  .home-hero { background-size: 180% 180%; animation: aurora-drift 14s ease-in-out infinite alternate; }
  .hero-mascot { animation: float 4.5s ease-in-out infinite; }
  .option.is-right { animation: right-pop 0.35s ease-out; }
  .lesson-row.is-next .lesson-icon { animation: soft-pulse 2.4s ease-in-out infinite; }
}
@keyframes bar-shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes aurora-drift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nav-dot { from { opacity: 0; transform: scaleX(0.3); } to { opacity: 1; transform: none; } }
@keyframes soft-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent); } }

/* Hoher Kontrast gewünscht: Verläufe durch klare Flächen ersetzen */
@media (prefers-contrast: more) {
  .home-hero, .btn.primary, .audio-btn, .ob-progress span.on { background: var(--primary) !important; }
  .brand-name { background: none; color: var(--text); }
  .card, .lesson-row, .tile, .option { border-width: 2px; }
}

/* ═════════════ Willkommensseite, Kurse & Preise, Abo ═════════════ */
.landing { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }
.landing-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; padding-top: calc(12px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.landing-nav { display: flex; align-items: center; gap: 14px; font-weight: 800; }
.landing-nav > a:not(.btn) { text-decoration: none; }
.landing-hero { display: grid; gap: 24px; align-items: center; padding: 18px 0 8px; }
.landing-hero h1 { font-size: clamp(2rem, 1.4rem + 2.8vw, 3.2rem); line-height: 1.1; margin: 6px 0 12px; }
.landing-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.landing-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 14px; }
.landing-cta .btn { min-width: 200px; }
.landing-art { position: relative; }
.landing-art .scene { margin: 0; }
.landing-art .scene-canvas { aspect-ratio: 5 / 4; border-radius: 32px; box-shadow: var(--shadow-lift); }
.landing-mascot { position: absolute; left: -10px; bottom: -24px; width: 34%; max-width: 150px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.25)); }
@media (min-width: 860px) {
  .landing-hero { grid-template-columns: 1.1fr 1fr; padding: 40px 0 24px; gap: 40px; }
}
.feature-grid { list-style: none; padding: 0; margin: 36px 0 8px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { border: 1px solid; border-radius: 26px; padding: 20px; box-shadow: var(--shadow); }
.feature h2 { font-size: 1.15rem; margin: 10px 0 4px; }
.feature p { margin: 0; color: color-mix(in srgb, var(--text) 75%, transparent); font-size: 0.95rem; }
.landing-section { margin-top: 30px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.steps p { margin: 2px 0 0; }
.step-num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--aurora); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.lang-chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chips li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.landing-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.landing-foot p { flex-basis: 100%; margin: 0; }

.pricing h1 { margin-top: 12px; }
.plan-grid { display: grid; gap: 16px; margin: 20px 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan-card { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.plan-card .btn { margin-top: auto; }
.plan-plus { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--aurora) border-box; box-shadow: var(--glow); }
.plan-name { font-size: 1.35rem; margin: 0; }
.plan-price { margin: 2px 0 0; font-family: var(--font-display); }
.plan-price strong { font-size: 2.2rem; font-weight: 700; }
.plan-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list .ico { margin-top: 3px; }
.plan-limit { margin: 0 0 10px; }
.is-current { cursor: default; }
.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.compare th, .compare td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.compare tbody th { font-weight: 800; }
@media (max-width: 520px) {
  .compare thead { display: none; }
  .compare tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .compare tbody th { grid-column: 1 / -1; border: 0; padding-bottom: 0; }
  .compare td { border: 0; }
  .compare .cmp-lab { display: inline; }
}
.cmp-lab { display: none; font-weight: 800; color: var(--muted); }
.cmp-lab.plus { color: var(--primary); }
.plan-summary .plan-price strong { font-size: 2rem; }
.summary-list { display: grid; gap: 10px; margin: 16px 0; }
.summary-list > div { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.summary-list dt { font-weight: 900; font-size: 0.85rem; }
.summary-list dd { margin: 2px 0 0; }
.billing .empty .btn { margin: 4px; }
.billing .spinner { margin: 12px auto; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plus-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 900; font-size: 0.8rem; }
.status.plus-lock { color: var(--primary); }
.game-row.is-locked { opacity: 0.85; }
.plus-hint { background: var(--aurora-soft); }
/* ═════════════ Rechtstexte, Kündigungsbutton ═════════════ */
.legal-text { max-width: 760px; }
.legal-text h2 { font-size: 1.15rem; margin: 22px 0 6px; }
.legal-text h3 { font-size: 1rem; margin: 16px 0 4px; }
.legal-text p { line-height: 1.6; }
.legal-missing { background: var(--accent-soft); color: var(--text); border: 1px dashed var(--accent); border-radius: 6px; padding: 0 4px; font-weight: 800; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 28px 0 10px; font-weight: 700; font-size: 0.92rem; }
.legal-links .cancel-link { color: var(--bad); }
.cancel-page textarea.text-input { min-height: 90px; }
.cancel-confirm { text-align: start; }
@media print {
  .topbar, .bottomnav, .landing-top, .legal-links, .net-banner, .toast-region, [data-print] { display: none !important; }
  body, body.with-chrome { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; }
}
/* ═════════════ KI-Assistent: neue Wörter, Hinweise, Abbrechen ═════════════ */
.assist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.assist-head [data-new-chat] { margin-inline-start: auto; }
.new-words { margin: 6px 0 0; padding: 10px 12px; border-radius: 16px; background: var(--aurora-soft); border: 1px solid var(--line); max-width: 90%; }
.new-words ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.new-words .corr-head { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 800; }
.ai-unsure { margin: 6px 0 0; padding: 8px 12px; border-radius: 14px; background: var(--accent-soft); max-width: 90%; display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.composer [data-cancel-chat] { flex: none; }
/* ═════════════ Handy-Feinschliff (aus dem Browser-Test) ═════════════ */
.pill, .landing-nav > a, .bottomnav a { white-space: nowrap; }
@media (max-width: 480px) {
  /* Kopfleiste: Markenname ausblenden, damit Sprachkürzel, Serie und Knöpfe in eine Zeile passen */
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar .brand-name { display: none; }
  .topbar-meta { gap: 6px; }
  #topbar-course { font-size: 0.8rem; padding: 4px 10px; }
  /* Untere Navigation: alle 6 Einträge vollständig sichtbar */
  .bottomnav { left: 6px; right: 6px; padding: 4px; gap: 2px; }
  .bottomnav a { font-size: 0.64rem; padding: 6px 0 8px; min-width: 0; letter-spacing: -0.01em; }
  .bottomnav a .nav-ico { width: 24px; height: 24px; }
  /* Willkommensseite: Kopfzeile kompakt */
  .landing-top .brand-name { font-size: 1.1rem; }
  .landing-nav { gap: 10px; font-size: 0.9rem; }
  .landing-nav .btn.small { padding: 6px 12px; min-height: 40px; }
}
@media (max-width: 360px) {
  .landing-top .brand-name { display: none; }
}
/* Netlify blendet bei kostenlosen Seiten ein Hinweisschild unten rechts ein (#nl-badge-frame).
   Es bleibt sichtbar, wird aber über die untere Navigation geschoben, damit es keine Knöpfe verdeckt. */
#nl-badge-frame { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 1024px) { #nl-badge-frame { bottom: 16px !important; } }
/* Startseite: Zeile „Sprache · Niveau · Ziel · Sprache ändern“ als Fließtext, damit das Symbol nicht allein umbricht */
.home-meta { display: block; line-height: 1.6; }
.home-meta .ico { margin-inline-end: 4px; vertical-align: -4px; }