/* ── Variables ── */
:root {
  --accent: #25ae7c;
  --accent-dark: #1d9268;
  --accent-light: #e8f8f2;
  --accent-xlight: #f0fdf8;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e6ea;
  --text-1: #1a2332;
  --text-2: #5a6677;
  --text-3: #9aa3b0;
  --red: #e74c3c;
  --red-light: #fde8e8;
  --orange: #f39c12;
  --orange-light: #fff3d6;
  --sidebar-w: 280px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 16px;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger:hover { background: var(--accent-light); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1) !important;
  text-decoration: none !important;
}
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text { font-size: 1.1rem; font-weight: 800; color: var(--text-1); }
.logo-sub { font-weight: 500; color: var(--text-2); font-size: 0.85em; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.font-size-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-2);
}
.btn-header-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background .15s;
}
.btn-header-link:hover { background: #c8f0e0; }
.btn-header-logout {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  background: none;
  border: 1.5px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-header-logout:hover { border-color: var(--red); color: var(--red); }
.fs-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.fs-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.fs-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Wortarten neue UI ── */
.wa-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.wa-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
  flex-shrink: 0;
}
.wa-dot.done { background: var(--accent); }
.wa-dot.active { background: var(--accent); box-shadow: 0 0 0 3px rgba(37,174,124,0.25); }
.wa-prog-text { font-size: 0.85rem; color: var(--text-3); font-weight: 600; margin-left: 4px; }

.wa-inline-result {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  vertical-align: middle;
}
.wa-inline-richtig { background: var(--accent-light); color: var(--accent-dark); }
.wa-inline-falsch  { background: var(--red-light); color: var(--red); }

.wa-hinweis {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--orange-light);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  font-size: 0.9rem;
}
.wa-hinweis-titel { font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.wa-hinweis-detail { color: var(--text-2); line-height: 1.5; }

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 90;
  transition: transform 0.3s ease;
}
.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 16px 8px 32px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 89;
}
.sidebar-overlay.show { display: block; }

/* ── Nav Tree ── */
.nav-tree { display: flex; flex-direction: column; gap: 4px; }

.nav-fach { }
.nav-fach-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-1);
  text-align: left;
  transition: background 0.15s;
}
.nav-fach-btn:hover { background: var(--accent-light); }
.nav-fach-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-fach-titel { flex: 1; }
.nav-chevron { font-size: 0.75rem; color: var(--text-3); transition: transform 0.2s; }

.nav-themen { padding-left: 8px; margin-top: 2px; }
.nav-thema { margin-bottom: 2px; }
.nav-thema-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s;
}
.nav-thema-btn:hover { background: var(--bg); }
.nav-thema-btn span:first-child { flex: 1; }

.nav-seiten { padding-left: 12px; margin-top: 2px; }
.nav-seite-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
  position: relative;
}
.nav-seite-link:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.nav-seite-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.nav-seite-icon { font-size: 0.8rem; flex-shrink: 0; }
.nav-done-badge {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
  margin-left: auto;
}

/* ── Main content ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
}
.content-area {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px 100px;
}

/* ── Spinner ── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 100px 0;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }

/* ── Page header ── */
.page-header { margin-bottom: 36px; }
.page-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-1);
  line-height: 1.2;
  margin-bottom: 10px;
}
.page-info {
  color: var(--text-2);
  margin-top: 10px;
  font-size: 0.97rem;
}
.badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ── Prose (Lernseite) ── */
.lernseite { }
.prose { max-width: 720px; }
.prose h1 { font-size: 1.85rem; font-weight: 900; margin: 0 0 24px; color: var(--accent-dark); }
.prose h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--text-1);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}
.prose h3 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 12px; color: var(--text-2); }
.prose p { margin-bottom: 16px; line-height: 1.8; }
.prose ul, .prose ol { margin: 16px 0 16px 24px; }
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose strong { color: var(--text-1); font-weight: 700; }
.prose em { color: var(--accent-dark); font-style: italic; }
.prose code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
}
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; border-radius: var(--radius); overflow: hidden; }
.prose th { background: var(--accent-light); padding: 12px 16px; text-align: left; font-weight: 700; color: var(--accent-dark); }
.prose td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.prose tr:last-child td { border-bottom: none; }
.prose blockquote { border-left: 4px solid var(--accent); padding-left: 16px; color: var(--text-2); font-style: italic; margin: 16px 0; }

