/* Lernbahn – Kugelbahn & Blockwelt. Ruhig, klar, große Tippflächen fürs iPad. */
:root {
  --sky: #E8F1F7;
  --surface: #FFFFFF;
  --surface-2: #F2F7FB;
  --ink: #13212E;
  --ink-soft: #46586A;
  --ink-mute: #64788B;
  --line: #C4D6E3;
  --line-2: #B7CAD8;
  --grid: #DCE8F1;

  --blue: #1F5FA8;
  --blue-dark: #123E70;
  --blue-soft: #EAF2FB;
  --orange: #F28C28;
  --orange-dark: #C26A12;
  --orange-ink: #8F4700;
  --orange-soft: #FFF4E6;
  --teal: #127A60;
  --teal-dark: #0B5442;
  --teal-soft: #DDF3EC;
  --teal-block: #2A9D8F;
  --amber: #E0A100;
  --amber-ink: #6B4600;
  --amber-soft: #FFF6DB;
  --stone: #8FA3B3;
  --wood: #B7793F;
  --rail: #3B4A5A;
  --rail-light: #A9BDCD;

  --cell: 46px;
  --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
/* Leichter Tipp-Schimmer, damit jeder Tipp auf dem iPad sichtbar ankommt */
a, button { -webkit-tap-highlight-color: rgba(31, 95, 168, .12); }
button:disabled { cursor: default; }
/* Nur ausgeschiedene Knöpfe blassen ab – eine richtige Antwort bleibt klar sichtbar */
button:disabled:where(:not(.right)) { opacity: .45; }
.bo-line:disabled, .story .pick:disabled { opacity: 1; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
/* Tastatur-Fokus immer sichtbar, auch über Markierungs-Rahmen (z. B. vorgeschlagene Station) */
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue) !important; outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Grundbausteine ---------- */
.marble {
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFD9B0 0%, var(--orange) 45%, #B35A00 100%);
  box-shadow: 0 3px 5px rgba(19, 33, 46, .3);
}
.block {
  display: inline-block;
  border-radius: 5px;
  background: var(--c, var(--stone));
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, .35), inset -4px -4px 0 rgba(0, 0, 0, .22);
}
.card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--line);
  padding: 20px 22px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 800;
  padding: 5px 12px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-dark);
}
.chip.teal { background: var(--teal-soft); color: var(--teal-dark); }
.chip.orange { background: var(--orange-soft); color: var(--orange-ink); }
.chip.solid { background: var(--blue); color: #fff; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px;
  border: 0; border-radius: 12px;
  font-size: 19px; font-weight: 800; text-decoration: none;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 5px 0 var(--line-2);
  transition: transform .08s ease, box-shadow .08s ease;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line-2); }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 5px 0 var(--blue-dark); }
