/* Lexio – Bubblegum-Pop: Plum-Umrisse, harte Schatten nur bei Bedienbarem, Inhalte ruhig und flach. */

:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #ecebf4;
  --text: #2b0f3f;
  --muted: #756e8a;
  --line: #e5e3ee;
  --outline: #2b0f3f;

  --pink: #e01b78;
  --pink-soft: #ffd1e6;
  --on-pink: #ffffff;
  --lilac: #c7b5ff;
  --lilac-soft: #e8e0ff;
  --lilac-ink: #4a2a9a;
  --mint: #2fd6a0;
  --mint-soft: #cff7e8;
  --mint-ink: #0b6b4e;
  --lemon: #ffd84a;
  --lemon-soft: #fff1b8;
  --lemon-ink: #6b4d00;
  --coral-soft: #ffdad4;
  --coral-ink: #a8281c;

  --pop: 0 4px 0 var(--outline);
  --nav-height: 72px;
}

/* Dunkel: folgt dem Gerät, außer der Nutzer hat Hell gewählt; oder der Nutzer hat Dunkel gewählt. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121f;
    --surface: #221b30;
    --surface-2: #2f2640;
    --text: #fff1f8;
    --muted: #b9b2cc;
    --line: #3a3150;
    --outline: #0d0416;

    --pink: #ff4fa0;
    --pink-soft: #5a1d45;
    --on-pink: #2b0f3f;
    --lilac-soft: #3a2a6a;
    --lilac-ink: #d9ccff;
    --mint-soft: #124a3b;
    --mint-ink: #7ff0c8;
    --lemon-soft: #4d3f0b;
    --lemon-ink: #ffe27a;
    --coral-soft: #55211b;
    --coral-ink: #ffb0a6;
  }
}
:root[data-theme="dark"] {
  --bg: #16121f;
  --surface: #221b30;
  --surface-2: #2f2640;
  --text: #fff1f8;
  --muted: #b9b2cc;
  --line: #3a3150;
  --outline: #0d0416;

  --pink: #ff4fa0;
  --pink-soft: #5a1d45;
  --on-pink: #2b0f3f;
  --lilac-soft: #3a2a6a;
  --lilac-ink: #d9ccff;
  --mint-soft: #124a3b;
  --mint-ink: #7ff0c8;
  --lemon-soft: #4d3f0b;
  --lemon-ink: #ffe27a;
  --coral-soft: #55211b;
  --coral-ink: #ffb0a6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px calc(var(--nav-height) + 40px);
}

h1 { font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 16px; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; margin: 28px 0 10px; }
a { color: var(--pink); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

/* Kopfzeile */
.top-bar { padding: 14px 16px 0; }
.top-bar-inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; color: var(--pink); text-decoration: none;
}
.brand::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 3px; border-radius: 50%; background: var(--lemon); border: 2px solid var(--outline); }
.top-bar-actions { display: flex; gap: 16px; align-items: center; }
.top-link, .link-button {
  color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.inline-form { display: inline; margin: 0; }

/* Navigation: schwebende Pille */
.site-nav {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 28px), 520px); height: var(--nav-height);
  background: var(--surface); border: 2.5px solid var(--outline); border-radius: 22px; box-shadow: var(--pop);
  display: flex; align-items: center; gap: 4px; padding: 8px;
}
.nav-item {
  flex: 1; height: 100%; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 700;
}
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { background: var(--pink); color: var(--on-pink); }