/* ── Callout boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 4px solid;
}
.callout-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}
.callout-body {
  font-size: 0.93rem;
  line-height: 1.7;
}
.callout-body p { margin: 0; }
.callout-info { background: #ebf5fb; border-color: #3498db; }
.callout-info .callout-title { color: #1a6fa8; }
.callout-example { background: #eafaf1; border-color: #27ae60; }
.callout-example .callout-title { color: #1e8449; }
.callout-tip { background: #fef9e7; border-color: #f39c12; }
.callout-tip .callout-title { color: #b7770d; }
.callout-wichtig { background: #fdedec; border-color: #e74c3c; }
.callout-wichtig .callout-title { color: #c0392b; }
.callout-merkregel { background: #f5eef8; border-color: #9b59b6; }
.callout-merkregel .callout-title { color: #6c3483; }
.callout-definition { background: var(--accent-xlight); border-color: var(--accent); }
.callout-definition .callout-title { color: var(--accent-dark); }

/* ── Home ── */
.home-hero {
  text-align: center;
  padding: 56px 0 44px;
}
.home-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-1);
  margin-bottom: 14px;
}
.home-title strong { color: var(--accent); }
.home-subtitle { font-size: 1.15rem; color: var(--text-2); }

.fach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 36px;
}
.fach-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s;
  color: var(--text-1);
  text-decoration: none !important;
  box-shadow: var(--shadow);
}
.fach-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,174,124,0.15);
}
.fach-card-icon { font-size: 2.6rem; flex-shrink: 0; }
.fach-card-content { flex: 1; min-width: 0; }
.fach-card-titel { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.fach-card-desc { font-size: 0.87rem; color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.fach-card-stats { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.fach-card-arrow { color: var(--accent); font-size: 1.4rem; font-weight: 700; align-self: center; flex-shrink: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* ── Exercise base ── */
.exercise { position: relative; }
.exercise-hint {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-style: italic;
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
}
.exercise-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ── Result cards ── */
.result-card {
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 28px;
  text-align: center;
  border: 2px solid;
}
.result-perfect {
  background: linear-gradient(135deg, var(--accent-light), #c8f0e0);
  border-color: var(--accent);
}
.result-good { background: var(--orange-light); border-color: var(--orange); }
.result-retry { background: var(--red-light); border-color: var(--red); }
.result-score { font-size: 1.7rem; font-weight: 900; margin-bottom: 8px; }
.result-msg { font-size: 1.05rem; color: var(--text-2); }

/* ── Lösungspanel ── */
.btn-loes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-loes:hover { border-color: var(--orange); color: var(--orange); }

.loesung-panel {
  margin-top: 12px;
  background: #fffdf5;
  border: 1.5px solid var(--orange);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeSlide 0.2s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loesung-kopf {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.loesung-liste { display: flex; flex-direction: column; gap: 6px; }
.loes-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 9px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.loes-top { display: flex; align-items: center; gap: 10px; }
.loes-detail {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.5;
  padding: 6px 0 0 30px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.loes-nr { font-size: 0.8rem; font-weight: 700; color: var(--text-3); min-width: 22px; }
.loes-wort { font-weight: 800; font-size: 1rem; color: var(--accent-dark); min-width: 90px; }
.loes-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.loes-gross { background: #dbeafe; color: #1e40af; }
.loes-klein { background: #f1f5f9; color: #475569; }
.loes-erkl {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--orange-light);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.55;
}

/* ── Lückentext ── */
.luecken-body { font-size: 1.1rem; line-height: 2.4; }
.luecken-body p { margin-bottom: 16px; }
.luecken-input {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1em;
  font-family: inherit;
  width: 130px;
  outline: none;
  transition: all 0.2s;
  background: white;
}
.luecken-input:focus { box-shadow: 0 0 0 3px rgba(37,174,124,0.2); }
.luecken-input.richtig { background: var(--accent-light); border-color: var(--accent); }
.luecken-input.falsch { background: var(--red-light); border-color: var(--red); }

.luecken-select {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1em;
  font-family: inherit;
  background: white;
  outline: none;
  cursor: pointer;
}
.luecken-select.richtig { background: var(--accent-light); border-color: var(--accent); }
.luecken-select.falsch { background: var(--red-light); border-color: var(--red); }

/* ── Wortbank ── */
.wb-bank {
  background: var(--accent-xlight);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.wb-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wb-chips, .ldd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-chip {
  display: inline-block;
  padding: 6px 14px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.wb-chip:hover:not(.used) { background: var(--accent-light); transform: translateY(-1px); }
.wb-chip.used {
  text-decoration: line-through;
  opacity: 0.4;
  border-color: var(--border);
  background: var(--bg);
}

/* ── Lücken-Drag-Drop ── */
.ldd-text .ldd-slot {
  display: inline-block;
  min-width: 72px;
  border-bottom: 2.5px solid var(--accent);
  padding: 1px 10px;
  margin: 0 3px;
  border-radius: 4px 4px 0 0;
  text-align: center;
  color: var(--text-3);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: baseline;
}
.ldd-text .ldd-slot:hover { background: var(--accent-light); }
.ldd-text .ldd-slot.filled {
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--text-1);
  background: var(--accent-xlight);
}
.ldd-text .ldd-slot.slot-richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark); }
.ldd-text .ldd-slot.slot-falsch  { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red); }

.ldd-bank {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 20px;
  margin-bottom: 8px;
}
.ldd-chip {
  display: inline-block;
  padding: 7px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.ldd-chip:hover:not(.placed) { border-color: var(--accent); transform: translateY(-1px); }
.ldd-chip.picked {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,174,124,0.2);
}
.ldd-chip.placed { opacity: 0.28; cursor: default; text-decoration: line-through; }

/* ── Wortarten ── */
.wort-sentences { margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.wort-satz {
  font-size: 1.2rem;
  line-height: 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
}
.wort-chip {
  display: inline-block;
  padding: 6px 14px;
  margin: 3px;
  border-radius: 20px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  user-select: none;
  background: white;
}
.wort-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.wort-chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,174,124,0.25);
  transform: translateY(-1px);
}
.wort-chip.chip-richtig { outline: 3px solid rgba(37,174,124,0.5) !important; }
.wort-chip.chip-falsch { outline: 3px solid rgba(231,76,60,0.6) !important; }
.wort-plain { display: inline; margin: 0 2px; font-size: 1.2rem; color: var(--text-3); }

.wortart-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.wortart-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  color: white;
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
}
.wortart-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── Quiz ── */
.quiz-question { margin-bottom: 36px; }
.quiz-q-text {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-1);
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  background: white;
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-light); font-weight: 700; }
.quiz-option.richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark) !important; font-weight: 700; }
.quiz-option.falsch { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red) !important; }
.quiz-explanation {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
  border-left: 3px solid var(--accent);
}

