/* Bildungsgarten – Gestaltung „Herbarium“: warmes Papier, Moosgrün, Terrakotta.
   Hell/Dunkel: folgt dem System, außer es ist über den Schalter fest gewählt (data-theme). */

:root {
  color-scheme: light;
  --bg: #f5f2ea;
  --bg-deep: #ece7da;
  --surface: #fffdf8;
  --surface-2: #f8f4ea;
  --text: #1e2a22;
  --muted: #56635a;
  --border: #dcd5c5;
  --border-strong: #b9b09c;
  --accent: #2f6b45;
  --accent-strong: #24583a;
  --accent-text: #ffffff;
  --accent-soft: #e5eee1;
  --terra: #9c4b28;
  --terra-soft: #f7e6d9;
  --warn-soft: #fbf0d9;
  --warn-border: #b07d16;
  --leaf: #4f8a5b;
  --leaf-dark: #2f6b45;
  --bloom: #c86a43;
  --bloom-heart: #e9b949;
  --soil: #b49b7b;
  --focus: #1a5fb4;
  --shadow: 0 1px 2px rgb(60 50 30 / 0.06), 0 4px 14px rgb(60 50 30 / 0.06);
  --shadow-lift: 0 2px 4px rgb(60 50 30 / 0.08), 0 10px 24px rgb(60 50 30 / 0.10);
  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --icon-home: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'/></svg>");
  --icon-calendar: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
  --icon-book: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z'/><path d='M5 17a3 3 0 0 1 3-3h11'/></svg>");
  --icon-cards: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='7' width='13' height='14' rx='2'/><path d='M8 3h10a2 2 0 0 1 2 2v12'/></svg>");
  --icon-sprout: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21v-9'/><path d='M12 12C12 8 9 6 5 6c0 4 3 6 7 6z'/><path d='M12 15c0-3 2-6 7-6 0 4-3 6-7 6z'/></svg>");
  --icon-grid: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='3' y='3' width='8' height='8' rx='1.5'/><rect x='13' y='3' width='8' height='8' rx='1.5'/><rect x='3' y='13' width='8' height='8' rx='1.5'/><rect x='13' y='13' width='8' height='8' rx='1.5'/></svg>");
  --icon-letters: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='2' y='7' width='6' height='10' rx='1.5'/><rect x='9' y='7' width='6' height='10' rx='1.5'/><rect x='16' y='7' width='6' height='10' rx='1.5'/></svg>");
  --icon-cross: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M3 9h6V3h6v6h6v6h-6v6H9v-6H3z'/></svg>");
  --icon-sun: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='4'/><path d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/></svg>");
  --icon-moon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/></svg>");
  --icon-search: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-4-4'/></svg>");
  --icon-leaf: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 19C5 10 11 5 20 5c0 9-5 14-14 14z'/><path d='M5 19l8-8'/></svg>");
  --icon-repeat: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 11a8 8 0 0 0-14-5l-2 2'/><path d='M4 3v5h5'/><path d='M4 13a8 8 0 0 0 14 5l2-2'/><path d='M20 21v-5h-5'/></svg>");
  --icon-shield: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/></svg>");
}

/* Dunkle Werte: einmal fürs System (ohne feste Wahl), einmal für die feste Wahl. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121714;
    --bg-deep: #0d110f;
    --surface: #1a211d;
    --surface-2: #212924;
    --text: #e7ece6;
    --muted: #a9b5ad;
    --border: #34403a;
    --border-strong: #4d5b53;
    --accent: #8fd0a3;
    --accent-strong: #a9dfb9;
    --accent-text: #0f1a14;
    --accent-soft: #1f3328;
    --terra: #eba17d;
    --terra-soft: #3a261c;
    --warn-soft: #362d17;
    --warn-border: #d4a73a;
    --leaf: #6fb784;
    --leaf-dark: #4f9a68;
    --bloom: #e48a62;
    --bloom-heart: #efc65c;
    --soil: #6d5c47;
    --focus: #9cc3ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lift: 0 4px 18px rgb(0 0 0 / 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121714;
  --bg-deep: #0d110f;
  --surface: #1a211d;
  --surface-2: #212924;
  --text: #e7ece6;
  --muted: #a9b5ad;
  --border: #34403a;
  --border-strong: #4d5b53;
  --accent: #8fd0a3;
  --accent-strong: #a9dfb9;
  --accent-text: #0f1a14;
  --accent-soft: #1f3328;
  --terra: #eba17d;
  --terra-soft: #3a261c;
  --warn-soft: #362d17;
  --warn-border: #d4a73a;
  --leaf: #6fb784;
  --leaf-dark: #4f9a68;
  --bloom: #e48a62;
  --bloom-heart: #efc65c;
  --soil: #6d5c47;
  --focus: #9cc3ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-lift: 0 4px 18px rgb(0 0 0 / 0.4);
}

/* ---- Grundlagen ---- */

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  overflow-wrap: break-word;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

