/* =========================================================
   Spanisch Vokabeln – Gestaltung im Stil von „Leons Hub“
   ========================================================= */

:root {
  --bg: #050816;
  --text: #f6f2ff;
  --muted: rgba(232, 226, 255, 0.76);
  --faint: rgba(232, 226, 255, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --card-bg: rgba(18, 13, 48, 0.62);
  --card-grad: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  --accent: #ffcf96;
  --accent-2: #c4b2ff;
  --app: #ff9f6e;               /* Leuchtfarbe dieser App im Hub */
  --ink: #1c1135;
  --good: #8fe3b0;
  --bad: #ff9a9a;
  --warn: #ffcf96;
  --btn-grad: linear-gradient(135deg, #ffe0ad 0%, #ffa7b4 50%, #bfa9ff 100%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --appbar-h: 56px;
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
a { color: inherit; }
h1, h2, p { margin: 0; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Hintergrund: Nachthimmel (ruhend, kein Ruckeln) ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, #03040f 0%, #0a0f2e 42%, #1b1650 78%, #2a1c55 100%);
}
.nebula {
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  border-radius: 50%;
}
.nebula--a {
  left: -62vmax; top: -58vmax;
  background: radial-gradient(closest-side, rgba(146, 92, 255, 0.34), rgba(146, 92, 255, 0.1) 45%, rgba(146, 92, 255, 0) 72%);
}
.nebula--b {
  right: -70vmax; top: 4vmax;
  background: radial-gradient(closest-side, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.05) 45%, rgba(56, 189, 248, 0) 72%);
}
.horizon {
  position: absolute;
  left: -20%; right: -20%; bottom: 0;
  height: 45%;
  background: radial-gradient(60% 55% at 50% 100%, rgba(255, 159, 110, 0.26), rgba(224, 122, 116, 0.08) 50%, rgba(224, 122, 116, 0) 78%);
}
.stars {
  position: absolute;
  left: 0; top: 0;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    12vw 9vh 0 0 rgba(255,255,255,.75), 31vw 4vh 0 0 rgba(255,255,255,.5), 52vw 13vh 0 0 rgba(255,255,255,.65),
    74vw 7vh 0 0 rgba(255,255,255,.8), 88vw 18vh 0 0 rgba(255,255,255,.45), 6vw 27vh 0 0 rgba(255,255,255,.45),
    23vw 21vh 0 0 rgba(255,255,255,.6), 44vw 31vh 0 0 rgba(255,255,255,.35), 63vw 25vh 0 0 rgba(255,255,255,.55),
    94vw 36vh 0 0 rgba(255,255,255,.5), 15vw 44vh 0 0 rgba(255,255,255,.3), 37vw 50vh 0 0 rgba(255,255,255,.4),
    81vw 47vh 0 0 rgba(255,255,255,.35), 58vw 58vh 0 0 rgba(255,255,255,.25), 4vw 63vh 0 0 rgba(255,255,255,.3),
    70vw 66vh 0 0 rgba(255,255,255,.2), 27vw 71vh 0 0 rgba(255,255,255,.2), 91vw 75vh 0 0 rgba(255,255,255,.2);
}
.stars--small { transform: scale(0.6); transform-origin: 0 0; opacity: 0.8; left: 3vw; top: 2vh; }

/* ---------- Kopfleiste mit „Zum Hub“ ---------- */
.appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.94), rgba(5, 8, 22, 0.78));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}
.hub-link svg { width: 18px; height: 18px; flex: none; }
.hub-link:active { transform: scale(0.96); background: rgba(255, 255, 255, 0.12); }
.appbar-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.appbar-title b { color: var(--app); font-weight: 600; }

