:root {
  --bg: #e9f8f5;
  --bg2: #fff7e6;
  --card: #ffffff;
  --ink: #23324a;
  --soft: #5d6b82;
  --line: #d9e4ea;
  --teal: #2bb3a3;
  --teal-d: #1b8e81;
  --sun: #ffc93c;
  --ok: #34c56b;
  --ok-bg: #e3f9eb;
  --bad: #ff7a59;
  --bad-bg: #fff0ea;
  --shadow: 0 6px 0 rgba(35, 50, 74, .12);
  --radius: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Andika", "Comic Neue", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
  min-height: 100vh;
  font-size: 18px;
  line-height: 1.4;
}
#app { max-width: 860px; margin: 0 auto; padding: 16px 16px 48px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--sun); outline-offset: 2px; }
h1, h2, h3 { margin: .2em 0 .4em; line-height: 1.15; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
.muted { color: var(--soft); }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--card); border-radius: 18px; padding: 14px 20px; font-size: 1.1rem; font-weight: 700;
  box-shadow: var(--shadow); border: 3px solid var(--line); transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(35,50,74,.12); }
.btn.primary { background: var(--teal); border-color: var(--teal-d); color: #fff; }
.btn.sun { background: var(--sun); border-color: #e7aa12; }
.btn.big { font-size: 1.5rem; padding: 20px 28px; width: 100%; }
.btn.small { font-size: .95rem; padding: 8px 14px; border-radius: 14px; }
.btn.icon { width: 52px; height: 52px; padding: 0; font-size: 1.5rem; border-radius: 50%; }

/* Header */
.top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill { background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }

/* Mascot */
.hero { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.mascot { font-size: 4.2rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.bubble { position: relative; background: #f0fbf9; border-radius: 18px; padding: 12px 16px; flex: 1; font-size: 1.15rem; }
.progress { height: 14px; background: #eef3f6; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--teal)); border-radius: 99px; transition: width .4s; }

/* Subject tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--card); border-radius: var(--radius); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); border: 3px solid transparent; }
.tile .ic { font-size: 2.4rem; display: block; }
.tile b { display: block; font-size: 1.05rem; margin-top: 4px; }
.tile small { color: var(--soft); }
.tile .progress { height: 10px; }

/* Profiles */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.profile { background: var(--card); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); }
.profile .av { font-size: 3.4rem; display: block; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; margin: 12px 0; }
.avatars button { font-size: 2.2rem; padding: 6px; border-radius: 16px; background: var(--card); border: 3px solid var(--line); }
.avatars button.sel { border-color: var(--teal); background: #e6f8f5; }
input.name { font: inherit; font-size: 1.4rem; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--line); width: 100%; }

/* Task */
.taskbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dots { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: #dfe8ee; }
.dots i.ok { background: var(--ok); }
.dots i.bad { background: var(--bad); }
.dots i.now { background: var(--sun); transform: scale(1.25); }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chip { display: inline-block; font-size: .9rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; color: #fff; }
.q { font-size: 1.5rem; font-weight: 700; margin: 10px 0 6px; display: flex; gap: 10px; align-items: flex-start; }
.q .txt { flex: 1; }
.visual { margin: 12px 0; text-align: center; }
.big-emoji { font-size: 5rem; line-height: 1.1; }
.task-big { font-size: 2.6rem; font-weight: 800; letter-spacing: .02em; }
.hint { color: var(--soft); font-size: 1rem; margin-top: 6px; }
.reading { text-align: left; font-size: 1.3rem; line-height: 1.6; background: #fffbea; border-radius: 16px; padding: 14px 18px; border: 2px dashed #f0d77a; }
.gap { display: inline-block; min-width: 1.6em; border-bottom: 4px solid var(--teal); margin: 0 .1em; color: var(--teal); }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.options.three { grid-template-columns: repeat(3, 1fr); }
.opt { background: #f6fafc; border: 3px solid var(--line); border-radius: 18px; padding: 16px 10px; font-size: 1.35rem; font-weight: 700; min-height: 68px; box-shadow: 0 4px 0 rgba(35,50,74,.08); }
.opt.ok { background: var(--ok-bg); border-color: var(--ok); }
.opt.bad { background: var(--bad-bg); border-color: var(--bad); animation: shake .35s; }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.answer-box { font-size: 2.4rem; font-weight: 800; text-align: center; min-height: 72px; border: 4px dashed var(--line); border-radius: 18px; margin-top: 14px; padding: 8px; letter-spacing: .08em; }
.answer-box.ok { border-color: var(--ok); background: var(--ok-bg); border-style: solid; }
.answer-box.bad { border-color: var(--bad); background: var(--bad-bg); border-style: solid; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; max-width: 420px; margin-left: auto; margin-right: auto; }
.keypad button { font-size: 1.8rem; font-weight: 800; padding: 14px 0; border-radius: 16px; background: #f6fafc; border: 3px solid var(--line); box-shadow: 0 4px 0 rgba(35,50,74,.08); }
.keypad .go { background: var(--teal); color: #fff; border-color: var(--teal-d); }

.order-target { min-height: 70px; display: flex; flex-wrap: wrap; gap: 8px; border: 4px dashed var(--line); border-radius: 18px; padding: 10px; margin-top: 14px; align-items: center; justify-content: center; }
.order-target.ok { border-color: var(--ok); background: var(--ok-bg); border-style: solid; }
.order-target.bad { border-color: var(--bad); background: var(--bad-bg); border-style: solid; }
.order-target .opt { min-height: 0; padding: 10px 14px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.order-pool .opt { min-height: 0; padding: 12px 16px; }

.feedback { margin-top: 16px; border-radius: 18px; padding: 14px 16px; font-size: 1.15rem; display: none; }
.feedback.show { display: block; animation: pop .25s; }
.feedback.ok { background: var(--ok-bg); }
.feedback.bad { background: var(--bad-bg); }
.feedback .btn { margin-top: 10px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* Visual helpers */
.blocks { display: inline-flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; justify-content: center; }
.blocks .ten { display: grid; grid-template-rows: repeat(10, 12px); gap: 2px; background: #2a7fd1; padding: 3px; border-radius: 4px; }
.blocks .ten i { width: 14px; background: #6bb6ff; border-radius: 2px; }
.blocks .ones { display: grid; grid-template-columns: repeat(2, 18px); gap: 3px; margin-left: 8px; }
.blocks .ones i { width: 18px; height: 18px; background: #ff9f43; border-radius: 3px; }
.groups { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.groups .g { display: flex; flex-wrap: wrap; max-width: 80px; gap: 3px; padding: 6px; border: 3px solid #c9dce6; border-radius: 14px; justify-content: center; }
.groups .g i { width: 14px; height: 14px; border-radius: 50%; background: #e94f7b; }
.coins { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.coin { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); border: 3px solid rgba(0,0,0,.15); }
.coin.cu { background: #d08a4e; color: #fff; }
.coin.au { background: #f3c84b; color: #6b4d00; }
.coin.eu { background: radial-gradient(circle, #f3d46b 52%, #c9ccd3 54%); color: #4d3b00; }
.coin.eu2 { background: radial-gradient(circle, #c9ccd3 52%, #f3d46b 54%); color: #333; }
.note { display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 58px; border-radius: 8px; font-weight: 800; font-size: 1.3rem; border: 3px solid rgba(0,0,0,.15); }
.note.n5 { background: #c7cfd6; } .note.n10 { background: #f2a5a0; } .note.n20 { background: #8cb7e8; }
.swatch { display: inline-block; width: 90px; height: 90px; border-radius: 50%; border: 4px solid rgba(0,0,0,.12); vertical-align: middle; }
.mix { display: inline-flex; align-items: center; gap: 12px; font-size: 2.6rem; font-weight: 800; }
.play { font-size: 1.3rem; }
.cmp { font-size: 2.4rem; font-weight: 800; }
.cmp .slot { display: inline-block; min-width: 1.4em; border: 4px dashed var(--teal); border-radius: 12px; color: var(--teal); }

/* Round end / stickers */
.sticker-big { font-size: 7rem; animation: spin-in .8s ease-out; display: inline-block; }
@keyframes spin-in { from { transform: scale(.2) rotate(-200deg); opacity: 0; } }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.album div { background: var(--card); border-radius: 18px; font-size: 2.6rem; text-align: center; padding: 8px 0; box-shadow: var(--shadow); }
.album div.locked { filter: grayscale(1) opacity(.25); }
.move { font-size: 5rem; }
.timer { font-size: 3rem; font-weight: 800; color: var(--teal-d); }

/* Parents */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--soft); font-weight: 700; }
.bar { height: 10px; background: #eef3f6; border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--teal); }
details { background: var(--card); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); margin: 12px 0; }
summary { font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.table-wrap { overflow-x: auto; }

.confetti { position: fixed; top: -20px; font-size: 1.6rem; pointer-events: none; animation: fall 1.4s ease-in forwards; z-index: 50; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .6; } }

/* Klassenwahl */
.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.levels button { font-size: 1.3rem; font-weight: 800; padding: 12px 0; border-radius: 14px; background: #f6fafc; border: 3px solid var(--line); }
.levels button.wide { grid-column: span 3; font-size: .95rem; padding: 12px 6px; overflow-wrap: anywhere; hyphens: auto; }
.levels button.sel { background: var(--teal); color: #fff; border-color: var(--teal-d); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* Mathe-Darstellungen */
.cnt { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 2.1rem; line-height: 1.2; margin: 4px 0; }
.cnt span { white-space: nowrap; }
.zhaus { display: inline-block; text-align: center; font-size: 2.2rem; font-weight: 800; }
.zhaus .dach { width: 188px; height: 72px; background: #ff8a3d; clip-path: polygon(50% 0, 100% 100%, 0 100%); color: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.zhaus .zimmer { display: grid; grid-template-columns: 1fr 1fr; width: 180px; border: 4px solid #ff8a3d; border-top: 0; }
.zhaus .zimmer span { padding: 10px 0; border-right: 4px solid #ff8a3d; }
.zhaus .zimmer span:last-child { border-right: 0; }
.lage { display: inline-grid; grid-template-columns: repeat(3, 72px); gap: 6px; font-size: 3rem; }
.lage span { background: #f6fafc; border: 3px solid var(--line); border-radius: 14px; }
.stw { border-collapse: collapse; margin: 0 auto; font-size: 1.8rem; font-weight: 800; }
.stw th, .stw td { border: 3px solid var(--line); padding: 6px 12px; min-width: 44px; text-align: center; }
.stw th { background: #eef6fb; font-size: 1.1rem; }
.col { display: inline-grid; justify-items: end; font: 800 2.3rem/1.25 ui-monospace, Menlo, Consolas, monospace; }
.col i { width: 100%; border-top: 4px solid var(--ink, #23324a); margin: 4px 0; }
.urne { display: flex; flex-wrap: wrap; gap: 8px; max-width: 260px; margin: 0 auto; justify-content: center; padding: 14px; border: 4px solid var(--line); border-radius: 0 0 40px 40px; }
.urne i { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset -4px -4px 0 rgba(0,0,0,.18); }
.note.n50 { background: #f4b97b; }
.formula { font: 700 1.5rem/1.5 'Cambria Math', Georgia, serif; }
@media (max-width: 520px) { .levels { grid-template-columns: repeat(4, 1fr); } .levels button.wide { grid-column: span 2; } .lage { grid-template-columns: repeat(3, 60px); font-size: 2.4rem; } .col { font-size: 1.8rem; } }
@media (max-width: 520px) {
  body { font-size: 16px; }
  .q { font-size: 1.25rem; }
  .task-big, .cmp { font-size: 2rem; }
  .big-emoji { font-size: 4rem; }
  .options { grid-template-columns: 1fr 1fr; }
  .opt { font-size: 1.15rem; }
  .mascot { font-size: 3.2rem; }
  .hero { padding: 14px; }
}
@media (max-width: 400px) {
  .hero { flex-direction: column; text-align: center; }
  .taskbar .pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Fußzeile + Rechtsseiten (ueber/impressum/datenschutz) */
.foot { text-align: center; margin-top: 28px; font-size: .9rem; color: var(--soft); }
.foot a, .doc a { color: var(--teal-d); }
.doc { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.doc .card { margin: 14px 0; line-height: 1.55; }
.doc h1 { margin-top: 12px; }
.doc h2 { font-size: 1.25rem; margin-top: 1.2em; }
.doc ul { padding-left: 1.2em; }
.doc .back { display: inline-block; margin-top: 4px; text-decoration: none; font-weight: 700; }
.doc .stand { font-size: .9rem; }