h1, h2, h3 { line-height: 1.22; margin: 1.6em 0 0.5em; text-wrap: balance; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.4rem); letter-spacing: -0.01em; margin-top: 0.3em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0.6em 0; max-width: 68ch; text-wrap: pretty; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.3em 0; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
strong { font-weight: 600; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; background: var(--surface); color: var(--accent);
  padding: 0.7rem 1rem; border: 2px solid var(--accent); border-radius: var(--radius-sm); z-index: 30; font-weight: 600;
}
.skip-link:focus { top: 0.5rem; }

/* ---- Icons (Maske, Farbe = Textfarbe) ---- */

.icon {
  display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -0.22em;
  background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon-home { --i: var(--icon-home); }
.icon-calendar { --i: var(--icon-calendar); }
.icon-book { --i: var(--icon-book); }
.icon-cards { --i: var(--icon-cards); }
.icon-sprout { --i: var(--icon-sprout); }
.icon-grid { --i: var(--icon-grid); }
.icon-letters { --i: var(--icon-letters); }
.icon-cross { --i: var(--icon-cross); }
.icon-search { --i: var(--icon-search); }
.icon-leaf { --i: var(--icon-leaf); }
.icon-repeat { --i: var(--icon-repeat); }
.icon-shield { --i: var(--icon-shield); }

/* ---- Kopf, Navigation, Hell/Dunkel-Schalter ---- */

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem;
  min-height: 3.6rem; padding: 0.55rem calc(var(--gutter) + 3.2rem) 0.55rem var(--gutter);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.site-header strong {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.005em;
}
.site-header strong::before {
  content: ""; width: 1.5rem; height: 1.5rem; flex: none; background: var(--accent);
  -webkit-mask: var(--icon-leaf) center / contain no-repeat; mask: var(--icon-leaf) center / contain no-repeat;
}
.site-header .badge { font-size: 0.75rem; }

.theme-toggle {
  position: absolute; top: 0.45rem; right: var(--gutter); z-index: 20;
  width: 2.75rem; height: 2.75rem; min-height: 2.75rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-toggle .icon { width: 1.3rem; height: 1.3rem; --i: var(--icon-moon); }
:root[data-theme="dark"] .theme-toggle .icon { --i: var(--icon-sun); }
.theme-toggle[hidden] { display: none; }

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.6rem var(--gutter) 2.5rem;
}

.main-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.25rem 0.25rem env(safe-area-inset-bottom);
  box-shadow: 0 -4px 18px rgb(0 0 0 / 0.05);
}
.main-nav a {
  flex: 1 1 0; min-width: 0; min-height: 3.6rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  text-align: center; padding: 0.35rem 0.1rem; font-size: 0.78rem; font-weight: 500; text-decoration: none; color: var(--muted);
  border-radius: var(--radius-sm); transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.main-nav a::before {
  content: ""; width: 1.45rem; height: 1.45rem; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.main-nav a[data-nav="start"] { --i: var(--icon-home); }
.main-nav a[data-nav="termine"] { --i: var(--icon-calendar); }
.main-nav a[data-nav="wissen"] { --i: var(--icon-book); }
.main-nav a[data-nav="ueben"] { --i: var(--icon-cards); }
.main-nav a[data-nav="fortschritt"] { --i: var(--icon-sprout); }
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.main-nav a[aria-current="page"]::before { background: var(--accent); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); }

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  #app:has(> .site-header) { display: flex; flex-wrap: wrap; align-items: stretch; }
  #app > .site-header { flex: 1 1 100%; padding-right: calc(var(--gutter) + 3.4rem); border-bottom: 0; }
  #app > .main-nav { flex: 1 1 100%; }
  #app > main { flex: 0 1 48rem; width: 100%; }
  .site-header .badge { white-space: nowrap; }
  .main-nav {
    position: static; justify-content: center; gap: 0.25rem; box-shadow: none;
    border-top: 0; border-bottom: 1px solid var(--border); padding: 0.3rem 0.5rem;
  }
  .main-nav a { flex: 0 0 auto; flex-direction: row; gap: 0.45rem; min-height: 2.75rem; padding: 0.4rem 0.85rem; font-size: 0.95rem; }
  .main-nav a::before { width: 1.15rem; height: 1.15rem; }
  main { padding-top: 1.4rem; }
}
@media (min-width: 1040px) {
  #app > .site-header { flex: 0 0 auto; border-bottom: 1px solid var(--border); padding-right: 1.5rem; }
  #app > .main-nav { flex: 1 1 0; justify-content: flex-end; padding-right: calc(var(--gutter) + 3.4rem); }
}

