/* Lernkoffer – ruhige, helle Farben, gut lesbar */
@font-face { font-family: "Andika"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/andika-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Andika"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/andika-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/fredoka-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #F7F4EE;
  --card: #FFFFFF;
  --ink: #2F3A48;
  --muted: #6E7683;
  --line: #E7E2D9;
  --soft: #F1EDE6;
  --primary: #5E81B5;
  --primary-t: #E4EBF5;
  --good: #6FA287;
  --good-t: #E5F0EA;
  --hint: #D2A84E;
  --hint-t: #F7EED8;
  --s0: #3D6FB6;
  --s1: #C2503F;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 6px 18px rgba(60, 50, 30, .06);
  --fs: 22px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper);
  font-family: "Andika", "Trebuchet MS", Verdana, sans-serif; font-size: var(--fs);
  line-height: 1.45; letter-spacing: .03em; word-spacing: .12em; -webkit-tap-highlight-color: transparent;
}
html, body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.big { --fs: 26px; }
h1, h2, .num, .tile b, .chip b, .next, .opt, .q, .pad button, .word, .level b, .stab { font-family: "Fredoka", "Andika", "Trebuchet MS", sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; letter-spacing: inherit; }
button:focus-visible, a:focus-visible { outline: 4px solid var(--primary); outline-offset: 3px; }
button:active { transform: scale(.98); }