/* Flächen */
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px;
}
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* Knöpfe: Sticker mit hartem Schatten, rasten beim Tippen ein */
.btn, button.btn, a.btn {
  display: inline-block; font: inherit; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer;
  padding: 12px 22px; border-radius: 14px; border: 2.5px solid var(--outline);
  background: var(--surface); color: var(--text); box-shadow: var(--pop);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active, .option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
.btn-primary { background: var(--pink); color: var(--on-pink); }
.btn-danger { color: var(--coral-ink); background: var(--coral-soft); }
.btn-small { padding: 6px 14px; border-radius: 10px; font-size: 0.85rem; box-shadow: 0 3px 0 var(--outline); }
.btn-big { display: block; width: 100%; font-size: 1.25rem; padding: 18px 22px; }

/* Formulare */
.form-group { margin-bottom: 14px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  width: 100%; font: inherit; font-weight: 500; padding: 13px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
textarea { min-height: 180px; resize: vertical; }

.error { background: var(--coral-soft); color: var(--coral-ink); padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.notice { background: var(--lilac-soft); color: var(--lilac-ink); padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.empty { text-align: center; padding: 32px 16px; }
.empty-emoji { font-size: 3.2rem; line-height: 1.2; }

/* Mastery-Pillen */
.pill { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 800; }
.pill-new { background: var(--lilac-soft); color: var(--lilac-ink); }
.pill-learning { background: var(--lemon-soft); color: var(--lemon-ink); }
.pill-almost { background: var(--pink-soft); color: var(--pink); }
.pill-mastered { background: var(--mint-soft); color: var(--mint-ink); }
.pill-problem { background: var(--coral-soft); color: var(--coral-ink); }

/* Balken */
.bar { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--pink); border-radius: 999px; }
.bar-good .bar-fill { background: var(--mint); }

/* Tabelle der Karten */
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 11px 6px; border-bottom: 1.5px solid var(--line); text-align: left; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.table tr.row-error td { background: var(--coral-soft); }
.table tr.row-duplicate td { background: var(--lemon-soft); }

/* Heute */
.greeting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 16px; }
.hello { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.chip {
  display: inline-block; padding: 7px 14px; border-radius: 10px; font-weight: 800; font-size: 0.92rem;
  background: var(--lemon); color: #3a2b00; border: 2.5px solid var(--outline); white-space: nowrap;
}

.hero {
  background: var(--pink); color: var(--on-pink); border: 2.5px solid var(--outline); border-radius: 22px;
  box-shadow: var(--pop); padding: 22px 20px 20px; margin-bottom: 18px;
}
.hero h2 { margin: 0 0 14px; font-size: 1.1rem; color: inherit; opacity: 0.92; }
.hero-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.count { text-align: left; }
.count strong { display: block; font-size: 3.4rem; line-height: 0.95; font-weight: 800; letter-spacing: -0.05em; }
.count span { font-size: 0.9rem; font-weight: 600; opacity: 0.95; }
.hero .notice { background: rgba(255, 255, 255, 0.22); color: inherit; }
.hero .btn-start { background: #fff; color: #2b0f3f; }

.level-card { display: flex; gap: 14px; align-items: center; }
.level-badge {
  flex: none; width: 66px; height: 66px; border-radius: 50%; background: var(--lemon); color: #3a2b00;
  border: 2.5px solid var(--outline); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; line-height: 1;
}
.level-badge small { font-size: 0.65rem; font-weight: 700; }
.level-badge strong { font-size: 1.7rem; letter-spacing: -0.03em; }
.level-main { flex: 1; }
.stat-row { display: flex; gap: 12px; }
.stat { flex: 1; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }

/* Battle: die Lernkarte ist das Auffällige */
.battle-progress { margin: 8px 0 20px; }
.flashcard {
  background: var(--lilac-soft); border: 2.5px solid var(--outline); border-radius: 24px; box-shadow: var(--pop);
  padding: 28px 20px 30px; margin-bottom: 22px; text-align: center; transform: rotate(-1.2deg);
}
.question-hint { color: var(--lilac-ink); font-weight: 700; margin: 0; }
.prompt {
  font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.04em;
  margin: 14px 0 4px; word-break: break-word; color: var(--text);
}
.options { display: grid; gap: 12px; }
.option {
  width: 100%; font: inherit; font-size: 1.2rem; font-weight: 800; padding: 16px 18px; border-radius: 16px; cursor: pointer;
  border: 2.5px solid var(--outline); background: var(--surface); color: var(--text); box-shadow: var(--pop);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.option:hover { background: var(--pink-soft); }
.answer-input { text-align: center; font-size: 1.5rem; font-weight: 800; border: 2.5px solid var(--outline) !important; }
.feedback { text-align: center; border: 2.5px solid var(--outline); border-radius: 22px; box-shadow: var(--pop); padding: 24px 18px; margin-bottom: 18px; }
.feedback-correct { background: var(--mint-soft); color: var(--mint-ink); }
.feedback-typo { background: var(--lemon-soft); color: var(--lemon-ink); }
.feedback-wrong { background: var(--coral-soft); color: var(--coral-ink); }
.feedback p { margin: 0 0 6px; }
.feedback-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.feedback-answer { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.summary { text-align: center; }
.summary-score { font-size: 3.6rem; font-weight: 800; letter-spacing: -0.05em; margin: 0; line-height: 1; }
.summary-xp { font-size: 1.6rem; font-weight: 800; color: var(--pink); margin: 10px 0; }
.celebrate { font-size: 3.4rem; }

/* Login */
.login-box { max-width: 380px; margin: 10vh auto 0; }
.login-logo { text-align: center; font-size: 3.4rem; font-weight: 800; letter-spacing: -0.05em; color: var(--pink); margin: 0 0 18px; }

@media (prefers-reduced-motion: reduce) {
  .btn, .option { transition: none; }
}