/* ---- Bausteine ---- */

.eyebrow { margin: 0 0 0.2rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra); }
.lead { font-size: 1.12rem; color: var(--text); }
.meta { color: var(--muted); font-size: 0.92rem; }

.back { margin: 0.4rem 0 0.2rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 0.2rem;
  color: var(--muted); font-weight: 600; text-decoration: none;
}
.back-link::before { content: "←"; font-size: 1.1em; transition: transform 0.2s var(--ease); }
.back-link:hover { color: var(--accent); }
.back-link:hover::before { transform: translateX(-3px); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; font-size: 1.2rem; }
.card-head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.35rem; }
.card-head h2 { margin: 0; }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.card-icon.terra { background: var(--terra-soft); color: var(--terra); }

.card-list { list-style: none; padding: 0; margin: 0; }
.card-list > li { margin: 0.65rem 0; }
.card-link {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.95rem 1.1rem; box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card-link:hover { color: inherit; border-color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.card-link .title { font-weight: 700; display: block; font-size: 1.04rem; line-height: 1.35; }
.card-link .meta { display: block; margin-top: 0.15rem; }

/* ---- Buttons ---- */

.button, button {
  font: inherit; font-weight: 600; min-height: 2.9rem; padding: 0.6rem 1.15rem; border-radius: 999px;
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-align: center; line-height: 1.25;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}
.button:hover, button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.button:active, button:active { transform: scale(0.98); }
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 2px 8px rgb(47 107 69 / 0.25); }
.button.primary:hover, button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
button:disabled, button:disabled:hover {
  cursor: not-allowed; transform: none; box-shadow: none;
  background: var(--surface-2); color: var(--muted); border: 1.5px dashed var(--border-strong);
}
.button.big, button.big { width: 100%; min-height: 3.6rem; font-size: 1.15rem; padding: 0.8rem 1.4rem; }
.button.quiet, button.quiet { border-color: var(--border-strong); color: var(--text); }
.button.quiet:hover, button.quiet:hover { border-color: var(--accent); color: var(--accent-strong); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

/* ---- Hinweise, Marken ---- */

.notice {
  background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--radius-sm);
  padding: 0.7rem 1rem; margin: 0.9rem 0;
}
.notice p { margin: 0.3em 0; }
.info { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; line-height: 1.4;
  background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--text); vertical-align: middle;
}
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: 999px; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}