/* ---------- Seitenrahmen ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--appbar-h) + env(safe-area-inset-top) + 18px)
           max(18px, env(safe-area-inset-right))
           calc(env(safe-area-inset-bottom) + 100px)
           max(18px, env(safe-area-inset-left));
}
body.learning #app { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }

.view { display: none; }
.view.active { display: block; animation: view-in 0.32s var(--ease) both; }
@keyframes view-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}

.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.title {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 10vw, 2.8rem);
  line-height: 1.05;
  color: #fff7ec;
  text-shadow: 0 0 26px rgba(190, 170, 255, 0.4);
}
.lead { color: var(--muted); }
.page-head { margin: 4px 0 22px; }

/* ---------- Karten (Glas-Stil wie im Hub) ---------- */
.panel {
  position: relative;
  border-radius: var(--radius);
  background: var(--card-grad), var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  isolation: isolate;
}
.panel::after {                 /* feine Leuchtlinie oben */
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--glow, var(--app)), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: 600 17px/1.15 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease, box-shadow 0.25s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .hub-link:focus-visible, .choice:focus-visible, .mode:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary {
  color: var(--ink);
  background: var(--btn-grad);
  box-shadow: 0 12px 30px -12px rgba(255, 167, 180, 0.75);
}
.btn-big { min-height: 60px; font-size: 18px; margin-top: 14px; }
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
}
.btn-danger {
  color: var(--bad);
  background: transparent;
  border: 1px solid rgba(255, 154, 154, 0.55);
  margin-bottom: 10px;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Startseite ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 16px 6px 14px; text-align: center; }
.stat:nth-child(2) { --glow: var(--accent-2); }
.stat:nth-child(3) { --glow: var(--good); }
.stat-num { display: block; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); }

.levels { margin-top: 12px; padding: 16px 18px 14px; --glow: var(--accent-2); }
.levels-title { font-weight: 600; margin-bottom: 12px; }
.levels-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  align-items: end;
  height: 76px;
}
.level-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.level-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #ffe0ad, #ffa7b4 55%, #bfa9ff);
  transform-origin: bottom;
  animation: bar-in 0.7s var(--ease) both;
}
@keyframes bar-in { from { transform: scaleY(0); } }
.level-num { font-size: 12px; color: var(--muted); margin-top: 5px; }
.levels-hint { margin-top: 8px; font-size: 13px; color: var(--faint); }

.home-message { text-align: center; color: var(--muted); margin: 22px 8px 2px; min-height: 1.5em; }