/* ── Blitzlesen ── */
.blitz-display {
  background: var(--text-1);
  color: white;
  border-radius: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 32px;
}
#blitz-word {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
}
.blitz-progress {
  text-align: center;
  color: var(--text-3);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}
.blitz-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.blitz-speed-wrap {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.blitz-speed-wrap label {
  font-weight: 600;
  color: var(--text-2);
  display: block;
  margin-bottom: 12px;
}
.blitz-speed-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.blitz-step-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.15s;
}
.blitz-step-btn:hover { background: var(--border); }
.blitz-speed-input {
  width: 90px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text-1);
}
.blitz-speed-unit {
  font-weight: 600;
  color: var(--text-3);
  font-size: 0.9rem;
}
.blitz-auto-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
}
.blitz-auto-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.blitz-auto-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.blitz-pause-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
}

/* ── Mathe ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.mathe-settings h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 28px; }
.mathe-settings-grid { display: grid; gap: 28px; margin-bottom: 32px; }
.setting-label { font-weight: 700; color: var(--text-1); display: block; margin-bottom: 12px; }
.setting-options { display: flex; flex-wrap: wrap; gap: 10px; }
.setting-radio, .setting-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  user-select: none;
}
.setting-radio:hover, .setting-check:hover { border-color: var(--accent); background: var(--accent-light); }
.setting-radio input, .setting-check input { accent-color: var(--accent); }

.mathe-aufgabe-display { text-align: center; padding: 40px 20px 24px; }
.mathe-aufgabe-text {
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--text-1);
  margin-bottom: 28px;
  letter-spacing: -2px;
}
.mathe-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.mathe-eq { font-size: 2rem; font-weight: 700; color: var(--text-3); }
.mathe-answer-input {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  border: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 24px;
  width: 170px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
}
.mathe-answer-input:focus { box-shadow: 0 0 0 4px rgba(37,174,124,0.2); }
.mathe-answer-input.richtig { border-color: var(--accent); background: var(--accent-light); }
.mathe-answer-input.falsch { border-color: var(--red); background: var(--red-light); animation: shake 0.4s; }
.mathe-feedback { font-size: 1.1rem; font-weight: 700; min-height: 32px; }
.feedback-richtig { color: var(--accent); }
.feedback-falsch { color: var(--red); }
.mathe-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.mathe-progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mathe-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.mathe-progress-text { text-align: center; font-size: 0.88rem; color: var(--text-3); font-weight: 600; }

/* ── Drag & Drop ── */
.dd-item { margin-bottom: 28px; }
.dd-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  background: var(--bg);
  border-radius: 10px;
  border: 2px dashed var(--border);
  margin-bottom: 12px;
  align-items: center;
}
.dd-slot {
  min-width: 80px;
  min-height: 40px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  padding: 6px 14px;
  background: white;
  font-size: 0.95rem;
}
.dd-slot:hover { border-color: var(--accent); background: var(--accent-light); }
.dd-slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent-xlight); }
.dd-slot.slot-richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark); }
.dd-slot.slot-falsch { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red); }
.dd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-chip {
  padding: 8px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.dd-chip:hover { border-color: var(--accent); }
.dd-chip.picked {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,174,124,0.2);
}