.status { white-space: nowrap; font-size: 0.88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.status-ok { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.status-again { color: var(--terra); border-color: var(--terra); background: var(--terra-soft); border-style: dashed; }
.status-partial { color: var(--text); border-color: var(--border-strong); }

/* ---- Formulare ---- */

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; margin: 1rem 0; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
legend { font-weight: 700; padding: 0 0.4rem; max-width: 100%; }

.search-field { position: relative; margin: 0.35rem 0 0.9rem; }
.search-field .icon { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .search { padding-left: 2.8rem; }
.search {
  width: 100%; font: inherit; min-height: 3rem; padding: 0.65rem 0.95rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.search:focus-visible { border-color: var(--focus); }
.field-label { display: block; font-weight: 600; margin-top: 0.8rem; }
select { font: inherit; padding: 0.55rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); min-height: 2.9rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.filter { border: 0; padding: 0; margin: 0.4rem 0 0.6rem; background: none; box-shadow: none; }
.filter legend { padding: 0; margin-bottom: 0.4rem; font-weight: 600; }
.filter-options { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.filter-chip { position: relative; }
.filter-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.filter-chip span {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 0.95rem; color: var(--text);
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.filter-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.filter-chip input:checked + span::before { content: "✓"; margin-right: 0.35rem; }
.filter-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.filter-chip:hover span { border-color: var(--accent); }

/* ---- Start ---- */

.hero {
  position: relative; overflow: hidden;
  margin: 0.4rem 0 1.2rem; padding: 1.4rem 1.2rem 1.25rem; border-radius: calc(var(--radius) + 6px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -2.5rem; top: -2.5rem; width: 9rem; height: 9rem; border-radius: 50%;
  background: var(--accent-soft); z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0.1rem 0 0.4rem; max-width: 16ch; }
.hero .lead { margin-bottom: 1.2rem; }
.hero-hint { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.92rem; text-align: center; max-width: none; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.85rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.75rem; margin: 0; align-items: start; }
.steps li::before {
  content: counter(step); display: flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: var(--font-display); font-size: 1.1rem;
}
.steps strong { display: block; }
.steps p { margin: 0.1rem 0 0; color: var(--muted); }

.shortcut-grid { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.65rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shortcut-grid li { margin: 0; }
.shortcut {
  display: flex; flex-direction: column; gap: 0.35rem; height: 100%; min-height: 6.2rem; padding: 0.95rem;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.shortcut:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.shortcut .icon { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.shortcut .title { font-weight: 700; }
.shortcut .meta { font-size: 0.86rem; line-height: 1.35; }
@media (min-width: 720px) { .shortcut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.newest-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.3; margin: 0.2rem 0; }

/* ---- Termine ---- */

.termin-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.85rem; align-items: center; }
.termin-num {
  display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--muted);
}
.termin-link:hover .termin-num { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.page-head { margin-bottom: 0.4rem; }
.page-head h1 { margin-bottom: 0.25rem; }
.page-head .meta { margin: 0; }

.action-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; margin: 1.1rem 0 0.4rem; padding: 0.9rem 1rem;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.action-bar .growth { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; color: var(--muted); font-size: 0.92rem; }

.objective-list { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.55rem; }
.objective-list li { margin: 0; padding: 0.75rem 0.95rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.objective-text { display: block; }
.objective-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; align-items: center; }

.unit { padding-top: 0.2rem; }
.unit + .unit { border-top: 1px solid var(--border); margin-top: 1.6rem; }

.concept-list { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
.concept-list li { margin: 0; padding: 0.7rem 0.95rem; border-left: 3px solid var(--leaf); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.concept-list .concept-name { font-weight: 700; }
.concept-list .tag { margin-left: 0.35rem; }
.concept-list .concept-short { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }

.sources { padding-left: 1.1em; font-size: 0.95rem; color: var(--muted); }
.sources li { margin: 0.35em 0; }

/* ---- Wissen ---- */

.concept-hit .title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; }
.concept-short-box {
  font-size: 1.1rem; font-weight: 600; padding: 0.9rem 1.1rem; margin: 1rem 0; border-radius: var(--radius-sm);
  background: var(--accent-soft); border-left: 4px solid var(--accent);
}

dl.definitions dt { font-weight: 700; margin-top: 0.9rem; }
dl.definitions dd { margin: 0.15rem 0 0 0; padding-left: 0.9rem; border-left: 2px solid var(--border); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }

details { margin: 0.6rem 0; }
summary { cursor: pointer; padding: 0.55rem 0; min-height: 2.75rem; display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--accent); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; display: inline-block; transition: transform 0.2s var(--ease); }
details[open] > summary::before { transform: rotate(90deg); }

/* ---- Üben: Auswahl ---- */

.practice-hero { background: var(--surface); }
.practice-hero .button-row { margin-bottom: 0; }
.termin-buttons { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.45rem; }
.termin-buttons li { margin: 0; }
.termin-buttons button {
  width: 100%; justify-content: flex-start; text-align: left; border-radius: var(--radius-sm); border-color: var(--border);
  color: var(--text); font-weight: 600; background: var(--surface);
}
.termin-buttons button::after { content: "→"; margin-left: auto; color: var(--accent); }
.termin-buttons button:hover { border-color: var(--accent); }

/* ---- Üben: Runde ---- */

.round-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0.3rem 0 0.2rem; }
.round-head h1 { margin: 0; font-size: 1.3rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.round-exit { min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 0.3rem; color: var(--muted); font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.round-exit::before { content: "✕"; margin-right: 0.35rem; }
.round-exit:hover { color: var(--terra); }

.progress { margin: 0.5rem 0 0.4rem; }
.progress progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 0.6rem; border: 0; border-radius: 999px;
  background: var(--bg-deep); overflow: hidden; color: var(--accent);
}
.progress progress::-webkit-progress-bar { background: var(--bg-deep); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 0.35s var(--ease); }
.progress progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.flashcard { perspective: 1400px; margin: 1rem 0; }
.flash-inner { display: grid; transform-style: preserve-3d; transition: transform 0.6s var(--ease); }
.flashcard.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  min-height: 13rem; padding: 1.4rem 1.3rem; border-radius: calc(var(--radius) + 4px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; justify-content: center;
}
.flash-front { font-size: 1.15rem; }
.flash-front p { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.45; }
.flash-back { transform: rotateY(180deg); background: var(--surface-2); border-color: var(--accent); justify-content: flex-start; }
.flash-front, .flash-back { transition: visibility 0s linear 0.28s; }
.flash-back, .flashcard.is-flipped .flash-front { visibility: hidden; }
.flashcard.is-flipped .flash-back { visibility: visible; }
.flash-label { margin: 0 0 0.4rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra); font-family: var(--font-body); }
.flash-front .flash-label { font-size: 0.78rem; font-family: var(--font-body); line-height: 1.4; }
.flash-recap { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px dashed var(--border-strong); }
.flash-answer p { font-size: 1.08rem; }
.flash-expl { color: var(--muted); font-size: 0.98rem; }

/* ---- Kontext, Situation, „Mehr dazu“ ---- */

.context-line { display: flex; flex-direction: column; gap: 0.1rem; margin: 0.4rem 0 0.8rem; }
.context-termin { color: var(--muted); font-size: 0.85rem; }
.context-unit { font-weight: 600; font-size: 0.98rem; }
.situation {
  background: var(--surface-2); border-left: 4px solid var(--terra); border-radius: var(--radius-sm);
  padding: 0.7rem 1rem; margin: 0.9rem 0;
}
.situation p { margin: 0.3em 0; }
.more { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 0.2rem 1rem; margin: 0.9rem 0; }
.more > summary { cursor: pointer; font-weight: 600; padding: 0.55rem 0; color: var(--accent-strong); }
.more[open] > summary { border-bottom: 1px dashed var(--border-strong); margin-bottom: 0.6rem; }
.more-text p { margin: 0.4em 0; }
.more-block { margin: 0.8rem 0; }
.related-list { padding-left: 1.1em; margin: 0.2rem 0; }
.related-list li { margin: 0.3em 0; }
.flash-hint { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 0.3rem auto 0; }

.rate-row { display: grid; gap: 0.6rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 560px) { .rate-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rate { min-height: 3.6rem; border-radius: var(--radius); font-size: 1.02rem; justify-content: flex-start; padding: 0.7rem 1rem; }
@media (min-width: 560px) { .rate { flex-direction: column; justify-content: center; gap: 0.25rem; min-height: 5.2rem; } }
.rate-sym { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.1rem; font-weight: 800; flex: none; }
.rate-yes { background: var(--accent); color: var(--accent-text); }
.rate-yes .rate-sym { background: rgb(255 255 255 / 0.2); }
.rate-yes:hover { background: var(--accent-strong); color: var(--accent-text); }
.rate-unsure { border-color: var(--border-strong); color: var(--text); }
.rate-unsure .rate-sym { background: var(--surface-2); border: 1.5px solid var(--border-strong); }
.rate-no { border-color: var(--terra); color: var(--terra); }
.rate-no .rate-sym { background: var(--terra-soft); }
.rate-no:hover { background: var(--terra-soft); color: var(--terra); }

.option {
  display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.85rem 1rem; margin: 0.55rem 0;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; min-height: 3.4rem; background: var(--surface);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.option:hover { border-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.option:has(input:disabled) { cursor: default; }
.option input { margin-top: 0.2rem; width: 1.3rem; height: 1.3rem; flex: none; }
.option.right { border: 2px solid var(--accent); background: var(--accent-soft); }
.option.wrong { border: 2px dashed var(--terra); background: var(--terra-soft); }
.option .verdict { display: block; font-weight: 700; font-size: 0.92rem; margin-top: 0.2rem; }
.option.right .verdict { color: var(--accent); }
.option.wrong .verdict { color: var(--terra); }
.choice legend { font-size: 1.12rem; line-height: 1.45; padding: 0 0.3rem; margin-bottom: 0.3rem; }

.feedback { animation: rise 0.35s var(--ease); }
.feedback h2 { display: flex; align-items: center; gap: 0.55rem; }
.feedback-sym { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; font-family: var(--font-body); font-size: 1.1rem; font-weight: 800; flex: none; }
.feedback.is-right { border-color: var(--accent); }
.feedback.is-right .feedback-sym { background: var(--accent); color: var(--accent-text); }
.feedback.is-wrong { border-color: var(--terra); border-style: dashed; }
.feedback.is-wrong .feedback-sym { background: var(--terra-soft); color: var(--terra); border: 1.5px solid var(--terra); }
.unsure-check { display: flex; gap: 0.6rem; align-items: center; min-height: 2.75rem; cursor: pointer; }
.unsure-check input { width: 1.25rem; height: 1.25rem; flex: none; }

.answer-box { border-left: 4px solid var(--accent); padding: 0.5rem 1rem; background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.summary-hero { text-align: center; padding: 1.4rem 1rem 0.6rem; display: flex; flex-direction: column; align-items: center; }
.summary-hero .plant { margin: 0 auto; }
.summary-hero h1 { margin-top: 0.5rem; }
.summary-hero p { margin-left: auto; margin-right: auto; }
.result-dots { list-style: none; padding: 0; margin: 0.8rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.result-dots li { margin: 0; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; font-weight: 800; border: 1.5px solid var(--border-strong); background: var(--surface); }
.result-dots .r-correct { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.result-dots .r-unsure { color: var(--text); }
.result-dots .r-wrong { border-style: dashed; border-color: var(--terra); color: var(--terra); background: var(--terra-soft); }
.problem-list { padding-left: 0; list-style: none; }
.problem-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.problem-list li:last-child { border-bottom: 0; }

/* ---- Pflanzen (Fortschritt) ---- */

.plant { display: block; flex: none; width: 3.5rem; height: 3.5rem; overflow: visible; }
.plant-sm { width: 2.6rem; height: 2.6rem; }
.plant-lg { width: 5.5rem; height: 5.5rem; }
.plant-xl { width: 7rem; height: 7rem; }
.plant-soil { fill: var(--soil); }
.plant-seed { fill: var(--terra); }
.plant-stem { fill: none; stroke: var(--leaf-dark); stroke-width: 2.4; stroke-linecap: round; }
.plant-leaf { fill: var(--leaf); }
.plant-bud { fill: var(--bloom); }
.plant-petal { fill: var(--bloom); }
.plant-heart { fill: var(--bloom-heart); }
.plant-leaf, .plant-bud, .plant-petal, .plant-heart { transform-box: fill-box; transform-origin: center; animation: grow 0.6s var(--ease) both; }
.plant-petal { animation-delay: 0.15s; }

.garden { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.8rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .garden { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bed {
  margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 0.9rem; align-items: start;
  padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.bed-plot { display: flex; align-items: flex-end; justify-content: center; width: 5.5rem; height: 5.5rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.bed-title { text-wrap: pretty; margin: 0.1rem 0 0.15rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.35; }
.bed-title a { color: var(--text); text-decoration: none; }
.bed-title a:hover { color: var(--accent); text-decoration: underline; }
.bed-stage { margin: 0; font-weight: 600; color: var(--accent); font-size: 0.92rem; }
.bed .meta { margin: 0.1rem 0 0; }
.bed details { grid-column: 1 / -1; margin: 0.35rem 0 0; }
.bed details .objective-list li { background: var(--surface-2); }

.stage-legend { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
@media (min-width: 560px) { .stage-legend { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stage-legend li { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; font-size: 0.82rem; text-align: center; color: var(--muted); }

.backup-section { margin-top: 2.2rem; }

/* ---- Spiele ---- */

.game-tiles { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.8rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .game-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.game-tiles > li { margin: 0; }
.game-tile {
  display: flex; flex-direction: column; gap: 0.5rem; height: 100%; padding: 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
a.game-tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.game-icon { display: flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.game-icon .icon { width: 1.8rem; height: 1.8rem; }
.game-tile .title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin: 0; }
.game-tile .meta { margin: 0; flex: 1; }
.game-go { font-weight: 700; color: var(--accent); }
.game-go::after { content: " →"; }
.game-tile.unavailable { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.game-tile.unavailable .game-icon { background: var(--bg-deep); color: var(--muted); }
.game-tile.unavailable h2 { margin: 0; font-size: 1.2rem; }
.game-tile.unavailable p { margin: 0; }

.game-status { min-height: 1.6em; font-weight: 600; }

.tiles { display: grid; gap: 0.5rem; margin: 1rem 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.size-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .tiles.size-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  min-height: 4rem; font-weight: 600; text-align: center; line-height: 1.25; padding: 0.5rem; word-break: break-word; hyphens: auto;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); color: var(--text); background: var(--surface); font-size: 0.95rem;
}
.tile:hover { border-color: var(--accent); background: var(--surface); }
.tile.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.raten-grid { display: grid; gap: 0.35rem; margin: 1rem 0; justify-content: safe center; max-width: 100%; overflow-x: auto; }
.raten-row { display: flex; gap: 0.25rem; }
.raten-cell {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: var(--rc, 2.4rem); height: var(--rc, 2.4rem); border: 2px solid var(--border); border-radius: 7px;
  font-weight: 700; background: var(--surface); text-transform: uppercase;
}
.raten-grid.len-1 { --len: 1; }
.raten-grid.len-2 { --len: 2; }
.raten-grid.len-3 { --len: 3; }
.raten-grid.len-4 { --len: 4; }
.raten-grid.len-5 { --len: 5; }
.raten-grid.len-6 { --len: 6; }
.raten-grid.len-7 { --len: 7; }
.raten-grid.len-8 { --len: 8; }
.raten-grid.len-9 { --len: 9; }
.raten-grid.len-10 { --len: 10; }
.raten-grid.len-11 { --len: 11; }
.raten-grid.len-12 { --len: 12; }
.raten-grid.len-13 { --len: 13; }
.raten-grid.len-14 { --len: 14; }
.raten-grid.len-15 { --len: 15; }
.raten-grid { --rc: max(1.2rem, min(2.6rem, calc((100vw - 2 * var(--gutter) - (var(--len, 6) - 1) * 0.25rem) / var(--len, 6)))); }
@media (min-width: 720px) { .raten-grid { --rc: min(2.8rem, calc((46rem - (var(--len, 6) - 1) * 0.25rem) / var(--len, 6))); } }
.raten-grid.len-11, .raten-grid.len-12, .raten-grid.len-13, .raten-grid.len-14, .raten-grid.len-15 { font-size: 0.85rem; }
.raten-cell small { position: absolute; right: 2px; bottom: 0; font-size: 0.6rem; font-weight: 700; }
.raten-cell.correct { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.raten-cell.present { background: var(--warn-soft); border: 2px dashed var(--warn-border); }
.raten-cell.absent { background: var(--bg-deep); color: var(--muted); }

.kw-clue-bar {
  position: sticky; top: 0.5rem; z-index: 5; margin: 0.8rem 0; padding: 0.8rem 1rem; min-height: 3.2rem;
  background: var(--accent-soft); border-color: var(--accent); font-weight: 600; box-shadow: var(--shadow-lift);
}
.kw-scroll { overflow-x: auto; margin: 0.8rem 0; padding-bottom: 0.4rem; display: flex; justify-content: safe center; }
.kw-grid {
  --cell: max(1.35rem, min(2.9rem, calc((100vw - 2 * var(--gutter) - (var(--cols) - 1) * 3px) / var(--cols))));
  display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); width: max-content; gap: 3px;
}
@media (min-width: 720px) { .kw-grid { --cell: min(2.9rem, calc((46rem - (var(--cols) - 1) * 3px) / var(--cols))); } }
.kw-grid.cols-5 { --cols: 5; } .kw-grid.cols-6 { --cols: 6; } .kw-grid.cols-7 { --cols: 7; } .kw-grid.cols-8 { --cols: 8; }
.kw-grid.cols-9 { --cols: 9; } .kw-grid.cols-10 { --cols: 10; } .kw-grid.cols-11 { --cols: 11; } .kw-grid.cols-12 { --cols: 12; }
.kw-grid.cols-13 { --cols: 13; } .kw-grid.cols-14 { --cols: 14; } .kw-grid.cols-15 { --cols: 15; }
.kw-block { background: transparent; }
.kw-cell { position: relative; background: var(--surface); border: 2px solid var(--border-strong); border-radius: 5px; transition: background-color 0.15s var(--ease); }
.kw-cell input {
  width: 100%; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: max(1rem, calc(var(--cell) * 0.5));
  font-weight: 700; text-align: center; text-transform: uppercase; padding: 0; min-height: 0; caret-color: transparent; border-radius: 3px;
}
.kw-cell input:focus { background: var(--surface); }
.kw-cell input:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.kw-num { position: absolute; top: 1px; left: 2px; font-size: 0.6rem; font-weight: 700; line-height: 1; color: var(--muted); pointer-events: none; }
.kw-active { background: var(--accent-soft); border-color: var(--accent); }
.kw-right { border-color: var(--accent); }
.kw-wrong { border: 2px dashed var(--terra); background: var(--terra-soft); }
.kw-clues { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.kw-clues li { margin: 0; }
.kw-clue {
  display: block; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  min-height: 2.75rem; text-align: left; font-weight: 400; color: var(--text); padding: 0.5rem 0.8rem; justify-content: flex-start;
}
.kw-clue:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

/* ---- Level, XP, Sicherungshinweis ---- */

.level-card { padding-bottom: 1rem; }
.level-meter { margin: 0.2rem 0 0.4rem; }
.level-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; }
.level-num { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; color: var(--accent-strong); }
.level-meter .progress { margin: 0.35rem 0 0.25rem; }
.level-next { margin: 0; }
.xp-gain {
  margin: 0.6rem 0 0.2rem; padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text);
}
.xp-gain.is-levelup { background: var(--terra-soft); border-color: var(--terra); }
.backup-hint { background: var(--accent-soft); border-color: var(--accent); }

/* ---- Bewegung ---- */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
main > div > section { animation: rise 0.3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .flashcard.is-flipped .flash-inner { transform: none; }
  .flashcard.is-flipped .flash-front { visibility: hidden; }
  .flash-back { transform: none; visibility: hidden; }
  .flashcard.is-flipped .flash-back { visibility: visible; }
}

@media print {
  .main-nav, .theme-toggle, .skip-link { display: none; }
  body { padding: 0; background: #fff; }
}

/* ---- Geführter Rundgang ---- */

.link-button {
  background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: var(--accent-strong);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; box-shadow: none;
}
.link-button:hover { color: var(--terra); background: none; }
body.tour-active #main { padding-bottom: 17rem; }
.tour-panel {
  position: fixed; z-index: 50; left: 50%; bottom: max(0.8rem, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(36rem, calc(100% - 1.6rem));
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow-lift), 0 12px 40px rgb(0 0 0 / 0.18); padding: 0.9rem 1.1rem 1rem;
}
/* Auf schmalen Bildschirmen liegt die Navigation unten: das Feld sitzt darüber. */
@media (max-width: 719px) {
  .tour-panel { bottom: calc(4.4rem + env(safe-area-inset-bottom)); padding: 0.7rem 0.9rem 0.8rem; }
  .tour-panel p { font-size: 0.95rem; }
  body.tour-active #main { padding-bottom: 22rem; }
  .tour-target { scroll-margin-bottom: 22rem; }
}
.tour-panel h2 { margin: 0.35rem 0 0.3rem; font-size: 1.15rem; }
.tour-panel h2:focus { outline: none; }
.tour-panel p { margin: 0.3rem 0; }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tour-count { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--terra); }
.tour-close { min-height: 2.2rem; min-width: 2.2rem; padding: 0.2rem 0.5rem; border-radius: 50%; }
.tour-progress { width: 100%; height: 0.35rem; margin: 0.4rem 0 0; accent-color: var(--accent); }
.tour-actions { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 0.7rem; }
.tour-actions button { flex: 1 1 0; }
.tour-target {
  outline: 4px solid var(--terra); outline-offset: 5px; border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9px var(--terra-soft);
  scroll-margin-bottom: 17rem; position: relative; z-index: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .tour-target { animation: tour-pulse 1.6s ease-out 2; }
}
@keyframes tour-pulse {
  0% { outline-offset: 12px; outline-color: transparent; }
  100% { outline-offset: 5px; }
}
.demo-flash { border-color: var(--accent); background: var(--surface-2); }
.demo-rate button:disabled { opacity: 1; cursor: default; }

/* ---- Fußzeile und Rechtstexte ---- */

.site-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.88rem; color: var(--muted); text-align: center; }
.site-footer a { color: var(--muted); }
.legal-home { text-decoration: none; color: inherit; }
.legal-page { max-width: 46rem; margin: 0 auto; padding: 1rem var(--gutter) 3rem; }
.legal-page .card { margin: 1rem 0; }
.legal-page h2 { font-size: 1.1rem; }