/* Kopfzeile */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
  background: rgba(247, 244, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar h1 { flex: 1; margin: 0; font-size: 1.05em; font-weight: 600; text-align: center; color: var(--ink); }
.icon-btn { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; background: var(--card); box-shadow: var(--shadow); }

main { max-width: 900px; margin: 0 auto; padding: 24px calc(16px + env(safe-area-inset-right)) calc(70px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); outline: none; }
h2 { font-size: 1.2em; font-weight: 600; margin: .3em 0 .6em; }
.muted { color: var(--muted); font-size: .8em; }

/* Maskottchen */
.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.hello .mascot { width: 112px; flex: none; }
.bubble { position: relative; background: var(--card); border-radius: 20px; padding: 14px 18px; font-size: 1em; box-shadow: var(--shadow); flex: 1; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.bubble::before { content: ""; position: absolute; left: -12px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right: 12px solid var(--card); border-left: 0; }
.bubble b { font-family: "Fredoka", sans-serif; font-weight: 600; }
.mascot { display: block; }
.mascot.bounce { animation: bounce .7s ease-out; }
@keyframes bounce { 35% { transform: translateY(-8px); } 70% { transform: translateY(0); } }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tile { border-radius: var(--radius); padding: 26px 20px; text-align: center; color: var(--ink); min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--t, var(--card)); }
.tile .big { font-size: 64px; line-height: 1; }
.tile b { font-size: 1.45em; font-weight: 600; }
.tile span.sub { font-size: .8em; color: var(--muted); }
.grid-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.chip { background: var(--card); border-radius: var(--radius); padding: 16px 10px 12px; text-align: center; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--shadow); }
.chip .ico { width: 58px; height: 58px; border-radius: 18px; background: var(--t, var(--soft)); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.chip .num { font-size: 1.7em; font-weight: 600; color: var(--c); line-height: 1.1; background: var(--t); border-radius: 16px; padding: 4px 14px; }
.chip b { font-weight: 600; font-size: .95em; }
.stars { font-size: .8em; letter-spacing: 0; min-height: 1.2em; }
.teacher-link { display: block; margin: 40px auto 0; color: var(--muted); font-size: .7em; text-decoration: underline; }

/* Aufgabe */
.task { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.progress { display: flex; gap: 6px; margin-bottom: 16px; }
.progress i { flex: 1; height: 10px; border-radius: 5px; background: var(--soft); }
.progress i.done { background: var(--c, var(--good)); opacity: .75; }
.progress i.now { background: var(--hint); }
.q { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 2.2em; font-weight: 600; margin: 10px 0; flex-wrap: wrap; }
.say { width: 54px; height: 54px; border-radius: 50%; background: var(--hint-t); font-size: 24px; flex: none; }
.answer-box { display: inline-block; min-width: 2.4em; padding: 0 .2em; border-radius: 14px; background: var(--soft); border: 2px dashed #CFC6B7; text-align: center; min-height: 1.3em; line-height: 1.2; }

.dots { display: grid; grid-template-rows: repeat(5, auto); grid-auto-flow: column; justify-content: center; gap: 6px 22px; margin: 8px 0 12px; }
.grp { display: flex; gap: 6px; padding: 5px 9px; border-radius: 999px; background: var(--soft); }
.grp i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); display: block; opacity: .85; }
.grp i:nth-child(5) { margin-right: 8px; }
.numline { width: 100%; height: auto; margin: 6px 0; }

.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.pad button { height: 68px; border-radius: 16px; background: var(--soft); font-size: 1.45em; font-weight: 600; }
.pad button.ok { background: var(--good); color: #fff; grid-column: span 2; white-space: nowrap; font-size: 1.15em; }
.pad button.del { font-size: 1.1em; }
.tools { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.tool { padding: 9px 18px; border-radius: 999px; background: var(--soft); font-size: .78em; font-weight: 700; color: var(--muted); }
.tool[aria-pressed="true"] { background: var(--hint-t); color: var(--ink); }

.feedback { margin-top: 14px; padding: 12px 16px; border-radius: 18px; font-size: .95em; display: flex; align-items: center; gap: 12px; }
.feedback .mascot { width: 56px; flex: none; }
.feedback.good { background: var(--good-t); }
.feedback.hint { background: var(--hint-t); }
.feedback:empty { display: none; }
.next { display: block; margin: 16px auto 0; padding: 15px 36px; border-radius: 16px; background: var(--c, var(--primary)); color: #fff; font-weight: 600; font-size: 1.1em; }
.next.secondary, .next[style*="#888"] { background: var(--soft) !important; color: var(--ink); }

/* Deutsch */
.pic { font-size: 86px; text-align: center; line-height: 1.1; }
.word { font-size: 2.1em; font-weight: 600; text-align: center; letter-spacing: .08em; margin: 6px 0 4px; }
.gap { display: inline-block; min-width: 1.6em; border-radius: 10px; background: var(--soft); border: 2px dashed #CFC6B7; }
.mark { text-decoration: underline; text-decoration-thickness: 5px; text-underline-offset: 7px; text-decoration-color: var(--hint); }
.opts { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.opt { min-width: 108px; height: 84px; padding: 0 22px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); color: var(--ink); font-size: 1.65em; font-weight: 600; }
.opt.right { background: var(--good-t); border-color: var(--good); color: #2F5E46; }
.opt.wiggle { animation: wiggle .4s; }
@keyframes wiggle { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.rule { background: var(--hint-t); border-radius: 18px; padding: 12px 16px; font-size: .85em; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.rule .say { width: 44px; height: 44px; font-size: 20px; background: var(--card); }

body.silben .s0 { color: var(--s0); }
body.silben .s1 { color: var(--s1); }

/* Konfetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 1.3s ease-in forwards; opacity: .8; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .confetti, .mascot.bounce { animation: none !important; display: none; } }

/* Ende */
.done { text-align: center; }
.done .mascot { width: 140px; margin: 0 auto; }

/* Einstellungen & Lehrkraft */
.panel { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.switch { width: 74px; height: 42px; border-radius: 999px; background: #D8D2C7; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { left: 36px; }
table.stat { width: 100%; border-collapse: collapse; font-size: .7em; }
table.stat th, table.stat td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bar-mini { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; min-width: 80px; }
.bar-mini span { display: block; height: 100%; background: var(--good); }
.btn { padding: 12px 20px; border-radius: 14px; background: var(--card); font-size: .8em; font-weight: 700; box-shadow: var(--shadow); }
.btn.danger { color: #B04A3A; }
a.btn, a.icon-btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }

/* Stufen & Schwierigkeit */
.stabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 auto 18px; background: var(--soft); padding: 5px; border-radius: 999px; width: fit-content; max-width: 100%; }
.stab { padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .82em; color: var(--muted); }
.stab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 10px; }
.level { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 1.15em; }
.level .lic { font-size: 46px; line-height: 1; width: 76px; height: 76px; border-radius: 22px; background: var(--t, var(--soft)); display: flex; align-items: center; justify-content: center; }
.frage { text-align: center; margin: 0 0 4px; font-size: 1em; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.q-text { font-size: 1.1em; font-weight: 600; text-align: center; line-height: 1.5; display: block; }
.q-ask { flex-direction: column; gap: 10px; }
.q-ask .q-text { font-size: .5em; }
.cmpbox { display: inline-block; min-width: 1.4em; border-radius: 12px; border: 2px dashed #CFC6B7; background: var(--soft); text-align: center; }
.note-sm { text-align: center; color: var(--muted); font-size: .85em; margin: 0; }
.riddle { display: block; font-size: .62em; line-height: 1.6; letter-spacing: .04em; font-weight: 600; }
.hidden-word { color: #CFC6B7; letter-spacing: .3em; }
.opt.emoji { font-size: 2.5em; min-width: 116px; height: 106px; font-family: inherit; }
.opt.words { font-size: 1.1em; min-width: 150px; }
#visual { display: flex; justify-content: center; margin: 6px 0; }
#visual:empty { display: none; }
#visual > * { max-width: 100%; }
.clock { max-width: 70vw; height: auto; }

/* Zwanzigerfeld */
.field { display: inline-flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--soft); border-radius: 16px; }
.frow { display: flex; gap: 6px; }
.frow i { width: 22px; height: 22px; border-radius: 50%; display: block; background: #fff; border: 2px solid var(--line); }
.frow i:nth-child(5) { margin-right: 10px; }
.frow i.a { background: #D9826A; border-color: #D9826A; }
.frow i.b { background: #7C9CC4; border-color: #7C9CC4; }
.frow i.x { background: #fff; border-color: #D9826A; position: relative; }
.frow i.x::after { content: ""; position: absolute; left: -3px; right: -3px; top: 8px; height: 3px; background: var(--ink); transform: rotate(-45deg); }

/* Hunderter, Zehner, Einer */
.blocks { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.bgroup { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: flex-end; max-width: 100%; }
.blocks .hun { width: 84px; height: 84px; border-radius: 4px; background: repeating-linear-gradient(0deg, #7C9CC4 0 7.4px, #B9CBE2 7.4px 8.4px); }
.blocks .ten { width: 13px; height: 84px; border-radius: 3px; background: repeating-linear-gradient(0deg, #D9826A 0 7.4px, #EDBDAE 7.4px 8.4px); }
.blocks .ones { display: inline-flex; flex-wrap: wrap; width: 52px; gap: 5px; align-content: flex-end; }
.blocks .ones i { width: 14px; height: 14px; border-radius: 50%; background: #6FA287; display: block; }
@media (max-width: 600px) {
  .blocks .hun { width: 56px; height: 56px; background: repeating-linear-gradient(0deg, #7C9CC4 0 4.6px, #B9CBE2 4.6px 5.6px); }
  .blocks .ten { height: 56px; width: 10px; background: repeating-linear-gradient(0deg, #D9826A 0 4.6px, #EDBDAE 4.6px 5.6px); }
}

/* Stellenwerttafel */
table.stw { border-collapse: collapse; font-family: "Fredoka", sans-serif; }
table.stw th, table.stw td { border: 2px solid var(--line); width: 54px; text-align: center; padding: 6px 0; }
table.stw th { background: var(--soft); font-size: .75em; color: var(--muted); }
table.stw td { font-size: 1.6em; font-weight: 600; height: 52px; }

/* Geld (selbst gezeichnet) */
.money { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; max-width: 100%; }
.coin { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .72em; color: #4A3A22; }
.c1, .c2 { background: #DDA98A; width: 46px; height: 46px; } .c5 { background: #DDA98A; width: 52px; height: 52px; }
.c10, .c20 { background: #E9D29A; width: 56px; height: 56px; } .c50 { background: #E9D29A; width: 64px; height: 64px; }
.c100, .c200 { background: radial-gradient(circle, #E9D29A 0 52%, #D3D6DA 53%); } .c100 { width: 68px; height: 68px; } .c200 { width: 74px; height: 74px; }
.note { display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 64px; border-radius: 8px; font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--ink); }
.n500 { background: #DCDDDF; } .n1000 { background: #F0CFC7; } .n2000 { background: #CAD9EC; }

/* Sätze bauen */
.built { min-height: 64px; border: 2px dashed #CFC6B7; border-radius: 16px; padding: 12px 16px; font-size: 1.2em; font-weight: 600; text-align: center; margin: 10px 0; background: var(--soft); }
.wtiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 10px; }
.wtile { padding: 12px 18px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font-size: 1.1em; font-weight: 700; }
.wtile:disabled { opacity: .3; }

@media (max-width: 520px) {
  :root { --fs: 19px; }
  .pad button { height: 58px; }
  .opt { min-width: 84px; height: 72px; }
  .pic { font-size: 68px; }
  .hello .mascot { width: 84px; }
  .tile { min-height: 140px; }
}
@media print {
  .bar, .no-print { display: none !important; }
  html, body { background: #fff; font-size: 12pt; }
  .panel { box-shadow: none; padding: 0; }
}

/* Eigene Symbole */
.ico-svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.icon-btn { display: flex; align-items: center; justify-content: center; color: var(--ink); }
.icon-btn .ico-svg { width: 26px; height: 26px; }
.say { display: inline-flex; align-items: center; justify-content: center; color: #7A6326; }
.say .ico-svg { width: 24px; height: 24px; }
.tool .ico-svg, .btn .ico-svg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.chip .ico { color: var(--c, var(--ink)); }
.chip .ico .ico-svg { width: 30px; height: 30px; stroke-width: 1.7; }
.tile .big { color: var(--ink); }
.tile .big .ico-svg { width: 58px; height: 58px; stroke-width: 1.5; }
.tile.wide { grid-column: 1 / -1; min-height: 130px; }
.level .lic { color: var(--c); }
.level .lic .ico-svg { width: 40px; height: 40px; stroke: none; fill: currentColor; }

/* Werkzeugkoffer */
.koffer-page { font-size: .92em; }
.kc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kc-head .ico { width: 52px; height: 52px; border-radius: 16px; background: var(--t); color: var(--c); display: flex; align-items: center; justify-content: center; }
.kc-head .ico .ico-svg { width: 28px; height: 28px; }
.kc-head h2 { margin: 0; }
.koffer-page h3 { font-family: "Fredoka", sans-serif; font-weight: 600; margin: 1.1em 0 .5em; }
.kc-row { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.kc-center { display: flex; justify-content: center; text-align: center; margin: 10px 0; }
.kc-grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.kc-box { background: var(--soft); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kc-box .say { width: 40px; height: 40px; }
.kc-box .say .ico-svg { width: 20px; height: 20px; }
.kc-big { font-family: "Fredoka", sans-serif; font-size: 1.5em; font-weight: 600; color: var(--c); }
.kc-pic { font-size: 40px; }
.kc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kc-two .kc-box span { display: flex; align-items: center; gap: 6px; }
.kc-tip { background: var(--hint-t); border-radius: 14px; padding: 10px 14px; margin: 12px 0; }
.kc-table { border-collapse: collapse; width: 100%; max-width: 420px; }
.kc-table th, .kc-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.kc-table th { background: var(--soft); font-family: "Fredoka", sans-serif; font-weight: 600; }
.kc-chips, .kc-words { display: flex; flex-wrap: wrap; gap: 8px; }
.kc-chips span { background: var(--t); border-radius: 10px; padding: 6px 12px; font-family: "Fredoka", sans-serif; font-weight: 600; }
.kc-words span { background: var(--soft); border-radius: 12px; padding: 6px 8px 6px 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.kc-words .say { width: 34px; height: 34px; } .kc-words .say .ico-svg { width: 18px; height: 18px; }
.kc-two .say { width: 34px; height: 34px; } .kc-two .say .ico-svg { width: 18px; height: 18px; }
.kc-hundred { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; max-width: 520px; margin: 0 auto; }
.kc-hundred span { background: var(--soft); border-radius: 6px; text-align: center; padding: 6px 0; font-weight: 700; font-size: .9em; }
.kc-hundred .f { background: var(--hint-t); } .kc-hundred .z { background: var(--t); color: var(--c); }
.kc-scroll { overflow-x: auto; }
.kc-mult { border-collapse: collapse; margin: 0 auto; font-family: "Fredoka", sans-serif; }
.kc-mult th, .kc-mult td { width: 42px; height: 38px; text-align: center; border: 1px solid var(--line); }
.kc-mult th { background: var(--t); color: var(--c); }
.kc-mult .sq { background: var(--hint-t); font-weight: 700; }
.kc-line { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kc-line b:first-child { color: var(--c); font-family: "Fredoka", sans-serif; }
.kc-line small { grid-column: 2; color: var(--muted); }
.kc-line .say { width: 38px; height: 38px; grid-row: 1 / span 2; grid-column: 3; } .kc-line .say .ico-svg { width: 18px; height: 18px; }
.kc-abc { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.kc-abc span { background: var(--t); color: var(--c); border-radius: 8px; text-align: center; font-family: "Fredoka", sans-serif; font-weight: 600; padding: 4px 0; }
.hand-h { color: #C66A52; } .hand-m { color: #5E81B5; }
@media (max-width: 520px) { .kc-row, .kc-two { grid-template-columns: 1fr; } .kc-line { grid-template-columns: 80px 1fr auto; } .kc-abc { grid-template-columns: repeat(7, 1fr); } }

/* Bilder (eigene Illustrationen) */
.pimg { width: 1em; height: 1em; object-fit: contain; display: inline-block; vertical-align: middle; -webkit-user-drag: none; }
.pic .pimg { width: 150px; height: 150px; }
.pic .pimg + .pimg { margin-left: -24px; }
.opt.emoji .pimg { width: 84px; height: 84px; }
.kc-pic .pimg { width: 64px; height: 64px; }
.pimg.inl { width: 1.6em; height: 1.6em; }
.pdigit { display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 30px; background: var(--hint-t); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 72px; color: var(--ink); }
.opt.emoji { height: 116px; min-width: 120px; padding: 0 14px; }
@media (max-width: 520px) { .pic .pimg { width: 120px; height: 120px; } .opt.emoji .pimg { width: 68px; height: 68px; } .opt.emoji { height: 96px; min-width: 96px; } }

/* Sterne */
.starrow { display: inline-flex; gap: 3px; vertical-align: middle; }
.starrow .st { width: 1.05em; height: 1.05em; fill: var(--soft); stroke: #CFC6B7; stroke-width: 1.4; stroke-linejoin: round; }
.starrow .st.on { fill: #E9C46A; stroke: #C9A040; }
.done .starrow .st { width: 44px; height: 44px; }

/* Einheitliche Kacheln */
.grid-sm { grid-auto-rows: 1fr; }
.chip { display: grid; grid-template-rows: auto auto 1.2em; justify-items: center; align-content: center; row-gap: 8px; }
.chip b { min-height: 2.5em; display: flex; align-items: center; justify-content: center; line-height: 1.2; text-align: center; }
.chip .ico { margin: 0; }
.stars { min-height: 1.2em; display: flex; justify-content: center; }

/* Kopfzeile mit Zurück und Spickzettel */
.bar { gap: 8px; }
.bar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Spickzettel als Fenster */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(47, 58, 72, .35); display: flex; align-items: flex-end; justify-content: center; padding-top: calc(40px + env(safe-area-inset-top)); }
.sheet-card { background: var(--paper); width: 100%; max-width: 900px; max-height: 100%; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,.12); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: "Fredoka", sans-serif; font-size: 1.05em; }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
body.sheet-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .sheet-card { animation: none; } }

/* Karten: Symbol und Text immer auf gleicher Höhe (oben ausgerichtet) */
.chip { grid-template-rows: auto auto 1fr; align-content: stretch; align-items: start; padding-top: 20px; padding-bottom: 14px; }
.chip b { align-items: flex-start; min-height: 2.5em; }
.chip .stars, .chip .starrow { align-self: end; }
.chip .num + span { align-self: start; }
.tile { justify-content: flex-start; padding-top: 30px; }
.level { justify-content: flex-start; }

/* ---------- Sticker, Album, Koffi anziehen ---------- */
button, .slot { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.saying { outline: 3px solid var(--hint); outline-offset: 3px; }
.sticker-get { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 18px auto 6px; padding: 16px; border-radius: var(--radius); background: var(--paper); max-width: 520px; }
.sticker-get b { display: block; font-size: 1.1em; }
.sticker-get .next { margin: 12px 0 0; display: inline-flex; align-items: center; gap: 8px; }
.sticker-get .next .ico-svg { width: 22px; height: 22px; stroke: #fff; }
.sticker-get .reward { margin-top: 6px; color: var(--ink); background: var(--hint-t); border-radius: 12px; padding: 6px 12px; font-size: .9em; }
.sticker-card { width: 118px; height: 118px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); }
.sticker-card .pimg { width: 92px; height: 92px; }
.sticker-card.pop { animation: stick-pop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stick-pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
.dress { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.dress .big-koffi { width: 150px; flex: none; margin: 0 auto; }
.dress-ctl { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.dress-ctl > b { font-size: 1.15em; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--b); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08), var(--shadow); display: flex; align-items: center; justify-content: center; }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 3px; }
.swatch:disabled { background: var(--soft); }
.swatch .ico-svg, .zub .ico-svg { width: 18px; height: 18px; color: var(--muted); }
.zubs { justify-content: flex-start; flex-wrap: wrap; }
.zub:disabled { opacity: .7; }
.apage .ico { background: var(--soft); overflow: hidden; }
.apage .ico .pimg { width: 50px; height: 50px; }
.apage.locked { opacity: .55; }
.acount { font-size: .8em; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; align-self: end; }
.acount .ico-svg { width: 16px; height: 16px; stroke: none; fill: var(--good); }
.album-page h2 { text-align: center; margin-top: 0; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; margin: 0 auto; }
.slot { aspect-ratio: 1; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-size: .85em; }
.slot.got { background: #fff; box-shadow: var(--shadow); }
.slot.got .pimg { width: 68%; height: auto; }
.slot.got.neu { animation: stick-pop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.slot.empty { border: 2.5px dashed var(--line); color: #B9B3A8; background: transparent; }
.level { position: relative; }
.level.rec { outline: 3px solid var(--c); outline-offset: -3px; }
.rec-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--c); color: #fff; font-size: .62em; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.gate { text-align: center; max-width: 520px; margin: 0 auto; }
.gate-ic .ico-svg { width: 44px; height: 44px; color: var(--muted); }
.gate p b { font-size: 1.2em; }
.gate-opts { grid-template-columns: repeat(2, 1fr); }
@media (prefers-reduced-motion: reduce) { .sticker-card.pop, .slot.got.neu { animation: none; } }

/* Handy: Startkacheln 2 × 2, damit alles auf einen Blick sichtbar ist */
@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { min-height: 0; padding: 22px 10px 18px; }
  .tile .big .ico-svg { width: 46px; height: 46px; }
  .tile b { font-size: 1.15em; }
  .tile span.sub { font-size: .7em; line-height: 1.3; }
}
.bar h1 { padding-left: 62px; } /* gleicht die zwei Knöpfe rechts aus, Titel steht mittig */
@media (max-width: 600px) {
  .bar h1 { white-space: normal; font-size: .9em; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* vier Startkacheln immer 2 × 2 */
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .tile { min-height: 230px; } }
/* Tablet: Uhr und Bilder größer */
@media (min-width: 700px) {
  .task svg.clock { width: 320px; height: 320px; }
  .task .pic .pimg { width: 210px; height: 210px; }
}
/* Einstellung mit mehreren Knöpfen: Auswahl unter dem Text */
.row.stack { flex-wrap: wrap; row-gap: 10px; }
.row.stack > div:first-child { flex: 1 1 100%; }
.row.stack .tools { flex-wrap: nowrap; justify-content: flex-start; }
.row .tools .tool { white-space: nowrap; }

/* ---------- Kacheln ohne Karte: großes Symbol, Text darunter ---------- */
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 14px; grid-auto-rows: auto; }
.chip { background: transparent; box-shadow: none; border-radius: 0; padding: 4px 2px; min-height: 0;
  display: grid; grid-template-rows: auto minmax(2.4em, auto) auto; justify-items: center; align-content: start; row-gap: 10px; }
.chip .ico { width: 104px; height: 104px; border-radius: 30px; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(60,50,30,.04); }
.chip .ico .ico-svg { width: 48px; height: 48px; stroke-width: 1.6; }
.chip .ico .pimg { width: 76px; height: 76px; }
.chip .num { width: 104px; height: 104px; border-radius: 30px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 2em; transition: transform .15s ease; }
.chip .num + span { font-family: "Fredoka", sans-serif; font-weight: 600; }
.chip b { min-height: 0; align-items: flex-start; font-size: 1em; line-height: 1.2; }
.chip .stars, .chip .starrow { align-self: start; }
.chip:active .ico, .chip:active .num { transform: scale(.94); }
.chip:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: 22px; }
@media (hover: hover) { .chip:hover .ico, .chip:hover .num { transform: translateY(-2px); } }
@media (max-width: 520px) { .grid-sm { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); } .chip .ico, .chip .num { width: 92px; height: 92px; border-radius: 26px; } }

/* ---------- Klasse: einmal wählen, danach kleiner Umschalter ---------- */
.stufe-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 640px; margin: 8px auto 14px; }
@media (max-width: 520px) { .stufe-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stufe-big { aspect-ratio: 1; border-radius: 28px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); }
.stufe-big b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 2.6em; line-height: 1; color: var(--primary); }
.stufe-big span { font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--muted); }
.stufe-row { position: relative; display: flex; justify-content: flex-end; margin: -6px 0 12px; }
.stufe-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 14px; border-radius: 999px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .8em; color: var(--muted); background: transparent; }
.stufe-btn .ico-svg { width: 18px; height: 18px; }
.stufe-btn:hover, .stufe-btn[aria-expanded="true"] { background: var(--soft); color: var(--ink); }
.stufe-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--card); border-radius: 16px; box-shadow: 0 10px 30px rgba(60,50,30,.14); padding: 6px; display: flex; flex-direction: column; min-width: 150px; }
.stufe-menu[hidden] { display: none; }
.stufe-menu button { text-align: left; padding: 10px 14px; border-radius: 10px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .85em; color: var(--ink); }
.stufe-menu button[aria-pressed="true"] { background: var(--primary-t); color: var(--primary); }
.stufe-menu button:hover { background: var(--soft); }

/* ---------- Spickzettel-Fenster: weiß, Titel und Symbol nur oben ---------- */
.sheet-card { background: var(--card); }
.sheet-head { background: var(--card); }
.sheet-body { background: var(--card); }
.sheet-title { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.sheet-title .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--t, var(--soft)); color: var(--c, var(--ink)); display: inline-flex; align-items: center; justify-content: center; }
.sheet-title .ico .ico-svg { width: 22px; height: 22px; }
.sheet .koffer-page { padding: 4px 2px 0; }
/* kompakter: leere Sterne-Zeile weglassen, auf dem Handy 3 Kacheln pro Reihe */
.chip .stars:empty { display: none; }
.chip { row-gap: 8px; }
.grid-sm { row-gap: 18px; }
@media (max-width: 520px) {
  .grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; }
  .chip .ico, .chip .num { width: 84px; height: 84px; border-radius: 24px; }
  .chip .ico .ico-svg { width: 40px; height: 40px; }
  .chip .num { font-size: 1.6em; }
  .chip b, .chip .num + span { font-size: .86em; }
}
@media (max-width: 360px) { .grid-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Silbentrennung und Zeilenumbruch: nichts darf seitlich überstehen ---------- */
html { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; hyphenate-limit-chars: 9 4 4; text-wrap: pretty; }
button, input, select, textarea, td, th { -webkit-hyphens: inherit; hyphens: inherit; overflow-wrap: inherit; }
/* Flex- und Grid-Kinder dürfen schmaler werden als ihr längstes Wort */
.chip, .tile, .level, .row > div, .bubble, .kc-grid4 > *, .sheet-card, .koffer-page, .panel, .hello > .bubble { min-width: 0; }
/* Übungswörter, Zahlen und Antworten werden nicht getrennt (Kinder lesen sie als Ganzes) */
.word, .q, .opt, .wtile, .built, .answer-box, .num, .pad, .stufe-big, .syl-word, .slot span, .kc-word, .stars { -webkit-hyphens: manual; hyphens: manual; overflow-wrap: normal; }
/* Tabellen passen sich der Breite an */
.koffer-page table { max-width: 100%; }
/* Album-Seiten: drei Spalten dürfen schrumpfen, Namen passen sich an */
.slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { min-width: 0; }
.slot span { font-size: clamp(.62em, 3.4vw, .95em); -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; max-width: 100%; text-align: center; }
/* Hunderterfeld: 10 Spalten passen immer in die Breite */
.kc-hundred { grid-template-columns: repeat(10, minmax(0, 1fr)) !important; font-size: clamp(.5em, 2.7vw, .85em); }
.kc-hundred > * { min-width: 0; }
/* „Fertig ✓“ im Zahlenblock: auf schmalen Geräten kleiner statt überstehen */
.pad button.ok { font-size: min(1.15em, 6vw); min-width: 0; padding-left: 4px; padding-right: 4px; }
.pad button { min-width: 0; }
.pad button.del { padding-left: 0; padding-right: 0; }
/* Titel oben nie trennen; auf schmalen Handys kein Ausgleichsabstand links */
.bar h1, .sheet-title { -webkit-hyphens: manual; hyphens: manual; }
@media (max-width: 400px) { .bar h1 { padding-left: 0; } }
@media (max-width: 360px) { .bar h1 { font-size: .78em; -webkit-line-clamp: 3; } }
@media (max-width: 360px) { .bar h1 { display: block; -webkit-line-clamp: unset; overflow: visible; } }

/* Kacheln: ruhige Titel, Sterne als kleines Abzeichen am Symbol */
.chip { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 16px; padding: 4px 2px 6px; }
.chip .ico, .chip .num { position: relative; flex: none; }
.chip .badge { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); display: flex; padding: 4px 7px; background: #fff; border-radius: 999px; line-height: 0; font-size: 16px;
  box-shadow: 0 1px 3px rgba(60, 50, 30, .12), 0 0 0 1px rgba(60, 50, 30, .05); }
.chip .badge .starrow { gap: 2px; }
.chip .badge .st { width: 13px; height: 13px; stroke-width: 1.6; }
.chip b, .chip .num + span { display: block; min-height: 0; max-width: 100%; padding: 0 6px; font-family: "Fredoka", "Andika", sans-serif; font-weight: 500; font-size: .9em; line-height: 1.25; color: var(--ink); text-align: center; text-wrap: balance; }
@media (max-width: 520px) { .chip b, .chip .num + span { font-size: .84em; } .chip { gap: 15px; } }
.chip b, .chip .num + span { align-self: center; }

/* Anhören: runder Lautsprecher oben rechts in der Aufgaben-Karte, neben dem Fortschritt */
.task-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.task-top .progress { flex: 1; margin-bottom: 0; min-width: 0; }
.task-top .hear-btn { flex: none; width: 44px; height: 44px; }

/* Startseite-Knopf: zwei Knöpfe links, zwei rechts – der Titel steht ohne Ausgleich mittig */
.bar h1 { padding-left: 0 !important; }
@media (max-width: 420px) { .bar .icon-btn { width: 42px; height: 42px; } .bar { gap: 6px; } }
@media (max-width: 340px) { .bar .icon-btn { width: 38px; height: 38px; } .bar { gap: 4px; } }

/* Lange Lesewörter (Schmetterling, Wassermelone) passen auch auf schmale Handys, ohne getrennt zu werden */
.word { font-size: min(2.1em, 8.2vw); }

/* Hunderter, Zehner, Einer nebeneinander; Einer füllen sich von unten (unterste Reihe zuerst) */
.blocks { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 12px 18px; }
.blocks .bgroup { flex-wrap: wrap; max-width: 100%; }
.blocks .ones { display: flex; flex-wrap: wrap-reverse; align-content: flex-start; width: 52px; height: 84px; gap: 5px; }
@media (max-width: 520px) { .blocks .ones { height: 56px; width: 48px; gap: 3px; } .blocks .ones i { width: 13px; height: 13px; } }
/* Spickzettel: Formen und Brüche */
.kc-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.kc-shapes .kc-box svg { width: 100%; height: auto; max-width: 140px; }

/* Titel darf die Knöpfe nie hinausschieben */
.bar h1 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 400px) { .kc-table th, .kc-table td { padding: 6px 6px; } }

/* Stellenwert-Farben wie in der Schule: Einer blau, Zehner rot, Hunderter grün (Tausender wieder blau, …) */
.blocks .hun { background: repeating-linear-gradient(0deg, #6FA287 0 7.4px, #B7D6C4 7.4px 8.4px); }
.blocks .ones i { background: #5E81B5; }
@media (max-width: 520px) { .blocks .hun { background: repeating-linear-gradient(0deg, #6FA287 0 4.6px, #B7D6C4 4.6px 5.6px); } }
table.stw th:nth-child(3n+1), table.stw td:nth-child(3n+1) { color: #4E8A6C; }
table.stw th:nth-child(3n+2), table.stw td:nth-child(3n+2) { color: #C4664C; }
table.stw th:nth-child(3n), table.stw td:nth-child(3n) { color: #4D73AD; }
table.stw th:nth-child(3n+1) { background: #E3EFE8; } table.stw th:nth-child(3n+2) { background: #F8E3DC; } table.stw th:nth-child(3n) { background: #E2EAF5; }
