:root {
  --pink: #ff6fb5;
  --pink-l: #ffd3ea;
  --violet: #8b5cf6;
  --violet-l: #e9ddff;
  --sky: #7cc8ff;
  --mint: #3ccf9a;
  --sun: #ffc93c;
  --red: #ff5a6e;
  --ink: #3b2a55;
  --ink-2: #6f5f8a;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(120, 80, 170, .12), 0 12px 30px rgba(120, 80, 170, .12);
  --font: 'Fredoka', 'Nunito', 'Segoe UI Rounded', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(170deg, #ffe1f2 0%, #e8dcff 45%, #d4ecff 100%) fixed;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}
input, select { font: inherit; user-select: text; -webkit-user-select: text; }
#app { max-width: 1100px; margin: 0 auto; padding: 12px 16px 24px; min-height: 100vh; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Grundbausteine ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.btn {
  font: inherit; font-weight: 600; font-size: 1.05rem; border: 0; cursor: pointer;
  background: #fff; color: var(--ink); padding: 12px 20px; border-radius: 16px;
  box-shadow: 0 4px 0 rgba(120, 80, 170, .2); transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120, 80, 170, .2); }
.btn.primary { background: linear-gradient(180deg, #ff86c4, var(--pink)); color: #fff; box-shadow: 0 4px 0 #d94a92; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 4px 0 #c9384b; }
.btn.small { font-size: .95rem; padding: 8px 14px; }
.btn.big { font-size: 1.3rem; padding: 16px 28px; }
.btn.icon { width: 48px; height: 48px; padding: 0; font-size: 1.3rem; display: grid; place-items: center; }
.hidden { display: none !important; }
.small { font-size: .9rem; color: var(--ink-2); }

.bar { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; }
.bar-mid { display: grid; justify-items: center; gap: 2px; }
.bar h1 { margin: 0; text-align: center; font-size: clamp(1.3rem, 3.5vw, 2rem); color: var(--violet); text-shadow: 0 2px 0 #fff; }
.topic-chip { font-size: .85rem; background: rgba(255,255,255,.8); padding: 2px 12px; border-radius: 999px; color: var(--ink-2); }
.wallet { display: flex; gap: 6px; }
.coins, .lucky { background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 1.1rem; box-shadow: var(--shadow); white-space: nowrap; }
.center { text-align: center; margin: 0; }

/* ---------- Pferd ---------- */
.horse { width: 100%; height: auto; display: block; overflow: visible;
  filter: drop-shadow(0 0 .6px #6b4f96) drop-shadow(0 0 .6px #6b4f96) drop-shadow(0 4px 3px rgba(80, 50, 120, .18)); }
.horse .leg, .horse .shin { transform-box: fill-box; transform-origin: 50% 0; }
.horse.running { --gait: .5s; }
.horse.running .l1, .horse.running .l4 { animation: legA var(--gait) infinite ease-in-out; }
.horse.running .l2, .horse.running .l3 { animation: legB var(--gait) infinite ease-in-out; }
.horse.running .l1 .shin, .horse.running .l4 .shin { animation: shinA var(--gait) infinite ease-in-out; }
.horse.running .l2 .shin, .horse.running .l3 .shin { animation: shinB var(--gait) infinite ease-in-out; }
@keyframes shinA { 0%, 100% { transform: rotate(0); } 60% { transform: rotate(38deg); } }
@keyframes shinB { 0%, 100% { transform: rotate(38deg); } 50% { transform: rotate(0); } }
.horse.running .rider { animation: post calc(var(--gait) / 2) infinite ease-in-out alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes post { to { transform: translateY(-3px) rotate(2deg); } }
.horse.running .hz-body { animation: bob calc(var(--gait) / 2) infinite ease-in-out alternate; }
.horse.running .wing { animation: flap var(--gait) infinite ease-in-out; transform-box: fill-box; transform-origin: 30% 100%; }
@keyframes legA { 0%, 100% { transform: rotate(32deg); } 50% { transform: rotate(-30deg); } }
@keyframes legB { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(32deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes flap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
.sparkles text { animation: twinkle 1.4s infinite alternate; }
.sparkles text:nth-child(2) { animation-delay: .5s; }
.sparkles text:nth-child(3) { animation-delay: .9s; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }

/* ---------- Hauptmenü ---------- */
.hero { display: grid; grid-template-columns: minmax(140px, 260px) 1fr; gap: 16px; align-items: center;
  background: linear-gradient(135deg, #fff 0%, #fff4fb 100%); }
.hero-horse { animation: idle 3s ease-in-out infinite; }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero h2 { margin: 0 0 4px; font-size: 1.8rem; }
.hero p { margin: 0 0 12px; }
.hero small { display: block; color: var(--ink-2); }
.goal-bar { height: 18px; background: var(--violet-l); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.goal-bar div { height: 100%; background: linear-gradient(90deg, var(--mint), #7be0b8); border-radius: 999px; transition: width .6s; }
.streak-badge { display: inline-block; margin-left: 10px; background: #fff1d6; padding: 2px 10px; border-radius: 999px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile {
  font: inherit; border: 0; cursor: pointer; text-align: left; color: var(--ink);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 4px;
  transition: transform .12s;
}
.tile:hover { transform: translateY(-3px) rotate(-.5deg); }
.tile:active { transform: translateY(2px); }
.tile .ti { font-size: 2.6rem; }
.tile b { font-size: 1.35rem; }
.tile small { color: var(--ink-2); font-size: .95rem; }
.t-race { background: linear-gradient(135deg, #ffd6ec, #ffb3da); }
.t-blitz { background: linear-gradient(135deg, #fff3c4, #ffe08a); }
.t-train { background: linear-gradient(135deg, #dff6ff, #b8e4ff); }
.t-wall { background: linear-gradient(135deg, #ffe4d1, #ffc9a6); }
.t-review { background: linear-gradient(135deg, #dcfbe9, #b5f0d0); }
.t-stable { background: linear-gradient(135deg, #ece2ff, #d5c2ff); }
.foot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: auto; }

/* ---------- Profile ---------- */
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.profile { font: inherit; border: 0; cursor: pointer; display: grid; justify-items: center; gap: 4px; color: var(--ink); }
.profile b { font-size: 1.3rem; }
.profile.add { place-content: center; background: rgba(255, 255, 255, .6); border: 3px dashed #c9b3ff; }
.profile .plus { font-size: 3rem; color: var(--violet); }

.form { display: grid; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.form label { font-weight: 600; display: grid; gap: 6px; }
.form input:not([type=checkbox]), .form select { padding: 12px 14px; border-radius: 14px; border: 2px solid var(--violet-l); font-size: 1.15rem; color: var(--ink); }
.form input:focus { outline: none; border-color: var(--violet); }
.grade-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.gbtn { font: inherit; font-size: 1.5rem; font-weight: 700; width: 56px; height: 56px; border-radius: 16px; border: 3px solid var(--violet-l); background: #fff; color: var(--ink); cursor: pointer; }
.gbtn.on { background: var(--violet); color: #fff; border-color: var(--violet); }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kbtn { font: inherit; border: 3px solid var(--violet-l); background: #fff; border-radius: 18px; padding: 8px; cursor: pointer; display: grid; justify-items: center; color: var(--ink); }
.kbtn.on { border-color: var(--pink); background: #fff3fa; }
.kbtn .horse { max-width: 160px; }
.chk { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.chk input { width: 22px; height: 22px; accent-color: var(--violet); }
.ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; }

/* ---------- Spielbereich ---------- */
.play-area { display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 14px; align-items: start; }
.task-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-height: 190px; display: grid; align-content: center; gap: 10px; }
.task { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .3em; font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 700; }
.task .sym { color: var(--violet); }
.slot { min-width: 1.8em; padding: 0 .25em; text-align: center; border-radius: 14px; background: var(--violet-l); color: var(--ink-2); border: 3px dashed #b9a3f0; }
.slot.filled { color: var(--ink); background: #fff7d6; border-style: solid; border-color: var(--sun); }
.task.ok .slot { background: #d9f7e9; border-color: var(--mint); color: #138a5e; animation: pop .3s; }
.task.bad .slot { background: #ffe0e5; border-color: var(--red); color: #c0263d; animation: shake .35s; }
@keyframes pop { 50% { transform: scale(1.18); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.feedback { min-height: 1.5em; }
.steps { background: #f3edff; border-radius: 14px; padding: 10px 14px; font-size: 1.15rem; display: grid; gap: 4px; }
.steps.small { font-size: 1rem; text-align: center; }
.hint { background: #fff6d8; border-radius: 14px; padding: 10px 14px; font-size: 1.1rem; }
.hint.good { background: #dcf8ea; }
.task-actions { display: flex; gap: 10px; justify-content: center; }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad-k { font: inherit; font-size: 1.8rem; font-weight: 700; height: 62px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(120, 80, 170, .22); cursor: pointer; touch-action: manipulation; }
.pad-k.hit, .pad-k:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120, 80, 170, .22); background: #f6f0ff; }
.pad-ok { grid-column: span 3; background: linear-gradient(180deg, #5fe0ae, var(--mint)); color: #fff; box-shadow: 0 4px 0 #24a676; }
.pad-back + .pad-ok { grid-column: span 2; }
.pad-ok.hit, .pad-ok:active { background: var(--mint); }

.countdown { position: fixed; inset: 0; display: none; place-items: center; font-size: 9rem; font-weight: 700; color: #fff; text-shadow: 0 6px 0 var(--pink), 0 10px 30px rgba(0, 0, 0, .2); pointer-events: none; z-index: 30; }
.countdown.show { display: grid; animation: pop .5s; }

.float-text { position: absolute; left: 30%; top: 0; font-weight: 700; font-size: 1.3rem; pointer-events: none; animation: floatUp 1.2s forwards; z-index: 5; white-space: nowrap; }
.float-text.good { color: #138a5e; }
.float-text.bad { color: #c0263d; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-40px); } }

/* ---------- Rennen ---------- */
.race-wrap { display: grid; gap: 8px; }
.track { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #bfe8ff 0%, #e6f6ff 18%, #9be39b 18%, #7ed07e 100%); padding: 34px 10px 8px; }
.track::before { content: '☁️      ☁️              ☁️        ⛰️'; position: absolute; top: 4px; left: 10px; right: 10px; font-size: 1.2rem; opacity: .8; white-space: pre; }
.lane { position: relative; height: clamp(62px, 10vh, 86px); border-bottom: 3px dashed rgba(255, 255, 255, .55); }
.lane:last-of-type { border-bottom: 0; }
.lane.me { background: rgba(255, 255, 255, .25); border-radius: 12px; }
.lane-name { position: absolute; right: 34px; top: 2px; font-size: .8rem; font-weight: 600; color: #2f6b2f; background: rgba(255, 255, 255, .7); padding: 0 8px; border-radius: 999px; z-index: 2; }
.lane.me .lane-name { color: #fff; background: var(--pink); }
.runner { position: absolute; left: 0; bottom: 0; height: 100%; aspect-ratio: 200 / 168; will-change: transform; }
.dust { position: absolute; left: -26px; bottom: 6px; width: 34px; height: 16px; border-radius: 50%; background: radial-gradient(#fff9, transparent 70%); opacity: 0; transition: opacity .3s; }
.lane.fast .dust { opacity: 1; animation: dust .3s infinite; }
@keyframes dust { 50% { transform: scale(1.3) translateX(-6px); } }
.finish { position: absolute; top: 30px; bottom: 0; right: 14px; width: 14px;
  background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 14px 14px; opacity: .85; }
.speedo { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 16px; box-shadow: var(--shadow); }
.speedo-bar { flex: 1; height: 14px; background: var(--violet-l); border-radius: 999px; overflow: hidden; }
.speedo-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--sun), var(--red)); border-radius: 999px; transition: width .2s; }
.speedo-txt { min-width: 140px; text-align: right; }

/* ---------- Sternenblitz ---------- */
.blitz-top { display: flex; gap: 12px; align-items: center; }
.timer { position: relative; flex: 1; height: 34px; background: #fff; border-radius: 999px; overflow: hidden; box-shadow: var(--shadow); }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--sky), var(--violet)); transition: width .1s linear; }
.timer-fill.low { background: linear-gradient(90deg, var(--sun), var(--red)); }
.timer-txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.blitz-score { background: #fff; border-radius: 999px; padding: 4px 18px; box-shadow: var(--shadow); font-size: 1.5rem; display: grid; line-height: 1.1; text-align: center; }
.blitz-score small { font-size: .75rem; color: var(--ink-2); }
.blitz-stage { position: relative; height: 150px; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #2b1f5c, #5b3fa8 70%, #8a6ad6); box-shadow: var(--shadow); }
.blitz-horse { position: absolute; left: 12px; bottom: -6px; width: 150px; z-index: 2; }
.sky { position: absolute; inset: 0 0 0 160px; }
.sky-star { position: absolute; font-size: 1.3rem; animation: pop .4s; }
.streak { position: absolute; right: 12px; top: 10px; color: #ffe066; font-weight: 700; z-index: 3; text-shadow: 0 2px 4px #0006; }

/* ---------- Reitstunde ---------- */
.jumps { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.jump { width: 26px; height: 26px; border-radius: 8px; background: #fff; box-shadow: 0 3px 0 rgba(120, 80, 170, .18); }
.jump.ok { background: var(--mint); }
.jump.ok::after { content: '✓'; color: #fff; display: grid; place-items: center; height: 100%; font-weight: 700; }
.jump.bad { background: var(--sun); }
.lesson-stage { display: flex; align-items: center; gap: 14px; }
.lesson-horse { width: 150px; flex-shrink: 0; }
.lesson-horse.hop { animation: hop .6s; }
@keyframes hop { 40% { transform: translateY(-22px) rotate(-6deg); } }
.bubble { position: relative; background: #fff; border-radius: 20px; padding: 14px 18px; box-shadow: var(--shadow); font-size: 1.15rem; }
.bubble::before { content: ''; position: absolute; left: -12px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right-color: #fff; border-left: 0; }

/* ---------- Zahlenmauer ---------- */
.wall-info { text-align: center; font-size: 1.1rem; }
.wall-round { display: inline-block; margin-left: 8px; background: #fff; padding: 2px 12px; border-radius: 999px; }
.wall-stage { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.wall { display: grid; gap: 6px; justify-items: center; }
.wall-row { display: flex; gap: 6px; }
.wall-horse { width: 130px; }
.brick { min-width: clamp(76px, 12vw, 110px); height: 58px; display: grid; place-items: center; border-radius: 10px; font-size: 1.6rem; font-weight: 700; padding: 0 6px; }
.brick.known { background: linear-gradient(180deg, #ffb48a, #f08f5c); color: #fff; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.brick.empty { background: #fff; border: 3px dashed #f3a77c; color: var(--ink-2); cursor: pointer; }
.brick.empty.sel { border-style: solid; border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-l); color: var(--ink); }
.brick.empty.ok { background: #d9f7e9; border: 3px solid var(--mint); color: #138a5e; }
.brick.empty.bad { background: #ffe0e5; border: 3px solid var(--red); color: #c0263d; }

/* ---------- Stall ---------- */
.stable { display: grid; grid-template-columns: minmax(260px, 1fr) 1.3fr; gap: 14px; }
.stable-preview { display: grid; gap: 10px; align-content: start; background: linear-gradient(180deg, #fff 60%, #e7f8e7); }
.stable-preview .pv { cursor: pointer; }
.stable-preview input { text-align: center; font-size: 1.4rem; font-weight: 600; border: 2px solid var(--violet-l); border-radius: 14px; padding: 8px; color: var(--ink); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { font: inherit; font-weight: 600; flex: 1; padding: 10px; border: 0; border-radius: 12px; background: var(--violet-l); color: var(--ink); cursor: pointer; }
.tabs button.on { background: var(--violet); color: #fff; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.item { font: inherit; border: 3px solid transparent; background: #faf7ff; border-radius: 16px; padding: 10px 6px; display: grid; justify-items: center; gap: 4px; cursor: pointer; color: var(--ink); }
.item.on { border-color: var(--mint); background: #effcf6; }
.item.locked { opacity: .75; }
.item.locked .sw, .item.locked .sw-emoji { filter: grayscale(.5); }
.item small { color: var(--ink-2); }
.sw { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--violet-l); }
.sw-emoji { font-size: 2rem; line-height: 42px; }
.buy-preview { display: grid; place-items: center; margin: 8px; }

/* ---------- Eltern ---------- */
.parents table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.parents th, .parents td { padding: 8px; text-align: left; border-bottom: 1px solid var(--violet-l); }
.mistakes { display: flex; flex-wrap: wrap; gap: 6px; }
.mistakes span { background: #fff1d6; padding: 4px 10px; border-radius: 999px; }
.row { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- Modal, Toast, Konfetti ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(59, 42, 85, .45); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fadeIn .2s; }
.modal { max-width: 460px; width: 100%; text-align: center; animation: pop .35s; }
.modal h2 { margin: 6px 0; }
.modal-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.result-medal { font-size: 4rem; }
.podium { display: grid; gap: 4px; margin: 8px auto; max-width: 260px; text-align: left; }
.podium .me { font-weight: 700; color: var(--pink); }
.prize { font-size: 1.6rem; font-weight: 700; color: #e07a00; }
.big { font-size: 2rem; font-weight: 700; margin: 4px; }
@keyframes fadeIn { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; z-index: 50; transition: opacity .4s; font-size: 1.1rem; }
.toast.out { opacity: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -40px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- Kleine Bildschirme / Tablets hochkant ---------- */
@media (max-width: 760px) {
  .play-area { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 120px 1fr; }
  .hero h2 { font-size: 1.4rem; }
  .stable { grid-template-columns: 1fr; }
  .pad-k { height: 50px; font-size: 1.5rem; }
  .task-box { min-height: 110px; padding: 12px; }
  .lane { height: 54px; }
  #app { gap: 10px; padding-top: 8px; }
  .lesson-horse { width: 100px; }
  .wall-horse { display: none; }
  .speedo-txt { min-width: 100px; font-size: .9rem; }
}

/* ================= v2: Geschichte, Aufgabenwahl, Stall ================= */
.horse.big { max-width: 420px; margin: 0 auto; }
.task .word { font-size: .55em; color: var(--ink-2); }
.frac { display: inline-grid; justify-items: center; line-height: 1; font-size: .8em; vertical-align: middle; }
.frac .num { border-bottom: 4px solid var(--ink); padding: 0 .15em .08em; }
.frac .den { padding-top: .08em; }
.frac .slot { font-size: .9em; }
.star-row { font-size: 2.4rem; letter-spacing: 6px; color: #e3dcef; }
.star-row .on { color: #ffc93c; text-shadow: 0 2px 0 #e09a00; }

/* Hauptmenü */
.adventure { font: inherit; border: 0; cursor: pointer; text-align: left; color: var(--ink); display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: linear-gradient(100deg, #fff 0%, #fff4fb 50%, #eef6ff 100%); transition: transform .12s; }
.adventure:hover { transform: translateY(-3px); }
.adventure b { display: block; font-size: 1.35rem; margin: 2px 0; }
.adventure small { color: var(--ink-2); }
.adv-k { color: var(--pink); font-weight: 600; }
.adv-go { font-size: 2rem; color: var(--violet); }
.tiles.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Karte */
.map-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.map-top p { margin: 4px 0 8px; }
.chapters { display: grid; gap: 14px; }
.chapter { border-radius: var(--radius); padding: 14px 16px 22px; box-shadow: var(--shadow); }
.chapter h3 { margin: 0 0 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chapter .deco { letter-spacing: 2px; }
.chapter.locked { filter: grayscale(.85) opacity(.6); }
.path { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.trail { flex: 1 0 14px; max-width: 50px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.95) 0 8px, transparent 8px 14px); }
.node { font: inherit; color: var(--ink); width: 132px; min-height: 120px; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.08); cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 8px; border: 4px solid transparent; }
.node.done { border-color: var(--col); }
.node.cur { border-color: var(--pink); animation: pulse 1.4s infinite; }
.node.lock { background: rgba(255,255,255,.55); cursor: default; }
.node-ic { font-size: 2rem; }
.node-t { font-size: .85rem; font-weight: 600; text-align: center; line-height: 1.15; }
.node-s i { font-style: normal; color: #e3dcef; font-size: 1.1rem; }
.node-s i.on { color: #ffc93c; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,111,181,.25); } }
.crystal { display: grid; justify-items: center; font-size: 2.4rem; gap: 2px; filter: grayscale(1) opacity(.45); }
.crystal small { font-size: .75rem; }
.crystal.got { filter: drop-shadow(0 0 10px var(--col)); }
.crystal.big { font-size: 5rem; filter: drop-shadow(0 0 18px var(--col)); animation: pop .6s; }
.gift { background: #fff4d6; border-radius: 14px; padding: 8px; }

/* Dialog-Szene */
.scene { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; animation: fadeIn .3s; overflow: auto; }
.scene-title { position: absolute; top: 16px; left: 0; right: 0; text-align: center; font-size: 1.4rem; font-weight: 700; color: var(--violet); text-shadow: 0 2px 0 #fff; }
.scene-inner { display: grid; grid-template-columns: minmax(160px, 320px) minmax(260px, 520px); gap: 20px; align-items: center; max-width: 900px; width: 100%; }
.scene-art { animation: idle 3s ease-in-out infinite; }
.scene-art.emoji span { font-size: clamp(7rem, 18vw, 11rem); display: block; text-align: center; }
.cloud-svg { width: 100%; }
.scene-bubble { background: #fff; border-radius: 26px; padding: 22px; box-shadow: var(--shadow); position: relative; }
.scene-bubble::before { content: ""; position: absolute; left: -16px; top: 40%; border: 14px solid transparent; border-right-color: #fff; border-left: 0; }
.scene-bubble b { font-size: 1.3rem; color: var(--pink); }
.scene-bubble p { font-size: 1.3rem; line-height: 1.45; margin: 10px 0 16px; }
.scene-btns { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.scene-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.scene-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--violet-l); }
.scene-dots i.on { background: var(--violet); }

/* Aufgabenwahl */
.grade-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.grade-tabs button { font: inherit; font-weight: 600; border: 0; padding: 10px 16px; border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 rgba(120,80,170,.15); }
.grade-tabs button.on { background: var(--violet); color: #fff; }
.topics-card h3 { margin: 6px 0 10px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.topic { font: inherit; color: var(--ink); text-align: left; border: 3px solid var(--violet-l); background: #fbf9ff; border-radius: 18px; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; transition: transform .1s; }
.topic:hover { transform: translateY(-2px); border-color: var(--violet); }
.topic.last { border-color: var(--pink); background: #fff4fa; }
.topic.off { opacity: .45; cursor: not-allowed; }
.topic b { font-size: 1.05rem; }
.topic .ex { white-space: pre-wrap; font-size: 1.25rem; font-weight: 600; color: var(--violet); }
.topic .meta { display: flex; justify-content: space-between; align-items: center; }
.topic .diff { color: var(--pink); letter-spacing: 2px; }
.topic .reward { background: #fff1d6; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.topic .mine { font-size: .8rem; color: var(--ink-2); }

/* Reitstunde-Figuren */
.teacher, .spring { font-size: 5.5rem; display: block; text-align: center; }

/* Heilquelle */
.spring-card { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; background: linear-gradient(135deg, #fff, #e6f7ff); }
.spring-art { font-size: 5rem; text-align: center; animation: idle 3s ease-in-out infinite; }
.perks { padding-left: 0; list-style: none; display: grid; gap: 6px; }
.perks li { background: #fff; border-radius: 12px; padding: 8px 12px; }

/* Stall v2 */
.groups { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.groups button { font: inherit; font-weight: 700; flex: 1; padding: 10px; border: 0; border-radius: 12px; background: #f3edff; color: var(--ink); cursor: pointer; }
.groups button.on { background: var(--pink); color: #fff; }
.tabs { flex-wrap: wrap; }
.tabs button { flex: 1 0 auto; }
.lucky-item { background: #effcf1; }
.stable-preview .chk { justify-content: center; }

/* Urkunde */
.urkunde-box { border: 6px double #e0b84a; border-radius: 18px; padding: 14px; background: #fffdf3; }
.urkunde-box h1 { margin: 4px 0; color: var(--pink); font-size: 2.2rem; }

@media (max-width: 760px) {
  .scene-inner { grid-template-columns: 1fr; }
  .scene-art { max-width: 200px; margin: 0 auto; }
  .scene-bubble::before { display: none; }
  .scene-bubble p { font-size: 1.1rem; }
  .spring-card { grid-template-columns: 1fr; }
  .adventure { grid-template-columns: 1fr auto; }
  .adventure .rainbow { display: none; }
  .node { width: 104px; min-height: 104px; }
  .wallet .lucky { display: none; }
}

/* ================= v3: bunter & kindgerechter ================= */
@font-face { font-family: 'Fredoka'; src: url('../fonts/Fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
:root {
  --rb: linear-gradient(90deg, #ff6b8b, #ffa94d, #ffd43b, #51cf66, #4dabf7, #b197fc);
  --shadow: 0 6px 0 rgba(120, 80, 170, .14), 0 14px 32px rgba(120, 80, 170, .14);
}
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 60%, rgba(255, 255, 255, .8) 0 2px, transparent 3px),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, .8) 0 2px, transparent 3px),
    radial-gradient(ellipse at 0% 0%, #ffd6ec 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, #d6f0ff 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, #fff1c9 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, #d9f8e6 0%, transparent 55%),
    linear-gradient(170deg, #ffe6f4 0%, #ece2ff 50%, #dcefff 100%);
  background-attachment: fixed;
}
/* zwei langsam ziehende Wölkchen im Hintergrund */
body::before, body::after { content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 999px; background: #fff; opacity: .7;
  box-shadow: 40px -14px 0 6px #fff, 86px 2px 0 -2px #fff; width: 110px; height: 40px; animation: drift 60s linear infinite; }
body::before { top: 9vh; left: -200px; }
body::after { top: 62vh; left: -200px; animation-duration: 85s; animation-delay: -30s; }
@keyframes drift { to { left: 110vw; } }

.card { border: 3px solid rgba(255, 255, 255, .95); background: rgba(255, 255, 255, .94); }
.bar h1, .rainbow-text { background: linear-gradient(90deg, #ff4fa3, #ff8a3d, #f5b800, #2fb36b, #2f8de4, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 0 #fff); letter-spacing: .5px; }
.btn { border-radius: 18px; transition: transform .12s; }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn.primary { background: linear-gradient(180deg, #ff8fd0 0%, #ff5fb0 55%, #ff7a8a 100%); box-shadow: 0 5px 0 #d9468e, 0 10px 20px rgba(255, 95, 176, .35); text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn.icon { border-radius: 50%; background: linear-gradient(180deg, #fff, #f3ecff); }
.coins { background: linear-gradient(180deg, #fff5e0, #ffe3b0); }
.lucky { background: linear-gradient(180deg, #ecfff0, #c9f5d4); }

/* Kacheln */
.tile { border: 4px solid #fff; position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.tile .ti { display: inline-block; transition: transform .2s; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .08)); }
.tile:hover .ti { animation: tiHop .6s ease-in-out infinite alternate; }
@keyframes tiHop { from { transform: translateY(0) rotate(0); } to { transform: translateY(-6px) rotate(-6deg); } }
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.t-race { background: linear-gradient(135deg, #ffc2e2, #ff8fc7); }
.t-blitz { background: linear-gradient(135deg, #fff0a8, #ffd43b); }
.t-train { background: linear-gradient(135deg, #c9ecff, #74c0fc); }
.t-training { background: linear-gradient(135deg, #c9ecff, #74c0fc); }
.t-wall { background: linear-gradient(135deg, #ffd8bf, #ffa26b); }
.t-review { background: linear-gradient(135deg, #c9fbe0, #63e6be); }
.t-stable { background: linear-gradient(135deg, #e5d8ff, #b197fc); }
.tile small { color: #4d3d66; }
.hero { background: linear-gradient(135deg, #ffffff 0%, #fff0f8 55%, #f0e8ff 100%); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; left: -40px; bottom: -70px; width: 360px; height: 140px; border-radius: 50%; background: radial-gradient(#c3f0c8, #a2e5ad); opacity: .7; }
.hero > * { position: relative; }
.adventure { border: 4px solid transparent; background: linear-gradient(100deg, #fff 0%, #fff4fb 50%, #eef6ff 100%) padding-box, var(--rb) border-box; }
.adv-go { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.goal-bar { height: 22px; border: 3px solid #fff; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .06); }
.goal-bar div { background: repeating-linear-gradient(-45deg, #51cf66 0 12px, #69db7c 12px 24px); }

/* Zahlenfeld: bunte Tasten */
.pad-k { border: 3px solid #fff; }
.pad-k[data-k="1"], .pad-k[data-k="6"] { background: #ffe3f1; }
.pad-k[data-k="2"], .pad-k[data-k="7"] { background: #fff0cc; }
.pad-k[data-k="3"], .pad-k[data-k="8"] { background: #dcf7e6; }
.pad-k[data-k="4"], .pad-k[data-k="9"] { background: #dff0ff; }
.pad-k[data-k="5"], .pad-k[data-k="0"] { background: #ece3ff; }
.pad-ok { background: linear-gradient(180deg, #69e6b4, #2fcf8f); }
.task-box { border: 4px solid #fff; background: linear-gradient(180deg, #ffffff, #fbf8ff); }
.slot { border-radius: 16px; }

/* Aufgabenwahl, Karte */
.topic { background: #fff; }
.topic-grid .topic:nth-child(6n+1) { border-color: #ffc2dd; }
.topic-grid .topic:nth-child(6n+2) { border-color: #ffd8a8; }
.topic-grid .topic:nth-child(6n+3) { border-color: #ffec99; }
.topic-grid .topic:nth-child(6n+4) { border-color: #b2f2bb; }
.topic-grid .topic:nth-child(6n+5) { border-color: #a5d8ff; }
.topic-grid .topic:nth-child(6n+6) { border-color: #d0bfff; }
.topic:hover { border-color: var(--pink); transform: translateY(-3px) rotate(-.4deg); }
.node { background: linear-gradient(180deg, #fff 55%, color-mix(in srgb, var(--col) 22%, #fff)); transition: transform .12s; }
.node:not(.lock):hover { transform: translateY(-3px) scale(1.04); }
.chapter { border: 4px solid rgba(255, 255, 255, .9); }
.chapter h3 { font-size: 1.25rem; }
.grade-tabs button.on, .tabs button.on { background: linear-gradient(180deg, #a07bff, #7c4dff); }
.groups button.on { background: linear-gradient(180deg, #ff8fd0, #ff5fb0); }

/* Gezeichnete Figuren */
.critter { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 5px 4px rgba(80, 50, 120, .16)); }
.critter .twinkle { animation: twinkle 1.6s ease-in-out infinite alternate; }
.critter .glow { animation: glowp 1.8s ease-in-out infinite alternate; }
@keyframes glowp { from { opacity: .55; } to { opacity: 1; } }
.critter .drop { animation: rain 1.2s linear infinite; }
.critter .drop:nth-of-type(2n) { animation-delay: .5s; }
@keyframes rain { from { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(10px); opacity: 0; } }
.critter .bolt { animation: flick 2.4s infinite; }
@keyframes flick { 0%, 88%, 100% { opacity: 1; } 90%, 94% { opacity: .2; } }
.horse .twinkle { animation: twinkle 1.4s infinite alternate; }
.lesson-horse .critter { max-width: 150px; margin: 0 auto; }
.spring-art .critter { max-width: 170px; margin: 0 auto; }
.scene-art .critter { max-width: 300px; margin: 0 auto; }
.scene-bubble { border: 4px solid #fff; }
.scene-bubble b { background: linear-gradient(90deg, #ff4fa3, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Willkommen / Sofort-Start */
.welcome-sub { font-size: 1.2rem; font-weight: 600; color: var(--ink-2); }
.welcome .step { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.welcome .step .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--rb); font-weight: 700; flex-shrink: 0; }
.welcome .go { justify-self: center; min-width: 260px; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.kbtn { transition: transform .15s; }
.kbtn:hover { transform: translateY(-3px); }
.kbtn.on { border-color: var(--pink); background: linear-gradient(180deg, #fff6fb, #ffe3f1); box-shadow: 0 0 0 4px rgba(255, 111, 181, .25); }
.kbtn b { font-size: 1.3rem; }
.gbtn { border-radius: 50%; transition: transform .12s; }
.gbtn:nth-child(1) { border-color: #ffc2dd; } .gbtn:nth-child(2) { border-color: #ffd8a8; } .gbtn:nth-child(3) { border-color: #ffec99; }
.gbtn:nth-child(4) { border-color: #b2f2bb; } .gbtn:nth-child(5) { border-color: #a5d8ff; } .gbtn:nth-child(6) { border-color: #d0bfff; }
.gbtn.on { background: linear-gradient(180deg, #a07bff, #7c4dff); border-color: #fff; transform: scale(1.12); box-shadow: 0 4px 0 #5f3dc4; }
details.more { background: #faf6ff; border-radius: 16px; padding: 10px 14px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.more label { margin-top: 10px; }
.legal { text-align: center; font-size: .85rem; padding: 4px 0 8px; }
.legal a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* v4: Abenteuer-Karte groß und präsent */
.adventure.card { padding: 26px 30px; gap: 26px; grid-template-columns: auto 1fr; margin: 18px 0;
  background: linear-gradient(110deg, #fff 0%, #ffeaf6 45%, #e6f1ff 100%) padding-box, var(--rb) border-box;
  border-width: 6px; box-shadow: 0 8px 0 rgba(139, 92, 246, .22), 0 18px 40px rgba(139, 92, 246, .22); }
.adventure .adv-k { font-size: 1.15rem; }
.adventure b { font-size: 2rem; line-height: 1.15; margin: 6px 0 4px; }
.adventure small { display: block; font-size: 1.05rem; }
.adventure .adv-play { display: table; }
.adv-play { display: inline-block; margin-top: 14px; padding: 12px 30px; border-radius: 999px; font-size: 1.35rem; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, #ff5fa8, #b06bff); box-shadow: 0 5px 0 #b0306f; animation: breathe 2.2s ease-in-out infinite; }
.adventure:hover .adv-play { filter: brightness(1.08); }
@media (max-width: 640px) {
  .adventure.card { grid-template-columns: 1fr; text-align: center; padding: 20px 16px; gap: 10px; }
  .adventure .rainbow { display: block; margin: 0 auto; max-width: 200px; }
  .adventure b { font-size: 1.6rem; }
  .adventure .adv-play { display: block; width: 100%; }
}

/* v5: Deutschland-Karte */
.map-top .mt-txt { flex: 1; min-width: 220px; }
.map-top .mt-txt > b { font-size: 1.35rem; }
.mt-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mt-btns .next-st { font-size: 1.25rem; padding: 12px 26px; animation: breathe 2.2s ease-in-out infinite; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 18px; align-items: start; margin-top: 16px; }
.map-box { background: #fff; border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); border: 4px solid #fff; }
.de-map { display: block; width: 100%; height: auto; font-family: var(--font); }
.de-map .land { stroke: #fff; stroke-width: 3; stroke-linejoin: round; cursor: pointer; transition: filter .15s; }
.de-map .land:hover { filter: brightness(1.05) saturate(1.2); }
.de-map .land.sel { stroke: #7c4dff; stroke-width: 5; }
.de-map .sea { font-size: 24px; font-weight: 600; fill: #5c9bd6; font-style: italic; }
.de-map .route-bg { fill: none; stroke: #fff; stroke-width: 14; stroke-linecap: round; opacity: .85; }
.de-map .route { fill: none; stroke: #a99bc9; stroke-width: 6; stroke-dasharray: 14 12; stroke-linecap: round; }
.de-map .route-done { fill: none; stroke: #ff4fa3; stroke-width: 7; stroke-dasharray: 14 12; stroke-linecap: round; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -26; } }
.de-map .pin { cursor: pointer; outline: none; }
.de-map .pin-c { fill: #fff; stroke-width: 6; transition: transform .15s; }
.de-map .pin:hover .pin-c, .de-map .pin:focus-visible .pin-c { transform: scale(1.15); }
.de-map .pin.lock .pin-c { fill: #f6f3fb; }
.de-map .pin.sel .pin-c { stroke: #7c4dff; stroke-width: 8; }
.de-map .pin-ic { font-size: 26px; pointer-events: none; }
.de-map .pin.lock .pin-ic { font-size: 20px; opacity: .7; }
.de-map .pin-ok { font-size: 14px; font-weight: 700; fill: #fff; pointer-events: none; }
.de-map .pin-lbl { font-size: 17px; font-weight: 700; fill: #3b2a55; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.de-map .pin.lock .pin-lbl { fill: #9a8fb0; }
.de-map .pin-pulse { fill: none; stroke: #ff4fa3; stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: pinPulse 1.4s ease-out infinite; }
@keyframes pinPulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.de-map .map-gem { pointer-events: none; }
.de-map .map-gem:not(.got) { opacity: .7; }
.de-map .map-gem.got { filter: drop-shadow(0 0 6px #fff); }
.de-map .map-me { pointer-events: none; animation: idle 2.4s ease-in-out infinite; }
.panel-host { position: sticky; top: 12px; }
.state-panel { border: 5px solid var(--col); padding: 18px; }
.sp-head { display: flex; gap: 14px; align-items: center; }
.sp-ic { font-size: 2.8rem; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--col) 22%, #fff); flex-shrink: 0; }
.sp-head h2 { margin: 0; font-size: 1.6rem; }
.sp-fact { background: #fffbe8; border-radius: 16px; padding: 10px 14px; margin: 14px 0; line-height: 1.45; }
.sp-stations { display: grid; gap: 12px; }
.sp-st { font: inherit; color: var(--ink); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: linear-gradient(100deg, #fff, color-mix(in srgb, var(--col) 16%, #fff)); border: 4px solid color-mix(in srgb, var(--col) 45%, #fff); border-radius: 20px; padding: 12px 14px;
  cursor: pointer; box-shadow: 0 5px 0 rgba(120, 80, 170, .14); transition: transform .12s; }
.sp-st:not(.lock):hover { transform: translateY(-3px); }
.sp-st.cur { border-color: var(--pink); animation: pulse 1.4s infinite; }
.sp-st.lock { opacity: .55; cursor: default; filter: grayscale(.6); }
.sp-kind { font-size: 2.2rem; }
.sp-txt b { display: block; font-size: 1.1rem; line-height: 1.2; }
.sp-txt small { color: var(--ink-2); }
.sp-stars i { font-style: normal; color: #e3dcef; font-size: 1.1rem; }
.sp-stars i.on { color: #ffc93c; }
.sp-go { font-weight: 700; color: #fff; background: linear-gradient(90deg, #ff5fa8, #b06bff); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
@media (max-width: 860px) {
  .map-layout { grid-template-columns: 1fr; }
  .panel-host { position: static; }
  .map-box { padding: 4px; }
}

/* v5: Landschaften */
.track.themed::before { content: none; }
.scenery { position: absolute; top: 2px; left: 8px; right: 8px; display: flex; justify-content: space-around; font-size: 1.5rem; pointer-events: none; opacity: .95; }
.track .scenery { font-size: 1.25rem; }
.obst { position: absolute; bottom: 2px; font-size: 1.6rem; z-index: 1; pointer-events: none; transform: translateX(-50%); }
.runner.hop > svg { animation: hopX .5s ease-out; }
@keyframes hopX { 45% { transform: translateY(-26px) rotate(-8deg); } }

/* v5: Springreiten */
.pj-wrap { display: grid; gap: 8px; }
.pj-arena { position: relative; height: clamp(190px, 30vh, 260px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pj-arena .scenery { font-size: 1.8rem; top: 8px; }
.pj-world { position: absolute; left: 0; bottom: 0; top: 0; will-change: transform; }
.pj-obst { position: absolute; bottom: 14px; width: 70px; transform: translateX(-50%); }
.pj-fence { display: block; width: 70px; height: 72px; overflow: visible; }
.pj-fence.wide { width: 100px; margin-left: -15px; }
.pj-fence .rail { transform-box: fill-box; transform-origin: 100% 100%; transition: transform .5s cubic-bezier(.5, 0, .7, 1.4); }
.pj-obst.down .rail { transform: translateY(26px) rotate(18deg); }
.pj-num { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: .85rem; color: #6f5f8a; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.pj-finish { position: absolute; bottom: 10px; top: 40%; width: 14px; background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 14px 14px; opacity: .85; }
.pj-horse { position: absolute; left: 0; bottom: 8px; width: 130px; z-index: 2; will-change: transform; }
.pj-jump svg { display: block; width: 100%; height: auto; }
.pj-jump.go { animation: pjJump .65s ease-in-out; }
@keyframes pjJump { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-78px) rotate(-12deg); } 65% { transform: translateY(-62px) rotate(9deg); } 100% { transform: translateY(0) rotate(0); } }
.pj-horse.refuse .pj-jump { animation: shake .45s; }
.pj-info { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 16px; box-shadow: var(--shadow); font-size: 1.05rem; }
.pj-faults b { color: #c0263d; }
.pj-arena .float-text { left: 40%; top: 30%; }
.t-jump { background: linear-gradient(135deg, #e5dbff, #b197fc); }
.t-cross { background: linear-gradient(135deg, #d3f9d8, #69db7c); }

/* v5: Fakten-Karte */
.sp-facts { background: #fffbe8; border: 3px dashed #ffd43b; border-radius: 18px; padding: 12px 16px; margin: 14px 0; }
.spf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.1rem; }
.spf-dots { display: flex; gap: 6px; }
.spf-dots i { width: 10px; height: 10px; border-radius: 50%; background: #f1e3a6; }
.spf-dots i.on { background: #f59f00; }
.spf-txt { font-size: 1.2rem; line-height: 1.5; margin: 10px 0 12px; min-height: 3.6em; }
.spf-txt.pop { animation: fadeIn .35s; }
.spf-nav { display: flex; gap: 8px; justify-content: flex-end; }

/* v5: Tribüne mit Zuschauern */
.track.themed { padding-top: 92px; }
.stands { position: absolute; top: 0; left: 0; right: 0; height: 88px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent 0 50%, #c98a5a 50% 54%, #f3d2a8 54% 77%, #c98a5a 77% 81%, #f3d2a8 81% 100%); }
.stands .scenery { top: 2px; font-size: 1.05rem; opacity: .9; }
.bunting { position: absolute; top: 24px; left: 0; right: 0; height: 14px; display: flex; justify-content: space-between; border-top: 2px solid #8a6aa8; }
.bunting i { width: 12px; height: 12px; background: var(--c); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.crowd { position: absolute; left: 70px; right: 6px; bottom: 2px; display: flex; flex-wrap: wrap; justify-content: space-around; align-content: flex-end; height: 46px; overflow: hidden; font-size: 1.15rem; line-height: 1.25; }
.crowd span { display: inline-block; animation: fanBob 2.4s ease-in-out infinite; animation-delay: calc(var(--w) * 3); }
@keyframes fanBob { 50% { transform: translateY(-2px); } }
.stands.cheer .crowd span { animation: cheerJump .45s ease-out 2; animation-delay: var(--w); }
@keyframes cheerJump { 40% { transform: translateY(-9px) scale(1.15); } }
.balloon { position: absolute; top: 4px; width: 16px; height: 20px; border-radius: 50% 50% 48% 48%; z-index: -1;
  background: radial-gradient(circle at 35% 30%, #fff9 0 12%, var(--c) 30%); animation: balloonBob 3s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
.balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 26px; background: #8a6aa8aa; }
@keyframes balloonBob { 50% { transform: translateY(-4px) rotate(4deg); } }
.vendor { position: absolute; left: 4px; bottom: 0; width: 64px; height: 60px; }
.icecart { width: 52px; height: 49px; position: absolute; left: 0; bottom: 0; }
.vendor-p { position: absolute; left: 40px; bottom: 6px; font-size: 1.2rem; animation: fanBob 1.8s ease-in-out infinite; }
.mini-conf { position: absolute; top: 40px; width: 7px; height: 11px; border-radius: 2px; z-index: 4; pointer-events: none; animation: miniFall 1.6s ease-in forwards; }
@keyframes miniFall { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--x), 170px) rotate(var(--r)); opacity: 0; } }
.cheer-bubble { position: absolute; top: 8px; background: #fff; color: #e64980; font-weight: 700; font-size: .95rem; padding: 2px 10px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.08); animation: floatUp 1.3s forwards; white-space: nowrap; z-index: 3; }
.pj-arena { height: clamp(240px, 36vh, 300px); }
.pj-arena .stands { height: 92px; }
.pj-arena .scenery { font-size: 1.05rem; top: 2px; }

/* ================= v6: Handy-Layout (alles ohne Scrollen spielbar) ================= */
.parents .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stable > *, .play-area > *, .map-layout > * { min-width: 0; }
@media (max-width: 760px) {
  #app.screen-game { gap: 8px; padding-bottom: 6px; }
  .screen-game .bar { grid-template-columns: 46px 1fr auto; }
  .screen-game .bar .btn.icon { width: 46px; height: 46px; }
  .screen-game .bar h1 { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .screen-game .bar-mid { min-width: 0; }
  .screen-game .topic-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .screen-game .topic-chip { font-size: .75rem; }
  /* Zahlenfeld: 4 Spalten, 4 Reihen, ✓ rechts unten */
  .pad { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .pad > span { display: none; }
  .pad-k { height: 48px; font-size: 1.45rem; border-radius: 14px; }
  .pad-k[data-k="7"] { grid-area: 1 / 1; } .pad-k[data-k="8"] { grid-area: 1 / 2; } .pad-k[data-k="9"] { grid-area: 1 / 3; }
  .pad-k[data-k="4"] { grid-area: 2 / 1; } .pad-k[data-k="5"] { grid-area: 2 / 2; } .pad-k[data-k="6"] { grid-area: 2 / 3; }
  .pad-k[data-k="1"] { grid-area: 3 / 1; } .pad-k[data-k="2"] { grid-area: 3 / 2; } .pad-k[data-k="3"] { grid-area: 3 / 3; }
  .pad-k[data-k="0"] { grid-area: 4 / 1 / 5 / 4; }
  .pad-k[data-k="⌫"] { grid-area: 1 / 4; }
  .pad-k[data-k="−"], .pad-k[data-k=","] { grid-area: 2 / 4; }
  .pad:has([data-k="−"]) .pad-k[data-k=","] { grid-area: 4 / 3; }
  .pad:has([data-k="−"]):has([data-k=","]) .pad-k[data-k="0"] { grid-area: 4 / 1 / 5 / 3; }
  .pad .pad-ok, .pad .pad-back + .pad-ok { grid-area: 3 / 4 / 5 / 5; height: auto; }
  .pad:not(:has([data-k="−"])):not(:has([data-k=","])) .pad-k[data-k="⌫"] { grid-area: 1 / 4 / 3 / 5; height: auto; }
  .task-box { min-height: 0; padding: 10px 12px; gap: 6px; }
  .task { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .feedback { min-height: 1.2em; font-size: .95rem; }
  /* Rennen & Geländeritt */
  .track.themed { padding: 66px 6px 4px; }
  .stands { height: 64px; }
  .stands .scenery { font-size: .85rem; }
  .bunting { top: 18px; }
  .crowd { height: 22px; font-size: .95rem; left: 54px; }
  .vendor { transform: scale(.75); transform-origin: 0 100%; }
  .balloon { width: 12px; height: 15px; }
  .lane { height: 40px; }
  .lane-name { font-size: .7rem; right: 26px; }
  .obst { font-size: 1.2rem; }
  .speedo { padding: 3px 12px; font-size: .9rem; }
  .speedo-bar { height: 10px; }
  /* Springreiten */
  .pj-arena { height: 196px; }
  .pj-arena .stands { height: 64px; }
  .pj-horse { width: 96px; }
  .pj-obst { bottom: 10px; transform: translateX(-50%) scale(.8); transform-origin: 50% 100%; }
  .pj-info { padding: 3px 10px; font-size: .9rem; }
  /* Sternenblitz, Reitstunde, Zahlenmauer */
  .blitz-stage { height: 110px; }
  .blitz-horse { width: 110px; }
  .sky { left: 116px; }
  .brick { min-width: clamp(56px, 18vw, 110px); height: 44px; font-size: 1.3rem; }
  .wall, .wall-row { gap: 5px; }
  .lesson-horse { width: 80px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .lane { height: 32px; }
  .pad-k { height: 38px; font-size: 1.3rem; }
  .pad { gap: 6px; }
  #app.screen-game { gap: 6px; padding-top: 4px; }
  .wall-info { font-size: .95rem; }
  .lane { height: 30px; }
  .stands { height: 46px; }
  .track.themed { padding-top: 48px; }
  .crowd { height: 20px; font-size: .85rem; }
  .vendor { transform: scale(.6); }
  .pj-arena { height: 160px; }
  .pj-arena .stands { height: 56px; }
  .track.themed { padding-top: 56px; }
  .stands { height: 54px; }
  .stands .scenery { display: none; }
  .bunting { top: 4px; }
  .balloon { top: -6px; }
  .blitz-stage { height: 90px; }
  .brick { height: 38px; }
  .task { font-size: 1.7rem; }
  .screen-game .bar .btn.icon { width: 40px; height: 40px; }
}
@media (max-width: 760px) {
  .screen-game .hint { font-size: .9rem; padding: 6px 10px; line-height: 1.35; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .screen-game .task-box .hint { font-size: .82rem; }
  .brick { height: 34px; font-size: 1.15rem; }
  .wall-info { line-height: 1.25; }
}
@media (max-width: 360px) {
  .screen-game .bar h1 { font-size: 1.02rem; }
  .wallet { font-size: .9rem; }
}
/* Tablet quer / niedrige Bildschirme: kompaktes Zahlenfeld neben der Aufgabe */
@media (min-width: 761px) and (max-height: 860px) {
  #app.screen-game { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .pad { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pad > span { display: none; }
  .pad-k { height: 54px; }
  .pad-k[data-k="7"] { grid-area: 1 / 1; } .pad-k[data-k="8"] { grid-area: 1 / 2; } .pad-k[data-k="9"] { grid-area: 1 / 3; }
  .pad-k[data-k="4"] { grid-area: 2 / 1; } .pad-k[data-k="5"] { grid-area: 2 / 2; } .pad-k[data-k="6"] { grid-area: 2 / 3; }
  .pad-k[data-k="1"] { grid-area: 3 / 1; } .pad-k[data-k="2"] { grid-area: 3 / 2; } .pad-k[data-k="3"] { grid-area: 3 / 3; }
  .pad-k[data-k="0"] { grid-area: 4 / 1 / 5 / 4; }
  .pad-k[data-k="⌫"] { grid-area: 1 / 4; }
  .pad-k[data-k="−"], .pad-k[data-k=","] { grid-area: 2 / 4; }
  .pad:has([data-k="−"]) .pad-k[data-k=","] { grid-area: 4 / 3; }
  .pad:has([data-k="−"]):has([data-k=","]) .pad-k[data-k="0"] { grid-area: 4 / 1 / 5 / 3; }
  .pad .pad-ok, .pad .pad-back + .pad-ok { grid-area: 3 / 4 / 5 / 5; height: auto; }
  .pad:not(:has([data-k="−"])):not(:has([data-k=","])) .pad-k[data-k="⌫"] { grid-area: 1 / 4 / 3 / 5; height: auto; }
  .play-area { grid-template-columns: 1fr minmax(280px, 360px); }
  .task-box { min-height: 0; align-self: stretch; }
  .lane { height: 54px; }
  .track.themed { padding-top: 84px; }
  .stands { height: 80px; }
  .pj-arena { height: 250px; }
}
@media (max-width: 760px) {
  .de-map .pin-in { transform: scale(1.3); }
  .de-map .map-me { transform: translate(-8px, -14px); }
  .map-top { gap: 10px; }
  .map-top .rainbow { width: 120px; }
  .map-top .mt-txt > b { font-size: 1.15rem; }
}

/* v7: Lehrplan-Einordnung der Aufgabenpakete */
.topic .badge { justify-self: start; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #eee8fb; color: #6f5f8a; }
.topic.st-now { border-color: #51cf66; background: linear-gradient(180deg, #f2fff4, #fff); box-shadow: 0 0 0 3px #d3f9d8; }
.topic.st-now .badge { background: #51cf66; color: #fff; }
.topic.st-done .badge { background: #d0ebff; color: #1864ab; }
.topic.st-later { opacity: .72; }
.topic.st-later .badge { background: #fff3bf; color: #8a6d00; }
.topic.st-extra { opacity: .72; border-style: dashed; }
.topic.st-extra .badge { background: #ffe3f1; color: #c2255c; }
.task { position: relative; }
.easy-chip { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: .75rem; font-weight: 700; white-space: nowrap;
  background: #d3f9d8; color: #2b8a3e; padding: 1px 10px; border-radius: 999px; }
/* v7: Live-Platzierung im Rennen */
.race-place { white-space: nowrap; padding: 2px 12px; border-radius: 999px; background: #fff3bf; color: #8a6d00; font-size: 1.05rem; }
.race-place.p1 { background: linear-gradient(180deg, #ffe066, #fcc419); color: #5c3d00; }
.race-place.p2 { background: #e9ecef; color: #495057; }
.race-place.p3 { background: #ffd8a8; color: #7a3e00; }
.race-place.p4 { background: #f3f0ff; color: #6f5f8a; }
.race-place.up { animation: pop .45s; }
.race-place.down { animation: shake .35s; }
@media (max-width: 760px) { .race-place { font-size: .9rem; padding: 1px 8px; } .speedo-txt { min-width: 0; } }
/* v7: Zurück aus Dialog-Szenen */
.scene-close { position: absolute; top: 12px; left: 12px; z-index: 2; }
.scene .scene-title { padding: 0 66px; }
/* v7: Figur wählen */
.fig-q { margin: 6px 0 4px; font-weight: 600; }
.fig-q small { font-weight: 400; color: var(--ink-2); }
.fig-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fbtn { overflow: hidden; font: inherit; border: 3px solid var(--violet-l); background: #fff; border-radius: 18px; padding: 6px; cursor: pointer; display: grid; justify-items: center; color: var(--ink); transition: transform .15s; }
.fbtn:hover { transform: translateY(-3px); }
.fbtn.on { border-color: var(--pink); background: linear-gradient(180deg, #fff6fb, #ffe3f1); box-shadow: 0 0 0 4px rgba(255, 111, 181, .25); }
.fbtn .horse { overflow: hidden; width: 100%; max-width: 130px; height: auto; aspect-ratio: 80 / 92; }
.fbtn b { font-size: clamp(.8rem, 3.4vw, 1rem); overflow-wrap: anywhere; }

/* ================= v8: Kulissen für Sternenblitz, Reitstunde, Zahlenmauer ================= */
/* Sternenblitz: Nachthimmel */
.blitz-stage { background: linear-gradient(180deg, #120b3a 0%, #2b1f6b 45%, #5b3fa8 80%, #7d5bd0 100%); }
.nightsky { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.blitz-horse { z-index: 3; }
.sky { z-index: 2; }
.streak { z-index: 4; }
.ns-star { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: twinkle 1.8s ease-in-out infinite alternate; animation-delay: var(--d); }
.ns-moon { position: absolute; right: 7%; top: 12%; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fffbe6, #ffe8a3 60%, #f5cf6b); box-shadow: 0 0 22px 6px rgba(255, 236, 160, .45); }
.ns-moon::after { content: ''; position: absolute; left: 9px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: rgba(214, 170, 70, .45); box-shadow: 12px -6px 0 -1px rgba(214, 170, 70, .35), 10px 9px 0 -2px rgba(214, 170, 70, .35); }
.ns-shoot { position: absolute; left: 30%; top: 10%; width: 90px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff); transform: rotate(18deg); opacity: 0; animation: shoot 6s linear infinite; }
.ns-shoot.s2 { left: 55%; top: 22%; animation-delay: 3.2s; animation-duration: 7.5s; }
@keyframes shoot { 0%, 82% { opacity: 0; transform: translate(0, 0) rotate(18deg); } 86% { opacity: 1; } 100% { opacity: 0; transform: translate(160px, 52px) rotate(18deg); } }
.ns-hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%; }
.ns-fly { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff59a; box-shadow: 0 0 8px 3px rgba(255, 240, 120, .7); animation: fly 4s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -1); }
@keyframes fly { 0% { transform: translate(0, 0); opacity: .4; } 50% { opacity: 1; } 100% { transform: translate(14px, -10px); opacity: .5; } }

/* gemeinsame Kulissen-Bausteine */
.kulisse { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; border-radius: inherit; }
.k-deco { position: absolute; font-size: 1.5rem; line-height: 1; }
.k-deco.big { font-size: 2.6rem; }
.k-sun { position: absolute; right: 5%; top: 8%; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #fff6b0, #ffd43b 70%); box-shadow: 0 0 0 7px rgba(255, 212, 59, .25), 0 0 26px rgba(255, 212, 59, .6); }
.k-cloud { position: absolute; top: 10%; width: 56px; height: 18px; border-radius: 999px; background: #fff; opacity: .9; animation: cloudDrift 14s ease-in-out infinite alternate; }
.k-cloud::before { content: ''; position: absolute; left: 12px; top: -10px; width: 26px; height: 22px; border-radius: 50%; background: #fff; }
.k-cloud.c2 { top: 20%; transform: scale(.8); animation-duration: 18s; }
@keyframes cloudDrift { to { translate: 30px 0; } }

/* Reitstunde: Reitplatz */
.lesson-stage { position: relative; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); overflow: hidden; min-height: 150px; }
.lesson-stage > .lesson-horse, .lesson-stage > .bubble { position: relative; z-index: 1; }
.lesson-stage.is-arena { background: linear-gradient(180deg, #bfe8ff 0%, #e4f6ff 38%, #a6e3a1 38%, #8fd58a 56%, #f1d9a7 56%, #e6c487 100%); }
.k-fence { position: absolute; left: 0; right: 0; bottom: 42%; height: 26px;
  background: linear-gradient(#fff, #fff) 0 5px / 100% 4px no-repeat, linear-gradient(#fff, #fff) 0 15px / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, #fff 0 6px, transparent 6px 46px); filter: drop-shadow(0 1px 0 rgba(0,0,0,.08)); }
.k-poles { position: absolute; left: 38%; bottom: 6%; width: 90px; height: 30px; }
/* Heilquelle: Zaubergarten */
.lesson-stage.is-garden { background: linear-gradient(180deg, #c8f1ff 0%, #e9fbff 40%, #b8f0c9 40%, #8fdca8 100%); }
.k-bubble { position: absolute; bottom: -12px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); background: rgba(160, 220, 255, .35); animation: bubbleUp 5s ease-in infinite; animation-delay: var(--d, 0s); }
@keyframes bubbleUp { to { transform: translateY(-190px); opacity: 0; } }

/* Zahlenmauer: Baustelle */
.wall-stage { position: relative; border-radius: var(--radius); padding: 14px 10px 10px; box-shadow: var(--shadow); overflow: hidden;
  background: linear-gradient(180deg, #bfe8ff 0%, #eaf7ff 55%, #b9e59a 55%, #93cf74 100%); }
.wall-stage > .wall, .wall-stage > .wall-horse { position: relative; z-index: 1; }
.k-crane { position: absolute; left: 1%; bottom: 0; width: 92px; height: 108px; opacity: .9; }
.k-sand { position: absolute; right: 9%; bottom: 0; width: 60px; height: 22px; border-radius: 60px 60px 0 0; background: linear-gradient(180deg, #f3d48b, #e2b85f); }
@media (max-width: 760px) {
  .lesson-stage { min-height: 0; padding: 8px 10px; }
  .k-deco.big { font-size: 1.9rem; }
  .k-crane { width: 64px; height: 76px; opacity: .75; }
  .ns-moon { width: 28px; height: 28px; }
  .k-sun { width: 24px; height: 24px; }
  .wall-stage { padding: 10px 6px 8px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .lesson-stage { padding: 5px 8px; }
  .lesson-stage .bubble { font-size: .95rem; padding: 8px 12px; }
}
/* v8: Eingabe-Prüfung */
input.bad { border-color: #ff6b8b !important; background: #fff0f3 !important; }
input.shake { animation: shake .35s; }
.input-err { margin: 4px 0 0; padding: 6px 10px; border-radius: 12px; background: #fff0f3; color: #c2255c; font-size: .9rem; font-weight: 600; }

/* ================= v9: Aufgaben mit Text und Bild (Größen, Geometrie, Daten, Sachaufgaben) ================= */
.task-text { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.4; text-align: center; color: var(--ink); }
.task-pic { display: flex; justify-content: center; margin: 2px 0 6px; }
.task-pic .pic { width: auto; max-width: 100%; height: 120px; }
.task-pic .pic-money { height: 56px; }
.task-pic .pic-shapes { height: auto; max-height: 110px; width: 100%; max-width: 320px; }
.task-pic .pic-tally { height: auto; max-height: 100px; width: 100%; max-width: 300px; }
.task .tok.word { font-size: .5em; }
@media (max-width: 760px) {
  .task-text { font-size: .98rem; line-height: 1.3; margin-bottom: 4px; }
  .task-pic .pic { height: 88px; }
  .task-pic .pic-money { height: 44px; }
  .task-pic .pic-shapes, .task-pic .pic-tally { max-height: 80px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .task-text { font-size: .88rem; }
  .task-pic .pic { height: 70px; }
}
.task-pic .pic-bars { height: 150px; }
.task-pic .pic-money { height: 64px; }
@media (max-width: 760px) {
  .task-pic .pic-bars { height: 130px; }
  .task-pic .pic-money { height: 56px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .task-pic .pic-bars { height: 104px; }
  .task-pic .pic-money { height: 46px; }
}
.task .tok.arrow { font-size: .55em; color: var(--pink); white-space: nowrap; background: #fff0f7; border-radius: 999px; padding: 0 .4em; }
/* Aufgaben mit Bild/Text im Rennen/Springen: auf dem Handy Platz schaffen */
@media (max-width: 760px) {
  .has-extra .stands { display: none; }
  .has-extra .track.themed { padding-top: 6px; }
  .has-extra .lane { height: 28px; }
  .has-extra .speedo { display: none; }
  .has-extra .pj-arena { height: 140px; }
  .has-extra .pj-info { padding: 1px 10px; font-size: .8rem; }
  .has-extra .task-text { font-size: .88rem; }
  .has-extra .task-pic .pic { height: 72px; }
  .has-extra .task-pic .pic-bars { height: 100px; }
  .has-extra .task-pic .pic-money { height: 42px; }
  .has-extra .task { font-size: 1.7rem; }
}
@media (max-width: 760px) {
  .has-extra .pj-arena { height: 112px; }
  .has-extra .pj-horse { width: 78px; }
  .has-extra .pj-obst { transform: translateX(-50%) scale(.65); }
  .has-extra .task-pic .pic-tally, .has-extra .task-pic .pic-shapes { max-height: 62px; }
}
@media (max-width: 760px) { .has-extra .feedback > .small:not(.steps) { display: none; } }
@media (max-width: 760px) {
  .has-extra .lesson-stage { display: none; }
  .has-extra .blitz-stage { height: 64px; }
  .has-extra .blitz-horse { width: 70px; }
  .has-extra .sky { left: 76px; }
}

/* ================= v10: Eltern-Tor & Elternbereich ================= */
.parent-card { font: inherit; color: #fff; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left;
  border: 0; border-radius: var(--radius); padding: 16px 20px; margin-top: 6px;
  background: linear-gradient(110deg, #3b2a6b, #5b3fa8 60%, #7c4dff); box-shadow: 0 6px 0 #2a1d52, 0 14px 30px rgba(59, 42, 107, .35); transition: transform .12s; }
.parent-card:hover { transform: translateY(-3px); }
.parent-card .pc-ic { font-size: 2.4rem; }
.parent-card b { display: block; font-size: 1.3rem; }
.parent-card small { color: #e5dbff; }
.parent-card .pc-lock { background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.35); padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .parent-card { grid-template-columns: auto 1fr; } .parent-card .pc-lock { grid-column: 1 / -1; justify-self: start; } }
.parent-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.parent-actions .install-hint { flex-basis: 100%; margin: 0; }
.gate-bg { z-index: 60; }
.gate { text-align: center; max-width: 420px; }
.gate-lock { font-size: 3rem; }
.gate-q { font-size: 1.5rem; font-weight: 700; color: var(--violet); margin: 6px 0; }
.gate-in { font: inherit; font-size: 1.6rem; text-align: center; width: 160px; padding: 8px; border: 3px solid var(--violet-l); border-radius: 14px; }
.gate-msg { min-height: 1.3em; color: #c2255c; font-weight: 600; }
/* v10: Vorlesen */
.say-btn { font: inherit; float: right; margin: -4px -4px 4px 8px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; cursor: pointer; font-size: 1.25rem;
  background: linear-gradient(180deg, #fff3bf, #ffd43b); box-shadow: 0 3px 0 #e0a800; }
.say-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e0a800; }
.task-box { position: relative; }
.task-box .say-btn { position: absolute; right: 10px; top: 10px; float: none; margin: 0; z-index: 2; }
@media (max-width: 760px) { .say-btn { width: 36px; height: 36px; font-size: 1.05rem; } }

/* ================= v11: Spielstand sichern (Familien-Code) ================= */
.backup-card { font: inherit; color: #fff; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%;
  border: 0; border-radius: var(--radius); padding: 16px 20px; margin: 4px 0 14px;
  background: linear-gradient(110deg, #0f6c8c, #1a9bb8 60%, #3cc9c0); box-shadow: 0 6px 0 #0a4d64, 0 14px 30px rgba(15, 108, 140, .3); transition: transform .12s; }
.backup-card:hover { transform: translateY(-3px); }
.backup-card .pc-ic { font-size: 2.4rem; }
.backup-card b { display: block; font-size: 1.3rem; }
.backup-card small { color: #dff7fb; }
.backup-card .pc-lock { background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .backup-card { grid-template-columns: auto 1fr; } .backup-card .pc-lock { grid-column: 1 / -1; justify-self: start; } }
.bk-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bk-steps > div { background: #f0fbfd; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.bk-steps span { font-size: 1.8rem; }
.bk-steps small { color: #4a5a66; line-height: 1.35; }
@media (max-width: 640px) { .bk-steps { grid-template-columns: 1fr; } }
.bk-warn { background: #fff7e0; border-radius: 12px; padding: 8px 12px; color: #7a5200; }
.bk-row { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.bk-main h3 { margin: 18px 0 4px; }
.bk-codebox { background: #f4f1ff; border: 2px dashed #b9a7ff; border-radius: 16px; padding: 12px; }
.bk-hidden { font-size: 1.2rem; letter-spacing: .05em; color: #8a7bc8; text-align: center; }
.bk-code { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.bk-code span { background: #fff; border: 2px solid #b9a7ff; border-radius: 12px; padding: 6px 12px; font-size: 1.25rem; font-weight: 700; color: #3b2a6b; display: inline-flex; align-items: baseline; gap: 6px; }
.bk-code small { font-size: .7rem; color: #9a8cd4; font-weight: 600; }
.bk-dialog { max-width: 560px; }
.bk-dialog textarea { width: 100%; font: inherit; font-size: 1.1rem; padding: 10px 12px; border: 2px solid #d9d0ff; border-radius: 14px; resize: vertical; box-sizing: border-box; }
.bk-dialog .modal-btns { flex-wrap: wrap; }
.bk-err:empty { display: none; }
.bk-more { margin-top: 18px; }
.bk-more summary { cursor: pointer; color: #6b6380; }
.print-card { display: none; }
@media print {
  body.printing-code > *:not(.print-card) { display: none !important; }
  body.printing-code { background: #fff !important; }
  body.printing-code .print-card { display: block; padding: 24px; font-size: 14pt; color: #000; }
  .print-card .bk-code span { border-color: #000; color: #000; }
}

/* v12: Anprobe im Stall */
.try-pv { display: grid; place-items: center; background: linear-gradient(180deg, #f6f3ff, #e7f8e7); border-radius: 18px; padding: 6px; margin: 6px 0; }
.try-pv svg { width: min(100%, 300px); height: auto; max-height: 38vh; }
.try-tag { text-align: center; margin: 4px 0; }
.try-tag small { color: #6b6380; }
.rider-note { margin: -4px 0 0; color: #6b6380; }