/* ── Error card ── */
.error-card {
  background: var(--surface);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto;
}
.error-card h2 { margin-bottom: 12px; color: var(--red); }
.error-card p { color: var(--text-2); margin-bottom: 12px; }
.error-card code {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.88em;
  margin-top: 4px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-1);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Celebration / Confetti ── */
.celebration {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
  border-radius: var(--radius);
}
.confetti-piece {
  position: absolute;
  top: -10px;
  border-radius: 3px;
  animation: confetti-fall 2.5s ease-in forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(700px) rotate(720deg); opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .content-area { padding: 32px 24px 80px; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 288px;
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar-overlay.show { display: block; z-index: 199; }

  .main { margin-left: 0; }
  .content-area { padding: 24px 16px 60px; }

  .home-title { font-size: 1.8rem; }
  .page-title { font-size: 1.6rem; }
  .fach-grid { grid-template-columns: 1fr; }

  #blitz-word { font-size: 2.6rem; }
  .mathe-aufgabe-text { font-size: 2.8rem; }
  .mathe-answer-input { width: 140px; font-size: 1.8rem; }

  .wort-satz { font-size: 1rem; line-height: 2.8; }
}

@media (max-width: 480px) {
  #blitz-word { font-size: 2rem; }
  .mathe-aufgabe-text { font-size: 2.2rem; }
  .result-score { font-size: 1.3rem; }
}

/* ── Login Modal ─────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 48, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: opacity .25s;
}
.login-overlay.hidden { display: none; }

.login-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: loginIn .25s ease;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-brand { font-size: 1.3rem; font-weight: 900; color: var(--text-1); }
.login-sub   { font-size: 0.82rem; color: var(--text-3); font-weight: 600; }
.login-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 22px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.login-form input:focus { border-color: var(--accent); }

.login-error {
  font-size: 0.88rem;
  color: var(--red);
  font-weight: 600;
  min-height: 20px;
}

.btn-login {
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-login:hover { background: var(--accent-dark); }
.btn-login:disabled { opacity: .6; cursor: default; }

.btn-guest {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: color .15s;
}
.btn-guest:hover { color: var(--text-2); }

.login-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* ── Home: Empfehlungen & Lesezeichen ────────────────────────────── */
.home-welcome {
  font-size: 1.1rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.home-section {
  margin-bottom: 36px;
}
.home-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
}
.empfehlung-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empfehlung-card {
  background: #fff9e6;
  border: 2px solid #f5c518;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.empfehlung-icon { font-size: 1.5rem; flex-shrink: 0; }
.empfehlung-body { flex: 1; }
.empfehlung-titel { font-weight: 700; font-size: 0.95rem; }
.empfehlung-msg   { font-size: 0.85rem; color: var(--text-2); margin-top: 2px; }
.empfehlung-link  { font-size: 0.82rem; font-weight: 700; color: var(--accent); margin-top: 6px; display: inline-block; }

.bookmark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bookmark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none !important;
  transition: all .15s;
}
.bookmark-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Lesezeichen-Button auf Seiten ──────────────────────────────── */
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  margin-top: 8px;
}
.bookmark-btn:hover       { border-color: var(--accent); color: var(--accent); }
.bookmark-btn.is-saved    { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