.btn.primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--blue-dark); }
.btn.go { background: var(--teal); color: #fff; box-shadow: 0 5px 0 var(--teal-dark); }
.btn.go:active:not(:disabled) { box-shadow: 0 2px 0 var(--teal-dark); }
.btn.outline { background: var(--surface); color: var(--blue); box-shadow: none; border: 2px solid var(--blue); min-height: 46px; font-size: 17px; }
.btn.outline:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--blue); min-height: 44px; padding: 8px 10px; font-size: 17px; }
.btn.big { min-height: 60px; font-size: 21px; }
.btn.choice { justify-content: flex-start; text-align: left; font-weight: 700; font-size: 18px; width: 100%; }
.btn.choice.right { background: var(--teal-soft); box-shadow: 0 5px 0 #8CC9B6; }
.btn.choice.wrong { background: var(--amber-soft); box-shadow: 0 5px 0 #E8CF8A; }
.btn.choice.selected { outline: 3px solid var(--orange); }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; max-width: 1280px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; letter-spacing: .3px; text-shadow: 2px 2px 0 #BFD6E6; text-decoration: none; color: var(--ink); }
.brand-logo { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.brand-logo .block { position: absolute; width: 20px; height: 20px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

main.screen { max-width: 1280px; margin: 0 auto; padding: 0 24px 40px; }

/* ---------- Startseite: Lernweg ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.home h1 { font-size: 30px; }
.map-wrap { position: relative; width: 100%; aspect-ratio: 748 / 530; margin-top: 4px; }
.map-wrap svg.track { position: absolute; inset: 0; width: 100%; height: 100%; }
.station-tile {
  position: absolute; transform: translate(-50%, -50%);
  width: 19%; min-width: 120px; min-height: 84px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  padding: 10px 12px; border: 0; border-radius: 12px; text-align: left;
  background: var(--surface); box-shadow: 0 6px 0 var(--line-2); color: var(--ink); text-decoration: none;
}
.station-tile .num { font-size: 13px; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.station-tile .name { font-size: 16px; font-weight: 800; line-height: 1.2; }
.station-tile.done { background: var(--teal-soft); box-shadow: 0 6px 0 #8CC9B6; }
.station-tile.done .num { color: var(--teal-dark); }
.station-tile.next { background: var(--orange-soft); outline: 3px solid var(--orange); animation: glow 2.6s ease-in-out infinite; }
.station-tile.next .num { color: var(--orange-ink); }
.station-tile:active { transform: translate(-50%, -50%) translateY(3px); }
.map-marble { position: absolute; transform: translate(-50%, -50%); animation: hop 1.6s ease-in-out infinite; }
.side { display: flex; flex-direction: column; gap: 16px; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-item { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.35; }
.num-block { flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 15px; font-weight: 800; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .25); }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); line-height: 1.2; }
.badge .block { width: 44px; height: 44px; }
.badge .empty { width: 44px; height: 44px; border-radius: 6px; border: 3px dashed var(--line-2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-mute); }

/* ---------- Station & Aufgabe ---------- */
.station-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.station-head h1 { font-size: 24px; }
.task-dots { display: flex; gap: 6px; margin-left: auto; }
.task-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--line); }
.task-dot.done { background: var(--teal-block); }
.task-dot.now { background: var(--orange); }

.denkplan { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.dp-step {
  flex: 1 1 0; min-width: 0; height: 52px; border-radius: 10px; padding: 0 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 3px solid var(--surface);
  transition: background .3s, border-color .3s;
}
.dp-step .num-block { width: 26px; height: 26px; font-size: 14px; background: var(--ink-mute); }
.dp-step .label { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-step.done { background: var(--teal-soft); border-color: var(--teal-soft); }
.dp-step.done .num-block { background: var(--teal); }
.dp-step.now { background: var(--orange-soft); border-color: var(--orange); }
.dp-step.now .num-block { background: var(--orange-ink); }
.dp-step.halt { background: var(--amber-soft); border-color: var(--amber); }
.dp-step.halt .num-block { background: #8A5A00; }
.dp-step.off { opacity: .45; }
.dp-step .marble { margin-left: auto; }
.dp-frage { margin: -8px 0 14px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }

.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.work { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }

.bubble { font-size: 20px; line-height: 1.45; }
.bubble .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bubble.weiche { border: 3px solid var(--amber); box-shadow: 0 6px 0 #E8CF8A; }
.weiche-title { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.weiche-title b { font-size: 19px; }
.feedback { border-radius: 10px; padding: 10px 14px; font-size: 17px; line-height: 1.45; }
.feedback.good { background: var(--teal-soft); }
.feedback.info { background: var(--surface-2); }
.feedback.halt { background: var(--amber-soft); }
.feedback.ki { background: #F1ECFB; }
.feedback .who { display: block; font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-bottom: 2px; }

.reihe { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.reihe .block { min-width: 46px; height: 46px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; --c: var(--teal); }
.reihe .block.yes { --c: var(--teal); }
.reihe .block.no { --c: #D3E0EA; color: var(--ink-soft); }
.reihe .block.mark { --c: var(--orange); color: var(--ink); }

/* ---------- Zahlenfeld ---------- */
.numpad { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; user-select: none; -webkit-user-select: none; }
.numpad button {
  height: 58px; border: 0; border-radius: 12px; font-size: 26px; font-weight: 800;
  background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 var(--line-2);
}
.numpad button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line-2); }
.numpad button.del { background: #E3ECF3; font-size: 20px; }
.numpad button.ok { background: var(--teal); color: #fff; box-shadow: 0 5px 0 var(--teal-dark); font-size: 21px; }

/* ---------- Kästchen-Rechnung ---------- */
.divgrid, .numpad, .bo-sheet, .slots, .tiles, .machine, .cards { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sheet { overflow: auto; max-height: 64vh; border-radius: 10px; -webkit-overflow-scrolling: touch; }
.divgrid {
  position: relative;
  background-color: #fff;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: 0 26px;
  border-radius: 8px;
}
.g-label { position: absolute; top: 3px; width: var(--cell); text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-mute); }
.g-cell {
  position: absolute; width: var(--cell); height: var(--cell);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cell) * .64); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
}
.g-cell.op { color: var(--ink-mute); }
.g-cell.typed { color: var(--blue); }
.g-cell.digit-btn { border: 0; background: transparent; border-radius: 8px; padding: 0; }
.g-cell.digit-btn.pickable { background: var(--orange-soft); box-shadow: inset 0 0 0 2px var(--orange); }
.g-cell.digit-btn.hint { animation: pulse 1.4s ease-in-out infinite; }
.g-head { position: sticky; top: 0; z-index: 2; box-shadow: 0 3px 0 rgba(19, 33, 46, .06); }
.g-cell.digit-btn.picked { background: var(--blue-soft); box-shadow: inset 0 0 0 3px var(--blue); }
.g-used { position: absolute; height: 4px; border-radius: 2px; background: var(--teal-block); }
.g-line { position: absolute; height: 3px; border-radius: 2px; background: var(--ink); }
.g-hi { position: absolute; height: var(--cell); border-radius: 8px; background: rgba(242, 140, 40, .18); border: 2px solid rgba(242, 140, 40, .75); }
.g-slot { position: absolute; height: calc(var(--cell) - 6px); border-radius: 8px; border: 3px solid var(--orange); background: rgba(255, 244, 230, .7); animation: pulse 2s ease-in-out infinite; }
.g-slot.err { border-color: var(--amber); background: rgba(255, 246, 219, .8); animation: breathe 2.4s ease-in-out infinite; }
.g-qbox { position: absolute; width: calc(var(--cell) - 6px); height: calc(var(--cell) - 6px); border-radius: 7px; border: 2px dashed #9FB3C4; background: #fff; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .6); font-weight: 800; color: var(--blue); }
.g-qbox.filled { border-style: solid; border-color: var(--blue); background: var(--blue-soft); }
.g-qbox.active { border: 3px solid var(--orange); animation: pulse 2s ease-in-out infinite; }
.g-qbox.err { border: 3px solid var(--amber); background: var(--amber-soft); color: var(--amber-ink); }
.g-arrow { position: absolute; width: 0; border-left: 3px dashed var(--orange); transform-origin: top; animation: grow .7s ease-out both; }
.g-note { position: absolute; font-size: 14px; font-weight: 800; padding: 3px 9px; border-radius: 8px; background: var(--amber-soft); color: var(--amber-ink); white-space: nowrap; }
.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.flash-ok { animation: flashok .9s ease-out both; }

.estimate { font-size: 16px; color: var(--ink-soft); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.estimate b { color: var(--ink); }

/* ---------- Looping-Anzeige ---------- */
.loop { display: flex; align-items: center; gap: 16px; }
.loop-ring { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.loop-ring svg { position: absolute; inset: 0; }
.loop-ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.loop-ring .center b { font-size: 19px; }
.loop-ring .center span { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.loop-ring .marble { position: absolute; transition: left .6s cubic-bezier(.4, 0, .2, 1), top .6s cubic-bezier(.4, 0, .2, 1); }
.loop-ring.spin svg { animation: spin .9s cubic-bezier(.5, 0, .3, 1); }
.loop-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.loop-steps li { display: flex; align-items: center; gap: 8px; }
.loop-steps li i { width: 12px; height: 12px; border-radius: 3px; background: #D3E0EA; }
.loop-steps li.now { color: var(--orange-ink); font-weight: 800; }
.loop-steps li.now i { background: var(--orange); }

/* ---------- Probe (Malnehmen) ---------- */
.multgrid .carry { position: absolute; font-size: calc(var(--cell) * .36); font-weight: 800; color: var(--orange-ink); }

/* ---------- Karten & Plättchen ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; container-type: inline-size; }
.num-card { min-height: 90px; padding: 0 8px; font-size: 30px; font-size: clamp(18px, 4.2cqi, 30px); font-weight: 800; border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 6px 0 var(--line-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@supports not (container-type: inline-size) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
.num-card.right { background: var(--teal-soft); box-shadow: 0 6px 0 #8CC9B6; }
.num-card.wrong { background: var(--amber-soft); box-shadow: 0 6px 0 #E8CF8A; }
.tiles { display: flex; gap: 12px; flex-wrap: wrap; }
.tile { width: 64px; height: 64px; border: 0; border-radius: 10px; font-size: 32px; font-weight: 800; color: #fff; --c: var(--wood); background: var(--c); box-shadow: inset 5px 5px 0 rgba(255, 255, 255, .3), inset -5px -5px 0 rgba(0, 0, 0, .22), 0 4px 0 rgba(0, 0, 0, .15); }
.tile.used { opacity: .25; }
.slots { display: flex; align-items: center; gap: 10px; font-size: 34px; font-weight: 800; flex-wrap: wrap; }
.slot { width: 68px; height: 68px; border-radius: 12px; border: 3px dashed var(--line-2); background: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.slot.filled { border-style: solid; border-color: var(--wood); }
.slot.focus { border-color: var(--orange); border-style: solid; }

.big-task { font-size: 30px; font-weight: 800; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.answer-input {
  font-size: 30px; font-weight: 800; padding: 8px 14px; min-width: 220px; min-height: 60px;
  border-radius: 12px; border: 3px solid var(--line-2); background: #fff; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center;
}
.answer-input.active { border-color: var(--orange); }
.answer-input .ph { color: var(--ink-mute); font-weight: 600; font-size: 20px; }
textarea.own { width: 100%; min-height: 96px; border-radius: 12px; border: 3px solid var(--line-2); padding: 10px 12px; font-size: 18px; resize: vertical; }
input.name { font-size: 22px; padding: 10px 14px; border-radius: 12px; border: 3px solid var(--line-2); width: 100%; }

.story { font-size: 21px; line-height: 1.85; }
.story .pick { position: relative; border: 0; padding: 0 6px; border-radius: 6px; background: var(--blue-soft); font-weight: 800; line-height: 1.5; }
.story .pick::after { content: ''; position: absolute; inset: -7px -3px; }
.story .pick.right { background: var(--teal-soft); }
.story .pick.wrong { background: var(--amber-soft); }

/* Fehler-Detektiv: Bos Rechnung, jede Zeile antippbar */
.bo-sheet { display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.bo-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 0; text-align: left; font-size: 20px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.bo-line.right { background: var(--teal-soft); }
.bo-line.wrong { background: var(--amber-soft); }

/* ---------- Kugel-Verteilmaschine ---------- */
.machine { position: relative; width: 100%; max-width: 500px; aspect-ratio: 600 / 470; margin: 0 auto; }
.machine svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.machine .lane { position: absolute; bottom: 6%; height: 61%; border: 4px solid var(--rail); border-top: 0; border-radius: 10px 10px 14px 14px; background: var(--surface-2); }
.machine .lane-label { position: absolute; bottom: -2%; transform: translateX(-50%); font-size: 16px; font-weight: 800; color: var(--teal-dark); white-space: nowrap; }
.machine .marble { position: absolute; transform: translate(-50%, -50%); }

/* ---------- Feier ---------- */
.overlay { position: fixed; inset: 0; background: rgba(19, 33, 46, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.celebrate { max-width: 480px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.celebrate .tower { position: relative; height: 120px; width: 160px; }
.celebrate .tower .block { position: absolute; width: 44px; height: 44px; }

/* ---------- Für Erwachsene ---------- */
.eltern table { width: 100%; border-collapse: collapse; font-size: 16px; }
.eltern th, .eltern td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.eltern th { font-size: 14px; color: var(--ink-soft); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.login input { font-size: 22px; padding: 12px 14px; border-radius: 12px; border: 3px solid var(--line-2); width: 100%; }
.login input:focus { border-color: var(--orange); outline: none; }

/* ---------- Bewegung ---------- */
@keyframes hop { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 9px)); } }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 #C98A3A, 0 0 0 4px rgba(242, 140, 40, .35); } 50% { box-shadow: 0 6px 0 #C98A3A, 0 0 0 10px rgba(242, 140, 40, .1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(242, 140, 40, .45); } 50% { box-shadow: 0 0 0 8px rgba(242, 140, 40, .12); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 3px rgba(224, 161, 0, .55); } 50% { box-shadow: 0 0 0 8px rgba(224, 161, 0, .15); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes flashok { 0% { background: rgba(42, 157, 143, .35); } 100% { background: transparent; } }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fadein { animation: fadein .45s ease-out both; }

body.ruhig *, body.ruhig *::before, body.ruhig *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Kleinere Bildschirme (iPad hochkant, Handy) ---------- */
@media (max-width: 1100px) {
  .task-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 960px) {
  .home, .task-layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .sheet { max-height: 44vh; }
  /* Denkplan hochkant: alle Namen sichtbar, dafür ohne Nummer */
  .dp-step { padding: 0 8px; gap: 6px; justify-content: center; }
  .dp-step .num-block { display: none; }
  .dp-step .label { font-size: clamp(14px, 2vw, 15px); }
  .dp-step.now, .dp-step.halt { flex: 1.25 1 0; justify-content: flex-start; }
}
@media (max-width: 700px) {
  body { font-size: 17px; }
  .topbar, main.screen { padding-left: 16px; padding-right: 16px; }
  .topbar { flex-wrap: wrap; }
  .topbar .chip { display: none; }
  .brand { font-size: 22px; }
  /* Denkplan auf dem Handy: Nummern, nur der aktuelle Schritt mit Namen */
  .dp-step { padding: 0 5px; }
  .dp-step .num-block { display: inline-flex; }
  .dp-step .label, .dp-step .marble { display: none; }
  .dp-step.now .label, .dp-step.halt .label { display: inline; }
  .dp-step.now, .dp-step.halt { flex: 3 1 0; }
  .map-wrap { aspect-ratio: auto; display: flex; flex-direction: column; gap: 12px; }
  .map-wrap svg.track, .map-marble { display: none; }
  .station-tile { position: static; transform: none; width: 100%; }
  .station-tile:active { transform: translateY(3px); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .num-card { font-size: 28px; }
  .numpad button { height: 52px; font-size: 22px; }
  .bubble { font-size: 18px; }
  .big-task { font-size: 24px; }
}
