/* =========================================================================
   Deutsch-Artikel-Trainer — Design „Cosy Classroom“ (warm & freundlich)
   ========================================================================= */

:root {
  --bg-0: #fdfaf6;
  --bg-1: #fbf4ec;
  --bg-2: #f8eee4;

  --panel: #fffefc;
  --panel-solid: #fffefc;
  --panel-border: rgba(216, 192, 195, 0.30);
  --panel-border-strong: rgba(216, 192, 195, 0.52);

  --ink: #6d5c62;
  --ink-dim: #9b8b90;
  --ink-faint: #c1b5b8;

  --der: #6ba8e0;
  --der-soft: #eef5fc;
  --die: #e58aa2;
  --die-soft: #fdeef2;
  --das: #6cc3a6;
  --das-soft: #e9f6f0;

  --rose: #f3bdc9;
  --lavender: #d7c7ec;
  --mint: #b6ddce;
  --peach: #f7d4b8;
  --gold: #ecc483;
  --gold-soft: #fbf2de;

  --ok: #6cc3a6;
  --danger: #e58aa2;
  --cyan: #82b7c8;
  --purple: #c1aae0;

  --shadow: 0 8px 24px rgba(213, 185, 190, 0.15);
  --shadow-lg: 0 14px 38px rgba(213, 185, 190, 0.22);
  --shadow-btn: 0 5px 14px rgba(213, 178, 185, 0.22);

  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1000px 700px at 12% -8%, #ffe3ec 0%, transparent 55%),
    radial-gradient(900px 650px at 100% 4%, #e7e3ff 0%, transparent 50%),
    radial-gradient(1000px 750px at 50% 115%, #dff3ea 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-1), var(--bg-0) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Hintergrund-Canvas (schwebende Pastell-Blüten) */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.3px; color: var(--ink); }

/* ------------------- Buttons ------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--panel-border-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.08s ease, box-shadow 0.18s ease, filter 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(190, 140, 150, 0.12);
}
.btn:hover { box-shadow: var(--shadow-btn); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #f6c4cf, #ef9fae);
  border-color: #f3bdc9;
  color: #fff;
  box-shadow: 0 8px 20px rgba(240, 175, 188, 0.32);
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-ghost { background: #fffefc; border-color: var(--panel-border-strong); color: var(--ink-dim); }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: linear-gradient(180deg, #ef9fae, #e07d94); border-color: #ec94a6; color: #fff; }
.btn-gold {
  background: linear-gradient(180deg, #f5d49a, #ecc07a);
  border-color: #f2cd92;
  color: #7a5a24;
  box-shadow: 0 8px 20px rgba(236, 196, 131, 0.35);
}
.btn-sm { padding: 8px 15px; font-size: 13px; }

/* ------------------- Panels / Cards ------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ------------------- Login ------------------- */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 430px;
  padding: 42px 36px;
  text-align: center;
}
.logo-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}
.logo-title .der { color: var(--der); }
.logo-title .die { color: var(--die); }
.logo-title .das { color: var(--das); }
.logo-sub {
  color: var(--ink-dim);
  font-size: 15px;
  margin-bottom: 26px;
  letter-spacing: 1px;
}
.logo-emoji { font-size: 44px; margin-bottom: 6px; }

.field { margin-bottom: 14px; text-align: left; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  font-weight: 700;
}
.field input, .field select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1.5px solid var(--panel-border-strong);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(239, 159, 178, 0.25);
}
select {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--panel-border-strong);
  background: #fff; color: var(--ink);
  font-size: 15px; font-family: var(--font-body); outline: none;
}
.form-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
  margin: 4px 0 8px;
}
.login-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ------------------- Topbar / Header ------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 24px;
  position: sticky;
  top: 12px;
  z-index: 20;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(10px);
}
.topbar .logo { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.topbar .logo .der { color: var(--der); }
.topbar .logo .die { color: var(--die); }
.topbar .logo .das { color: var(--das); }
.topbar .spacer { flex: 1; }

/* Sprachumschalter (DE/EN) */
.lang-switch {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10000;
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 253, 249, 0.94);
  border: 1.5px solid var(--panel-border-strong);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-btn);
  backdrop-filter: blur(8px);
}
.lang-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.lang-btn:hover:not(.active) { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.lang-btn.active { color: #fff; background: var(--die); }

.user-pill { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, var(--rose), var(--lavender));
  color: #fff;
  box-shadow: 0 3px 10px rgba(190, 140, 150, 0.3);
}
.user-meta { line-height: 1.25; }
.user-meta .name { font-weight: 800; font-size: 15px; }
.user-meta .rank { font-size: 12px; color: var(--ink-dim); }

.xp-bar {
  height: 8px;
  border-radius: 6px;
  background: #f0e6e0;
  overflow: hidden;
  width: 130px;
}
.xp-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--lavender));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.streak-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.icon-btn {
  background: #fff;
  border: 1.5px solid var(--panel-border-strong);
  color: var(--ink-dim);
  width: 38px; height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 17px;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rose); }