/* ---------- Rundenauswahl ---------- */
.back-row { margin: -6px 0 6px -4px; }
.modes { display: grid; gap: 10px; margin-top: 18px; }
.mode {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  --glow: var(--mode-color);
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}
.mode:active { transform: scale(0.985); }
.mode[aria-checked="true"] {
  border-color: rgba(255, 207, 150, 0.75);
  background: linear-gradient(160deg, rgba(255, 207, 150, 0.16), rgba(196, 178, 255, 0.06)), var(--card-bg);
}
.mode-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px; height: 50px;
  border-radius: 16px;
  font-size: 24px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 55%), var(--mode-color, var(--app));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 26px -12px var(--mode-color, var(--app));
}
.mode-text { flex: 1; min-width: 0; }
.mode-name { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; }
.mode-desc { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.mode-check {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mode[aria-checked="true"] .mode-check { background: var(--accent); border-color: var(--accent); }
.mode[aria-checked="true"] .mode-check::after {
  content: ""; width: 9px; height: 5px;
  border: solid var(--ink); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.mode:disabled { opacity: 0.45; cursor: not-allowed; }

.setup-label { margin: 22px 0 8px; font-weight: 600; }
.setup-count { margin-top: 18px; text-align: center; color: var(--muted); font-size: 15px; }

/* Umschalter (Segmente) */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.segmented button[aria-checked="true"] { background: var(--btn-grad); color: var(--ink); }

/* ---------- Lernmodus ---------- */
.learn-top { display: flex; align-items: center; gap: 12px; margin: -6px 0 12px; }
.progress {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--btn-grad);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease);
}
.learn-count { font-size: 14px; color: var(--muted); min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 42vh;
  min-height: 42dvh;
  padding: 30px 22px;
  text-align: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.18s ease;
}
.card:active { transform: scale(0.99); }
.card.pop { animation: card-in 0.35s var(--ease) both; }
@keyframes card-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
#view-learn[data-mode="choice"] .card,
#view-learn[data-mode="type"] .card { min-height: 25vh; min-height: 25dvh; cursor: default; }
#view-learn[data-mode="type"] .card { min-height: 20vh; min-height: 20dvh; }

.card-lang {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-word {
  margin: 10px 0 4px;
  font-family: var(--serif);
  font-size: clamp(2rem, 9.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  color: #fff7ec;
  word-break: break-word;
}
.card-back { width: 100%; animation: reveal 0.3s var(--ease) both; }
@keyframes reveal {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: none; }
}
.card-back hr { border: 0; height: 1px; margin: 22px 18%; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.card-answer { color: var(--accent); }

.btn-speak {
  position: absolute;
  top: 12px; right: 12px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  font-size: 19px;
  cursor: pointer;
}
.btn-speak:active { transform: scale(0.94); }

.learn-actions { margin-top: 14px; }

/* Karteikarten: Selbstbewertung */
.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn-rate {
  min-height: 64px;
  padding: 8px 6px;
  border-radius: 20px;
  font-size: 16px;
  color: var(--ink);
}
.rate-0 { background: var(--bad); }
.rate-1 { background: var(--warn); }
.rate-2 { background: var(--good); }

/* Multiple Choice */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card-grad), var(--card-bg);
  color: var(--text);
  font-size: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.choice:active { transform: scale(0.98); }
.choice-key {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--muted);
}
.choice.correct { background: rgba(143, 227, 176, 0.18); border-color: var(--good); }
.choice.correct .choice-key { background: var(--good); border-color: var(--good); color: var(--ink); }
.choice.wrong { background: rgba(255, 154, 154, 0.16); border-color: var(--bad); animation: shake 0.35s ease; }
.choice.wrong .choice-key { background: var(--bad); border-color: var(--bad); color: var(--ink); }
.choices.answered .choice:not(.correct):not(.wrong) { opacity: 0.45; }
.choices.answered .choice { pointer-events: none; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Tippen */
.type-form { display: grid; gap: 10px; }
.type-input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1.5px solid var(--line-strong);
  background: rgba(5, 8, 22, 0.55);
  font-size: 20px;              /* über 16px: kein Auto-Zoom auf dem iPhone */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease;
}
.type-input:focus { border-color: var(--accent); }
.type-input.is-good { border-color: var(--good); }
.type-input.is-close { border-color: var(--warn); }
.type-input.is-bad { border-color: var(--bad); animation: shake 0.35s ease; }
.type-skip { justify-self: center; color: var(--muted); font-weight: 500; }

/* Rückmeldung (Multiple Choice & Tippen) */
.feedback {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  animation: reveal 0.25s var(--ease) both;
}
.feedback-title { font-weight: 700; }
.feedback-text { color: var(--muted); margin-top: 2px; }
.feedback-text strong { color: var(--text); font-family: var(--serif); font-size: 1.1em; }
.feedback.good { border-color: rgba(143, 227, 176, 0.6); }
.feedback.good .feedback-title { color: var(--good); }
.feedback.close { border-color: rgba(255, 207, 150, 0.6); }
.feedback.close .feedback-title { color: var(--warn); }
.feedback.bad { border-color: rgba(255, 154, 154, 0.6); }
.feedback.bad .feedback-title { color: var(--bad); }

/* ---------- Abschluss ---------- */
.done { text-align: center; padding-top: 2vh; }
.ring-wrap { position: relative; width: 190px; height: 190px; margin: 6px auto 10px; }
.ring-wrap::before {           /* weicher Schein hinter dem Ring */
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 167, 180, 0.28), rgba(196, 178, 255, 0.1) 60%, transparent 75%);
}
.ring { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 10; }
.ring-value {
  fill: none;
  stroke: url(#ring-grad);
  stroke-width: 10;
  stroke-linecap: round;
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-pct { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

.done-title { font-family: var(--serif); font-size: 34px; font-weight: 600; color: #fff7ec; margin-top: 8px; }
.done-text { color: var(--muted); margin: 6px auto 0; max-width: 32ch; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 6px; }
.summary .stat-num { font-size: 28px; }
.summary .s-good { --glow: var(--good); }
.summary .s-good .stat-num { color: var(--good); }
.summary .s-bad { --glow: var(--bad); }
.summary .s-bad .stat-num { color: var(--bad); }
.summary .s-new { --glow: var(--accent-2); }
.summary .s-new .stat-num { color: var(--accent-2); }
.done-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.done-buttons .btn { margin-top: 0; }

/* Einblenden der Abschluss-Elemente nacheinander */
.done.play > * { animation: rise 0.6s var(--ease) both; }
.done.play > *:nth-child(2) { animation-delay: 0.25s; }
.done.play > *:nth-child(3) { animation-delay: 0.35s; }
.done.play > *:nth-child(4) { animation-delay: 0.5s; }
.done.play > *:nth-child(5) { animation-delay: 0.65s; }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}

/* Ruhige Variante: aufsteigende Lichtpunkte */
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkles i {
  position: absolute;
  bottom: 18%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(255, 207, 150, 0.6);
  opacity: 0;
}
.done.calm.play .sparkles i { animation: float-up 3.2s ease-out both; }
.sparkles i:nth-child(1) { left: 8%;  animation-delay: 0.3s !important; }
.sparkles i:nth-child(2) { left: 26%; animation-delay: 0.9s !important; background: var(--accent-2); }
.sparkles i:nth-child(3) { left: 50%; animation-delay: 0.5s !important; }
.sparkles i:nth-child(4) { left: 72%; animation-delay: 1.2s !important; background: var(--accent-2); }
.sparkles i:nth-child(5) { left: 90%; animation-delay: 0.7s !important; }
@keyframes float-up {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  20%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(0, -150px, 0) scale(1); }
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
}

/* ---------- Wörter ---------- */
.word-form { padding: 16px; --glow: var(--accent-2); }
.field { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.input {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 5px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: rgba(5, 8, 22, 0.5);
  color: var(--text);
  font-size: 17px;              /* mind. 16px, sonst zoomt das iPhone */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--accent); }
select.input { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 22px center, right 16px center; background-size: 6px 6px; background-repeat: no-repeat; }
.form-buttons { display: flex; gap: 8px; }
.form-buttons .btn { flex: 1; }

.search { margin-top: 18px; }
.word-total { color: var(--faint); font-size: 14px; margin: 12px 4px 8px; }
.word-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.word-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px 10px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card-grad), var(--card-bg);
}
.word-text { flex: 1; min-width: 0; cursor: pointer; }
.word-es { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.word-de { color: var(--muted); font-size: 15px; }
.word-level { display: flex; gap: 4px; margin-top: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.dot.on { background: var(--accent); }
.word-delete {
  flex: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  font-size: 24px;
  cursor: pointer;
}
.word-delete:active { background: rgba(255, 255, 255, 0.08); }

/* ---------- Einstellungen ---------- */
.setting { padding: 18px; margin-bottom: 12px; }
.setting:nth-child(3) { --glow: var(--accent-2); }
.setting:nth-child(4) { --glow: var(--bad); }
.setting-label { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.setting-hint { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.setting .btn-ghost { margin-bottom: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Tab-Leiste ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: linear-gradient(0deg, rgba(5, 8, 22, 0.96), rgba(5, 8, 22, 0.82));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 9px 0 8px;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); font-weight: 600; }
body.learning .tabbar { display: none; }

/* ---------- Weniger Bewegung (Systemeinstellung) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .sparkles { display: none; }
}
