:root {
  --bg: #eef4fb;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #6b7893;
  --brand: #2f6fed;
  --brand-dark: #1d4fb8;
  --good: #22a06b;
  --good-bg: #e3f7ee;
  --bad: #e5484d;
  --bad-bg: #fdecec;
  --warn: #f5a524;
  --dot: #ff7a45;
  --dot-hidden: #d7deea;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(31, 42, 68, 0.10);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(120deg, var(--brand), #6a5cff);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__title {
  font-size: clamp(18px, 3vw, 24px);
  margin: 0;
  font-weight: 800;
  flex: 1;
}
.topbar__title span { font-weight: 500; opacity: .85; }
.topbar__home {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.topbar__home:hover { background: rgba(255, 255, 255, 0.3); }
.topbar__score { display: flex; gap: 10px; font-weight: 800; }
.score__streak, .score__stars {
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.app { flex: 1; width: 100%; max-width: 940px; margin: 0 auto; padding: 20px 16px 40px; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
}

/* ---------- Name-Setup ---------- */
.name-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 360px;
  margin: 60px auto 0;
  text-align: center;
}
.name-setup__icon {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(47,111,237,.3));
}
.name-setup__title { margin: 0; font-size: clamp(22px, 5vw, 30px); }
.name-setup__sub   { margin: 0; color: var(--muted); font-size: 16px; }
.name-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 22px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  border: 3px solid #cdd7ea;
  border-radius: 14px;
  background: #f7f9fd;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.name-input:focus { border-color: var(--brand); background: #eef3ff; }
.name-input--shake { animation: shake .4s; }

/* Name-Edit-Button im Menü */
.name-edit {
  background: none;
  border: 0;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
  opacity: .45;
  transition: opacity .15s;
  vertical-align: middle;
  padding: 0 2px;
}
.name-edit:hover { opacity: 1; }

