:root{
  --bg:#fff8ec; --card:#ffffff; --ink:#2d2a32; --muted:#7a7480;
  --pri:#ff8a3d; --pri-d:#e56f20; --ok:#3cb371; --bad:#ef5d5d; --sky:#5aa9e6; --lila:#9b72cf; --gelb:#ffd23f;
  --shadow:0 6px 0 rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.06);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{background:var(--bg); color:var(--ink); font-family:"Andika","Verdana","Trebuchet MS",system-ui,sans-serif; user-select:none; -webkit-user-select:none; overflow-x:hidden}
button{font-family:inherit; color:inherit; border:0; cursor:pointer}
.screen{display:none; min-height:100vh; padding:16px; flex-direction:column; align-items:center}
.screen.on{display:flex}
.wrap{width:100%; max-width:820px}
.top{display:flex; justify-content:space-between; align-items:center; width:100%; max-width:820px; gap:8px}
.pill{background:var(--card); border-radius:999px; padding:8px 16px; font-size:22px; box-shadow:var(--shadow); white-space:nowrap}
.icon-btn{background:var(--card); border-radius:50%; width:56px; height:56px; font-size:28px; box-shadow:var(--shadow)}
.icon-btn.small{width:44px;height:44px;font-size:20px;opacity:.6}
h1{font-size:40px; margin:20px 0 4px; text-align:center}
h2{font-size:28px; margin:8px 0}
.sub{font-size:22px; color:var(--muted); text-align:center; margin:0 0 16px}
.mascot{font-size:110px; line-height:1; margin-top:16px; animation:hop 2.4s ease-in-out infinite}
@keyframes hop{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
.big-btn{background:var(--pri); color:#fff; font-size:34px; font-weight:bold; padding:22px 48px; border-radius:28px; box-shadow:0 8px 0 var(--pri-d); margin:18px 0; transition:transform .08s}
.big-btn:active{transform:translateY(6px); box-shadow:0 2px 0 var(--pri-d)}
.big-btn.blue{background:var(--sky); box-shadow:0 8px 0 #3d86c0}
.row{display:flex; gap:14px; flex-wrap:wrap; justify-content:center}
.stat{background:var(--card); border-radius:20px; padding:14px 20px; box-shadow:var(--shadow); text-align:center; min-width:130px}
.stat b{display:block; font-size:34px}
.stat span{font-size:16px; color:var(--muted)}

/* Aufgabe */
.progress{flex:1; height:22px; background:#f0e6d6; border-radius:999px; overflow:hidden; margin:0 10px}
.progress i{display:block; height:100%; width:0; background:linear-gradient(90deg,var(--gelb),var(--pri)); border-radius:999px; transition:width .4s}
.task{background:var(--card); border-radius:32px; box-shadow:var(--shadow); width:100%; max-width:820px; margin-top:16px; padding:20px 16px 28px; text-align:center; position:relative}
.prompt{font-size:26px; margin:4px 48px 10px; min-height:34px}
.speak{position:absolute; top:14px; right:14px}
.stage{min-height:170px; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:6px; margin:8px 0 18px}
.emoji-xl{font-size:130px; line-height:1}
.word{font-size:72px; font-weight:bold; letter-spacing:4px}
.letter-xl{font-size:150px; font-weight:bold; line-height:1}
.math{font-size:84px; font-weight:bold; letter-spacing:6px}
.dots{display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; padding:8px 14px; border-radius:16px; background:#fbf4e8}
.dots span{font-size:46px; line-height:1.05}
.dotgroup{display:flex; gap:22px; flex-wrap:wrap; justify-content:center; align-items:center}
.seq{display:flex; gap:10px; align-items:center}
.seq div{font-size:60px; font-weight:bold; width:96px; height:96px; border-radius:20px; background:#fbf4e8; display:flex; align-items:center; justify-content:center}
.seq div.gap{background:#fff; border:4px dashed var(--pri); color:var(--pri)}
.wall{display:flex; flex-direction:column-reverse; align-items:center}
.wrow{display:flex}
.brick{width:88px; height:64px; margin:-1.5px; border:3px solid #8a6d4b; background:#f7e3c7; font-size:36px; font-weight:bold; display:flex; align-items:center; justify-content:center}
.brick.empty{background:#fff}
.brick.filled{background:#e3f0fb; color:#1f6fb5}
.brick.ask{background:var(--gelb); color:var(--pri-d); animation:pulse 1.2s ease-in-out infinite}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(255,138,61,.6)}50%{box-shadow:0 0 0 8px rgba(255,138,61,0)}}
@media (max-width:520px){ .brick{width:72px;height:54px;font-size:28px} }
.choices{display:grid; gap:14px; grid-template-columns:repeat(auto-fit, minmax(150px,1fr)); width:100%}
.choice{background:#fff; border:4px solid #eadfcd; border-radius:24px; font-size:56px; font-weight:bold; min-height:120px; padding:8px; box-shadow:0 6px 0 #eadfcd; transition:transform .08s}
.choice.emo{font-size:84px}
.choice.txt{font-size:40px}
.choice:active{transform:translateY(4px); box-shadow:0 2px 0 #eadfcd}
.choice.right{background:#e3f7ea; border-color:var(--ok); box-shadow:0 6px 0 var(--ok)}
.choice.wrong{background:#fde7e7; border-color:var(--bad); box-shadow:0 6px 0 var(--bad); animation:shake .35s}
.choice.dim{opacity:.35}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.feedback{font-size:30px; height:44px; margin-top:12px; font-weight:bold}
.feedback.ok{color:var(--ok)} .feedback.bad{color:var(--bad)}
.burst{position:fixed; pointer-events:none; font-size:42px; animation:fly 1s ease-out forwards; z-index:50}
@keyframes fly{from{opacity:1; transform:translate(0,0) scale(1)} to{opacity:0; transform:translate(var(--dx),var(--dy)) scale(.4)}}

/* Ergebnis */
.stars-big{font-size:90px; letter-spacing:8px; margin:6px 0}
.sticker-new{font-size:120px; animation:pop .8s ease-out}
@keyframes pop{0%{transform:scale(0) rotate(-30deg)}70%{transform:scale(1.2) rotate(8deg)}100%{transform:scale(1)}}
.album{display:grid; grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); gap:10px; width:100%; max-width:820px; margin-top:12px}
.album div{background:var(--card); border-radius:18px; box-shadow:var(--shadow); font-size:52px; height:88px; display:flex; align-items:center; justify-content:center}
.album div.locked{filter:grayscale(1); opacity:.18}

/* Eltern */
.parent{font-family:system-ui,-apple-system,"Segoe UI",sans-serif; user-select:text; -webkit-user-select:text}
.panel{background:var(--card); border-radius:18px; box-shadow:var(--shadow); padding:16px 18px; margin:12px 0; width:100%}
.panel h3{margin:0 0 10px; font-size:19px}
table{width:100%; border-collapse:collapse; font-size:15px}
th,td{text-align:left; padding:7px 6px; border-bottom:1px solid #f0e6d6; vertical-align:middle}
th{color:var(--muted); font-weight:600; font-size:13px}
.bar{height:12px; background:#f0e6d6; border-radius:6px; overflow:hidden; min-width:80px}
.bar i{display:block; height:100%; border-radius:6px}
.days{display:flex; align-items:flex-end; gap:6px; height:130px; padding-top:8px}
.days .d{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; font-size:11px; color:var(--muted)}
.days .d i{display:block; width:100%; max-width:30px; border-radius:6px 6px 0 0; background:var(--sky)}
.days .d.none i{background:#eee; height:3px!important}
.pbtn{background:#f0e6d6; border-radius:12px; padding:10px 14px; font-size:15px; margin:4px 4px 4px 0}
.pbtn.pri{background:var(--pri); color:#fff}
.pbtn.danger{background:#fde7e7; color:#b33}
label.tg{display:inline-flex; align-items:center; gap:6px; margin:4px 14px 4px 0; font-size:15px}
.note{font-size:14px; color:var(--muted); line-height:1.45}
.summary{font-size:16px; line-height:1.5}
.tag{display:inline-block; padding:2px 8px; border-radius:8px; font-size:13px; background:#f0e6d6}
.gate{font-size:26px; text-align:center}
.gate input{font-size:30px; width:120px; text-align:center; padding:8px; border-radius:12px; border:3px solid #eadfcd}
select,input[type=text]{font-size:15px; padding:6px 8px; border-radius:8px; border:2px solid #eadfcd}
@media (max-width:520px){
  .choice{min-height:96px; font-size:44px} .choice.emo{font-size:64px} .choice.txt{font-size:30px}
  .word{font-size:52px} .math{font-size:60px} .emoji-xl{font-size:100px} .letter-xl{font-size:110px}
  .seq div{width:66px;height:66px;font-size:40px} .dots span{font-size:34px}
  h1{font-size:32px} .big-btn{font-size:28px; padding:18px 34px}
}
#print{display:none}
@media print{
  @page{size:A4; margin:12mm}
  body{background:#fff}
  body>*:not(#print){display:none!important}
  #print{display:block; font-family:"Andika","Verdana",sans-serif; color:#000}
  .page{page-break-after:always; break-after:page; border:2px dashed #555; border-radius:6mm; padding:8mm 9mm; min-height:262mm; position:relative}
  .page:last-child{page-break-after:auto; break-after:auto}
}
.page h1{font-size:26pt; margin:0; text-align:left; text-decoration:underline}
.ph{display:flex; justify-content:space-between; align-items:flex-end; gap:8mm; flex-wrap:wrap; margin-bottom:4mm}
.ph .nm{font-size:13pt} .ph .nm span{display:inline-block; border-bottom:1.5px solid #000; min-width:55mm; margin-left:2mm}
.pinfo{font-size:11pt; color:#444; margin:0 0 5mm}
.pcode{position:absolute; bottom:4mm; right:8mm; font-size:9pt; color:#666}
.pgrid{display:grid; gap:7mm 6mm}
.pitem{position:relative; padding:2mm 2mm 2mm 7mm; font-size:20pt; break-inside:avoid}
.pitem .no{position:absolute; left:0; top:1mm; font-size:9pt; color:#777}
.pline{display:inline-block; border-bottom:1.5px solid #000; min-width:14mm; height:1.1em; vertical-align:bottom; text-align:center; color:#1a5fb4}
.pbox{display:inline-block; border:1.5px solid #000; width:13mm; height:12mm; vertical-align:middle; text-align:center; line-height:12mm; color:#1a5fb4}
.pemo{font-size:34pt; line-height:1.1}
.pwall .brick{width:18mm; height:13mm; font-size:17pt; border:1.4px solid #000; background:#fff; margin:-0.7px}
.pwall .brick.filled{color:#1a5fb4; background:#fff}
.pdots{display:grid; grid-template-columns:repeat(5,7mm); gap:1mm; font-size:15pt; border:1px solid #bbb; border-radius:2mm; padding:1mm 2mm; margin-right:2mm}
.psol{font-size:12pt; columns:2}
.psol div{break-inside:avoid; margin-bottom:2mm}
.paperrow{display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid #f0e6d6; font-size:15px; flex-wrap:wrap}
.paperrow input[type=text]{width:70px}

/* ===== Plattform-Ergänzungen ===== */
.kids{display:flex; flex-wrap:wrap; gap:18px; justify-content:center; margin:14px 0}
.kid{background:var(--card); border-radius:28px; box-shadow:var(--shadow); padding:16px 22px 14px; min-width:150px; font-size:26px; font-weight:bold; display:flex; flex-direction:column; align-items:center; gap:4px}
.kid span{font-size:84px; line-height:1}
.kid:active{transform:translateY(3px)}
.avatars{display:flex; flex-wrap:wrap; gap:6px; margin:10px 0}
.avatars button{font-size:32px; width:54px; height:54px; border-radius:14px; background:#fff3e2; border:3px solid transparent}
.avatars button.sel{border-color:var(--pri); background:#ffe2c8}
.kidform .kname{font-size:22px; padding:10px; width:100%; max-width:320px; border-radius:10px; border:2px solid #e8dccb; font-family:inherit}
.kidrow{display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid #f0e6d6}
.kidrow .kav{font-size:30px}
.kidrow.act b{color:var(--pri-d)}
details>summary{list-style:none; display:inline-block}
details>summary::-webkit-details-marker{display:none}
.syncdot{position:fixed; top:8px; left:50%; transform:translateX(-50%); width:10px; height:10px; border-radius:50%; background:transparent}
.syncdot.offline{background:var(--gelb)}
.syncdot.abgemeldet{background:var(--bad)}
.toast{position:fixed; left:50%; bottom:24px; transform:translate(-50%,40px); background:#2d2a32; color:#fff; padding:12px 18px; border-radius:12px; font-size:16px; max-width:90vw; opacity:0; transition:.25s; pointer-events:none; z-index:50; font-family:system-ui,sans-serif}
.toast.on{opacity:1; transform:translate(-50%,0)}
.parent a{color:var(--pri-d)}

/* ===== Deutsch: Laute, Wortanfang, Sätze, Schreiben ===== */
.note-big{font-size:30px; color:var(--muted); margin-top:4px}
.pbx{display:inline-flex; gap:6px}
.pbx i{display:inline-block; width:44px; height:44px; border:3px solid var(--ink); border-radius:6px; position:relative}
.pbx i.x::before,.pbx i.x::after{content:""; position:absolute; left:50%; top:-4px; width:4px; height:48px; background:var(--pri-d); border-radius:2px}
.pbx i.x::before{transform:translateX(-50%) rotate(45deg)} .pbx i.x::after{transform:translateX(-50%) rotate(-45deg)}
.choice.boxes{min-height:100px}
.boegen{vertical-align:middle; color:var(--ink)}
.word.satz{font-size:48px; letter-spacing:1px; line-height:1.2; text-align:center}
.choice.satzwahl{font-size:46px; min-height:120px; padding:6px}
.satzbild{display:inline-flex; align-items:flex-end; gap:4px}
.satzbild .wer{font-size:1.1em}
.satzbild .ding{font-size:.7em; border-radius:50%; padding:5px; line-height:1}
.word.reihe-b{font-size:60px; letter-spacing:6px}
.luecke{display:inline-block; min-width:60px; border-bottom:5px solid var(--pri); color:var(--pri)}
@media (max-width:600px){ .word.satz{font-size:32px} .choice.satzwahl{font-size:42px} .pbx i{width:32px;height:32px} .word.reihe-b{font-size:40px} }
.pbx3{display:flex; gap:1.5mm; margin-top:1mm} .pbx3 span{width:10mm; height:10mm; border:1.5px solid #000; display:inline-flex; align-items:center; justify-content:center; font-size:18pt}
.psyl{display:flex; flex-direction:column} .psyl span{border:1.5px solid #000; margin-top:-1.5px; padding:1mm 4mm; font-size:18pt; min-width:16mm; text-align:center}
.pframe{border:1.5px solid #000; height:70mm; border-radius:2mm; padding:2mm}
.lrow{display:block; width:100%; height:auto; margin:1mm 0 3mm}

/* ===== iPad und Touch ===== */
html{-webkit-text-size-adjust:100%}
body{overscroll-behavior:none; -webkit-touch-callout:none}
button,.choice,.kid,.big-btn,.icon-btn,select,label{touch-action:manipulation}
.screen{min-height:100dvh; padding:max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left))}
.parent input,.parent select,.gate input{font-size:16px}
.gate input{font-size:32px}
/* Querformat (iPad quer, Laptop): alles muss ohne Scrollen auf den Bildschirm passen */
@media (orientation:landscape) and (max-height:900px){
  .task{margin-top:10px; padding:14px 16px 18px}
  .stage{min-height:120px; margin:4px 0 12px}
  .emoji-xl{font-size:110px} .letter-xl{font-size:120px} .word{font-size:60px}
  .choice{min-height:100px}
}
@media (orientation:landscape) and (max-height:700px){
  .emoji-xl{font-size:84px} .letter-xl{font-size:96px} .word{font-size:48px} .word.satz{font-size:36px}
  .choice{min-height:84px; font-size:46px} .choice.emo{font-size:64px} .prompt{font-size:22px}
}
/* Hochformat iPad: mehr Platz, größere Ziele */
@media (orientation:portrait) and (min-width:700px){
  .task{margin-top:28px; padding:28px 22px 34px}
  .stage{min-height:220px}
  .choice{min-height:150px; font-size:64px} .choice.txt{font-size:46px} .choice.emo{font-size:96px}
  .choice.satzwahl{font-size:54px; padding:6px 4px} .word.satz{font-size:56px}
  .choices{gap:18px}
  .prompt{font-size:30px} .emoji-xl{font-size:170px} .letter-xl{font-size:180px} .word{font-size:84px}
}
.satzbild{max-width:100%} .choice.satzwahl{overflow:hidden}
@media (orientation:portrait){ .choices:has(.satzwahl:nth-child(4)){grid-template-columns:repeat(2,1fr)!important} }
.satzbild{flex-wrap:wrap; justify-content:center}