/* ------------------- Stat-Row ------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card { padding: 16px 18px; text-align: center; }
.stat-card .val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}
.stat-card .lbl {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.4px;
  margin-top: 4px;
  font-weight: 700;
}
.stat-card .val.gold { color: var(--gold); }
.stat-card .val.cyan { color: var(--cyan); }
.stat-card .val.purple { color: var(--purple); }
.stat-card .val.green { color: var(--das); }
.stat-card .val.rose { color: var(--rose); }

/* ------------------- Section / Level-Karten ------------------- */
.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink-dim);
  letter-spacing: 0.5px;
  margin: 6px 0 16px;
  font-weight: 700;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.level-card {
  padding: 22px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.level-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.level-card .lvl-tag {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 2px;
}
.level-card .lvl-name { color: var(--ink-dim); font-size: 13px; margin-bottom: 14px; }
.level-card .progress {
  height: 10px; border-radius: 7px;
  background: #f0e6e0;
  overflow: hidden;
  margin: 8px 0 6px;
  position: relative;
}
.level-card .progress > span {
  display: block; height: 100%; border-radius: 7px;
  transition: width 0.5s ease;
}
.level-card .progress .marker {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--gold);
  opacity: 0.8;
}
.level-card .meta { font-size: 12px; color: var(--ink-faint); }
.level-card .play {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.gift-badge {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--gold-soft);
  color: #9a6a1f;
  border: 1px solid var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  animation: pop 0.5s ease;
}
.reward-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