/* ---------- Vorschlag-Zeile ---------- */
.suggest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.suggest-row__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: linear-gradient(120deg, #fffbe6, #fff3d0);
  border: 2px solid #ffd97a;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, transform .06s;
}
.suggest-chip:hover { background: linear-gradient(120deg, #fff3cc, #ffe89a); transform: translateY(-1px); }

/* ---------- Fortschritt-Button im Menü ---------- */
.prog-open-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border: 2px solid #cdd7ea;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  margin-top: 4px;
}
.prog-open-btn:hover { background: #eef2f9; border-color: var(--brand); }

/* ---------- Fortschrittsübersicht ---------- */
.prog-header  { margin-bottom: 18px; }
.prog-title   { margin: 0; font-size: clamp(20px, 4vw, 26px); }
.prog-section { margin: 22px 0 10px; font-size: 15px; color: var(--muted); font-weight: 700; }

/* Fortschrittsbalken */
.prog-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
}
.prog-seg {
  flex: 1;
  height: 26px;
  border-radius: 6px;
  background: #dde4f0;
  transition: background .2s;
}
.prog-seg--bronze { background: #c8845a; }
.prog-seg--silver { background: #8fa0bb; }
.prog-seg--gold   { background: #d4a017; }
.prog-seg--blitz  { background: linear-gradient(135deg, #ffe01b, #ff9500); }

/* Medaillen-Zeile */
.prog-medals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.prog-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #f2f5fb;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 60px;
  flex: 1;
}
.prog-medal__icon  { font-size: 22px; line-height: 1; }
.prog-medal__count { font-size: 20px; font-weight: 900; color: var(--ink); }
.prog-medal__label { font-size: 11px; font-weight: 700; color: var(--muted); }
.prog-medal--none   .prog-medal__icon { color: var(--muted); }
.prog-medal--bronze .prog-medal__count { color: #9a5c2a; }
.prog-medal--silver .prog-medal__count { color: #5a6480; }
.prog-medal--gold   .prog-medal__count { color: #a07800; }
.prog-medal--blitz  .prog-medal__count { color: #ff9500; }

/* Detail-Grid */
.prog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.prog-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: transform .12s, box-shadow .12s;
}
.prog-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31,42,68,.14); }
.prog-card__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px; flex: none; color: #fff;
}
.prog-card__body  { flex: 1; min-width: 0; }
.prog-card__no    { font-size: 11px; font-weight: 700; color: var(--muted); }
.prog-card__title { font-size: 13px; font-weight: 800; line-height: 1.2; }
.prog-card__avg   { font-size: 11px; font-weight: 700; margin-top: 3px; }
.prog-card__avg--good { color: var(--good); }
.prog-card__avg--warn { color: var(--warn); }
.prog-card__avg--bad  { color: var(--bad); }
.prog-card__avg--none { color: var(--muted); font-style: italic; font-weight: 500; }
.prog-card__badge {
  position: absolute;
  top: -6px; right: -6px;
  font-size: 16px;
  line-height: 1;
}
.prog-card__badge--blitz {
  background: linear-gradient(135deg, #ffe01b, #ff9500);
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

/* ---------- Menü ---------- */
.intro {
  text-align: center;
  margin-bottom: 22px;
}
.intro h2 { margin: 6px 0; font-size: clamp(20px, 4vw, 28px); }
.intro p { color: var(--muted); margin: 4px auto; max-width: 620px; }

.world-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dde6f5;
}
.world-header:first-of-type { margin-top: 10px; }
.world-header__badge {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #6a5cff);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.world-header__info { display: flex; flex-direction: column; gap: 1px; }
.world-header__title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.world-header__desc  { font-size: 13px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.tile {
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit;
  color: inherit;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31,42,68,.16); }
.tile--suggested {
  box-shadow: 0 0 0 3px #ffd97a, var(--shadow);
}
.tile__body { flex: 1; min-width: 0; }
.tile__perf {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: .01em;
}
.tile__perf--good { color: var(--good); }
.tile__perf--warn { color: var(--warn); }
.tile__perf--bad  { color: var(--bad); }
.tile__perf--none { color: var(--muted); font-weight: 500; font-style: italic; }

.tile__icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 26px;
  flex: none;
  color: #fff;
}
.tile__no { font-size: 12px; font-weight: 700; color: var(--muted); }
.tile__title { font-weight: 800; font-size: 16px; line-height: 1.2; }
.tile__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Übungsansicht ---------- */
.ex {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 28px);
}
.ex__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ex__badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 24px; color: #fff; flex: none;
}
.ex__title { margin: 0; font-size: clamp(18px, 3vw, 22px); }
.ex__how { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }

/* Modus-Umschalter */
.mode-toggle {
  display: inline-flex;
  background: #eef2f9;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 12px;
}
.mode-toggle__btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mode-toggle__btn--active {
  background: var(--brand);
  color: #fff;
}
.mode-toggle__btn:not(.mode-toggle__btn--active):hover {
  background: #e2e8f4;
  color: var(--ink);
}

/* Statistik-Leiste */
.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.thr-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: .01em;
}
.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f2f5fb;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.stat__icon { font-size: 14px; }
.stat__val {
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}
.stat--last  .stat__val { color: var(--brand); }
.stat--count .stat__val { color: var(--good); }
.stat--total .stat__val { color: #8b5cf6; }
.stat--avg   .stat__val { color: var(--warn); }

.visual {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  overflow-x: auto;
}
.visual:empty { display: none; }

.question {
  text-align: center;
  font-size: clamp(17px, 3vw, 20px);
  font-weight: 600;
  margin: 14px 0 6px;
}
.equation {
  text-align: center;
  font-size: clamp(30px, 7vw, 46px);
  font-weight: 800;
  letter-spacing: 1px;
  margin: 6px 0 4px;
  color: var(--ink);
}
.equation .blank { color: var(--brand); }

/* Typ-Chips für Üb 3/7/9 im question-Bereich */
.eq-type {
  display: inline-block;
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 800;
  padding: 5px 18px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.eq-type--ones  { background: #e3f7ee; color: #22a06b; }
.eq-type--tens  { background: #e8eeff; color: #2f6fed; }
.eq-type--plus  { background: #e3f7ee; color: #22a06b; }
.eq-type--minus { background: #ffe8e8; color: #e5484d; }

/* Zahlenmauer */
.wall {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.wall__row          { display: flex; gap: 6px; }
.wall__row--top     { margin-left: 50px; }
.wall__row--mid     { margin-left: 25px; }
.wall__row--bot     { margin-left: 0; }
.wall__stone {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  border-radius: 8px;
  border: 2px solid transparent;
}
.wall__stone--given  { background: var(--card); border-color: #b0bcd6; color: var(--text); }
.wall__stone--target { background: #fef3c7; border: 2px dashed #f59e0b; color: #92400e; font-size: 22px; }
.wall__stone--hidden { background: #dde5f0; opacity: .45; }
.wall__stone--filled { background: #f0fdf4; border-color: #22a06b; border-style: solid; color: #15803d; }

/* Antwortfelder */
.answers {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0;
}
.answers__label { width: 100%; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: -4px; }
.abox {
  width: 74px;
  height: 74px;
  border: 3px solid #cdd7ea;
  border-radius: 14px;
  background: #f7f9fd;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  transition: border-color .12s, background .12s;
}
.abox--active { border-color: var(--brand); background: #eef3ff; box-shadow: 0 0 0 4px rgba(47,111,237,.15); }
.abox--good { border-color: var(--good); background: var(--good-bg); }
.abox--bad { border-color: var(--bad); background: var(--bad-bg); }

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 6px auto 4px;
}
.key {
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  padding: 16px 0;
  border: 0;
  border-radius: 14px;
  background: #eef2f9;
  color: var(--ink);
  cursor: pointer;
  transition: background .1s, transform .05s;
}
.key:hover { background: #e2e8f4; }
.key:active { transform: scale(.96); }
.key--wide { grid-column: span 1; }
.key--del { background: #fdecec; color: var(--bad); }
.key--next { background: #e7f0ff; color: var(--brand); }

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, transform .05s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: #eef2f9; color: var(--ink); }
.btn--ghost:hover { background: #e2e8f4; }

/* Feedback */
.feedback {
  text-align: center;
  min-height: 30px;
  font-size: 19px;
  font-weight: 800;
  margin-top: 12px;
}
.feedback--good { color: var(--good); }
.feedback--bad { color: var(--bad); }
.feedback--hint { color: var(--warn); font-weight: 600; font-size: 16px; }
.sol__answer { display: block; }
.sol__strategy {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.shake { animation: shake .4s; }

@keyframes pop {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.pop { animation: pop .35s; }

/* ---------- SVG Hilfsmittel ---------- */
.hf-dot { fill: var(--dot-hidden); }
.hf-dot--on { fill: var(--dot); }
.hf-dot--mul { fill: var(--brand); }
.hf-winkel { fill: none; stroke: #ff5a1f; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.hf-sep { stroke: #9fb0cc; stroke-width: 1.5; stroke-dasharray: 4 3; }
.nl-line { stroke: #9fb0cc; stroke-width: 3; }
.nl-tick { stroke: #9fb0cc; stroke-width: 2; }
.nl-tick--ten { stroke: #5c6e8f; stroke-width: 3; }
.nl-label { fill: #5c6e8f; font: 600 13px var(--font); text-anchor: middle; }
.nl-marker { fill: #ff5a1f; }
.nl-marker-label { fill: #ff5a1f; font: 800 16px var(--font); text-anchor: middle; }

.chart {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 460px;
}
.chart__cell {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  background: #f2f5fb;
  border-radius: 7px;
  font-weight: 700;
  font-size: clamp(10px, 2.4vw, 15px);
  color: #33405e;
}
.chart__cell--blank { background: #fbfcfe; color: transparent; border: 1px dashed #d3dbea; }
.chart__cell--target {
  background: #fff4e6;
  border: 3px solid #ff8c1a;
  color: transparent;
  box-shadow: 0 0 0 3px rgba(255,140,26,.18);
}

/* ---------- Tages-Streak-Banner ---------- */
.daily-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 20px;
  padding: 12px 20px;
  max-width: 480px;
  background: linear-gradient(120deg, #fff7e6, #fff0fa);
  border: 2px solid #ffe0a0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.daily-banner__icon { font-size: 22px; }
.daily-banner__text b { color: var(--warn); }
.daily-banner--today { border-color: #b8f0d4; background: linear-gradient(120deg, #f0fff8, #e8f5ff); }
.daily-banner--today .daily-banner__text b { color: var(--good); }

/* ---------- Level-Chip auf Kachel ---------- */
.tile__level {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 3px 0 2px;
  letter-spacing: .02em;
}
.tile__level--bronze { background: #f5ece0; color: #9a5c2a; }
.tile__level--silver { background: #eef0f4; color: #5a6480; }
.tile__level--gold   { background: #fef9e0; color: #a07800; }

/* ---------- Blitzrechner-Abzeichen auf Kachel ---------- */
.tile { position: relative; }
.tile__blitz {
  position: absolute;
  top: -8px; right: -8px;
  background: linear-gradient(135deg, #ffe01b, #ff9500);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255,149,0,.4);
  white-space: nowrap;
}

/* ---------- Blitzrechner Toast ---------- */
.blitz-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, #ffe01b, #ff9500);
  color: #fff;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 900;
  padding: 24px 40px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(255,149,0,.45);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  text-align: center;
}
.blitz-toast.show {
  animation: blitz-pop 2.2s ease forwards;
}
@keyframes blitz-pop {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  25%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  75%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* ---------- Persönlicher Rekord Toast ---------- */
.record-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, #22a06b, #2f6fed);
  color: #fff;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 900;
  padding: 20px 36px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(47, 111, 237, 0.4);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  text-align: center;
}
.record-toast.show { animation: blitz-pop 2.4s ease forwards; }

/* ---------- Konfetti-Nachricht ---------- */
.confetti-msg {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  color: #fff;
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 900;
  padding: 28px 44px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
  z-index: 201;
  pointer-events: none;
  text-align: center;
  line-height: 1.4;
  animation: confetti-msg 5s ease forwards;
}
.confetti-msg small { font-size: .55em; font-weight: 700; opacity: .92; }
@keyframes confetti-msg {
  0%   { transform: translate(-50%, -50%) scale(0);    opacity: 0; }
  10%  { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  18%  { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.9);   opacity: 0; }
}

/* ---------- Achievement Toast ---------- */
.ach-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #6a5cff, #2f6fed);
  color: #fff;
  padding: 12px 22px 12px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(47, 111, 237, .38);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}
.ach-toast.show { animation: ach-slide 2.4s ease forwards; }
.ach-toast__icon { font-size: 22px; }
.ach-toast__body { line-height: 1.3; }
.ach-toast__body b { font-size: 11px; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .05em; display: block; }
@keyframes ach-slide {
  0%   { opacity: 0; transform: translateX(-50%) translateY(30px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0);    }
  75%  { opacity: 1; transform: translateX(-50%) translateY(0);    }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ---------- Achievement-Grid in Fortschrittsübersicht ---------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.ach-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ach-card--locked {
  background: #f4f6fb;
  box-shadow: none;
  opacity: .45;
  filter: grayscale(1);
}
.ach-card__icon  { font-size: 28px; line-height: 1.2; }
.ach-card__title { font-size: 13px; font-weight: 800; color: var(--ink); }
.ach-card__desc  { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* stat--avg leuchtet auf wenn Blitz erreicht */
.stat--avg.blitz .stat__val { color: #ff9500; }
.stat--avg.blitz .stat__icon::after { content: " 🚀"; }

/* ---------- View Transitions (Chrome / Safari 18+) ---------- */
@keyframes vt-slide-out-left {
  to { transform: translateX(-28px); opacity: 0; }
}
@keyframes vt-slide-in-right {
  from { transform: translateX(28px); opacity: 0; }
}
@keyframes vt-slide-out-right {
  to { transform: translateX(28px); opacity: 0; }
}
@keyframes vt-slide-in-left {
  from { transform: translateX(-28px); opacity: 0; }
}

/* Menü → Übung (forward) */
[data-nav-dir="forward"]::view-transition-old(root) {
  animation: vt-slide-out-left 0.22s ease;
}
[data-nav-dir="forward"]::view-transition-new(root) {
  animation: vt-slide-in-right 0.22s ease;
}

/* Übung → Menü (back) */
[data-nav-dir="back"]::view-transition-old(root) {
  animation: vt-slide-out-right 0.22s ease;
}
[data-nav-dir="back"]::view-transition-new(root) {
  animation: vt-slide-in-left 0.22s ease;
}

@media (max-width: 520px) {
  .abox { width: 60px; height: 60px; font-size: 26px; }
  .app { padding: 14px 10px 30px; }
}
