/* Zahlenreich – kindgerechte Oberfläche fürs iPad */
:root {
  --ink: #2b2350;
  --ink-soft: #6b6390;
  --card: #ffffff;
  --card-2: #f6f3ff;
  --line: #e6e0fa;
  --primary: #7c4dff;
  --primary-dark: #5a2fe0;
  --accent: #ffb703;
  --accent-dark: #f08c00;
  --good: #22b573;
  --good-soft: #d9f7e8;
  --bad: #ff7a7a;
  --bad-soft: #ffe6e6;
  --sky: #4cc9f0;
  --pink: #ff70a6;
  --radius: 26px;
  --radius-s: 16px;
  --shadow: 0 6px 0 rgba(43, 35, 80, .12), 0 12px 28px rgba(43, 35, 80, .10);
  --shadow-s: 0 3px 0 rgba(43, 35, 80, .12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  --home-bg: linear-gradient(180deg, #bfe9ff 0%, #e8f8ff 55%, #c8f0b0 55%, #9ddc7a 100%);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #eef6ff;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font-family: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
input, select { font-family: inherit; font-size: 1.1rem; }
input { -webkit-user-select: text; user-select: text; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.pad { padding: 16px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.center { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.hidden { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* iPhone: Schrift im Querformat nicht automatisch vergrößern */

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  min-height: 64px;
}
.topbar h1 { font-size: 1.6rem; margin: 0; flex: 1; text-align: center; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--card); box-shadow: var(--shadow-s); font-size: 1.6rem;
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.stars {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border-radius: 999px; padding: 8px 16px 8px 12px;
  font-weight: 800; font-size: 1.3rem; box-shadow: var(--shadow-s); color: var(--ink);
}
.stars .s { font-size: 1.4rem; }
.stars.bump { animation: bump .4s ease; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: var(--radius-s); padding: 16px 26px;
  font-size: 1.3rem; font-weight: 800; background: var(--primary); color: #fff;
  box-shadow: 0 5px 0 var(--primary-dark); transition: transform .06s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-dark); }
.btn.big { font-size: 1.7rem; padding: 22px 36px; border-radius: var(--radius); }
.btn.accent { background: var(--accent); color: #4a2d00; box-shadow: 0 5px 0 var(--accent-dark); }
.btn.good { background: var(--good); box-shadow: 0 5px 0 #168a56; }
.btn.light { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn.danger { background: #e5484d; color: #fff; box-shadow: 0 5px 0 #b3363a; }
.btn.light.danger { background: var(--card); color: #c0392b; box-shadow: 0 5px 0 var(--line); }
.btn.small-btn { padding: 8px 14px; font-size: .95rem; }
.btn.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn:disabled { opacity: .5; }
/* Belohnung erst ansehen: Weiter kurz blass (holdButtons), ohne Countdown */
.btn.hold { opacity: .35; filter: grayscale(.7); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* ---------- Home ---------- */
.scr-home { background: var(--home-bg); }
.scr-home.dark { color: #fff; }
.scr-home.dark .muted { color: #d8d2ff; }
.home-main {
  flex: 1; display: grid; gap: 18px; padding: 8px 20px 20px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 0;
}
@media (orientation: portrait), (max-width: 760px) {
  .home-main { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; padding-bottom: 70px; }
  .home-main .tiles { overflow: visible; }
}
.hero { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.mascot { position: relative; font-size: 120px; line-height: 0; display: inline-block; padding-top: .18em; filter: drop-shadow(0 8px 0 rgba(0,0,0,.08)); }
/* Maskottchen als festes Bild (mascots.js): Bild 1 em × 1 em, Anziehsachen in % darüber */
.mbox { position: relative; display: inline-block; width: 1em; height: 1em; vertical-align: middle; isolation: isolate; }
.mbox .base { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.mbox .base.emoji { display: flex; align-items: center; justify-content: center; line-height: 1; }
.mbox .w { position: absolute; height: auto; max-width: none; z-index: 2; pointer-events: none; }
.mbox .ov { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mbox .ov svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mimg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.18em; }
.mimg.emoji { width: auto; height: auto; }
/* Deko: links oben, immer hinter dem Maskottchen. Begleiter: rechts unten daneben, ohne Überlappung (17.11.2026).
   --ml/--mr = linker/rechter Rand des sichtbaren Tiers (0–1, mascotEl). Prozent beziehen sich auf die Breite des Maskottchens. */
.mascot .mbox { z-index: 1; }
.mascot .deco { position: absolute; left: calc(var(--ml, 0) * 100% - .6em); top: -.12em; font-size: .6em; line-height: 1; z-index: 0; pointer-events: none; }
.mascot .pet { position: absolute; left: calc(var(--mr, 1) * 100% + .06em); bottom: 0; font-size: .5em; line-height: 1; z-index: 2; }
.mascot.has-deco { margin-left: calc(.3em - var(--ml, 0) * 1em); padding-top: .3em; }
.mascot.has-pet { margin-right: calc(.62em + (var(--mr, 1) - 1) * 1em); }
.item-img { width: 1.15em; height: 1.15em; object-fit: contain; vertical-align: middle; }
.mascot.idle { animation: float 3s ease-in-out infinite; }
.mascot.jump { animation: jump .55s ease; }
.mascot.shake { animation: shake .45s ease; }
.mascot.small { font-size: 64px; }
.mascot.tiny { font-size: 44px; }
.bubble {
  position: relative; background: #fff; color: var(--ink); border-radius: 22px; padding: 14px 20px;
  font-size: 1.25rem; font-weight: 700; box-shadow: var(--shadow-s); max-width: 520px;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  border: 12px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.left::after { left: -12px; top: 50%; bottom: auto; transform: translateY(-50%); border: 12px solid transparent; border-right-color: #fff; border-left: 0; }

.weekdots { display: flex; gap: 10px; align-items: center; justify-content: center; }
.weekdots .dot { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.7); border: 3px dashed #b9b0e6; display: grid; place-items: center; font-size: 1.1rem; }
.weekdots .dot.on { background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow-s); }
.weekdots .chest { margin-left: 4px; display: block; line-height: 0; }
.weekdots .chest img { width: 72px; height: auto; display: block; } /* Truhen-Bild, seit 29.11.2026 größer als das alte 🧰 */
.weekdots .chest.open { animation: bump 1s ease infinite; }

.start-btn { font-size: 2rem; padding: 26px 46px; border-radius: 30px; animation: pulse 2.2s ease-in-out infinite; }
.start-btn.done { animation: none; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: start; overflow-y: auto; padding: 4px; }
.tile {
  border: none; background: var(--card); border-radius: 22px; padding: 16px 10px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow);
  font-weight: 800; font-size: 1.05rem; position: relative; color: var(--ink);
}
.tile .ti { font-size: 2.6rem; line-height: 1.1; }
.tile .sub { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.tile:active { transform: translateY(3px); }
.tile.locked { opacity: .7; }
.tile .badge { position: absolute; top: 8px; right: 10px; background: var(--pink); color: #fff; border-radius: 999px; font-size: .8rem; padding: 2px 8px; }
.rankline { font-weight: 800; font-size: 1.1rem; }
.progress { height: 14px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd166); border-radius: 999px; transition: width .5s; }
.wishbar { background: rgba(255,255,255,.85); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow-s); color: var(--ink); width: min(440px, 100%); }
.parent-btn { position: absolute; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5; border: none; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; font-size: .95rem; color: var(--ink-soft); background: rgba(255,255,255,.7); box-shadow: var(--shadow-s); opacity: .8; }
.scr-home.dark .parent-btn { background: rgba(255,255,255,.18); color: #e8e4ff; }

/* ---------- Mission ---------- */
.scr-mission { color: var(--ink); }
.scr-mission.dark .m-top, .scr-mission.dark .m-meta { color: #fff; }
.m-top { display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 4px; }
.path { position: relative; flex: 1; height: 54px; margin-left: 14px; }
.path .track { position: absolute; left: 0; right: 40px; top: 50%; height: 12px; transform: translateY(-50%); background: rgba(255,255,255,.55); border-radius: 999px; overflow: hidden; }
.path .track i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, var(--accent)); width: 0; transition: width .4s; }
.path .walker { position: absolute; top: 50%; transform: translate(-50%, -60%); font-size: 40px; line-height: 0; transition: left .4s; }
.path .goal { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 38px; }
.combo { font-weight: 900; font-size: 1.3rem; min-width: 70px; text-align: center; }
.combo .flame { display: inline-block; transition: transform .2s; }
.m-body {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px;
  padding: 8px 18px max(16px, env(safe-area-inset-bottom)); min-height: 0;
}
@media (orientation: portrait), (max-width: 820px) {
  .m-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
}
.m-task { display: flex; flex-direction: column; gap: 14px; min-height: 0; position: relative; }
.m-task > :not(.scene), .m-body > .col { position: relative; z-index: 1; }
.scene.ground { overflow: visible; inset: auto -18px -6px; height: 90px; }
.scene.ground .sc-ground { bottom: 0; }
.m-meta { display: flex; align-items: flex-end; gap: 12px; }
.task-card {
  /* Nur so groß wie nötig, damit rundherum die Welt zu sehen ist */
  flex: 0 1 auto; margin: auto 0; align-self: center; width: min(100%, 680px); min-height: min(300px, 100%);
  background: var(--card); border-radius: 30px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 50px 24px 26px; position: relative; overflow: hidden; min-width: 0; max-width: 100%;
}
.task-card.golden { box-shadow: 0 0 0 6px #ffd166, var(--shadow); }
.task-card .tag { position: absolute; top: 14px; left: 18px; font-weight: 800; font-size: .95rem; color: var(--ink-soft); }
.task-card .gold-tag { font-weight: 900; color: #c47f00; text-align: center; margin-top: -10px; }
.prompt { font-size: 1.35rem; font-weight: 700; text-align: center; max-width: 700px; line-height: 1.35; }
.expr { font-size: clamp(2.2rem, 5.4vw, 4rem); font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.expr.small-expr { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
.expr .line { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; white-space: pre-wrap; text-align: center; max-width: 100%; }
.expr { max-width: 100%; }
.expr .glue { display: inline-flex; align-items: center; white-space: pre; }
.field {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.35em; padding: 0 .2em;
  margin: 0 .08em; border-radius: 16px; border: 4px dashed #c9bff3; background: var(--card-2); color: var(--primary-dark);
  transition: border-color .15s, background .15s;
}
.field.active { border: 4px solid var(--primary); background: #fff; box-shadow: 0 0 0 5px rgba(124, 77, 255, .15); }
.field.ok { border: 4px solid var(--good); background: var(--good-soft); color: #127a4c; }
.field.bad { border: 4px solid var(--bad); background: var(--bad-soft); color: #c0392b; animation: shake .4s; }
.field.swap { border: 4px solid var(--accent-dark); background: #fff1d6; color: #b35900; position: relative; }
.field.swap::after { content: '🔄'; position: absolute; top: -.55em; right: -.55em; font-size: .45em; }
.field .ghost { color: #c9bff3; font-size: .62em; font-weight: 800; margin: 0 .06em; }
.swapbox { display: flex; align-items: center; gap: 12px; background: #fff1d6; border: 3px solid #ffc861; border-radius: 18px; padding: 10px 16px; font-size: 1.15rem; max-width: 640px; text-align: left; }
.swapbox .swap-ico { font-size: 2rem; }
.swapbox .swap-tip { font-weight: 700; color: #7a4a00; }
.swapbox .ze { display: inline-flex; gap: 4px; vertical-align: middle; }
.swapbox .ze i { font-style: normal; font-weight: 900; border: 2px solid #ffc861; border-radius: 8px; padding: 0 6px; background: #fff; }
.swapbox.compact { font-size: 1rem; padding: 6px 12px; margin-top: 8px; }
.swapbox.compact .swap-ico { font-size: 1.5rem; }
.field .cursor { width: 3px; height: .9em; background: var(--primary); animation: blink 1s steps(1) infinite; margin-left: 2px; }
.hintbox { background: #fff7d6; border: 3px solid #ffe08a; border-radius: 18px; padding: 12px 16px; font-size: 1.15rem; font-weight: 700; max-width: 640px; text-align: center; }
.solutionbox { background: #eaf6ff; border: 3px solid #a9dcff; border-radius: 18px; padding: 12px 16px; font-size: 1.25rem; font-weight: 800; max-width: 640px; text-align: center; }
.speak-btn { position: absolute; top: 10px; right: 12px; }
.say-btn { width: 46px; height: 46px; font-size: 1.35rem; }
.say-btn.inline { display: inline-grid; vertical-align: middle; margin-left: 10px; width: 40px; height: 40px; font-size: 1.15rem; }
.say-btn.corner { position: absolute; top: 12px; right: 12px; }
.say-btn.big { width: 64px; height: 64px; font-size: 2rem; }
.say-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
/* Zahli (web/js/zahli.js): Pose und Aufsatz liegen als zwei Bilder genau übereinander, nie animiert */
.zahli { position: relative; display: inline-block; aspect-ratio: 248 / 296; flex-shrink: 0; line-height: 0; vertical-align: middle; }
.zahli img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.zahli .z-medal { position: absolute; left: 84%; top: 35%; transform: translate(-50%, -50%); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.zahli-says { display: flex; align-items: center; justify-content: center; gap: 14px; }
.zahli-says .bubble { text-align: left; }
.say-row .bubble.left { margin-left: 6px; }
.reward-duo { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.game-host { display: flex; align-items: flex-end; justify-content: center; gap: 10px; font-size: 64px; line-height: 1; }
.shop-stage { display: flex; align-items: flex-end; justify-content: center; gap: 22px; margin: 6px 0 12px; }
.zahli-gift { background: none; border: 0; padding: 0; cursor: pointer; }
.zahli-gift.chest-big { font-size: 16px; animation: none; } /* Zahli hält die Wochen-Schatztruhe als Geschenk, ohne Wackeln */
.modal { position: relative; }
.reward-panel { position: relative; }
.hintbox, .solutionbox { display: flex; align-items: center; justify-content: center; gap: 10px; }

.feedback { position: absolute; left: 50%; top: 18%; transform: translate(-50%, 0); font-size: 2.2rem; font-weight: 900; color: var(--good); pointer-events: none; text-shadow: 0 3px 0 #fff; white-space: nowrap; animation: rise 1s ease forwards; z-index: 5; }
.feedback.combo-fb { color: #ff7b00; font-size: 2.6rem; }

/* Welt-Szene hinter Mission und Belohnung */
.scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.scr-mission > :not(.scene), .scr-reward > :not(.scene) { position: relative; z-index: 1; }
.scene > span { position: absolute; line-height: 1; user-select: none; }
.sc-ground { bottom: -6px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.12)); }
.sc-float { opacity: .9; }
.sc-float .flip { display: inline-block; transform: scaleX(-1); }

/* Eltern: Extra-Training und Einstufung */
.custom-topic { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.type-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.type-check { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.type-check input { flex: none; width: 22px; height: 22px; accent-color: var(--primary); }
.row-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.row-pick { border: none; border-radius: 14px; padding: 10px 14px; font-weight: 900; font-size: 1.05rem; background: var(--card-2); box-shadow: 0 3px 0 var(--line); min-width: 62px; }
.row-pick.on { background: var(--good); color: #fff; box-shadow: 0 3px 0 #168a56; }

/* Pinnwand */
.board { gap: 12px; align-items: center; }
.board > * { width: min(900px, 100%); }
.board-h { margin: 8px 0 0; font-size: 1.4rem; }
.week-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.week-card { position: relative; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-s); padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.week-card.me { box-shadow: 0 0 0 4px #ffd166, var(--shadow-s); }
.week-card .say-btn.corner { top: 6px; right: 6px; width: 38px; height: 38px; font-size: 1.05rem; }
.wc-mascot { font-size: 54px; line-height: 1; position: relative; }
.wc-name { font-weight: 900; font-size: 1.15rem; }
.wc-week { font-weight: 800; color: var(--ink-soft); }
.wc-stickers { font-size: 1.5rem; min-height: 1.6em; letter-spacing: 2px; }
.wc-total { display: flex; gap: 10px; font-weight: 800; font-size: .95rem; color: var(--ink-soft); }
.feed-card { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-s); padding: 12px 14px; }
.feed-card.new { box-shadow: 0 0 0 3px #a9dcff, var(--shadow-s); }
.fc-mascot { font-size: 44px; line-height: 1; }
.fc-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fc-text { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.fc-when { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.react-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.react { border: none; background: var(--card-2); border-radius: 999px; min-width: 56px; height: 48px; padding: 0 12px; font-size: 1.5rem; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 3px 0 var(--line); }
.react b { font-size: 1rem; }
.react.on { background: #ffe9a8; box-shadow: 0 3px 0 #f3c46b; }
.react.ro { opacity: 1; }
.react:active { transform: translateY(2px); }
.react-from { font-weight: 700; color: var(--ink-soft); font-size: .95rem; }

/* Witz-Pause */
.joke { gap: 14px; max-width: 560px; text-align: center; }
.joke-e { font-size: 76px; line-height: 1; animation: wobble 1.6s ease-in-out infinite; }
.joke-q { font-size: 1.45rem; font-weight: 800; line-height: 1.35; }
.joke-a { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.55rem; font-weight: 900; color: var(--primary-dark); background: #fff7d6; border: 3px solid #ffe08a; border-radius: 20px; padding: 12px 18px; animation: pop .35s ease; }

/* Ziffernblock */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: end; }
.numpad button {
  border: none; border-radius: 22px; background: var(--card); box-shadow: 0 6px 0 var(--line);
  font-size: 2.4rem; font-weight: 900; height: 82px; color: var(--ink);
}
.numpad button:active, .numpad button.press { transform: translateY(5px); box-shadow: 0 1px 0 var(--line); }
.numpad .ok { background: var(--good); color: #fff; box-shadow: 0 6px 0 #168a56; }
.numpad .ok:active { box-shadow: 0 1px 0 #168a56; }
.numpad .del { background: #ffe9e3; box-shadow: 0 6px 0 #ffd0c2; font-size: 2rem; }
.numpad .comma { font-size: 2.6rem; }
.numpad .del-wide { grid-column: span 3; }
@media (orientation: portrait), (max-width: 820px) {
  .numpad { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .numpad button { height: 70px; font-size: 2rem; }
  /* Zwei Reihen in Zahlenreihenfolge: 1 2 3 4 5 6 / 7 8 9 0 ⌫ ✓ (statt des umgebrochenen Taschenrechner-Blocks) */
  .numpad [data-k="1"] { order: 1; } .numpad [data-k="2"] { order: 2; } .numpad [data-k="3"] { order: 3; }
  .numpad [data-k="4"] { order: 4; } .numpad [data-k="5"] { order: 5; } .numpad [data-k="6"] { order: 6; }
  .numpad [data-k="7"] { order: 7; } .numpad [data-k="8"] { order: 8; } .numpad [data-k="9"] { order: 9; }
  .numpad [data-k="0"] { order: 10; } .numpad [data-k="del"], .numpad [data-k=","] { order: 11; } .numpad [data-k="ok"] { order: 12; }
  .numpad .del-wide { order: 13; grid-column: span 6; }
}
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: end; }
.choices button { height: 120px; font-size: 3.5rem; font-weight: 900; border: none; border-radius: 24px; background: var(--card); box-shadow: 0 6px 0 var(--line); }
/* Einheiten mit Wort darunter (2. Klasse: „min“ / „Minuten“) */
.choices button .ch-main { display: block; line-height: 1; }
.choices button .ch-word { display: block; font-size: clamp(.75rem, 2.6vw, 1rem); font-weight: 800; color: var(--ink-soft); margin-top: 4px; line-height: 1.1; }
.next-btn { width: 100%; font-size: 1.8rem; padding: 22px; }

/* Boss */
.bossbar { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.9); border-radius: 18px; padding: 8px 14px; box-shadow: var(--shadow-s); }
.bossbar .be { font-size: 46px; }
.bossbar .be.hit { animation: shake .4s; }
.hp { display: flex; gap: 4px; }
.hp i { width: 22px; height: 22px; border-radius: 6px; background: #ff5d73; display: block; }
.hp i.gone { background: #e5e0f5; }

/* Visuals */
.clock-svg { width: min(260px, 40vh); height: auto; }
.rect-svg { width: min(380px, 70%); height: auto; }
.wall { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 900; }
.wall .wrow { display: flex; gap: 8px; }
.wall .brick { min-width: 3.2em; height: 1.6em; border-radius: 10px; background: #ffd9b8; border: 3px solid #e8a96f; display: grid; place-items: center; }
.wall .field { min-width: 3.2em; height: 1.6em; border-radius: 10px; margin: 0; }
.placetable { display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 900; }
.placetable .pt-number { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: .08em; }
.placetable .pt-grid { display: grid; border: 3px solid var(--primary); border-radius: 16px; overflow: hidden; background: #fff; }
.placetable .pt-head { display: flex; flex-direction: column; align-items: center; padding: 6px 18px; background: var(--primary); color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; }
.placetable .pt-head small { font-size: .8rem; font-weight: 700; opacity: .9; }
.placetable .pt-head + .pt-head, .placetable .pt-cell + .pt-cell { border-left: 3px solid #d9ccff; }
.placetable .pt-cell { padding: 10px 14px; display: grid; place-items: center; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.placetable .pt-cell .field { margin: 0; }

/* ---------- Belohnung ---------- */
.reward { align-items: center; justify-content: flex-start; text-align: center; padding: 16px; }
.reward-panel { margin: auto 0; background: rgba(255,255,255,.98); border-radius: 34px; padding: 24px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(860px, 100%); color: var(--ink); }
/* Handy (24.11.2026, Spiel-Rundgang): „Zum Start“ lag unter dem Rand; Knöpfe zu zweit, Bär und Überschrift kleiner */
@media (max-width: 560px) {
  .reward-panel { padding: 18px 14px; gap: 10px; border-radius: 26px; }
  .reward-panel h2 { font-size: 1.5rem; margin: 0; }
  .reward-panel .row.wrap { gap: 10px !important; }
  .reward-panel .row.wrap .btn.big { font-size: 1.2rem; padding: 14px 12px; flex: 1 1 40%; }
  .reward-panel .mascot { font-size: 84px; }
}
.reward h2 { font-size: 2.4rem; margin: 0; }
.statrow { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.stat { background: var(--card); border-radius: 20px; padding: 12px 18px; box-shadow: var(--shadow-s); font-weight: 800; font-size: 1.2rem; min-width: 120px; }
.stat b { display: block; font-size: 2rem; }
.egg { font-size: 150px; cursor: pointer; display: inline-block; transition: transform .1s; }
.egg.wobble { animation: wobble .5s ease; }
.egg.c1 { filter: drop-shadow(0 0 10px #ffe066); }
.egg.c2 { filter: drop-shadow(0 0 22px #ffd166); }
.zahli-reveal { font-size: 150px; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1); display: inline-block; }
.zahli-name { font-size: 1.8rem; font-weight: 900; }
.glitzer { position: relative; display: inline-block; }
.glitzer::after { content: '✨'; position: absolute; right: -.2em; top: -.2em; font-size: .45em; animation: twinkle 1.2s ease-in-out infinite; }
.glitzer.big { filter: drop-shadow(0 0 12px #ffe066) saturate(1.4); }
.chest-big { font-size: 130px; animation: bump 1s ease infinite; cursor: pointer; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 1.8rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } /* minmax: bei 360 px Breite war der Sonntag abgeschnitten (24.11.2026) */
.cal .wd { text-align: center; font-weight: 800; color: var(--ink-soft); }
.cal .day { aspect-ratio: 1; background: #f3f1fa; border-radius: 16px; position: relative; display: grid; place-items: center; font-size: clamp(1.6rem, 4vw, 2.6rem); border: none; }
.cal .day .num { position: absolute; top: 4px; left: 8px; font-size: .9rem; font-weight: 800; color: var(--ink-soft); }
.cal .day.done { background: #fff; box-shadow: var(--shadow-s); }
.cal .day.bonus { box-shadow: 0 0 0 3px #ffd166, var(--shadow-s); }
.cal .day.today { outline: 3px solid var(--primary); }
.cal .day.partial::after { content: '…'; font-size: 1.2rem; color: var(--ink-soft); }
.cal .day.empty { background: transparent; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; color: var(--ink-soft); font-weight: 700; }

/* ---------- Album ---------- */
.series { margin-bottom: 18px; }
.series h3 { margin: 6px 0 10px; font-size: 1.4rem; }
.zgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.zcard { background: #fff; border-radius: 18px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow-s); }
.zcard .ze { font-size: 3rem; line-height: 1.2; }
.zcard .zn { font-size: .8rem; font-weight: 800; min-height: 2em; }
.zcard.locked .ze { filter: brightness(0) opacity(.18); }
.zcard.locked .zn { color: #bbb; }
.zcard .cnt { font-size: .75rem; color: var(--ink-soft); }

/* ---------- Garten ---------- */
.garden { display: grid; grid-template-columns: 34px repeat(10, minmax(0, 1fr)); gap: 5px; max-width: 760px; margin: 0 auto; }
.garden .gh { font-weight: 900; color: #6b4b2a; display: grid; place-items: center; font-size: 1rem; }
.garden .bed { padding: 0; min-width: 0; aspect-ratio: 1; border-radius: 10px; background: #a9744f; display: grid; place-items: center; font-size: clamp(1rem, 2.8vw, 1.9rem); border: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); position: relative; }
.garden .bed.s1 { background: #b88a5f; }
.garden .bed.s2 { background: #9bc96d; }
.garden .bed.s3 { background: #7cc35a; }
.garden .bed.sel { outline: 4px solid #fff; }
.garden .bed.twin { box-shadow: 0 0 0 3px #ffd166; }
/* Garten-Stand mit Worten (24.11.2026) */
.garden-count { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-weight: 900; font-size: 1.15rem; margin: 0 auto 12px; }
.garden-wrap { background: linear-gradient(#c7efb0, #a6dc86); border-radius: 26px; padding: 14px; }

/* ---------- Laden / Abzeichen ---------- */
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.item { background: #fff; border-radius: 20px; padding: 14px; text-align: center; box-shadow: var(--shadow-s); border: 3px solid transparent; }
.item .ie { font-size: 3rem; min-height: 1.25em; display: flex; align-items: center; justify-content: center; }
.item.on { border-color: var(--good); }
.item .price { font-weight: 900; }
.badgegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.bcard { background: #fff; border-radius: 20px; padding: 14px; text-align: center; box-shadow: var(--shadow-s); }
.bcard .be { font-size: 3rem; }
.bcard.locked { opacity: .45; filter: grayscale(1); }
.bcard .bn { font-weight: 900; }
.bcard .bd { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Advent ---------- */
.advent { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 700px) { .advent { grid-template-columns: repeat(4, 1fr); } }
.door { aspect-ratio: 1; border-radius: 16px; border: 3px solid #fff; font-size: clamp(1.4rem, 3.4vw, 2.4rem); font-weight: 900; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-s); }
.door.closed { background: repeating-linear-gradient(45deg, #c0392b, #c0392b 12px, #d14b3d 12px, #d14b3d 24px); }
.door.ready { background: repeating-linear-gradient(45deg, #1e8449, #1e8449 12px, #239b56 12px, #239b56 24px); animation: bump 1.4s ease infinite; }
.door.open { background: #fff7e6; color: var(--ink); }
.door.future { background: #4f6288; color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.45); }
/* Winternacht mit verschneitem Boden (unbewegt) */
.advent-bg { background: radial-gradient(ellipse 140% 22% at 50% 100%, #ffffff 0 55%, transparent 56%), linear-gradient(180deg, #152a52 0%, #24497a 55%, #3d6fa3 100%); color: #fff; }
.advent-bg .topbar h1 { color: #fff; }
.advent-bg .advent { max-width: min(900px, calc((100vh - 270px) * 1.45)); margin: 0 auto; }

/* ---------- Spiele ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.game-card { border: none; border-radius: 26px; padding: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; color: var(--ink); }
.game-card .ge { font-size: 4rem; }
.game-card h3 { margin: 6px 0; font-size: 1.5rem; }
.balloon-field { position: relative; flex: 1; overflow: hidden; background: linear-gradient(#aee3ff, #e9f7ff); border-radius: 26px; margin: 0 16px 16px; }
.balloon { position: absolute; width: 110px; height: 136px; border: none; background: none; padding: 0; }
.balloon .bb { width: 110px; height: 120px; border-radius: 50% 50% 48% 48%; display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); box-shadow: inset -10px -12px 0 rgba(0,0,0,.12); }
.balloon .str { width: 2px; height: 30px; background: #888; margin: 0 auto; }
.balloon.popped { animation: popout .25s forwards; }
.balloon.wrongb { animation: shake .4s; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 0; flex: 1; min-height: 0; }
.duel .side { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 0; }
.duel .side.kid { background: #f1ebff; }
.duel .side.adult { background: #fff4dc; }
.duel .side .expr { font-size: clamp(1.8rem, 4vw, 3rem); }
.duel .side { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.duel .side .task-card { flex: 1 1 auto; min-height: 90px; margin: 0; width: 100%; padding: 12px; }
.duel .side .numpad { gap: 8px; }
.duel .side .numpad button { height: clamp(46px, 7.2vh, 64px); font-size: 1.7rem; }
@media (orientation: portrait) { .duel .side .numpad { grid-template-columns: repeat(3, 1fr); } .duel .side .numpad button { order: 0; } }
.duel .score { font-size: 1.4rem; font-weight: 900; text-align: center; }
.duel .bar { height: 18px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; }
.duel .bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.duel .side.adult .bar i { background: var(--accent-dark); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 20, 70, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 30px; padding: 24px; max-width: 640px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; animation: pop .35s cubic-bezier(.2, 1.5, .4, 1); color: var(--ink); }
.modal h2 { margin-top: 0; }
/* Knopfreihen in Fenstern brechen bei Bedarf um (24.11.2026: „Weiterrechnen!“ ragte bei 360 px aus dem Fenster) */
.modal .row { flex-wrap: wrap; justify-content: center; }
.worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.world { border: none; border-radius: 22px; padding: 18px 10px; font-weight: 900; font-size: 1.15rem; box-shadow: var(--shadow-s); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.world .wi { font-size: 3rem; display: block; }

/* ---------- Konfetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
.flystar { position: fixed; z-index: 90; font-size: 2rem; pointer-events: none; transition: transform .7s cubic-bezier(.5, -0.3, .7, 1), opacity .7s; }

/* ---------- Eltern ---------- */
.parent { background: #f4f6fb; }
.parent .tabs { display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; }
.parent .tab { border: none; border-radius: 999px; padding: 10px 18px; font-weight: 800; background: #fff; box-shadow: var(--shadow-s); white-space: nowrap; font-size: 1rem; }
.parent .tab.on { background: var(--primary); color: #fff; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.pcard { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.pcard h3 { margin: 0 0 10px; font-size: 1.2rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.kpi b { display: block; font-size: 1.8rem; }
.kpi span { color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
table.list { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.list td, table.list th { padding: 8px 6px; border-bottom: 1px solid #eef; text-align: left; }
table.list th { color: var(--ink-soft); font-size: .85rem; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 800; }
.pill.red { background: #ffe1e1; color: #b03030; }
.pill.yellow { background: #fff2c6; color: #8a6200; }
.pill.green { background: #dcf7e8; color: #19794a; }
.pill.grey { background: #eceaf5; color: #6b6390; }
.heat { display: grid; grid-template-columns: 30px repeat(10, 1fr); gap: 3px; max-width: 520px; }
.heat .hc { aspect-ratio: 1; border-radius: 6px; border: none; font-size: .7rem; font-weight: 800; color: rgba(0,0,0,.6); }
.heat .hh { display: grid; place-items: center; font-weight: 800; color: var(--ink-soft); font-size: .8rem; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0eef8; }
.form-row label { font-weight: 700; }
.form-row .hint { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 42px; height: 42px; border-radius: 12px; border: none; background: var(--card-2); font-size: 1.4rem; font-weight: 900; }
.stepper b { min-width: 48px; text-align: center; font-size: 1.2rem; }
.switch { width: 58px; height: 34px; border-radius: 999px; background: #d8d4e8; border: none; position: relative; flex: none; }
.switch::after { content: ''; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--good); }
.switch.on::after { left: 28px; }
.typelist .form-row { padding: 8px 0; }
select.sel { padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
input.txt { padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); width: 100%; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars .b { flex: 1; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars .b.goal { background: var(--good); }
.bars .b span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--ink-soft); white-space: nowrap; }

/* PIN */
.pinpad { display: grid; grid-template-columns: repeat(3, 80px); gap: 10px; justify-content: center; margin-top: 12px; }
.pinpad button { height: 70px; border-radius: 18px; border: none; background: var(--card-2); font-size: 1.8rem; font-weight: 900; }
.pindots { display: flex; gap: 12px; justify-content: center; margin: 10px 0; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; background: #e3def5; }
.pindots i.on { background: var(--primary); }

/* Setup */
.setup, .scr-setup { background: linear-gradient(160deg, #e8dcff, #ffe3f1 60%, #fff6d6); }
.mascot-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 16px 0; }
.mascot-pick button { font-size: 3.4rem; border-radius: 22px; border: 4px solid transparent; background: #fff; padding: 10px 0; box-shadow: var(--shadow-s); }
.mascot-pick button.on { border-color: var(--primary); transform: scale(1.06); }

.toast { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 700; z-index: 99; animation: fade .2s; }
.offline { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); background: #ffe08a; color: #6b4b00; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; z-index: 60; }

/* ---------- Animationen ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes jump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-34px) scale(1.08, .95); } 60% { transform: translateY(0) scale(.95, 1.05); } 100% { transform: translateY(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-7px); } 80% { transform: translateX(6px); } }
@keyframes bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes popout { to { transform: scale(1.6); opacity: 0; } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---------- Tageswertung ---------- */
.daycard { width: 100%; display: flex; gap: 20px; align-items: center; background: #fff; border-radius: 28px; padding: 18px 24px; box-shadow: var(--shadow); max-width: 820px; color: var(--ink); }
.daycard .medal { font-size: 110px; line-height: 1; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 6px 0 rgba(0,0,0,.08)); }
.daycard .medal-title { font-size: 1.8rem; font-weight: 900; }
@media (max-width: 700px) { .daycard { flex-direction: column; } }
.awards { display: flex; gap: 8px; flex-wrap: wrap; }
.award { background: #fff4cf; border: 2px solid #ffd166; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 1.05rem; }
.cal .day .cal-medal { position: absolute; right: 4px; bottom: 2px; font-size: .9rem; }

.daycard { box-shadow: none; background: #f7f4ff; }
.heat .hc.few { opacity: .45; }
.pinpad button.ok { background: var(--good); color: #fff; }
/* „Doch nicht“ unter einem PIN-Block mit Abstand: Am iPhone landete ein Tippen auf die 0 sonst auf dem Knopf darunter (30.11.2026) */
.pin-cancel { margin-top: 30px !important; }
.pinpad button.press, .pinpad button:active { transform: translateY(2px); filter: brightness(.93); }
/* Niedrige Bildschirme (Handy mit Safari-Leisten, 24.11.2026): PIN-Fenster passt ohne Scrollen */
@media (max-height: 720px) {
  .pinpad { gap: 8px; margin-top: 6px; }
  .pinpad button { height: 56px; }
}
.admin-pill { margin-left: 10px; background: #fff3c4; color: #8a6100; font-size: .8rem; vertical-align: middle; }
.admin-banner { margin: 0 16px 8px; padding: 10px 14px; border-radius: 14px; background: #fff3c4; color: #6b4b00; font-weight: 700; }
.form-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }

/* Eltern: Tagespensum heute */
.today-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; margin-bottom: 14px; font-size: 1.1rem; }
.today-banner .tb-icon { font-size: 2.2rem; }
.today-banner.done { background: #e3f8e9; border: 2px solid #5cc97a; }
.today-banner.open { background: #fff6dc; border: 2px solid #f1c95a; }
.today-banner .small { font-weight: 600; opacity: .8; margin-top: 2px; }
.today-line { font-weight: 800; margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; display: inline-block; }
.today-line.done { background: #e3f8e9; color: #1f7a3a; }
.today-line.open { background: #fff6dc; color: #8a6400; }
.ntfy-last { font-weight: 700; padding: 8px 10px; border-radius: 10px; }
.ntfy-last.ok { background: #e3f8e9; color: #1f7a3a; }
.ntfy-last.bad { background: #fde8e4; color: #a33a24; }
.voice-warn { color: #a35b00; font-weight: 700; }
.joke-vote { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; }
.joke-vote .vote { font-size: 2rem; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #e4defa; background: #fff; cursor: pointer; }
.joke-vote .vote.on { border-color: var(--primary); background: #efeaff; transform: scale(1.08); }

/* Bonus-Runde: Bereich wählen */
.focus-pick { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 620px; }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: 100%; }
.focus-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 18px; border: 3px solid #e4defa; background: #fff; font: inherit; font-weight: 800; font-size: 1.1rem; color: var(--ink, #2b2350); cursor: pointer; box-shadow: 0 4px 0 #e4defa; }
.focus-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e4defa; }
.focus-btn .fi { font-size: 2.2rem; line-height: 1.1; }
.focus-btn small { font-weight: 700; opacity: .7; }
.focus-btn.random { width: 100%; flex-direction: row; justify-content: center; gap: 12px; font-size: 1.3rem; background: #fff7d6; border-color: #ffe08a; box-shadow: 0 4px 0 #ffe08a; }
.pindots.shake { animation: shake .45s ease; }
.voice-diag summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); font-size: .9rem; }
.voice-diag .small { margin-top: 6px; color: var(--ink-soft); }
.shopgrid .item { position: relative; }
.shopgrid .item.seasonal:not(.on) { border-color: #ffd36b; }
.season-tag { position: absolute; top: 6px; right: 6px; background: #ff7a59; color: #fff; font-weight: 800; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.season-note { text-align: center; font-weight: 800; background: #fff6dc; border-radius: 14px; padding: 8px 12px; margin: 0 auto 12px; max-width: 560px; }

/* Frischer Start: erster Tipp schaltet den Ton frei und liest die Begrüßung vor */
.tap-start { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: none; background: rgba(43, 35, 80, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font: inherit; cursor: pointer; }
.tap-start .ts-mascot { font-size: 140px; line-height: 1; }
.tap-start b { font-size: 2.4rem; }
.tap-start span:last-child { font-size: 1.4rem; font-weight: 800; background: var(--primary); padding: 14px 26px; border-radius: 999px; box-shadow: 0 6px 0 rgba(0,0,0,.2); }

/* Einheitliche Fenster: „Doch nicht“ steht immer zentriert unter den Auswahl-Knöpfen (wie bei der Bonus-Runde) */
.modal .btn.ghost:last-child { display: block; margin: 12px auto 0; }

/* ---------- Handy (schmal, z. B. iPhone hochkant) ---------- */
@media (max-width: 520px) {
  .topbar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .topbar h1 { font-size: 1.3rem; }
  .icon-btn { width: 44px; height: 44px; font-size: 1.35rem; }
  .stars { padding: 6px 12px 6px 10px; font-size: 1.1rem; }
  .stars .s { font-size: 1.15rem; }
  /* Laden-Reiter kompakter, damit sie nicht drei Zeilen brauchen */
  .scr-shop .row.wrap .btn { font-size: .95rem; padding: 9px 12px; }
  /* Garten: 10 Spalten passen auch in Safari (breitere Schrift als Firefox) */
  .garden { grid-template-columns: 20px repeat(10, minmax(0, 1fr)); gap: 3px; }
  .garden .gh { font-size: .72rem; }
  .garden .bed { border-radius: 6px; font-size: clamp(.65rem, 3vw, 1.2rem); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
  .garden-wrap { padding: 8px; border-radius: 18px; }
  /* Mission: schwebende Deko überdeckt am Handy Sprechblase und Karte, nur der Boden bleibt */
  .scr-mission .sc-float, .scr-mission .sc-move { display: none; }
  /* Duell: kompakte Kopfzeile ohne Umbruch, niedrigere Karte, mehr Platz für den Ziffernblock */
  .duel .side { padding: 8px 6px; gap: 6px; }
  .duel .score { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .duel .side .task-card { min-height: 110px; padding: 8px; }
  .duel .side .expr { font-size: clamp(1.3rem, 6vw, 2.2rem); }
  .duel .side .numpad { gap: 6px; }
  .duel .side .numpad button { height: clamp(46px, 7vh, 60px); font-size: 1.5rem; }
  /* Eltern-Knopf am Ende der Seite statt über dem Text */
  .scr-home .parent-btn { position: static; display: block; margin: 4px 16px calc(14px + env(safe-area-inset-bottom)) auto; }
}
select.sel { max-width: 100%; }
/* Eltern-Bereich am iPad mini (23.11.2026): Trend-Spalte und Auswahlfelder standen über die Karte hinaus */
.pcard { min-width: 0; overflow-x: auto; }
select.sel.big-sel { font-size: 1.3rem; padding: 10px 14px; }
.pgrid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.form-row > select.sel { min-width: 0; flex-shrink: 1; }
@media (max-width: 800px) { .pgrid { grid-template-columns: 1fr; } }
.grade-tip { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 14px; background: #fff7d6; font-weight: 700; }
.grade-tip .row { gap: 8px; flex-wrap: wrap; }

/* Gerät verbinden, Einladung, Geräteliste (seit 18.11.2026) */
input.txt.code-input { font-size: 1.8rem; font-weight: 800; text-align: center; letter-spacing: 4px; text-transform: uppercase; max-width: 420px; align-self: center; }
.err-line { color: #c0392b; font-weight: 700; min-height: 1.2em; margin: 0; }
.hint-box { background: #fff7d6; border: 2px solid #ffe08a; border-radius: 16px; padding: 10px 14px; text-align: left; }
.hint-box p { margin: 4px 0 0; }
.how-box { background: #f3efff; border-radius: 16px; padding: 10px 14px; text-align: left; }
.how-box ul, .steps { text-align: left; margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.join-form { gap: 14px; text-align: left; }
.join-form label { display: flex; flex-direction: column; gap: 6px; }
.join-form label.type-check { flex-direction: row; }
/* QR-Code mit Zahli in der Mitte (24.11.2026): Einladung und Gerät hinzufügen */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: 4px 0; }
.qr-pic { width: min(220px, 60vw); background: #fff; border-radius: 14px; padding: 4px; box-shadow: 0 2px 10px rgba(43, 35, 80, .12); }
.qr-pic svg { display: block; width: 100%; height: auto; }
.qr-box .muted { max-width: 420px; }
.big-code { font-size: 2.6rem; font-weight: 900; letter-spacing: 6px; text-align: center; background: #f3efff; border-radius: 16px; padding: 10px 16px; margin: 8px 0; user-select: all; }
.dev-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dev-row:last-child { border-bottom: 0; }
.dev-row .dev-name { flex: 1 1 200px; display: flex; flex-direction: column; }
.dev-name .pill { margin-left: 6px; vertical-align: middle; }
.mail-preview { border: 2px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; text-align: left; max-height: 46vh; overflow: auto; }

/* ⚡ 1×1-Training (seit 19.11.2026): zwei Pflicht-Knöpfe am Start, Trainings-Bildschirm, Mein Tempo */
.start-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.start-row .start-btn { font-size: 1.45rem; padding: 18px 24px; border-radius: 24px; }
.start-row .start-btn.done { opacity: 0.85; }
.start-row .start-btn.locked { opacity: 0.7; }
.start-row .start-btn.shake { animation: shake .4s; }
.start-btn .done-sub { display: block; font-size: .62em; font-weight: 700; opacity: .8; margin-top: 2px; }
.one-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 900; font-size: 1.35rem; }
.one-ghost { font-size: 1rem; color: var(--muted, #666); font-weight: 800; }
.one-time { margin: 4px 0 2px; }
.one-time i { transition: none; }
.one-sol { font-weight: 800; font-size: 1.2rem; margin-top: 6px; }
.one-skip { align-self: center; margin-top: 14px; }
.stairs { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 12px 0 4px; min-height: 140px; }
.stair { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 44px; }
.stair i { display: block; width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(#ffd54a, #ffb300); }
.stair b { font-size: 1rem; }
.stair small { font-size: 0.75rem; color: var(--muted, #666); }
/* Kleine Handys (Safari mit Leisten, 360 × 640): der Knopf „Tagesmission“ soll ohne Scrollen zu sehen sein (24.11.2026) */
@media (max-width: 560px) and (max-height: 760px) {
  .scr-home .hero { gap: 8px; }
  .scr-home .hero .mascot { font-size: 90px; }
  /* Startknopf direkt unter das Maskottchen, Rang und Wochenziel darunter (sonst unter dem Rand) */
  .scr-home .hero > * { order: 3; }
  .scr-home .hero > .say-row { order: 0; }
  .scr-home .hero > .mascot { order: 1; }
  .scr-home .hero > .start-btn, .scr-home .hero > .start-row, .scr-home .hero > .start-btn + .small, .scr-home .hero > .start-row + .small { order: 2; }
  .cal { gap: 4px; }
  .cal .day { border-radius: 10px; font-size: clamp(1.1rem, 5vw, 1.6rem); }
  .cal .day .num { top: 2px; left: 4px; font-size: .72rem; }
}
@media (max-width: 520px) {
  .start-row .start-btn { font-size: 1.2rem; padding: 14px 18px; }
  .stair { width: 32px; }
}
.one-count { white-space: nowrap; }
/* ⚡ Einmaleins in der Bonus-Runde (an erster Stelle) und Reihenwahl */
/* Bonus-Runde (23.11.2026): weitere Themen auf Wunsch einblenden */
.focus-pick .more-topics { display: block; margin: 12px auto 0; }
.focus-grid.row-grid { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.focus-grid.row-grid .focus-btn { padding: 10px 6px; font-size: 1rem; }
.focus-grid.row-grid .fi { font-size: 1.7rem; font-weight: 900; }

/* Wochenziel (21.11.2026): antippbar am Start, eigene Feier mit Truhen-Inhalt */
.week-btn { background: none; border: 0; padding: 6px 10px; border-radius: 18px; cursor: pointer; font: inherit; }
.week-btn:active { transform: scale(.97); }
.week-btn.reached { background: rgba(255, 224, 102, .45); }
.week-trophy { font-size: 64px; line-height: 1; }
.chest-loot { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.chest-loot .loot { background: rgba(255,255,255,.85); border-radius: 18px; padding: 10px 16px; box-shadow: var(--shadow-s); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 130px; }
.chest-loot .zahli-reveal { font-size: 90px; }
.chest-loot .zahli-reveal.big { font-size: 110px; }
.chest-loot .loot-stars { font-size: 2.2rem; font-weight: 900; line-height: 1.6; }
.modal .chest-loot .zahli-reveal { font-size: 64px; animation: none; }

/* Rechenweg-Hilfe beim Einmaleins (22.11.2026): Punktefeld und eine Zeile Rechenweg, ohne Erklärtext */
.helpbox { background: #f4efff; border: 3px solid #d6c8ff; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 640px; color: #2b2350; position: relative; }
.dotfield { max-width: 100%; max-height: 26vh; height: auto; }
.field20 { max-width: 100%; height: auto; }
.help-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 1.2rem; }
.help-chip { padding: 3px 10px; border-radius: 12px; background: #fff; border: 2px solid #d6c8ff; white-space: nowrap; }
.help-chip.cA { border-color: #7c4dff; color: #5a2fe0; }
.help-chip.cB { border-color: #ff9800; color: #b35f00; }
.help-chip.cE { border-color: #2e9be0; color: #1b6fa8; }
.help-chip.cX { border-color: #e5533d; color: #c23a25; }
.help-chip.res { background: #e8f8ec; border-color: #46c06b; color: #1d7a3c; }
.help-op { font-weight: 900; color: #6b6290; }
.jumpline { max-width: 100%; height: auto; }
.placetable-help { max-width: 100%; height: auto; max-height: 24vh; }
.helpbox.plain .help-chip.res { white-space: normal; text-align: center; }
/* Wochenziel: ⚡ Challenges neben den Tagen */
.weekdots .dot.ch { border-color: #ffb300; }
.weekdots .dot.ch.on { background: #ffe066; border: 3px solid #fff; }
/* Wochenziel (23.11.2026, Wunsch des Users): Tage oben, ⚡ Challenges darunter, Truhe rechts daneben vertikal mittig */
.weekdots .wk-rows { display: flex; flex-direction: column; gap: 6px; }
.weekdots .wk-row { display: flex; gap: 10px; }
.weekdots .chest { margin-left: 6px; }
/* ⚡ Challenge heute schon gemacht: gleicher Knopf, grün (vorher kaum zu erkennen) */
.start-row .start-btn.again { opacity: 1; animation: none; }
/* Laden: zu teuer, aber antippbar (sagt, wie viele Sterne fehlen) */
.item .btn.short { opacity: .5; }
.ch-remind { font-weight: 800; color: #b35f00; }
/* Mit Rechenweg-Hilfe: Karte kompakter, damit Rechnung, Punktefeld und Zeile auch am Handy zu sehen sind */
.task-card.with-help { padding-top: 42px; gap: 8px; }
.task-card.with-help .expr { font-size: clamp(1.8rem, 4.5vw, 3.2rem); }
@media (max-width: 520px) {
  .task-card.with-help { padding: 38px 12px 12px; }
  .helpbox { padding: 6px 8px; gap: 4px; border-width: 2px; }
  .dotfield { max-height: 17vh; }
  .help-line { font-size: .95rem; gap: 4px; }
  .help-chip { padding: 2px 6px; }
}
/* Wochenpunkte mit ⚡: am Handy kleiner, damit 5 Tage, 2 Challenges und die Truhe in eine Zeile passen */
@media (max-width: 520px) {
  .weekdots { gap: 6px; }
  .weekdots .wk-row { gap: 6px; }
  .weekdots .dot { width: 30px; height: 30px; font-size: 1rem; }
  .weekdots .chest img { width: 58px; }
}

/* Themenliste im Eltern-Bereich (seit 23.11.2026) */
.topic-row { padding: 10px 0; border-bottom: 1px solid #f0eef8; display: flex; flex-direction: column; gap: 6px; }
.topic-row.off .topic-name { color: var(--ink-soft); }
.topic-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-name { font-weight: 800; }
.topic-per { font-size: .85rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.topic-ctl { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.topic-ctl label { display: flex; align-items: center; gap: 6px; }
select.sel.small-sel { padding: 5px 8px; font-size: .9rem; }
input.txt.small-txt { padding: 5px 8px; width: 7.5em; font-size: .9rem; }
/* Übergang Aufwärmen → Hauptteil und 🎁 Überraschung in der Mission */
.warm-done { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.warm-done-icon { font-size: 60px; line-height: 1.1; margin-top: 10px; }
@media (max-width: 520px) { .warm-done-icon { font-size: 44px; margin-top: 26px; } }
.task-card.surprise { box-shadow: 0 0 0 6px #c9b6ff, var(--shadow); }
/* Handy (23.11.2026, iPhone 16 in Safari: Geld-Aufgabe überdeckte die obere Tastenreihe, Uhr und Rechenmauer wurden abgeschnitten):
   Die Karte füllt genau den Platz zwischen Sprechblase und Ziffernblock und wird nie größer. Passt der Inhalt nicht, beginnt er
   oben (statt über das Schild zu rutschen) und lässt sich in der Karte schieben. Bei wenig Höhe (Safari mit Leisten) alles etwas kleiner. */
.task-card { justify-content: safe center; }
@media (max-width: 520px) {
  .task-card { flex: 1 1 auto; min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; }
  .task-card .prompt { font-size: 1.15rem; }
  .rect-svg { width: auto; max-width: 70%; max-height: 24vh; }
}
@media (max-width: 520px) and (max-height: 760px) {
  .m-top { padding-bottom: 0; }
  .path { height: 46px; }
  .m-body { gap: 10px; padding-top: 4px; }
  .m-task { gap: 8px; }
  .m-meta .mascot.small { font-size: 48px; }
  .m-meta .bubble { font-size: 1.05rem; padding: 8px 14px; }
  .task-card { padding: 44px 14px 14px; gap: 10px; }
  .task-card .speak-btn { width: 38px; height: 38px; font-size: 1.1rem; top: 6px; right: 8px; }
  .task-card .prompt { font-size: 1.05rem; line-height: 1.3; }
  .numpad { gap: 7px; }
  .numpad button { height: 58px; font-size: 1.8rem; }
  .numpad .del-wide { height: 48px; font-size: 1.4rem; }
  .clock-svg { width: min(200px, 28vh); }
  .rect-svg { width: auto; max-width: 70%; max-height: 19vh; }
  .wall { font-size: 1.4rem; gap: 6px; }
  .wall .wrow { gap: 6px; }
  .hintbox, .solutionbox { font-size: 1rem; padding: 8px 12px; }
}
/* Bonus-Auswahl am Handy (23.11.2026): zwei Spalten, damit Zufall und alle 6 Kacheln ohne Schieben zu sehen sind */
@media (max-width: 520px) {
  .focus-pick .focus-grid:not(.row-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .focus-pick .focus-grid:not(.row-grid) .focus-btn { padding: 8px 6px; font-size: 1rem; }
  .focus-pick .focus-grid:not(.row-grid) .focus-btn .fi { font-size: 1.7rem; }
  .focus-pick .focus-btn.random { flex-wrap: wrap; row-gap: 0; padding: 10px; }
  .focus-pick .focus-btn.random small { flex-basis: 100%; text-align: center; }
  .focus-pick h2 { font-size: 1.3rem; padding-right: 34px; }
}
/* Bilder zum Abzählen (Knobeln, 23.11.2026) */
.pics { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pics-row { display: flex; gap: 10px; font-size: 2.2rem; line-height: 1.15; }
@media (max-width: 520px) { .pics-row { font-size: 1.8rem; gap: 6px; } }
/* 🎁 Überraschung am Ende (23.11.2026): Geschenkband über die ganze Karte, ohne Bewegung */
.task-card.surprise { box-shadow: 0 0 0 6px #ff8cc6, var(--shadow); padding-top: 58px; }
.surprise-ribbon { position: absolute; top: 0; left: 0; right: 0; height: 38px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: repeating-linear-gradient(135deg, #ff5fae 0 16px, #ff86c3 16px 32px); color: #fff; font-weight: 900; font-size: 1.15rem;
  letter-spacing: .3px; text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.surprise-ribbon .plus { background: #fff; color: #d02f86; border-radius: 999px; padding: 1px 10px; font-size: .95rem; text-shadow: none; }
/* 🔊 sitzt im Geschenkband, damit er den Aufgabentext nicht überdeckt */
.task-card.surprise .speak-btn { top: 3px; right: 8px; width: 32px; height: 32px; font-size: 1rem; z-index: 2; }
@media (max-width: 520px) { .task-card.surprise { padding-top: 52px; } .task-card.surprise .speak-btn { top: 3px; right: 6px; width: 32px; height: 32px; } }
.surprise-intro { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Text im Geschenkband weicht dem 🔊 aus */
.surprise-ribbon { padding: 0 44px; }
@media (max-width: 520px) { .surprise-ribbon { font-size: 1rem; gap: 6px; padding: 0 40px; } .surprise-ribbon .plus { font-size: .85rem; padding: 0 7px; } }
/* Obst-Rätsel (23.11.2026): Bild-Gleichungen untereinander */
.eqs { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 2rem; font-weight: 900; }
@media (max-width: 520px) { .eqs { font-size: 1.7rem; } }
/* Rätsel „Wer bin ich?“ und Rechendreieck (23.11.2026) */
.clues { display: flex; flex-direction: column; gap: 6px; font-size: 1.15rem; font-weight: 800; text-align: left; }
.wall.tri .brick { border-radius: 50%; min-width: 2.2em; height: 2.2em; background: #ffe1ef; border-color: #ff8cc6; }
.wall.tri .brick.ex { border-radius: 10px; min-width: 3.2em; height: 1.6em; background: #e8f8ec; border-color: #46c06b; }
.wall.tri .wrow { gap: 14px; }
@media (max-width: 520px) { .clues { font-size: 1rem; } }
/* Zauberquadrat, viele Bilder (Kekse) (23.11.2026) */
.wall.square .brick, .wall.square .field { min-width: 2.2em; height: 1.8em; background: #eef3ff; border-color: #9db7ff; }
.wall.square .field { background: var(--card-2); border-color: #c9bff3; }
.wall.square .field.active { background: #fff; border-color: var(--primary); }
.pics-row { flex-wrap: wrap; justify-content: center; max-width: 340px; }
.pics-row.many { font-size: 1.6rem; gap: 6px; }
@media (max-width: 520px) { .pics-row.many { font-size: 1.3rem; gap: 4px; max-width: 300px; } }

/* ---------- Handy im Querformat (26.11.2026, iPhone 16 quer: 852 × 393) ----------
   Gilt nur quer und höchstens 500 px hoch: iPads (ab 744 px Höhe) und Handys hochkant bleiben unverändert.
   Zwei Spalten wie am iPad, alles kleiner; der Ziffernblock bleibt 3 × 4 und passt genau in die Höhe. */
@media (orientation: landscape) and (max-height: 500px) {
  /* Dynamic Island und Kamera liegen quer seitlich: jeder Bildschirm hält dort Abstand, der Hintergrund läuft bis zum Rand */
  .screen { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .pad { padding-left: 16px; padding-right: 16px; }
  .parent-btn { right: calc(16px + env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); padding: 5px 11px; font-size: .85rem; }
  .stars { padding: 4px 12px 4px 9px; font-size: 1.1rem; }
  .stars .s { font-size: 1.15rem; }
  .topbar { padding-top: 6px; padding-bottom: 4px; }
  .topbar h1 { font-size: 1.25rem; }
  .icon-btn { width: 42px; height: 42px; font-size: 1.2rem; }

  /* Startseite: links Begrüßung, Maskottchen, Startknopf; rechts die Kacheln; jede Spalte scrollt für sich */
  .home-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden;
    gap: 12px; padding: 2px 12px 6px; }
  .scr-home .hero { overflow-y: auto; justify-content: flex-start; gap: 6px; padding: 2px 0 10px; min-height: 0; }
  .scr-home .hero > * { order: 3; flex-shrink: 0; }
  .scr-home .hero > .say-row { order: 0; }
  .scr-home .hero > .mascot { order: 1; }
  .scr-home .hero > .start-btn, .scr-home .hero > .start-row, .scr-home .hero > .start-btn + .small, .scr-home .hero > .start-row + .small { order: 2; }
  .scr-home .hero .say-row { gap: 8px; }
  .scr-home .hero .home-zahli { width: 46px !important; }
  .scr-home .hero .bubble { font-size: .95rem; padding: 7px 12px; }
  .scr-home .hero .mascot { font-size: 72px; }
  .scr-home .start-btn { font-size: 1.25rem; padding: 10px 18px; border-radius: 20px; }
  .scr-home .start-row { gap: 8px; }
  .scr-home .tiles, .home-main .tiles { overflow-y: auto; gap: 8px; padding: 2px 2px 52px; }
  .tile { padding: 6px 4px; gap: 1px; font-size: .88rem; border-radius: 16px; }
  .tile .ti { font-size: 1.55rem; }
  .tile .sub { font-size: .72rem; }

  /* Aufgaben (Mission, Challenge, Blitz-Runde): oben schmal, Ziffernblock rechts in voller Höhe */
  .m-top { padding: 4px 12px 0; gap: 8px; }
  .path { height: 34px; }
  .path .walker { font-size: 28px; }
  .path .goal { font-size: 26px; }
  .combo { font-size: 1.05rem; min-width: 52px; }
  .m-body { grid-template-columns: minmax(0, 1fr) min(300px, 36vw); grid-template-rows: minmax(0, 1fr); gap: 12px;
    padding: 4px 12px max(8px, env(safe-area-inset-bottom)); }
  .m-task { gap: 6px; }
  .scene.ground { inset: auto -12px -6px; }
  .m-meta .mascot.small { font-size: 40px; }
  .m-meta .bubble { font-size: .95rem; padding: 6px 12px; }
  .task-card { flex: 1 1 auto; min-height: 0; margin: 0; width: 100%; overflow-y: auto; overscroll-behavior: contain;
    padding: 34px 14px 10px; gap: 8px; border-radius: 22px; }
  .task-card .tag { top: 9px; left: 14px; font-size: .85rem; }
  .task-card .speak-btn { width: 34px; height: 34px; font-size: 1rem; top: 5px; right: 8px; }
  .task-card .prompt { font-size: 1rem; line-height: 1.3; }
  .expr { font-size: clamp(1.6rem, 8.5vh, 2.6rem); gap: 6px; }
  .expr.small-expr { font-size: clamp(1.3rem, 6.5vh, 2rem); }
  .surprise-ribbon { font-size: 1rem; gap: 6px; white-space: nowrap; }
  .surprise-ribbon .plus { font-size: .85rem; padding: 0 7px; }
  .task-card.surprise { padding-top: 44px; }
  .surprise-ribbon { height: 32px; }
  .wall { font-size: 1.3rem; gap: 5px; }
  .wall .wrow { gap: 5px; }
  .hintbox, .solutionbox { font-size: .95rem; padding: 6px 10px; }
  .swapbox { font-size: .95rem; padding: 6px 10px; }
  .clock-svg { width: min(170px, 35vh); }
  .rect-svg { width: auto; max-width: 70%; max-height: 38vh; }
  /* Ziffernblock: wieder 3 × 4 (die Regel für schmale Bildschirme stellt sonst 6 × 2 um), Höhe passend zum Bildschirm */
  .numpad { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .numpad button[data-k] { order: 0; }
  .numpad button { height: calc((100vh - 96px) / 4); height: calc((100dvh - 96px) / 4); font-size: 1.8rem; border-radius: 16px; box-shadow: 0 4px 0 var(--line); }
  .numpad .ok { box-shadow: 0 4px 0 #168a56; }
  .numpad .del { box-shadow: 0 4px 0 #ffd0c2; font-size: 1.5rem; }
  .numpad .del-wide { height: 40px; font-size: 1.2rem; grid-column: 1 / -1; }
  /* Mit Komma (Geld) kommt eine fünfte Reihe „⌫ löschen“ dazu: die vier Reihen darüber etwas niedriger */
  .numpad:has(.del-wide) button:not(.del-wide) { height: calc((100vh - 143px) / 4); height: calc((100dvh - 143px) / 4); }

  /* Duell: zwei Hälften nebeneinander, Ziffernblock je Seite in zwei Reihen 1–6 / 7 8 9 0 ⌫ ✓ */
  .duel .side { gap: 6px; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); }
  .duel .side .task-card { min-height: 60px; padding: 6px; }
  .duel .side .expr { font-size: clamp(1.4rem, 7vh, 2.2rem); }
  .duel .score { font-size: 1.1rem; }
  .duel .side .numpad { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .duel .side .numpad button { height: 44px; font-size: 1.3rem; }
  .duel .side .numpad [data-k="1"] { order: 1; } .duel .side .numpad [data-k="2"] { order: 2; } .duel .side .numpad [data-k="3"] { order: 3; }
  .duel .side .numpad [data-k="4"] { order: 4; } .duel .side .numpad [data-k="5"] { order: 5; } .duel .side .numpad [data-k="6"] { order: 6; }
  .duel .side .numpad [data-k="7"] { order: 7; } .duel .side .numpad [data-k="8"] { order: 8; } .duel .side .numpad [data-k="9"] { order: 9; }
  .duel .side .numpad [data-k="0"] { order: 10; } .duel .side .numpad [data-k="del"] { order: 11; } .duel .side .numpad [data-k="ok"] { order: 12; }

  /* Fenster: weniger Rand, scrollen bei Bedarf */
  .modal-bg { padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .modal { padding: 14px 18px; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 22px; }
  .modal h2 { margin-bottom: 8px; }
  .pindots { margin: 4px 0; }
  .pindots + p { margin: 2px 0; }
  .pinpad { gap: 6px; margin-top: 2px; }
  .pinpad button { height: 42px; }
}

/* 🎬 Kino (30.11.2026): Film-Karten mit Vorschaubild, Abspielen über die ganze Fläche */
.kino-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.kino-card { position: relative; border: none; border-radius: 22px; padding: 0 0 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow); text-align: center; color: var(--ink); }
.kino-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.kino-thumb { position: relative; }
.kino-card .kino-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%;
  background: rgba(124, 77, 255, .92); color: #fff; font-size: 1.8rem; line-height: 64px; padding-left: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.kino-card h3 { margin: 10px 10px 2px; font-size: 1.25rem; }
.kino-card p { margin: 0; font-weight: 700; }
.kino-player { position: fixed; inset: 0; z-index: 50; background: #15121f; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
/* „Fertig geschaut“ liegt hochkant unten, quer rechts daneben, also nie dort, wo der Film in der anderen Lage war:
   Am iPhone reagierte der Knopf nach quer und wieder hochkant nicht mehr (30.11.2026). Vermutlich schluckt der
   YouTube-Rahmen Tipps noch an seiner alten Stelle; hochkant unterhalb der kurzen Bildschirmseite und quer rechts davon
   kann diese alte Stelle nie liegen. */
.kino-frame { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; padding: 8px 8px 0; }
.kino-frame iframe { border: 0; width: min(100%, calc((100dvh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; background: #000; border-radius: 10px; }
.kino-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px 14px 22px; color: #fff; font-size: 1.1rem; text-align: center; }
.kino-head .btn { flex: none; min-height: 64px; min-width: 240px; }
@media (orientation: landscape) {
  .kino-player { flex-direction: row; }
  .kino-frame { padding: 8px 0 8px 8px; }
  .kino-frame iframe { width: min(100%, calc((100dvh - 16px) * 16 / 9)); }
  .kino-head { flex: 0 0 200px; padding: 12px; }
  .kino-head .btn { min-width: 0; width: 100%; }
}