/* Niveau-Farben (weiche Akzente) */
.lvl-a1 { color: #3fae8b; }
.lvl-a2 { color: #4a9bb5; }
.lvl-b1 { color: #e7a94e; }
.lvl-b2 { color: #f08a5d; }
.lvl-c1 { color: #e06282; }
.bar-a1 { background: linear-gradient(90deg, #7ccbb0, #4a9bb5); }
.bar-a2 { background: linear-gradient(90deg, #7cc4da, #6a97e0); }
.bar-b1 { background: linear-gradient(90deg, #f7c877, #f08a5d); }
.bar-b2 { background: linear-gradient(90deg, #f6a26f, #e8839a); }
.bar-c1 { background: linear-gradient(90deg, #e8839a, #b59bdb); }

/* ------------------- Game-Screen ------------------- */
#screen-game { max-width: 660px; margin: 0 auto; }
.game-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.game-topbar .quit {
  background: #fff; border: 1.5px solid var(--panel-border-strong);
  color: var(--ink-dim); width: 42px; height: 42px;
  border-radius: 12px; cursor: pointer; font-size: 18px;
  font-family: var(--font-body);
}
.game-topbar .quit:hover { color: var(--ink); border-color: var(--rose); }
.hearts { display: flex; gap: 5px; font-size: 24px; }
.heart { transition: transform 0.2s, opacity 0.2s, filter 0.2s; }
.heart.lost { opacity: 0.25; transform: scale(0.8); filter: grayscale(1); }
.combo-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}
.combo-pill.on { opacity: 1; }
.combo-pill.pop { animation: pop 0.25s ease; }
.score-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--cyan);
}

.q-progress {
  height: 10px; border-radius: 7px;
  background: #f0e6e0;
  overflow: hidden;
  margin-bottom: 26px;
}
.q-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--lavender));
  border-radius: 7px;
  transition: width 0.3s ease;
}

.q-card {
  padding: 34px 24px;
  text-align: center;
  margin-bottom: 26px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.q-card .q-level {
  position: absolute; top: 14px; right: 18px;
  font-family: var(--font-display); font-size: 13px;
  color: var(--ink-faint);
  font-weight: 700;
}
.q-card .noun {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  word-break: break-word;
  color: var(--ink);
}
.q-card .translation {
  font-size: 16px;
  color: var(--ink-dim);
  font-style: italic;
}
.q-card .hint-toggle {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-faint);
  background: none; border: none; cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-body);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.answer-btn {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  padding: 26px 8px;
  border-radius: 18px;
  border: 2px solid transparent;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(190, 140, 150, 0.12);
}
.answer-btn:active { transform: scale(0.96); }
.answer-btn.der { background: var(--der-soft); border-color: var(--der); color: var(--der); }
.answer-btn.die { background: var(--die-soft); border-color: var(--die); color: var(--die); }
.answer-btn.das { background: var(--das-soft); border-color: var(--das); color: var(--das); }
.answer-btn.der:hover { background: var(--der); color: #fff; box-shadow: 0 8px 22px rgba(74, 139, 212, 0.4); }
.answer-btn.die:hover { background: var(--die); color: #fff; box-shadow: 0 8px 22px rgba(224, 98, 130, 0.4); }
.answer-btn.das:hover { background: var(--das); color: #fff; box-shadow: 0 8px 22px rgba(63, 174, 139, 0.4); }
.answer-btn.correct-flash { background: var(--ok); color: #fff; border-color: var(--ok); box-shadow: 0 8px 26px rgba(63, 174, 139, 0.5); }
.answer-btn.wrong-flash { background: var(--danger); color: #fff; border-color: var(--danger); animation: shake 0.4s ease; }
.answer-btn.reveal-correct { background: var(--ok); color: #fff; border-color: var(--ok); }
.answer-btn.dimmed { opacity: 0.35; }
.answer-btn .kbd {
  display: block;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 700;
  opacity: 0.7;
  margin-top: 4px;
  letter-spacing: 0;
}

/* Feedback-Banner */
.feedback {
  text-align: center;
  min-height: 40px;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--danger); }
.feedback .small { font-size: 14px; font-weight: 600; color: var(--ink-dim); display: block; margin-top: 4px; letter-spacing: 0; }

/* ------------------- Summary ------------------- */
#screen-summary { max-width: 560px; margin: 0 auto; }
.summary-box { padding: 40px 32px; text-align: center; }
.summary-box .big {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 700;
  margin: 8px 0;
  color: var(--ink);
}
.summary-box .stars { font-size: 46px; margin: 10px 0 4px; letter-spacing: 6px; color: var(--gold); }
.summary-box .stars .off { opacity: 0.18; filter: grayscale(1); }
.summary-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.summary-rows .s-item { padding: 14px 8px; border-radius: var(--radius-sm); background: #fbf2ea; }
.summary-rows .s-val { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.summary-rows .s-lbl { font-size: 11px; color: var(--ink-dim); margin-top: 2px; font-weight: 700; }
.summary-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.xp-earned {
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
  animation: pop 0.4s ease;
}

/* Gutschein-Banner in der Zusammenfassung */
.reward-banner {
  margin: 18px 0 6px;
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gold-soft), #fff3df);
  border: 2px dashed var(--gold);
  animation: floatIn 0.5s ease;
}
.reward-banner .rb-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #9a6a1f;
}
.reward-banner .rb-sub { font-size: 14px; color: #a97b2f; margin-top: 4px; }

/* ------------------- Gutscheine (Belohnungen) ------------------- */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gift-card {
  border-radius: 20px;
  padding: 22px 20px;
  text-align: center;
  background: linear-gradient(160deg, #fffdf7, #fff5e6);
  border: 2px dashed var(--gold);
  position: relative;
  box-shadow: var(--shadow);
}
.gift-card .gift-emoji { font-size: 46px; }
.gift-card .gift-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 2px;
  color: #7a4f16;
}
.gift-card .gift-teacher { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.gift-card .gift-meta { font-size: 12px; color: var(--ink-dim); margin-top: 10px; }
.gift-card.locked {
  border-color: var(--panel-border-strong);
  background: #fbf6f0;
  filter: saturate(0.6);
}
.gift-card.locked .gift-emoji { filter: grayscale(1); opacity: 0.55; }
.gift-card.locked .gift-title { color: var(--ink-faint); }
.gift-card .progress { height: 8px; border-radius: 6px; background: #f0e6e0; overflow: hidden; margin-top: 12px; }
.gift-card .progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--peach)); }
.gift-card .gift-progress-label { font-size: 11px; color: var(--ink-faint); margin-top: 6px; font-weight: 700; }

/* ------------------- Feier-Overlay ------------------- */
.celebration {
  position: fixed; inset: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.celebration .celeb-card {
  max-width: 460px;
  width: 100%;
  padding: 34px 28px;
  text-align: center;
  animation: floatIn 0.45s ease;
  border: 3px solid var(--gold);
  background: linear-gradient(160deg, #fffdf7, #fff3df);
  box-shadow: var(--shadow-lg);
}
.celebration .gift-box {
  font-size: 76px;
  display: inline-block;
  animation: giftBounce 0.9s ease infinite;
}
.celebration .celeb-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: #7a4f16;
}
.celebration .celeb-sub { font-size: 15px; color: var(--ink-dim); margin-bottom: 8px; }
.celebration .celeb-gift {
  margin: 12px 0 18px;
  padding: 16px;
  border: 2px dashed var(--gold);
  border-radius: 16px;
  background: #fffdf7;
}

/* ------------------- Leaderboard ------------------- */
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #fbf6f0;
  border: 1px solid transparent;
}
.lb-row.me { border-color: var(--rose); background: #fdeef2; }
.lb-rank {
  font-family: var(--font-display);
  font-weight: 700;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  background: #f0e6e0;
  color: var(--ink-dim);
}
.lb-row:nth-child(1) .lb-rank { background: var(--gold); color: #fff; }
.lb-row:nth-child(2) .lb-rank { background: #c9cdd6; color: #fff; }
.lb-row:nth-child(3) .lb-rank { background: #e0a97a; color: #fff; }
.lb-name { flex: 1; font-weight: 800; }
.lb-sub { font-size: 12px; color: var(--ink-faint); }
.lb-xp { font-family: var(--font-display); color: var(--cyan); font-weight: 700; }

/* ------------------- Modal ------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(74, 53, 64, 0.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
}
.modal h2 { font-size: 20px; margin-bottom: 18px; }
.modal .close-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }

/* ------------------- Admin ------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}
.admin-side {
  padding: 16px;
  position: sticky;
  top: 16px;
}
.admin-side .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink-dim);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s;
  border: 1px solid transparent;
  width: 100%;
  background: none;
  text-align: left;
  font-family: var(--font-body);
}
.admin-side .nav-item:hover { color: var(--ink); background: #fbf3ee; }
.admin-side .nav-item.active { color: var(--ink); background: #fdeef2; border-color: var(--rose); }
.admin-side .nav-item .emoji { font-size: 17px; }

.admin-main { min-width: 0; }
.admin-section { animation: fadeIn 0.25s ease; }
.admin-section h2 { font-size: 22px; margin-bottom: 18px; }
.admin-section h2 .sub { font-size: 13px; color: var(--ink-dim); font-weight: 600; font-family: var(--font-body); margin-left: 10px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; }
thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--panel-border);
  font-weight: 700;
}
tbody tr { border-bottom: 1px solid #f3e8e0; }
tbody tr:hover { background: #fbf6f0; }

.article-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}
.article-tag.der { background: var(--der-soft); color: var(--der); }
.article-tag.die { background: var(--die-soft); color: var(--die); }
.article-tag.das { background: var(--das-soft); color: var(--das); }
.role-tag {
  display: inline-block; padding: 3px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.role-tag.admin { background: var(--gold-soft); color: #9a6a1f; }
.role-tag.user { background: #f0e9fb; color: var(--purple); }

/* Nationalflagge neben Namen */
.flag { display: inline-block; margin: 0 3px; font-size: 1.05em; line-height: 1; }

.row-actions { display: flex; gap: 8px; }
.row-actions button { font-size: 13px; }

.form-card { padding: 22px; margin-bottom: 20px; }
.form-card h3 { font-size: 16px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; justify-content: center; }
.pager span { color: var(--ink-dim); font-size: 14px; font-weight: 700; }

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  background: #fffdf9;
  border: 1.5px solid var(--panel-border-strong);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
  color: var(--ink);
}
.toast.ok { border-color: var(--das); color: var(--das); }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* ------------------- Animations ------------------- */
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes giftBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.08); }
}
.float-in { animation: floatIn 0.35s ease; }

/* ------------------- Rundenauswahl (Chips) ------------------- */
.round-picker { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-display);
  font-weight: 700;
  min-width: 40px;
  padding: 8px 0;
  text-align: center;
  border-radius: 12px;
  border: 1.5px solid var(--panel-border-strong);
  background: #fff;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.chip:hover { color: var(--ink); border-color: var(--rose); }
.chip.active {
  background: #fdeef2;
  border-color: var(--rose);
  color: var(--die);
  box-shadow: 0 4px 12px rgba(239, 159, 178, 0.35);
}

.q-card.wrong-flash { animation: shake 0.4s ease; }

/* ------------------- Maskottchen ------------------- */
.level-card .lvl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.mascot-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mascot-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #fdf4f1, #f6eef7);
  border: 1.5px solid var(--panel-border);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}
.mascot-circle .mascot-emoji { line-height: 1; }
.mascot-circle .mascot-acc {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.14));
  animation: pop 0.4s ease;
  pointer-events: none;
}
.mascot-circle .mascot-acc svg { width: 100%; height: 100%; display: block; }
.stage-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-dim);
}

.avatar.mascot {
  background: linear-gradient(160deg, #fdf4f1, #f6eef7);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
  position: relative;
}
.avatar.mascot .mascot-acc {
  position: absolute;
  top: -6px; right: -6px;
  width: 15px; height: 15px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.14));
  pointer-events: none;
}
.avatar.mascot .mascot-acc svg { width: 100%; height: 100%; display: block; }
.mascot-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-dim);
  background: #fbf2f0;
  border: 1px solid var(--panel-border);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Maskottchen-Auswahl */
.mascot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.mascot-choice {
  padding: 16px 10px;
  text-align: center;
  border-radius: 16px;
  border: 2px solid var(--panel-border);
  background: #fffefc;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.mascot-choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-btn); }
.mascot-choice.selected { border-color: var(--rose); background: #fdf0f4; box-shadow: 0 6px 16px rgba(243, 189, 201, 0.35); }
.mascot-choice .mascot-svg svg { width: 56px; height: 56px; }
.mascot-choice .name { font-family: var(--font-display); font-size: 13px; font-weight: 700; margin-top: 6px; color: var(--ink); }
.mascot-choice .check {
  position: absolute; top: 8px; right: 10px;
  color: var(--das); font-size: 16px; font-weight: 800;
}

/* SVG-Maskottchen skalieren */
.mascot-circle svg, .avatar.mascot svg { width: 100%; height: 100%; }
.mascot-pill svg { width: 16px; height: 16px; vertical-align: middle; }
.avatar.mascot { font-size: 0; }

/* ------------------- Timer ------------------- */
.timer-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: #fbf2f0;
  border: 1px solid var(--panel-border);
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ------------------- Verlauf ------------------- */
.hist-chip {
  background: #fbf2f0;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 16px;
  text-align: center;
  min-width: 80px;
}
.hist-chip .v { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); }
.hist-chip .l { font-size: 11px; color: var(--ink-dim); font-weight: 700; margin-top: 2px; }
.hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fbf6f0;
  border: 1px solid transparent;
}
.hist-row:hover { border-color: var(--panel-border-strong); }
.hist-idx {
  font-family: var(--font-display);
  font-weight: 700;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: #f0e6e0;
  color: var(--ink-dim);
  flex-shrink: 0;
}
.hist-main { flex: 1; min-width: 0; }
.hist-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hist-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.hist-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hist-acc { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.hist-acc.good { color: var(--das); }
.hist-acc.mid { color: var(--gold); }
.hist-acc.low { color: var(--die); }
.hist-time { font-size: 12px; color: var(--ink-dim); font-weight: 700; }

/* ------------------- Responsive ------------------- */
@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-side .nav-item { width: auto; }
  .answer-btn { font-size: 20px; padding: 20px 4px; }
  .q-card .noun { font-size: 34px; }
  .logo-title { font-size: 32px; }
  .summary-rows { grid-template-columns: 1fr 1fr; }
  .topbar { position: static; }
}

/* ------------------- Belohnungs-Banner ------------------- */
.reward-progress {
  padding: 16px 20px;
  margin-bottom: 22px;
  text-align: center;
  background: linear-gradient(135deg, #fffdf7, #fff3df);
  border: 2px dashed var(--gold);
}
.reward-progress .rp-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #7a4f16;
}
.reward-progress .rp-sub { font-size: 14px; color: #a97b2f; margin-top: 4px; }
.reward-progress .rp-count { font-size: 13px; color: #b08950; margin-top: 2px; font-weight: 700; }
.reward-progress .rp-bar { max-width: 360px; margin: 10px auto 0; }
.reward-progress .rp-bar > span { background: linear-gradient(90deg, var(--gold), var(--peach)); }
.reward-progress .rp-earned { color: var(--das); }
.reward-progress.earned { border-color: var(--gold); background: linear-gradient(135deg, #f1faf5, #fff7e6); }
.reward-progress.eligible { border-color: var(--gold); background: linear-gradient(135deg, #fff7e6, #fdf1f5); }
.gift-card.eligible { border-color: var(--gold); }

/* ------------------- Wörterliste (Drucken) ------------------- */
.print-header {
  text-align: center;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 14px;
}
.print-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.print-sub { font-size: 13px; color: var(--ink-dim); margin-top: 3px; }
.words-level { margin-bottom: 18px; }
.wl-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.wl-count { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.wl-list { line-height: 1.9; }
.word-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--panel-border);
  background: #fff;
  margin: 3px;
}
.word-pill.der { color: var(--der); background: var(--der-soft); border-color: var(--der); }
.word-pill.die { color: var(--die); background: var(--die-soft); border-color: var(--die); }
.word-pill.das { color: var(--das); background: var(--das-soft); border-color: var(--das); }

/* ------------------- Drucken ------------------- */
@media print {
  #bg-canvas,
  #screen-login, #screen-home, #screen-game, #screen-summary,
  #lb-modal, #rewards-modal, #history-modal, #mascot-modal, #celebration,
  .toast-wrap {
    display: none !important;
  }
  #words-modal {
    position: static !important;
    display: block !important;
    background: #fff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }
  #words-modal .modal {
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
  }
  #words-modal .close-row,
  #words-modal > .modal > h2,
  #words-modal > .modal > p {
    display: none !important;
  }
  .word-pill { break-inside: avoid; }
  .print-header { color: #000; }
  .print-title, .wl-title { color: #000; }
  .print-sub, .wl-count { color: #555; }
}

/* ------------------- Battles ------------------- */
.battle-btn { position: relative; }
.badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--die);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.badge.pulse { animation: badgePulse 1.2s ease-in-out infinite; }
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* Battle-Benachrichtigung (Home-Banner) */
.battle-alert {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #fff3f0, #fdeef6);
  border: 2px solid var(--die);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
  animation: alertPulse 2s ease-in-out infinite;
}
.battle-alert .ba-icon { font-size: 30px; line-height: 1; }
.battle-alert .ba-text { flex: 1; min-width: 0; }
.battle-alert .ba-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--die); }
.battle-alert .ba-sub { font-size: 13px; color: var(--ink-dim); margin-top: 2px; }

/* Klassen-Challenge */
.class-goal { margin-bottom: 14px; background: linear-gradient(135deg, #fff9ef, #fdf1f5); border: 1.5px solid var(--gold); }
.class-goal .cg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.class-goal .cg-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: #9a6a1f; }
.class-goal .cg-count { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--gold); }
.class-goal .cg-bar { height: 10px; border-radius: 6px; background: #f0e6e0; overflow: hidden; }
.class-goal .cg-bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--peach)); }
.class-goal .cg-sub { font-size: 13px; color: var(--ink-dim); margin-top: 6px; }
.class-goal.done { border-color: var(--das); background: linear-gradient(135deg, #f1faf5, #fff7e6); }
.class-goal.done .cg-count { color: var(--das); }
@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 138, 162, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(229, 138, 162, 0); }
}

.battle-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-dim);
  margin: 14px 0 8px;
}
.battle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbf6f0;
  border: 1px solid transparent;
  margin-bottom: 8px;
}
.battle-row:hover { border-color: var(--panel-border-strong); }
.battle-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fdf4f1, #f6eef7);
  border: 1.5px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.battle-avatar svg { width: 100%; height: 100%; }
.battle-main { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.battle-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.battle-result { font-family: var(--font-display); font-weight: 700; }

.battle-banner {
  margin: 14px 0 6px;
  padding: 16px;
  border-radius: 18px;
  background: #f3edfb;
  border: 2px dashed var(--lavender);
  animation: floatIn 0.5s ease;
}
.battle-banner .bb-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--purple);
}
.battle-banner .bb-sub { font-size: 14px; color: var(--ink-dim); margin-top: 4px; }

.lb-challenge {
  background: #fff;
  border: 1.5px solid var(--panel-border-strong);
  color: var(--ink-dim);
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.lb-challenge:hover { color: var(--die); border-color: var(--die); background: var(--die-soft); }

.challenge-levels { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.challenge-levels .chip { min-width: 56px; font-size: 16px; padding: 12px 0; }

/* =========================================================================
   Mobile (Handy) — kompakter, keine Überläufe, alles gut tippbar
   ========================================================================= */
@media (max-width: 640px) {
  /* Platz für den festen DE/EN-Umschalter oben rechts lassen */
  .wrap { padding: 46px 12px 56px; }

  /* Header: umbrechen & kompakter */
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; }
  .topbar .spacer { display: none; }
  .topbar .logo { font-size: 16px; }
  .user-pill { flex-basis: 100%; order: 10; gap: 8px; }
  .user-pill .user-meta .name { font-size: 14px; }
  .user-pill .user-meta .rank { font-size: 11px; }
  .avatar { width: 38px; height: 38px; }
  .btn { font-size: 13px; padding: 9px 14px; }

  /* Statistik-Karten: 2 pro Reihe */
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 12px 8px; }
  .stat-card .val { font-size: 22px; }

  /* Level-Karten: 1 pro Reihe */
  .level-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Spiel */
  .game-topbar { gap: 8px; }
  .game-topbar .quit { width: 38px; height: 38px; }
  .hearts { font-size: 20px; }
  .q-card { padding: 22px 16px; min-height: 130px; }
  .q-card .noun { font-size: 34px; }
  .answer-grid { gap: 10px; }
  .answer-btn { font-size: 19px; padding: 18px 4px; border-radius: 14px; }
  .answer-btn .kbd { font-size: 9px; }

  /* Zusammenfassung */
  .summary-box { padding: 26px 16px; }
  .summary-box .big { font-size: 40px; }
  .summary-box .stars { font-size: 32px; }
  .summary-rows { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .summary-rows .s-val { font-size: 18px; }

  /* Login */
  .login-box { padding: 28px 20px; }
  .logo-title { font-size: 28px; }

  /* Modals: fast volle Breite */
  .modal-backdrop { padding: 10px; }
  .modal { padding: 18px 14px; max-width: none; }
  .modal h2 { font-size: 17px; }

  /* Battle-Zeilen umbrechen */
  .battle-row { flex-wrap: wrap; }
  .battle-actions { width: 100%; justify-content: flex-start; }

  /* Sprachumschalter kompakter */
  .lang-switch { top: 8px; right: 8px; padding: 2px; }
  .lang-btn { padding: 5px 8px; font-size: 11px; }
}

/* ------------------- Aussprache (Lautsprecher) ------------------- */
.noun-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; }
.speak-btn {
  background: var(--der-soft);
  border: 1.5px solid var(--panel-border-strong);
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s, box-shadow 0.15s;
}
.speak-btn:hover { transform: scale(1.08); box-shadow: var(--shadow-btn); }
.speak-btn:active { transform: scale(0.94); }

/* ------------------- Erfolge (Badges) ------------------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.ach-card {
  padding: 16px 12px;
  border-radius: 16px;
  text-align: center;
  background: #fbf6f0;
  border: 1.5px solid var(--panel-border);
}
.ach-card.earned { background: linear-gradient(160deg, #fffdf4, #fff5e6); border-color: var(--gold); }
.ach-card .ach-icon { font-size: 30px; }
.ach-card .ach-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-top: 6px; color: var(--ink); }
.ach-card .ach-desc { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.ach-card:not(.earned) .ach-icon { filter: grayscale(1); opacity: 0.5; }
.ach-card:not(.earned) .ach-name { color: var(--ink-faint); }

/* ------------------- Tages-Quests ------------------- */
.quest-btn { position: relative; }
.quest-list { display: flex; flex-direction: column; gap: 12px; }
.quest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fbf6f0;
  border: 1.5px solid var(--panel-border);
}
.quest-card.done { border-color: var(--gold); background: linear-gradient(160deg, #fffdf4, #fff5e6); }
.quest-icon { font-size: 28px; flex-shrink: 0; }
.quest-main { flex: 1; min-width: 0; }
.quest-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.quest-desc { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.quest-progress { height: 8px; border-radius: 5px; background: #f0e6e0; overflow: hidden; margin-top: 8px; }
.quest-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--peach)); border-radius: 5px; transition: width 0.3s; }
.quest-meta { font-size: 11px; color: var(--ink-faint); font-weight: 700; margin-top: 4px; }
.quest-action { flex-shrink: 0; }
.quest-claimed { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--das); white-space: nowrap; }

/* SRS-Wiederholungs-Badge (Spiel) */
.review-badge {
  font-size: 11px;
  font-weight: 800;
  color: #b8860b;
  background: #fff7e6;
  border: 1px solid #f0d9a8;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: center;
}

/* Hausaufgaben (Schüler-Startseite) */
.homework-panel { margin-bottom: 18px; }
.hw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbf6f0;
  border: 1.5px solid var(--panel-border);
  margin-top: 10px;
}
.hw-item.done { border-color: var(--das); background: #f2faf4; }
.hw-item.done .hw-title { color: var(--das); }
.hw-main { flex: 1; min-width: 0; }
.hw-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.hw-meta { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.hw-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hw-side .progress { height: 8px; border-radius: 6px; background: #f0e6e0; overflow: hidden; width: 90px; }
.hw-side .progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--das), var(--gold)); }
.hw-count { font-size: 12px; color: var(--ink-dim); font-weight: 700; white-space: nowrap; }

/* ===== Beispielsätze & Artikel-Regeln ===== */
.sent-art { font-weight: 800; }
.sent-art.der { color: var(--der); }
.sent-art.die { color: var(--die); }
.sent-art.das { color: var(--das); }

.q-card .sentence {
  margin-top: 10px;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.5;
}
.fb-sentence {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-top: 8px;
  letter-spacing: 0;
  line-height: 1.5;
}
.fb-rule {
  font-size: 14px;
  font-weight: 600;
  color: #6d4f9e;
  background: #f3edfb;
  border: 1px solid #e4d8f4;
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 10px;
  letter-spacing: 0;
  line-height: 1.5;
}

/* Fehler-Trainer */
.mistake-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.chip.mistake-toggle { padding: 8px 18px; min-width: 0; width: auto; }
.chip.mistake-toggle.active { background: #fff3e6; border-color: var(--gold); color: #9a6a1f; }

/* Artikel-Regeln (Modal) */
.rule-group { margin-bottom: 16px; }
.rule-group-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin-bottom: 6px; letter-spacing: 0.5px; }
.rule-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 14px; color: var(--ink); }
.rule-item .sent-art { min-width: 66px; font-family: var(--font-display); }
.rule-example { color: var(--ink-dim); }

/* Streak-Kalender */
.cal-months { display: flex; gap: 4px; margin-bottom: 4px; font-size: 10px; color: var(--ink-faint); height: 14px; overflow: hidden; }
.cal-months span { width: 12px; white-space: nowrap; }
.cal-grid { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.cal-week { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.cal-day { width: 12px; height: 12px; border-radius: 3px; background: #f1e8e8; }
.cal-day.l1 { background: #fbd6e0; }
.cal-day.l2 { background: #f7a8c0; }
.cal-day.l3 { background: #ef7ba0; }
.cal-day.future { background: transparent; border: 1px dashed #eee; box-sizing: border-box; }
.cal-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--ink-faint); }
.cal-sq { width: 12px; height: 12px; border-radius: 3px; background: #f1e8e8; }
.cal-legend .cal-sq:nth-of-type(2) { background: #fbd6e0; }
.cal-legend .cal-sq:nth-of-type(3) { background: #f7a8c0; }
.cal-legend .cal-sq:nth-of-type(4) { background: #ef7ba0; }
#streak-badge { cursor: pointer; }

/* Inaktivitäts-Ampel (Admin) */
.act-badge { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.act-badge.act-ok { background: #e3f5ec; color: #2c8a5f; }
.act-badge.act-warn { background: #fff3e0; color: #b57a1f; }
.act-badge.act-bad { background: #fde6e6; color: #c0392b; }
.act-badge.act-never { background: #f0f0f0; color: #999; }

/* Artikel-Verwechslungen (Admin) */
.conf-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.conf-pair { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; min-width: 118px; font-size: 14px; }
.conf-bar { flex: 1; height: 10px; background: #f2ecec; border-radius: 6px; overflow: hidden; }
.conf-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); border-radius: 6px; }
.conf-count { min-width: 44px; text-align: right; font-size: 13px; color: var(--ink-dim); font-weight: 700; }

