:root {
  --bg: #fff8ec;
  --surface: #ffffff;
  --surface-2: #f6efe2;
  --text: #1f2a30;
  --muted: #56616b;
  --line: #eadfcb;
  --primary: #0f6e6a;
  --primary-ink: #ffffff;
  --primary-soft: #d9f2ec;
  --accent: #f5a623;
  --accent-soft: #fff0cc;
  --ok: #1d7a43;
  --ok-soft: #def6e6;
  --bad: #b3372b;
  --bad-soft: #fde4e0;
  --info-soft: #e4eeff;
  --info: #2c5394;
  --focus: #1b5fd1;
  --star: #f2b100;
  --star-off: #e2d6bf;
  /* Kachel-Töne: Hintergrund + kräftigere Unterkante */
  --tone-1: #fff1c2; --tone-1-b: #f0cf6a;
  --tone-2: #dff0ff; --tone-2-b: #9ccdf5;
  --tone-3: #ffe3e8; --tone-3-b: #f5a9b8;
  --tone-4: #e4f7d6; --tone-4-b: #a8db86;
  --tone-5: #ece6ff; --tone-5-b: #bcaef2;
  --tone-6: #ffe7d1; --tone-6-b: #f4b583;
  --blob-1: #ffe2a8;
  --blob-2: #cdeee6;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 2px 0 rgba(31, 42, 48, 0.05), 0 8px 24px rgba(31, 42, 48, 0.07);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12191b;
    --surface: #1b2427;
    --surface-2: #243034;
    --text: #edf2f1;
    --muted: #a9b5b8;
    --line: #34444a;
    --primary: #4fc3b8;
    --primary-ink: #0b1514;
    --primary-soft: #1b3a38;
    --accent: #f5b94a;
    --accent-soft: #3a3020;
    --ok: #74d39a;
    --ok-soft: #1c3627;
    --bad: #f39286;
    --bad-soft: #3e2421;
    --info-soft: #1f2b40;
    --info: #a3c2f5;
    --focus: #8ab4ff;
    --star: #ffcc33;
    --star-off: #4a565a;
    --tone-1: #3a3220; --tone-1-b: #6b5a2a;
    --tone-2: #1d3044; --tone-2-b: #33557a;
    --tone-3: #3d2329; --tone-3-b: #6e3b47;
    --tone-4: #233620; --tone-4-b: #3f6236;
    --tone-5: #2b2645; --tone-5-b: #4c4380;
    --tone-6: #3d2b1c; --tone-6-b: #6c4a2c;
    --blob-1: #2a2618;
    --blob-2: #15302d;
    --shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
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.5;
  min-height: 100vh;
}
body.with-chrome { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0 0 0.75rem; }
a { color: var(--primary); }
kbd { font-family: inherit; font-size: 0.85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; }
s { text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
details summary { cursor: pointer; color: var(--primary); font-weight: 700; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.tiny { font-size: 0.8rem; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.stack { display: grid; gap: 10px; margin-top: 1rem; }
.noscript { padding: 2rem; text-align: center; }

/* ───── Kopf- und Fußleiste ───── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; }
.brand-mark, .hero-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent)));
  color: var(--primary-ink); font-weight: 800;
}
.topbar-meta { display: flex; align-items: center; gap: 8px; }

/* ───── App-Modus (installiert) und Offline-Hinweis ───── */
.net-banner {
  padding: 8px 16px; font-size: 0.88rem; line-height: 1.4;
  background: var(--accent-soft); color: var(--text);
  border-bottom: 1px solid var(--line);
}
.offline-only { display: none; }
.is-offline .offline-only { display: block; }
@media (display-mode: standalone) {
  /* Im eigenen App-Fenster: kein versehentliches Markieren der Bedienleisten */
  .topbar, .bottomnav { -webkit-user-select: none; user-select: none; }
}
.pill { font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.streak-pill { background: var(--accent-soft); color: var(--text); }

.icon-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { min-width: 32px; height: 32px; font-size: 0.95rem; vertical-align: middle; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px;
  text-decoration: none; color: var(--muted); font-size: 0.78rem; font-weight: 700;
}
.bottomnav a span { font-size: 1.25rem; line-height: 1; }
.bottomnav a.active { color: var(--primary); }
.bottomnav a.active span { transform: translateY(-1px); }

main { outline: none; }
.page, .onboarding, .lesson { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; }

/* ───── Laden ───── */
.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 14px; border: 2px solid transparent;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 70%, black); }
.btn.primary:hover:not([disabled]) { background: color-mix(in srgb, var(--primary) 90%, white); }
.btn.secondary { background: var(--primary-soft); color: var(--text); }
.btn.ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; border-radius: 10px; box-shadow: none; }
.btn.xl { min-height: 56px; font-size: 1.1rem; }
.btn.block { display: flex; width: 100%; }

/* ───── Karten ───── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
fieldset.card { min-width: 0; }
.card-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 4px; }
.eyebrow { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.linkcard { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.linkcard:hover { border-color: var(--primary); }
.chev { font-size: 1.6rem; color: var(--muted); }
.tag { text-transform: none; letter-spacing: 0; background: var(--accent-soft); color: var(--text); padding: 1px 8px; border-radius: 999px; }
.big { font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.2; }
.big .muted { font-size: 1rem; font-weight: 700; }

.greet { font-size: 1.5rem; }
.greet .muted { display: block; font-size: 0.95rem; font-weight: 700; margin-top: 2px; }
.nudge { color: var(--muted); margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid-2 .card { margin: 0; display: flex; align-items: center; gap: 12px; }
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.ring { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.streak-icon { font-size: 2.2rem; width: 64px; text-align: center; flex: none; }

.lesson-next { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.lesson-icon { font-size: 1.8rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 14px; flex: none; }
.challenge.done { border-color: var(--ok); }
.btn.xl.block { margin: 4px 0 0; }

.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width 0.4s ease; }
.challenge .bar > span { background: var(--accent); }

/* ───── Onboarding ───── */
.onboarding { padding-top: 28px; }
.ob-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.ob-progress span { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); }
.ob-progress span.on { background: var(--primary); }
.hero { text-align: center; padding: 24px 0 8px; }
.hero-mark { width: 72px; height: 72px; border-radius: 22px; font-size: 2.2rem; margin: 0 auto 16px; }
.lead { font-size: 1.1rem; }
.h-sub { font-size: 1rem; color: var(--muted); margin-top: 1.25rem; }
.choice-cards { display: grid; gap: 10px; margin: 12px 0; }
.choice-card {
  position: relative; display: grid; gap: 2px; padding: 14px 16px 14px 48px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.choice-card input { position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; accent-color: var(--primary); }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-card.disabled { opacity: 0.55; cursor: not-allowed; }
.cc-title { font-weight: 800; }
.cc-desc { color: var(--muted); font-size: 0.92rem; }
.soon { margin: 6px 0 4px; font-size: 0.9rem; }
.ob-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.ob-actions .btn.primary { min-width: 140px; }

/* ───── Kursübersicht ───── */
.unit { margin-top: 22px; }
.unit-head { display: flex; justify-content: space-between; align-items: baseline; }
.lesson-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.lesson-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.lesson-row:hover { border-color: var(--primary); }
.lesson-row.is-next { border: 2px solid var(--primary); }
.status { display: inline-block; margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.next { color: var(--primary); }

/* ───── Lektion ───── */
.lesson { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 0; }
.lesson-top { display: flex; align-items: center; gap: 12px; }
.lesson-top .bar { flex: 1; margin: 0; height: 12px; }
.adapt-note { font-size: 0.85rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; margin: 14px 0 0; }
.exercise { flex: 1; padding: 20px 0 24px; }
.ex-type { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.ex-question { font-size: 1.2rem; font-weight: 800; }
.ex-sentence { font-size: 1.35rem; font-weight: 700; margin: 6px 0 4px; }
.ex-hint { color: var(--muted); }
.ex-source { font-size: 1.3rem; font-weight: 800; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.blank { display: inline-block; min-width: 4ch; border-bottom: 3px solid var(--accent); margin: 0 4px; padding: 0 4px; color: var(--muted); }
.blank.filled { color: var(--text); background: var(--accent-soft); border-radius: 6px 6px 0 0; }

.options { display: grid; gap: 10px; margin-top: 14px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 54px; padding: 12px 14px; font: inherit; font-weight: 700; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; cursor: pointer;
}
.option:hover:not([disabled]) { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.option .key { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 8px; font-size: 0.8rem; color: var(--muted); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.is-right { border-color: var(--ok); background: var(--ok-soft); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.option[disabled] { cursor: default; }

.dialog-lines { display: grid; gap: 8px; margin-bottom: 14px; }
.bubble { position: relative; max-width: 90%; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dialog-lines .bubble .who { display: block; font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.dialog-lines .bubble.me { justify-self: end; background: var(--primary-soft); }

.audio-row { display: flex; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.audio-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 18px;
  font: inherit; font-weight: 800; color: var(--primary-ink); background: var(--primary); border: 0; border-radius: 14px; cursor: pointer;
}
.audio-btn.secondary { background: var(--primary-soft); color: var(--text); }

.notice { border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.notice-warn { background: var(--accent-soft); }
.notice-info { background: var(--info-soft); }

.field-label { display: block; font-weight: 800; font-size: 0.9rem; margin: 14px 0 6px; }
.text-input, .settings select, .settings input[type="text"] {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical;
}
.text-input:focus, .settings select:focus, .settings input[type="text"]:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.text-input.is-right { border-color: var(--ok); }
.text-input.is-wrong { border-color: var(--bad); }
.field-help { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.match-col { display: grid; gap: 10px; align-content: start; }
.match-btn {
  min-height: 54px; padding: 10px; font: inherit; font-weight: 700; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; cursor: pointer;
}
.match-btn.selected { border-color: var(--primary); background: var(--primary-soft); }
.match-btn.is-right { border-color: var(--ok); background: var(--ok-soft); opacity: 0.7; cursor: default; }
.shake { animation: shake 0.4s; border-color: var(--bad) !important; background: var(--bad-soft) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.order-line {
  min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px;
  border: 2px dashed var(--line); border-radius: 14px; background: var(--surface);
}
.order-line.is-right { border: 2px solid var(--ok); }
.order-line.is-wrong { border: 2px solid var(--bad); }
.order-line .placeholder { color: var(--muted); font-size: 0.9rem; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px; padding: 8px 14px; font: inherit; font-weight: 700; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; cursor: pointer;
}
.chip:hover:not([disabled]) { border-color: var(--primary); }
.order-bank .chip[disabled] { visibility: hidden; }
.order-line .chip[disabled] { cursor: default; }
.chip.in-line { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Rückmeldung */
.lesson-foot {
  position: sticky; bottom: 0; margin: 0 -16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.lesson-foot.fb-right { background: var(--ok-soft); border-top-color: var(--ok); }
.lesson-foot.fb-wrong { background: var(--bad-soft); border-top-color: var(--bad); }
.lesson-foot.fb-info { background: var(--info-soft); border-top-color: var(--info); }
.feedback { max-height: 46vh; overflow-y: auto; }
.feedback:empty { display: none; }
.fb-head { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.fb-right .fb-head { color: var(--ok); }
.fb-wrong .fb-head { color: var(--bad); }
.fb-info .fb-head { color: var(--info); }
.sol-label { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 2px; color: var(--muted); }
.solution { font-weight: 800; font-size: 1.05rem; }
.why { margin: 4px 0 8px; padding-left: 20px; }
.why li { margin-bottom: 4px; }
.retry-note { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.foot-actions { display: flex; gap: 10px; justify-content: space-between; }
.foot-actions .btn.primary { flex: 1; max-width: 320px; margin-left: auto; }
.checklist { list-style: none; padding: 0; margin: 4px 0 10px; }
.checklist li { padding: 2px 0; }
.checklist li.ok span { color: var(--ok); font-weight: 800; }
.checklist li.no { color: var(--muted); }
.corr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; }
.corr ul { margin: 6px 0 0; padding-left: 18px; }
.corr li { margin-bottom: 6px; }
.corr-head { font-size: 0.85rem; color: var(--muted); margin: 0; }
.corr-none { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; text-align: right; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.badge.demo { background: var(--accent-soft); color: var(--text); }
.badge.ai { background: var(--info-soft); color: var(--info); }

/* Ergebnis */
.result { text-align: center; }
.result-hero { font-size: 3.5rem; margin: 12px 0 4px; }
.result .card { text-align: left; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 2px; text-align: center; }
.stat-num { font-size: 1.45rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.word-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.word-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.word-list li > span:first-child { font-weight: 800; }
.word-list li > .muted { flex: 1; text-align: right; }

/* Leere Ansichten */
.empty { text-align: center; padding-top: 48px; }
.empty-icon { font-size: 3rem; margin-bottom: 8px; }

/* ───── Assistent ───── */
.assist-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.assist-head h1 { margin: 0; }
.segmented { display: flex; border: 0; padding: 0; margin: 12px 0 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 0.85rem; font-weight: 800; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); }
.scenario-bar { margin: 8px 0 12px; }
.scenario-active { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius-sm); margin: 0; font-size: 0.92rem; }
.scenario-active .btn { margin-left: auto; }

.chat-log {
  display: flex; flex-direction: column; gap: 10px; min-height: 240px; max-height: 52vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.chat-empty { margin: auto; text-align: center; max-width: 420px; }
.chat-empty .chips { justify-content: center; }
.chat-sys { align-self: center; font-size: 0.8rem; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; margin: 0; text-align: center; }
.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; }
.msg .bubble { max-width: 100%; }
.msg.me .bubble { background: var(--primary); color: var(--primary-ink); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--surface-2); border-color: transparent; border-bottom-left-radius: 4px; display: flex; gap: 6px; align-items: flex-start; }
.msg-meta { margin-top: 4px; }
.msg .corr { margin-top: 6px; max-width: 100%; }
.chat-error { align-self: stretch; background: var(--bad-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.chat-error p { margin: 0 0 8px; }
.typing { display: inline-flex !important; gap: 4px; padding: 14px 16px !important; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.hint-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; align-self: flex-end; justify-content: flex-end; }
.hint-row .chip { min-height: 34px; padding: 4px 10px; font-size: 0.88rem; border-style: dashed; border-bottom-width: 2px; }

.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.composer textarea {
  flex: 1; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line);
  border-radius: 14px; padding: 11px 14px; resize: none; min-height: 48px; max-height: 140px;
}
.composer textarea:focus { border-color: var(--primary); outline: none; }
.composer .btn { min-height: 48px; }
.mic { height: 48px; width: 48px; border: 2px solid var(--line); background: var(--surface); }
.mic.live { background: var(--bad-soft); border-color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }

/* ───── Fortschritt ───── */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; margin: 12px 0 6px; }
.day { display: grid; justify-items: center; gap: 4px; }
.day-bar { width: 100%; max-width: 34px; height: 96px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.day-bar span { display: block; width: 100%; background: var(--primary); border-radius: 8px; }
.day-bar span.reached { background: var(--ok); }
.day-label { font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.day-val { font-size: 0.75rem; color: var(--muted); }
.unit-progress { margin: 10px 0; }
.trouble { padding-left: 18px; margin: 8px 0; }
.trouble li { margin-bottom: 6px; }

/* ───── Einstellungen ───── */
.settings fieldset { border: 1px solid var(--line); }
.settings legend { padding: 0 6px; }
.field { margin: 12px 0; }
.field > label { display: block; font-weight: 800; font-size: 0.92rem; margin-bottom: 6px; }
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; margin-top: 2px; }
.field.check label { font-weight: 600; margin: 0; }
.field input[type="range"] { width: 100%; accent-color: var(--primary); }
.settings .btn.block { margin-bottom: 18px; }

/* ───── Toasts ───── */
.toast-region { position: fixed; left: 0; right: 0; bottom: calc(90px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 0.92rem; box-shadow: var(--shadow); max-width: 520px; transition: opacity 0.4s, transform 0.4s; }
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ───── Wort/Satz in der Lernsprache: antippen = vorlesen, Übersetzung daneben ───── */
.term { display: inline-flex; align-items: flex-start; gap: 10px; max-width: 100%; vertical-align: middle; }
.term-body { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.term-block .term-body { flex-direction: column; align-items: flex-start; gap: 3px; }
.term-say {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px; margin: -3px -8px;
  font: inherit; font-weight: 700; color: inherit; text-align: start; background: transparent; cursor: pointer;
  border: 0; border-radius: 8px; border-bottom: 2px dotted color-mix(in srgb, var(--primary) 55%, transparent);
  transition: background-color var(--t-fast, 140ms) ease;
}
.term-say:hover { background: var(--primary-soft); }
.term-static { cursor: default; border-bottom: 0; }
.term-text { overflow-wrap: anywhere; }
.term-lab {
  flex: none; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1;
  padding: 3px 5px; border-radius: 5px; background: var(--surface-2); color: var(--muted); align-self: center;
}
.term-say .term-lab { background: var(--primary-soft); color: var(--primary); }
.term-gloss { display: inline-flex; align-items: baseline; gap: 6px; font-size: 0.9em; font-weight: 600; color: var(--muted); }
.term-gloss .term-lab { align-self: baseline; }
.term-missing { font-style: italic; font-size: 0.8rem; }
/* Lautsprecher-Symbol, beim Abspielen hervorgehoben */
.term-icon { width: 18px; height: 18px; flex: none; background: currentColor; opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/></svg>") center / contain no-repeat; }
.say-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; vertical-align: middle; color: var(--primary); background: var(--primary-soft); border: 0; border-radius: 50%; cursor: pointer; }
.say-btn .term-icon { opacity: 1; }
.is-playing { background: var(--primary-soft) !important; box-shadow: 0 0 0 2px var(--primary); }
.is-playing .term-icon, .say-btn.is-playing .term-icon { opacity: 1; animation: say-pulse 0.9s ease-in-out infinite; }
@keyframes say-pulse { 50% { transform: scale(1.2); } }

/* Bilder zum Begriff */
.picto { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; border-radius: 12px; background: var(--surface-2); }
.picto-none { color: var(--muted); font-size: 0.95rem; font-weight: 800; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); border: 1px dashed var(--line); }
.word-item { display: block !important; padding: 8px 0 !important; }
.word-item .term { width: 100%; align-items: center; }
.speak-text .term { font-size: 1.5rem; }
.speak-text .picto { width: 56px; height: 56px; font-size: 2rem; }
.greet-target { display: inline-block; font-size: 1.2rem; }
.voice-line { margin-top: 8px; }
.lesson-intro h1 { margin-top: 8px; }

/* Antwortoptionen: nach dem Prüfen Vorlesen + Übersetzung */
.option-wrap { display: grid; gap: 4px; }
.opt-after { display: flex; align-items: center; gap: 8px; padding: 0 6px 2px 44px; }
.bubble .term { font-weight: 600; }
.solution .term { font-size: 1.05rem; }

/* ───── Sprachauswahl (Aufklapp-Auswahlfeld) ─────
   Animiert werden nur transform, opacity und grid-template-rows: Das ist flüssig und
   erzeugt keine großen Layoutsprünge. Dauer bewusst kurz (120–240 ms).
   Bei „Weniger Bewegung“ greift die globale Regel ganz unten plus der Block direkt hier drunter. */
:root {
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 140ms;
  --t-open: 220ms;
}
.ls-field { margin-bottom: 6px; }
.ls-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 10px 14px;
  font: inherit; color: var(--text); text-align: start; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
.ls-trigger:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.ls-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ls-trigger-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ls-name { font-weight: 800; }
.ls-native { color: var(--muted); }
.ls-chevron { width: 10px; height: 10px; flex: none; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform var(--t-open) var(--ease-out); }
.ls-trigger[aria-expanded="true"] .ls-chevron { transform: translateY(2px) rotate(225deg); }

/* Auf- und Zuklappen: Höhe über grid-template-rows (0fr ↔ 1fr), dazu Ein-/Ausblenden.
   visibility sorgt dafür, dass ein geschlossenes Feld nicht per Tab oder Screenreader erreichbar ist. */
.ls-panel {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows var(--t-open) var(--ease-out), opacity var(--t-fast) ease, visibility 0s linear var(--t-open);
}
.ls-panel[data-open="true"] {
  grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows var(--t-open) var(--ease-out), opacity var(--t-open) ease, visibility 0s;
}
.ls-panel-inner { min-height: 0; overflow: hidden; }
.ls-panel-inner > * { transform: translateY(-6px); transition: transform var(--t-open) var(--ease-out); }
.ls-panel[data-open="true"] .ls-panel-inner > * { transform: none; }
.ls-search { margin: 8px 0 6px; }
.ls-list {
  list-style: none; margin: 0; padding: 4px; max-height: min(320px, 46vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
}
.ls-option {
  display: grid; grid-template-columns: 18px 1fr; grid-template-areas: "check main" "check tag";
  gap: 0 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background-color var(--t-fast) ease, transform var(--t-fast) ease;
}
.ls-option + .ls-option { margin-top: 2px; }
.ls-check { grid-area: check; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); position: relative; transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.ls-opt-main { grid-area: main; }
.ls-tag { grid-area: tag; font-size: 0.78rem; color: var(--muted); }
.ls-option.is-available .ls-tag { color: var(--ok); font-weight: 700; }
.ls-option:hover, .ls-option.is-active { background: var(--surface-2); }
.ls-option.is-active { box-shadow: inset 0 0 0 2px var(--focus); }
.ls-option.is-selected { background: var(--primary-soft); }
.ls-option.is-selected .ls-check { border-color: var(--primary); background: var(--primary); }
.ls-option.is-selected .ls-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--primary-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.ls-option[aria-disabled="true"] { cursor: not-allowed; opacity: 0.5; }
.ls-option[aria-disabled="true"]:hover { background: transparent; }
.ls-empty { padding: 14px; text-align: center; color: var(--muted); }
.ls-count { margin: 6px 2px 2px; }

/* Kurze, ruhige Hervorhebungen */
@keyframes ls-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ls-refresh { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes ls-picked { 0% { transform: scale(1); } 40% { transform: scale(0.98); background: color-mix(in srgb, var(--primary) 28%, var(--surface)); } 100% { transform: scale(1); } }
@keyframes ls-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes ls-spin { from { transform: rotate(0); } to { transform: rotate(180deg); } }
.ls-list.ls-refresh { animation: ls-refresh var(--t-fast) ease; }
.ls-option.ls-picked { animation: ls-picked 260ms var(--ease-out); }
.ls-trigger.ls-flash { animation: ls-flash 520ms var(--ease-out); }
.ls-swap.ls-spin .ls-swap-icon { display: inline-block; animation: ls-spin 260ms var(--ease-out); }
.ls-reveal { animation: ls-fade-in 200ms var(--ease-out); }

.ls-swap-row { display: flex; justify-content: center; margin: 10px 0 4px; }
.ls-variant { margin-top: 8px; }
.ls-status { margin-top: 12px; }
.ls-hello { font-size: 1.6rem; font-weight: 800; margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  .ls-panel, .ls-panel[data-open="true"], .ls-panel-inner > *, .ls-chevron, .ls-option, .ls-trigger { transition: none; }
  /* Die globale Regel unten gibt jedem Element einen Mini-Übergang. Für die geerbte Sichtbarkeit
     im Auswahlfeld würde das den Fokus beim Öffnen kurz blockieren – deshalb hier ganz aus. */
  .ls-panel-inner, .ls-panel-inner * { transition: none !important; }
  .ls-panel-inner > * { transform: none; }
  .ls-reveal, .ls-list.ls-refresh, .ls-option.ls-picked, .ls-trigger.ls-flash, .ls-swap.ls-spin .ls-swap-icon { animation: none; }
}
.notice-ok { background: var(--ok-soft); }
.notice .chips { margin-top: 8px; }
.greet-target { color: var(--primary); }
.pill-link { text-decoration: none; }
.pill-link:hover { background: var(--primary-soft); color: var(--text); }
.sticky-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 4px; }

/* ───── Verfügbarkeit (Symbol + Text, nie nur Farbe) ───── */
.cap { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.cap-yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-soft); }
.cap-demo { color: var(--text); background: var(--accent-soft); }
.cap-unknown { color: var(--info); background: var(--info-soft); }
.cap-no { color: var(--muted); }
.cap-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.cap-list li { display: flex; gap: 10px; align-items: flex-start; }
.cap-icon { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 0.8rem; background: var(--surface-2); }
.cap-list .cap-yes .cap-icon { background: var(--ok-soft); color: var(--ok); }
.cap-list .cap-demo .cap-icon { background: var(--accent-soft); }
.cap-list .cap-unknown .cap-icon { background: var(--info-soft); color: var(--info); }
.cap-list li.cap-yes, .cap-list li.cap-demo, .cap-list li.cap-unknown, .cap-list li.cap-no { border: 0; background: none; padding: 0; color: var(--text); font-size: 0.92rem; }
.cap-strip { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.cap-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.cap-box summary { font-size: 0.9rem; }

/* ───── Sprachauswahl ───── */
.lp-filters { border: 0; padding: 0; margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lp-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 700; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.lp-toggle input { accent-color: var(--primary); }
.lp-toggle:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.lp-select select { font: inherit; font-size: 0.88rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.lp-list { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; margin-top: 4px; }
.lp-row { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.lp-row.selected { border-color: var(--primary); background: var(--primary-soft); }
.lp-row.disabled .lp-main { cursor: not-allowed; }
.lp-row.disabled .lp-name { color: var(--muted); }
.lp-main { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.lp-main input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.lp-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.lp-name { font-weight: 800; }
.lp-native { font-size: 1.05rem; }
.lp-meta { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.lp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 30px; }
.lp-details { margin: 6px 0 0 30px; font-size: 0.85rem; }
.lp-empty { padding: 16px; text-align: center; color: var(--muted); }
.lp-variant { margin-top: 12px; }
.lp-wrap > summary { font-weight: 800; color: var(--text); padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.lp-wrap[open] > summary { margin-bottom: 8px; }

/* ───── Umschrift, Sprechübung, Wortlisten ───── */
.tr { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); font-style: italic; }
.option .tr { display: inline; margin-inline-start: auto; }
.big-tr { font-size: 1rem; margin: -2px 0 6px; }
.speak-text { font-size: 1.6rem; }
.audio-btn.live { background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
.speak-out { min-height: 1.5em; }
.word-hits { display: flex; flex-wrap: wrap; gap: 6px; }
.word-hits span.hit, .word-hits span.miss { padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.word-hits .hit { background: var(--ok-soft); color: var(--ok); }
.word-hits .miss { background: var(--surface-2); color: var(--muted); text-decoration: underline dotted; }
.word-list .w { display: flex; flex-direction: column; }

/* Rechts-nach-links: Text richtet sich nach seiner eigenen Schreibrichtung */
[dir="rtl"] { text-align: right; }
.option { text-align: start; }
.ex-sentence[dir="rtl"], .speak-text[dir="rtl"] { font-size: 1.7rem; line-height: 1.7; }
.order-line[dir="rtl"], .order-bank[dir="rtl"] { direction: rtl; }
.chip[dir="rtl"], .match-btn[dir="rtl"] { font-size: 1.15rem; }

/* ───── Lernspiele ───── */
.game-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.game-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.game-row.is-off { background: var(--surface-2); border-style: dashed; }
.game-row.is-off strong { color: var(--muted); }
.game-row .status { margin-inline-end: 8px; }
.game-off-reason { font-weight: 600; }
.game-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 12px; background: var(--primary-soft); }
.g-select { font: inherit; width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); }
.how-list { margin: 6px 0 0; padding-inline-start: 1.3em; display: grid; gap: 4px; }
.game-title { font-size: 1.15rem; margin: 14px 0 8px; }
.game-stage { margin-top: 4px; }
.game-word { font-size: 1.35rem; font-weight: 800; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 8px 0; }
.game-word .term-text { font-size: 1.5rem; }
.game-feedback:empty { display: none; }
.game-feedback { margin: 14px 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.game-feedback.fb-right { background: var(--ok-soft); border-color: transparent; }
.game-feedback.fb-wrong { background: var(--bad-soft); border-color: transparent; }
.game-feedback.fb-info { background: var(--info-soft); border-color: transparent; }
.game .btn.xl.block { margin-top: 12px; }

/* Bildauswahl: große Bilder im Raster */
.picto-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picto-options .option { justify-content: center; min-height: 104px; position: relative; }
.picto-options .option .key { position: absolute; top: 8px; inset-inline-start: 8px; }
.picto-xl { width: 72px; height: 72px; font-size: 2.6rem; background: transparent; }

/* Blitzrunde */
.blitz-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.blitz-score strong, .blitz-time strong { font-size: 1.2rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.time-bar { height: 6px; }
.time-bar > span { background: color-mix(in srgb, var(--primary) 60%, var(--accent)); transition: width 0.2s linear; }
.pause-panel { text-align: center; margin-top: 12px; }

/* Satz-Puzzle */
.order-solution { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; }
.order-solution .arrow { color: var(--muted); }

/* Wort-Schatzsuche */
.find-list { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.find-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.find-list li.is-found { background: var(--ok-soft); border-color: transparent; }
.find-list li.is-revealed { background: var(--surface-2); }
.find-mark { flex: none; width: 1.4em; text-align: center; font-weight: 800; color: var(--ok); }
.ws-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; max-width: 520px; margin: 0 auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ws-cell {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 800;
  font-size: clamp(0.85rem, 4.2vw, 1.25rem); cursor: pointer; line-height: 1;
}
.ws-cell:hover:not([disabled]) { border-color: var(--primary); }
.ws-cell.is-start { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.ws-cell.hint { border-color: var(--accent); border-style: dashed; }
.ws-cell.found { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ws-cell.revealed { background: var(--accent-soft); border-color: var(--accent); }
.ws-cell[disabled] { cursor: default; }
.game-tools { margin-top: 12px; justify-content: center; }

@media (prefers-reduced-motion: no-preference) {
  .game-feedback.fb-right .fb-head, .ws-cell.found { animation: game-pop 240ms var(--ease-out, ease-out); }
}
@keyframes game-pop { from { transform: scale(0.94); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .time-bar > span { transition: none; }
}

/* ═════════════ Kinderfreundliches Design (überschreibt die Grundstile oben) ═════════════ */

body {
  font-size: 18px;
  background:
    radial-gradient(circle at 0% 0%, var(--blob-1) 0, transparent 280px),
    radial-gradient(circle at 100% 0%, var(--blob-2) 0, transparent 320px),
    var(--bg);
  background-repeat: no-repeat;
}
h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.01em; }
h2 { font-weight: 900; }
.card-title { font-size: 1.12rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 1.15rem; margin: 22px 0 10px; }

/* Bilder & Symbole */
.ico { display: inline-block; flex: none; vertical-align: -0.25em; object-fit: contain; }
.ico-text { font-size: 1.2em; line-height: 1; }
/* Echte Emojis des Geräts (farbig, auch in Knöpfen mit font-variant-emoji: text) */
.ico-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "Segoe UI Symbol", sans-serif;
  font-variant-emoji: emoji;
  font-style: normal; font-weight: 400; line-height: 1; letter-spacing: 0;
}
span.ico.ico-emoji {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--s, 24px); height: var(--s, 24px); font-size: calc(var(--s, 24px) * 0.9);
  overflow: visible;
}
.picto span.ico.ico-emoji { width: 78%; height: 78%; font-size: 40px; }
.picto-xl span.ico.ico-emoji { font-size: 68px; }
.scene-canvas { container-type: inline-size; }
.mascot { display: block; height: auto; max-width: 100%; }
.nav-ico { width: 28px; height: 28px; }

/* Kopfleiste */
.topbar { background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 2px solid var(--line); }
.brand { font-size: 1.1rem; font-weight: 900; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: none; }
.pill { font-size: 0.85rem; padding: 5px 12px; background: var(--surface); border: 2px solid var(--line); color: var(--text); }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border-color: var(--tone-1-b); }
.icon-btn { min-width: 44px; height: 44px; }

/* Untere Navigation: große Bild-Symbole, aktive Seite als farbige Fläche */
.bottomnav { grid-template-columns: repeat(6, 1fr); border-top: 2px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); gap: 2px; }
.bottomnav a { gap: 3px; padding: 6px 2px 8px; border-radius: 14px; font-size: 0.74rem; font-weight: 800; color: var(--muted); min-height: 56px; }
.bottomnav a:hover { background: var(--surface-2); }
.bottomnav a.active { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 380px) { .bottomnav a { font-size: 0.66rem; } .nav-ico { width: 24px; height: 24px; } }
body.with-chrome { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* Schaltflächen: groß, rund, mit „drückbarer“ Unterkante */
.btn { min-height: 52px; padding: 12px 22px; border-radius: 18px; font-size: 1.02rem; font-weight: 900; }
.btn.primary { box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 65%, black); }
.btn.secondary { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); border-bottom-width: 4px; }
.btn.ghost { background: var(--surface); border-width: 2px; }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: 0.95rem; border-radius: 14px; }
.btn.xl { min-height: 62px; font-size: 1.2rem; }
.btn .ico { margin: -4px 0; }
.cta { margin: 6px 0 16px !important; }

/* Karten */
.card { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.linkcard:hover, .lesson-row:hover { border-color: var(--primary); }
.row-start { display: flex; align-items: center; gap: 12px; }
.celebrate { display: flex; gap: 14px; align-items: center; }
.celebrate .mascot { flex: none; }

/* Farbige Kacheln (Lektionen, Spiele, Startseite) */
.tone-1 { background: var(--tone-1) !important; border-color: var(--tone-1-b) !important; }
.tone-2 { background: var(--tone-2) !important; border-color: var(--tone-2-b) !important; }
.tone-3 { background: var(--tone-3) !important; border-color: var(--tone-3-b) !important; }
.tone-4 { background: var(--tone-4) !important; border-color: var(--tone-4-b) !important; }
.tone-5 { background: var(--tone-5) !important; border-color: var(--tone-5-b) !important; }
.tone-6 { background: var(--tone-6) !important; border-color: var(--tone-6-b) !important; }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 160px; padding: 16px 12px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  border: 2px solid; border-bottom-width: 6px;
}
.tile-title { font-size: 1.15rem; font-weight: 900; }
.tile-sub { font-size: 0.85rem; color: var(--muted); font-weight: 700; line-height: 1.3; }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Startseite */
.home-hero { display: flex; align-items: flex-end; gap: 6px; margin: 4px 0 6px; }
.hero-mascot { flex: none; width: 112px; }
.hero-bubble {
  position: relative; flex: 1; min-width: 0; background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.hero-bubble::before {
  content: ""; position: absolute; left: -11px; bottom: 18px; width: 18px; height: 18px;
  background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg);
}
.hero-bubble .greet { font-size: 1.6rem; margin: 0 0 4px; }
.hero-bubble .nudge { margin: 0; color: var(--text); }
.hero-bubble .greet-target { margin: 8px 0 0; font-size: 1.1rem; }
.home-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.lesson-next { margin: 0 0 14px; }
.streak-icon { width: 64px; display: grid; place-items: center; }
.ring circle { stroke-width: 10; }
.ring-fg { stroke: var(--accent); }
.challenge .bar > span { background: var(--accent); }
.bar { height: 14px; }
.challenge .row-start .ico { margin-bottom: 4px; }

/* Lektions-Symbole */
.lesson-icon { width: 60px; height: 60px; border-radius: 18px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface-2); }
.big-icon { width: 84px; height: 84px; border-radius: 24px; flex: none; display: grid; place-items: center; }
.intro-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.intro-head h1 { margin: 0; }
.intro-head p { margin: 2px 0 0; }
.intro-head .mascot { flex: none; }
.lesson-row { border: 2px solid var(--line); border-bottom-width: 4px; padding: 14px; min-height: 84px; }
.lesson-row.is-next { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.status { display: inline-flex; align-items: center; gap: 6px; }

/* Sterne: Anerkennung, keine Note */
.stars { display: inline-flex; gap: 1px; line-height: 1; vertical-align: middle; }
.star { color: var(--star-off); font-size: 1.05rem; }
.star.on { color: var(--star); text-shadow: 0 1px 0 color-mix(in srgb, var(--star) 60%, black); }
.stars-xl .star { font-size: 2.8rem; margin: 0 2px; }
.result-stars { margin: 0 0 8px; }

/* Abzeichen */
.badge-grid { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 14px 10px;
  border-radius: 18px; border: 2px solid var(--tone-1-b); border-bottom-width: 4px; background: var(--tone-1);
}
.badge-card strong { font-weight: 900; }
.badge-card.open { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.badge-card.open .ico { filter: grayscale(1); opacity: 0.45; }
.badge-open { font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

/* Bilder zum Wort: große, klare Bildkarten */
.picto { width: 56px; height: 56px; border-radius: 16px; background: var(--tone-2); border: 2px solid var(--tone-2-b); }
.picto .ico { width: 78%; height: 78%; vertical-align: middle; }
.picto-none { background: var(--surface-2); border: 2px dashed var(--line); color: var(--muted); font-size: 1.2rem; font-weight: 900; }
.picto-xl { width: 96px; height: 96px; background: transparent; border: 0; }
.picto-options .option { min-height: 132px; }
.word-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.word-cards .word-item { border: 2px solid var(--line) !important; border-radius: 18px; padding: 10px 12px !important; background: var(--surface); }
.word-cards .picto { width: 68px; height: 68px; }
.speak-text .picto { width: 80px; height: 80px; }
.voice-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.voice-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line); }
.voice-list li.has > span:first-child { color: var(--ok); font-weight: 900; }
.voice-list li.none { color: var(--muted); }
.ai-status:empty { display: none; }
.ai-status { margin-top: 8px; }
[data-ai-check] { margin-top: 6px; }
.word-example { margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 0.92rem; }
.word-example .sol-label { display: block; margin: 0 0 2px; }
.word-example .term { font-weight: 600; }

/* Aufgaben & Optionen: große Touch-Flächen */
.option { min-height: 62px; border-radius: 18px; font-size: 1.05rem; }
.option .key { width: 30px; height: 30px; border-radius: 10px; }
.chip { min-height: 48px; border-radius: 14px; font-size: 1.05rem; }
.match-btn { min-height: 60px; border-radius: 18px; }
.audio-btn { min-height: 56px; border-radius: 18px; font-size: 1.05rem; }
.fb-head { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 900; }
.lesson-foot { border-top-width: 3px; }

/* Ergebnis */
.result-hero { display: flex; justify-content: center; margin: 8px 0 0; }
.empty-icon { display: flex; justify-content: center; }
.stat { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 18px; }
.stat-num { font-weight: 900; }

/* Einrichtung */
.hero .mascot { margin: 0 auto 8px; }
.choice-card { border-bottom-width: 4px; border-radius: 18px; min-height: 60px; }
.cc-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 900; }
.ob-progress span { height: 8px; }
.ob-progress span.on { background: var(--accent); }

/* Spiele */
.game-icon { width: 60px; height: 60px; border-radius: 18px; border: 2px solid var(--line); border-bottom-width: 4px; }
.game-icon.big-icon { width: 84px; height: 84px; }
.game-title { display: flex; align-items: center; gap: 8px; }
.game-word { border-width: 2px; border-radius: 18px; }
.ws-cell { border-radius: 10px; }

/* ───── Drei Zeilen pro Wort: Originalschrift · Aussprache · Bedeutung ───── */
.term-body { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.term-say { gap: 10px; padding: 4px 6px; margin: -4px -6px; border-bottom: 0; border-radius: 12px; }
/* Wörter zusammenhalten (wichtig für Chinesisch/Japanisch, wo sonst zwischen jedem Zeichen umbrochen wird);
   nur bei echtem Platzmangel umbrechen */
.term-text { font-size: 1.12em; font-weight: 800; word-break: keep-all; overflow-wrap: break-word; }
.term-body { flex: 1 1 auto; }
.term-spk {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--primary) 60%, black);
}
.term-spk .term-icon { opacity: 1; width: 18px; height: 18px; }
.term-say:hover .term-spk { filter: brightness(1.08); }
.term-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 0.92em; line-height: 1.35; }
.term-rowlab { flex: none; font-size: 0.8em; font-weight: 800; color: var(--muted); }
.term-tr .term-trtext { font-weight: 700; font-style: italic; color: var(--primary); }
.term-gloss { color: var(--text); font-weight: 600; }
.term-gloss.term-missing { color: var(--muted); font-style: italic; }
.term-nosound { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }
.word-cards .term-text { font-size: 1.4rem; }
.word-cards .term-row { font-size: 1rem; }
.game-word .term-text { font-size: 1.6rem; }

/* Antwortoptionen und Paare mit Aussprachehilfe */
.opt-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.option .opt-body .tr, .option .opt-tr { display: block; margin: 0; font-size: 0.85rem; }
.match-btn .tr { display: block; margin-top: 2px; font-size: 0.82rem; }
.opt-after-rows { display: inline-flex; flex-direction: column; }

/* Hilfen ausblenden (Einstellung „Aussprache/Bedeutung zeigen“) */
.hide-tr .term-tr, .hide-tr .opt-tr, .hide-tr .option .tr, .hide-tr .match-btn .tr { display: none !important; }
.hide-gloss .term-gloss { display: none !important; }
.help-toggles { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.help-toggles legend { width: 100%; padding: 0; margin: 0 0 6px; }
.help-toggles .lp-toggle { min-height: 44px; padding: 8px 14px; font-size: 0.95rem; }

/* Lektionseinstieg in kleinen Schritten */
.intro-tools { margin-top: 12px; }
.intro-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.intro-nav .btn.primary { flex: 1; max-width: 380px; margin-left: auto; }
.lesson-intro .lesson-top .bar { flex: 1; margin: 0; height: 12px; }

/* Sprachauswahl: „So sagst du Hallo“ */
.ls-hello { font-size: 0.95rem; font-weight: 700; margin: 6px 0; }
.ls-hello .term { display: flex; margin-top: 6px; }
.ls-hello .term-text { font-size: 1.5rem; }

/* ───── Sprechen: Mikrofon-Erklärung, Ergebnis, Antwort sprechen ───── */
.mic-consent { border-color: var(--tone-2-b); background: var(--tone-2); margin-bottom: 14px; }
.mic-consent ul { margin: 6px 0 10px; padding-inline-start: 1.2em; }
.speak-result { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.speak-stars { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.mic-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn.live, .audio-btn.live { background: var(--bad); color: #fff; border-color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .btn.live { animation: pulse 1.2s infinite; } }
.audio-row .term-nosound { align-self: center; }

/* ───── Einführung „App kennenlernen“ ───── */
.help-btn { font-weight: 900; font-size: 1.05rem; border: 2px solid var(--line); background: var(--surface); border-radius: 50%; min-width: 40px; height: 40px; }
.home-meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.home-meta-row .home-meta { margin: 0; }
body.tour-open { overflow: hidden; }
.tour-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(15, 25, 30, 0.45);
}
.tour {
  width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto; background: var(--surface);
  border-radius: 26px 26px 0 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}
@media (min-width: 640px) {
  .tour-backdrop { align-items: center; padding: 24px; }
  .tour { border-radius: 26px; padding: 20px 24px; }
}
.tour-top { display: flex; align-items: center; gap: 10px; }
.tour-top .mascot { flex: none; }
.tour-top h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.tour-top .eyebrow { margin: 0; }
.tour-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 14px; }
.tour-steps span { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tour-steps span i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.tour-steps span.done i { width: 100%; }
.tour-steps span.now i { width: 100%; }
.tour-scene { min-height: 280px; }
.tour-scene p { margin: 10px 0 0; }
.tour-try { margin-top: 10px; }
.tour-try:empty { display: none; }
.tour-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.tour-controls .btn.primary { min-width: 130px; }
.tour-skip { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 8px; }

/* Szenen-Bühne */
.tour-visual { position: relative; border-radius: 20px; padding: 18px; background: linear-gradient(135deg, var(--tone-2), var(--tone-4)); border: 2px solid var(--line); min-height: 170px; display: grid; gap: 10px; align-content: center; overflow: hidden; }
.tv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tv-label { font-size: 0.85rem; font-weight: 800; color: var(--muted); min-width: 84px; }
.tv-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-weight: 800; }
.tv-cycle { position: relative; display: inline-grid; }
.tv-cycle .tv-choice { grid-area: 1 / 1; }
.tv-hello { font-weight: 900; color: var(--primary); }
.tv-pointer { position: absolute; right: 22%; bottom: 8px; pointer-events: none; }
.tv-listen { grid-template-columns: 1fr auto; align-items: center; }
.tv-word { background: var(--surface); border-radius: 16px; padding: 12px; border: 2px solid var(--line); }
.tv-mic { position: relative; display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.tv-wave { position: absolute; inset: -2px; border-radius: 50%; border: 3px solid var(--primary); opacity: 0; }
.tv-quiz-word { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); border-radius: 999px; font-weight: 900; font-size: 1.2rem; border: 2px solid var(--line); }
.tv-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tv-tile { display: grid; place-items: center; height: 82px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; }
.tv-pointer-game { right: auto; left: 46%; bottom: 0; }
.tv-plus { position: absolute; top: 12px; right: 16px; font-weight: 900; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; opacity: 0; }
.tv-progress { justify-items: center; }
.tv-stars { display: flex; gap: 6px; font-size: 2.6rem; color: var(--star); text-shadow: 0 2px 0 color-mix(in srgb, var(--star) 60%, black); }
.tv-badges { display: flex; gap: 10px; }
.tv-badge { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--tone-1); border: 2px solid var(--tone-1-b); }
.tv-bar { width: 80%; height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; border: 2px solid var(--line); }
.tv-bar span { display: block; height: 100%; width: 70%; background: var(--accent); border-radius: inherit; }

/* ───── Mini-Film (Handy-Rahmen, läuft von selbst, ohne Ton) ───── */
.film-stage { display: flex; justify-content: center; margin: 12px 0 8px; }
.film-phone {
  width: 280px; max-width: 100%; height: 430px; padding: 10px; border-radius: 34px;
  background: #1f2a30; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), inset 0 0 0 2px #3a4a52;
}
.film-screen { position: relative; height: 100%; border-radius: 26px; overflow: hidden; background: var(--bg); color: var(--text); font-size: 15px; }
.film-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-weight: 900; font-size: 0.85rem; border-bottom: 2px solid var(--line); background: var(--surface); }
.film-badge { margin-left: auto; font-size: 0.68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); }
.fl { display: none; position: absolute; inset: 44px 0 0 0; padding: 12px; flex-direction: column; gap: 10px; }
.film-screen[data-frame="0"] .fl-0, .film-screen[data-frame="1"] .fl-1, .film-screen[data-frame="2"] .fl-2,
.film-screen[data-frame="3"] .fl-3, .film-screen[data-frame="4"] .fl-4, .film-screen[data-frame="5"] .fl-5 { display: flex; }
.fl-title { margin: 0; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.fl-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.fl-hello { font-weight: 900; color: var(--primary); }
.fl-ok { font-size: 0.85rem; font-weight: 800; color: var(--ok); display: flex; align-items: center; gap: 6px; opacity: 0; }
.fl-card { padding: 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); }
.fl-center { text-align: center; }
.fl-word { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fl-big { font-size: 1.8rem; font-weight: 900; word-break: keep-all; }
.fl-mid { font-size: 1.5rem; font-weight: 900; word-break: keep-all; }
.fl-spk { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); flex: none; }
.fl-spk .ico { filter: brightness(10); }
.fl-wave { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--primary); opacity: 0; }
.fl-line { margin: 6px 0 0; font-size: 0.9rem; }
.fl-line b { color: var(--muted); font-size: 0.8rem; }
.fl-mic { align-self: center; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 18px; background: var(--primary); color: var(--primary-ink); font-weight: 900; }
.fl-heard { margin: 0; text-align: center; font-size: 0.9rem; opacity: 0; }
.fl-stars { display: flex; justify-content: center; gap: 4px; font-size: 2rem; color: var(--star-off); }
.fl-stars.big { font-size: 2.6rem; color: var(--star); }
.fl-quiz { align-self: center; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-weight: 900; font-size: 1.15rem; }
.fl-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.fl-tile { display: grid; place-items: center; height: 76px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; }
.fl-plus { position: absolute; top: 12px; right: 14px; font-weight: 900; font-size: 1.1rem; color: var(--ok); display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--ok-soft); opacity: 0; }
.fl-badges { display: flex; justify-content: center; gap: 8px; }
.fl-badges span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--tone-1); border: 2px solid var(--tone-1-b); }
.fl-progress { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 2px solid var(--line); }
.fl-progress i { display: block; height: 100%; width: 70%; background: var(--accent); }
.fl-5 { align-items: center; justify-content: center; text-align: center; }
.fl-end { font-size: 1.4rem; font-weight: 900; margin: 0; }
.film-pointer { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
.film-caption { min-height: 3em; margin: 6px 0; text-align: center; font-weight: 800; font-size: 1.02rem; }
.film-timeline { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.film-timeline span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
@media (max-height: 700px) { .film-phone { height: 380px; } }

/* Endzustände (gelten immer; bei „Weniger Bewegung“ ist der Film damit eine Folge von Standbildern) */
.fl-row.is-target { border-color: var(--primary); background: var(--primary-soft); }
.fl-0 .fl-ok, .fl-heard, .fl-plus { opacity: 1; }
.fl-2 .fl-stars span:nth-child(-n + 2) { color: var(--star); }
.fl-tile.is-target { border-color: var(--ok); background: var(--ok-soft); }

@media (prefers-reduced-motion: no-preference) {
  .film-dialog.is-paused *, .film-dialog.is-paused *::before { animation-play-state: paused !important; }
  /* Szene 1: Hand tippt auf die Lernsprache */
  .film-screen[data-frame="0"] .film-pointer { animation: fp0 4.2s ease-in-out both; }
  .fl-row.is-target { animation: fl-select 4.2s ease-in-out both; }
  .fl-0 .fl-ok { animation: fl-appear 4.2s ease-out both; animation-delay: 0s; }
  /* Szene 2: Lautsprecher antippen, Schallwellen */
  .film-screen[data-frame="1"] .film-pointer { animation: fp1 3.8s ease-in-out both; }
  .fl-wave { animation: fl-wave 1.1s ease-out 1.6s 3 both; }
  .fl-wave.w2 { animation-delay: 2s; }
  /* Szene 3: Mikrofon, Erkannt, Sterne */
  .film-screen[data-frame="2"] .film-pointer { animation: fp2 4.8s ease-in-out both; }
  .fl-mic { animation: fl-mic 4.8s ease-in-out both; }
  .fl-heard { animation: fl-heard 4.8s ease-out both; }
  .fl-2 .fl-stars span { animation: fl-star 4.8s ease-out both; }
  .fl-2 .fl-stars span:nth-child(2) { animation-name: fl-star2; }
  .fl-2 .fl-stars span:nth-child(3) { animation-name: none; }
  /* Szene 4: Bild antippen, richtig, +1 Stern */
  .film-screen[data-frame="3"] .film-pointer { animation: fp3 4.8s ease-in-out both; }
  .fl-tile.is-target { animation: fl-correct 4.8s ease-in-out both; }
  .fl-plus { animation: fl-plusin 4.8s ease-out both; }
  /* Szene 5: Erfolge */
  .fl-4 .fl-stars span { display: inline-block; animation: star-pop 520ms cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .fl-4 .fl-stars span:nth-child(2) { animation-delay: 0.25s; }
  .fl-4 .fl-stars span:nth-child(3) { animation-delay: 0.5s; }
  .fl-badges span { animation: card-in 420ms ease-out both; }
  .fl-badges span:nth-child(1) { animation-delay: 0.9s; }
  .fl-badges span:nth-child(2) { animation-delay: 1.05s; }
  .fl-badges span:nth-child(3) { animation-delay: 1.2s; }
  .fl-progress i { animation: bar-grow 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 1.4s both; transform-origin: left center; }
  /* Schluss: Wegi hüpft */
  .fl-5 .mascot { animation: wegi-hop 0.8s ease-out 2 both; }
  .fl-end { animation: page-in 400ms ease-out 0.3s both; }
}
@keyframes fp0 { 0% { opacity: 0; transform: translate(220px, 380px); } 15% { opacity: 1; } 45% { transform: translate(170px, 232px); } 52% { transform: translate(170px, 236px) scale(0.85); } 58%, 85% { opacity: 1; transform: translate(170px, 232px); } 100% { opacity: 0; transform: translate(170px, 232px); } }
@keyframes fl-select { 0%, 52% { border-color: var(--line); background: var(--surface); transform: none; } 57% { transform: scale(1.04); } 62%, 100% { border-color: var(--primary); background: var(--primary-soft); transform: none; } }
@keyframes fl-appear { 0%, 62% { opacity: 0; transform: translateY(6px); } 72%, 100% { opacity: 1; transform: none; } }
@keyframes fp1 { 0% { opacity: 0; transform: translate(140px, 360px); } 15% { opacity: 1; } 40% { transform: translate(208px, 110px); } 47% { transform: translate(208px, 114px) scale(0.85); } 54%, 90% { opacity: 1; transform: translate(208px, 110px); } 100% { opacity: 0; transform: translate(208px, 110px); } }
@keyframes fl-wave { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(1.8); } }
@keyframes fp2 { 0% { opacity: 0; transform: translate(200px, 380px); } 12% { opacity: 1; } 24% { transform: translate(140px, 222px); } 29% { transform: translate(140px, 226px) scale(0.85); } 34%, 55% { opacity: 1; transform: translate(140px, 222px); } 65%, 100% { opacity: 0; transform: translate(140px, 222px); } }
@keyframes fl-mic { 0%, 28% { background: var(--primary); box-shadow: none; } 32%, 55% { background: var(--bad); box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 25%, transparent); } 60%, 100% { background: var(--primary); box-shadow: none; } }
@keyframes fl-heard { 0%, 52% { opacity: 0; transform: translateY(6px); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes fl-star { 0%, 62% { color: var(--star-off); transform: none; } 66% { color: var(--star); transform: scale(1.4); } 72%, 100% { color: var(--star); transform: none; } }
@keyframes fl-star2 { 0%, 70% { color: var(--star-off); transform: none; } 74% { color: var(--star); transform: scale(1.4); } 80%, 100% { color: var(--star); transform: none; } }
@keyframes fp3 { 0% { opacity: 0; transform: translate(60px, 380px); } 15% { opacity: 1; } 42% { transform: translate(122px, 232px); } 48% { transform: translate(122px, 236px) scale(0.85); } 54%, 85% { opacity: 1; transform: translate(122px, 232px); } 100% { opacity: 0; transform: translate(122px, 232px); } }
@keyframes fl-correct { 0%, 48% { border-color: var(--line); background: var(--surface); transform: none; } 53% { transform: scale(1.08); } 58%, 100% { border-color: var(--ok); background: var(--ok-soft); transform: none; } }
@keyframes fl-plusin { 0%, 55% { opacity: 0; transform: translateY(8px); } 63%, 100% { opacity: 1; transform: none; } }

/* ───── Mini-Film zur Lektion: animierte Bildergeschichte ───── */
.story-dialog { max-width: 620px; }
.story-teaser { border-color: var(--tone-5-b); background: var(--tone-5); }
.story-stage {
  position: relative; height: 230px; margin: 12px 0 6px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, var(--tone-2) 0 62%, var(--tone-4) 62% 100%); border: 2px solid var(--line);
}
.st-bg { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); opacity: 0.22; }
.st-char { position: absolute; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.5s ease, opacity 0.3s ease; }
.st-bunny { left: 9%; }
.st-fox { right: 9%; }
.st-fox .ico { transform: scaleX(-1); }
.st-name { font-size: 0.75rem; font-weight: 900; padding: 1px 8px; border-radius: 999px; background: var(--surface); }
.story-stage[data-who="bunny"] .st-fox, .story-stage[data-who="fox"] .st-bunny { opacity: 0.75; }
.st-prop { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); }
.st-prop:empty { display: none; }
.st-prop .ico { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.15)); }
.st-hand { position: absolute; bottom: 120px; opacity: 0; pointer-events: none; }
.story-stage[data-who="bunny"] .st-hand { left: 22%; }
.story-stage[data-who="fox"] .st-hand { right: 22%; }
.story-stage[data-act="wave"] .st-hand { opacity: 1; }
.st-bubble {
  position: absolute; top: 14px; max-width: 62%; padding: 10px 14px; border-radius: 18px; background: var(--surface);
  border: 2px solid var(--line); font-weight: 900; font-size: 1.1rem; line-height: 1.3; box-shadow: var(--shadow); word-break: keep-all; overflow-wrap: break-word;
}
.st-bubble:empty { display: none; }
.story-stage[data-who="bunny"] .st-bubble { left: 6%; border-bottom-left-radius: 4px; }
.story-stage[data-who="fox"] .st-bubble { right: 6%; border-bottom-right-radius: 4px; }
.st-action { margin: 4px 0 6px; font-size: 0.9rem; font-style: italic; color: var(--muted); min-height: 1.4em; }
.story-sub { min-height: 96px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); }
.story-sub .st-who { margin: 0 0 4px; font-size: 0.85rem; font-weight: 900; color: var(--muted); }
.story-sub .term-text { font-size: 1.3rem; }
.story-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.story-options .lp-toggle { min-height: 40px; }
.story-end { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--tone-1); border: 2px solid var(--tone-1-b); }
.story-end p { margin: 0 0 8px; }
.story-end .options { margin-top: 8px; }
@media (max-width: 420px) { .story-stage { height: 210px; } .st-bubble { font-size: 1rem; max-width: 70%; } }

@media (prefers-reduced-motion: no-preference) {
  .story-dialog.is-paused .story-stage * { animation-play-state: paused !important; }
  .st-anim[data-who="bunny"] .st-bunny, .st-anim[data-who="fox"] .st-fox { animation: st-talk 0.9s ease-in-out 2; }
  .st-anim .st-bubble { animation: st-pop 300ms cubic-bezier(0.3, 1.4, 0.5, 1) both; }
  .st-anim .st-prop { animation: st-prop-in 500ms ease-out 0.3s both; }
  .st-anim[data-act="wave"] .st-hand { animation: st-wave 0.6s ease-in-out 4; transform-origin: 70% 90%; }
  .st-anim[data-act="give"][data-who="bunny"] .st-prop { animation: st-give-right 1.6s ease-in-out 0.4s both; }
  .st-anim[data-act="give"][data-who="fox"] .st-prop { animation: st-give-left 1.6s ease-in-out 0.4s both; }
  .st-anim[data-act="walk"][data-who="bunny"] .st-bunny { animation: st-walk-l 2.4s ease-in-out 1s both; }
  .st-anim[data-act="walk"][data-who="fox"] .st-fox { animation: st-walk-r 2.4s ease-in-out 1s both; }
}
@keyframes st-talk { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } 60% { transform: translateY(0) scale(1.03, 0.97); } }
@keyframes st-pop { from { opacity: 0; transform: scale(0.85) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes st-prop-in { from { opacity: 0; transform: translate(-50%, 16px) scale(0.8); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes st-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
@keyframes st-give-right { 0% { opacity: 0; transform: translate(-190%, 0) scale(0.8); } 20% { opacity: 1; } 100% { opacity: 1; transform: translate(80%, 0); } }
@keyframes st-give-left { 0% { opacity: 0; transform: translate(90%, 0) scale(0.8); } 20% { opacity: 1; } 100% { opacity: 1; transform: translate(-180%, 0); } }
@keyframes st-walk-l { 0% { transform: none; } 100% { transform: translateX(-60px); opacity: 0.4; } }
@keyframes st-walk-r { 0% { transform: none; } 100% { transform: translateX(60px); opacity: 0.4; } }

/* Bewegung nur, wenn erwünscht – und dann sanft */
@media (prefers-reduced-motion: no-preference) {
  /* Seitenwechsel und Karten */
  .page-anim > * { animation: page-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .page-anim .tile-grid > *, .page-anim .game-list > li, .page-anim .lesson-list > li, .page-anim .badge-grid > li, .page-anim .word-cards > li, .page-anim .stats > * {
    animation: card-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .page-anim :is(.tile-grid, .game-list, .lesson-list, .badge-grid, .word-cards, .stats) > :nth-child(2) { animation-delay: 50ms; }
  .page-anim :is(.tile-grid, .game-list, .lesson-list, .badge-grid, .word-cards, .stats) > :nth-child(3) { animation-delay: 100ms; }
  .page-anim :is(.tile-grid, .game-list, .lesson-list, .badge-grid, .word-cards, .stats) > :nth-child(4) { animation-delay: 150ms; }
  .page-anim :is(.tile-grid, .game-list, .lesson-list, .badge-grid, .word-cards, .stats) > :nth-child(5) { animation-delay: 200ms; }
  .page-anim :is(.tile-grid, .game-list, .lesson-list, .badge-grid, .word-cards, .stats) > :nth-child(n + 6) { animation-delay: 250ms; }

  /* Schaltflächen */
  .btn { transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, filter 0.15s ease; }
  .btn.primary:hover:not([disabled]) { transform: translateY(-1px); }
  .btn:active:not([disabled]) { transform: translateY(2px) scale(0.98); }
  .option, .match-btn, .chip { transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease; }
  .option:active:not([disabled]), .match-btn:active:not([disabled]), .chip:active:not([disabled]) { transform: scale(0.98); }
  .bottomnav a { transition: background 0.2s ease, color 0.2s ease; }

  /* Fortschrittsanzeigen füllen sich beim Erscheinen */
  .bar > span { animation: bar-grow 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left center; }
  .ring-fg { animation: ring-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

  /* Rückmeldungen */
  .ex-body { animation: page-in 240ms ease-out both; }
  .lesson-foot.fb-right, .lesson-foot.fb-wrong, .lesson-foot.fb-info, .game-feedback:not(:empty) { animation: slide-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .option.is-right { animation: right-pop 360ms ease-out; }
  .option.is-wrong { animation: shake 0.35s; }
  .stars-xl .star.on { animation: star-pop 420ms cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .stars-xl .star.on:nth-child(2) { animation-delay: 140ms; }
  .stars-xl .star.on:nth-child(3) { animation-delay: 280ms; }

  /* Einführung: Dialog und Szenen */
  .tour-backdrop { animation: fade-in 200ms ease-out both; }
  .tour { animation: sheet-up 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .tour-scene-in { animation: page-in 300ms ease-out both; }
  .tour-steps span.now i { width: 0; animation: tour-fill 9s linear forwards; }
  .tour.is-paused, .tour.is-paused * { animation-play-state: paused !important; }
  .tv-choice { opacity: 0; animation: tv-cycle 6s ease-in-out infinite; animation-delay: calc(var(--i) * 2s); }
  .tv-lang .tv-pointer { animation: tv-tap 2s ease-in-out infinite; }
  .tv-wave { animation: tv-wave 1.8s ease-out infinite; }
  .tv-wave.w2 { animation-delay: 0.9s; }
  .tv-pointer-game { animation: tv-move 4.5s ease-in-out infinite; }
  .tv-tile.is-target { animation: tv-correct 4.5s ease-in-out infinite; }
  .tv-plus { animation: tv-plus 4.5s ease-in-out infinite; }
  .tv-star { display: inline-block; animation: star-pop 520ms cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.2s + var(--i) * 0.25s); }
  .tv-badge { animation: card-in 420ms ease-out both; animation-delay: calc(0.9s + var(--i) * 0.15s); }
  .tv-bar span { animation: bar-grow 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 1.2s both; transform-origin: left center; }

  .tile, .lesson-row, .linkcard, .badge-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .tile:hover, .lesson-row:hover, .linkcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .result-hero .mascot { animation: wegi-hop 0.6s ease-out 1; }
}
/* „Weniger Bewegung“: Einführung als ruhige Standbilder */
@media (prefers-reduced-motion: reduce) {
  .tv-cycle .tv-choice:not(:first-child) { display: none; }
  .tv-tile.is-target { border-color: var(--ok); background: var(--ok-soft); }
  .tv-plus { opacity: 1; }
  .tv-pointer { display: none; }
  .tour-steps span.now i { width: 100%; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0.4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ring-in { from { stroke-dashoffset: var(--ring-c); } }
@keyframes right-pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes star-pop { from { opacity: 0; transform: scale(0.3) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes tour-fill { from { width: 0; } to { width: 100%; } }
@keyframes tv-cycle { 0%, 4% { opacity: 0; transform: translateY(6px); } 8%, 30% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes tv-tap { 0%, 100% { transform: translate(0, 0); } 45% { transform: translate(-6px, -8px); } 55% { transform: translate(-6px, -4px) scale(0.92); } }
@keyframes tv-wave { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes tv-move { 0%, 10% { transform: translate(-70px, 30px); opacity: 0; } 25% { opacity: 1; } 45% { transform: translate(0, 0); } 52% { transform: translate(0, 4px) scale(0.9); } 60%, 85% { transform: translate(0, 0); opacity: 1; } 100% { opacity: 0; } }
@keyframes tv-correct { 0%, 50% { border-color: var(--line); background: var(--surface); transform: none; } 56% { transform: scale(1.06); } 60%, 90% { border-color: var(--ok); background: var(--ok-soft); transform: none; } 100% { border-color: var(--line); background: var(--surface); } }
@keyframes tv-plus { 0%, 55% { opacity: 0; transform: translateY(6px); } 62%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .tile, .lesson-row, .linkcard, .badge-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .tile:hover, .lesson-row:hover, .linkcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .result-hero .mascot { animation: wegi-hop 0.6s ease-out 1; }
}
@keyframes wegi-hop { 0% { transform: translateY(8px) scale(0.96); } 60% { transform: translateY(-6px); } 100% { transform: none; } }

@media (min-width: 760px) {
  body { font-size: 18px; }
  .page { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Oberflächentexte, die (noch) nicht in der gewählten Sprache vorliegen und auf Englisch erscheinen */
[data-i18n-fb] { text-decoration: underline dotted; text-decoration-color: currentColor; text-underline-offset: 3px; }
.ui-lang-status p { margin: 6px 0 0; }

/* ═════════════ Szenenbilder (js/content/scenes.js) ═════════════ */
:root {
  --sky-day-a: #cfeeff; --sky-day-b: #f3fbff;
  --sky-warm-a: #ffe6c2; --sky-warm-b: #fff8ec;
  --sky-morning-a: #ffd9b8; --sky-morning-b: #fff4e0;
  --sky-evening-a: #ffc9a8; --sky-evening-b: #e9dcff;
  --sky-night-a: #2d3a6b; --sky-night-b: #54609a;
  --hill: #bfe5a6; --hill-warm: #f2d6a8; --sun: #ffd65a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky-day-a: #1d3550; --sky-day-b: #23394a;
    --sky-warm-a: #3d2f1f; --sky-warm-b: #2a2620;
    --sky-morning-a: #47302a; --sky-morning-b: #2e2a24;
    --sky-evening-a: #46302e; --sky-evening-b: #2f2a48;
    --sky-night-a: #141a33; --sky-night-b: #252d55;
    --hill: #2f5130; --hill-warm: #4a3d26; --sun: #c9a63a;
  }
}
.scene { margin: 0 0 14px; }
.scene-canvas {
  position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 7;
  border-radius: var(--radius); border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--sky-a), var(--sky-b));
}
.sky-day { --sky-a: var(--sky-day-a); --sky-b: var(--sky-day-b); --ground: var(--hill); }
.sky-warm { --sky-a: var(--sky-warm-a); --sky-b: var(--sky-warm-b); --ground: var(--hill-warm); }
.sky-morning { --sky-a: var(--sky-morning-a); --sky-b: var(--sky-morning-b); --ground: var(--hill); }
.sky-evening { --sky-a: var(--sky-evening-a); --sky-b: var(--sky-evening-b); --ground: var(--hill-warm); }
.sky-night { --sky-a: var(--sky-night-a); --sky-b: var(--sky-night-b); --ground: #2b3d3a; }
.scene-sun { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; right: -6%; top: -18%; background: var(--sun); opacity: 0.35; }
.sky-night .scene-sun { opacity: 0; }
.scene-hill { position: absolute; left: -10%; right: -10%; bottom: -38%; height: 62%; border-radius: 50% 50% 0 0; background: var(--ground); }
.scene-item { position: absolute; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.12)); user-select: none; pointer-events: none; }
span.scene-item { font-size: 2rem; font-size: calc(var(--w, 10) * 0.9cqw); line-height: 1; }
.scene-item.flip { transform: translate(-50%, -50%) scaleX(-1); }
.scene-item.bubble { background: var(--surface); border-radius: 30%; padding: 1.2%; box-shadow: 0 2px 0 var(--line); }
.scene-caption { font-size: 0.9rem; color: var(--muted); margin-top: 6px; text-align: center; }
.scene-sm { margin: 0; flex: none; width: 112px; }
.scene-sm .scene-canvas { border-radius: var(--radius-sm); aspect-ratio: 4 / 3; }
.scene-sm .scene-item.bubble { padding: 1.5%; }
.lesson-next.has-scene { align-items: center; }
.game-row .scene-sm { width: 96px; }
@media (min-width: 760px) {
  .scene-lg .scene-canvas { aspect-ratio: 16 / 6; }
  .scene-sm { width: 140px; }
}
@media (prefers-reduced-motion: no-preference) {
  .scene-lg .scene-item { animation: scene-in 0.5s var(--ease-out, ease-out) both; animation-delay: calc(var(--i) * 70ms); }
  .scene-lg .scene-item.bob { animation: scene-in 0.5s var(--ease-out, ease-out) both, scene-bob 2.6s ease-in-out 0.8s infinite; animation-delay: calc(var(--i) * 70ms), calc(0.8s + var(--i) * 120ms); }
  .scene-lg .scene-item.flip.bob { animation: scene-in 0.5s ease-out both; }
}
@keyframes scene-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes scene-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5%; } }

/* ═════════════ Konto ═════════════ */
.account-btn { position: relative; }
.account-btn img { display: block; }
.account-dot { position: absolute; right: 6px; bottom: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); border: 2px solid var(--surface); }
.account-btn.signed-in .account-dot { background: var(--ok); }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.account-head h1 { margin: 2px 0 0; }
.account-head .mascot { flex: none; }
.account-form { display: grid; gap: 2px; }
.account-form .text-input { width: 100%; box-sizing: border-box; }
.account-form .btn.block { margin-top: 8px; }
.account-who { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; overflow-wrap: anywhere; }
.account-sent { text-align: center; display: grid; justify-items: center; gap: 4px; }
.account-back { margin: 18px 0 8px; text-align: center; }
.form-error:empty { display: none; }
.sync-line p { margin: 0; }
.sync-line .row-start { gap: 8px; }
.center { text-align: center; }
.center-row { justify-content: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 12px 0; background: var(--surface-2); border-radius: 999px; }
.seg-btn { display: block; text-align: center; padding: 10px 12px; min-height: 44px; box-sizing: border-box; border-radius: 999px; font-weight: 800; color: var(--muted); text-decoration: none; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 380px) {
  .account-head .mascot { width: 76px; height: 76px; }
  .topbar .account-btn { min-width: 40px; }
}

/* Oberflächentext ohne Übersetzung (deutscher Ausgangstext sichtbar) – bewusst erkennbar, nicht versteckt */
[data-i18n-missing] { text-decoration: underline wavy; text-decoration-color: var(--bad); text-underline-offset: 4px; }