/* ===== Zauberzahlen · tema unicorni & magia, mobile-first ===== */
:root {
  --violet: #6a4bb6;
  --violet-deep: #2a1a4a;
  --violet-mid: #5b3a9e;
  --pink: #ec4899;
  --pink-soft: #fbcfe8;
  --gold: #ffcb3d;
  --gold-soft: #fff3b0;
  --mint: #7ee8c0;
  --sky: #8fd3ff;
  --good: #34d399;
  --soft: #f5edff;
  --ink: #2b2350;
  --card: rgba(255, 255, 255, 0.92);
  --tap: 64px;
  --r: 22px;
  --shadow: 0 8px 22px rgba(40, 16, 80, 0.28);
  font-size: clamp(16px, 4.4vw, 22px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  font-family: "Baloo 2", "Comic Sans MS", "Chalkboard SE", "Segoe UI Rounded", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #7c5cd6 0%, #9a5cf0 45%, #e06bc0 100%);
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}

/* stelline sullo sfondo */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff6 40%, transparent 41%),
    radial-gradient(2px 2px at 70% 20%, #fff5 40%, transparent 41%),
    radial-gradient(3px 3px at 40% 70%, #fff4 40%, transparent 41%),
    radial-gradient(2px 2px at 85% 60%, #fff5 40%, transparent 41%),
    radial-gradient(2px 2px at 15% 80%, #fff4 40%, transparent 41%);
}

.app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

/* ===== bottoni generici ===== */
button { font-family: inherit; cursor: pointer; border: none; }
.btn {
  min-height: var(--tap); padding: 14px 18px;
  border-radius: var(--r); font-size: 1.05rem; font-weight: 700;
  background: #fff; color: var(--violet); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s ease;
}
.btn:active { transform: scale(0.95); }
.btn-ghost { background: rgba(255,255,255,0.18); color: #fff; box-shadow: none; border: 2px solid rgba(255,255,255,0.5); }
.btn-pink { background: var(--pink); color: #fff; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem;
  background: rgba(255,255,255,0.22); color: #fff; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== header schermata ===== */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.topbar .spacer { flex: 1; }
.title { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.18); margin: 0; }

/* ===== HOME / mappa-mondo ===== */
.home-hero { text-align: center; color: #fff; margin: 6px 0 14px; }
.home-hero .star { font-size: 1rem; }
.mascot {
  font-size: 4.4rem; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.25));
  animation: float 3.2s ease-in-out infinite;
}
.bubble {
  background: #fff; color: var(--ink); border-radius: 18px; padding: 10px 16px;
  display: inline-block; max-width: 90%; box-shadow: var(--shadow); margin-top: 8px;
  font-weight: 700; position: relative;
}
.bubble::after {
  content: ""; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-bottom-color: #fff;
}
.collection {
  margin: 4px 0 14px; background: rgba(255,255,255,0.16); border-radius: var(--r);
  padding: 10px 14px; color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 56px;
}
.collection .label { font-size: .85rem; opacity: .9; width: 100%; }
.collection .sticker { font-size: 1.6rem; }

.games { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.game-card {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow);
  width: 100%;
}
.game-card .emoji { font-size: 2.8rem; line-height: 1; }
.game-card .grow { flex: 1; min-width: 0; }
.game-card .name { font-weight: 800; font-size: 1.15rem; color: var(--violet); }
.game-card .sub { font-size: .82rem; color: #6b6088; margin-top: 2px; }
.stars { font-size: 1rem; letter-spacing: 1px; margin-top: 4px; }

/* footer azioni home */
.home-actions { display: flex; gap: 10px; justify-content: center; margin-top: auto; padding-top: 8px; }

/* ===== schermata gioco ===== */
.game-screen { display: flex; flex-direction: column; flex: 1; }
.prompt {
  text-align: center; color: #fff; font-size: 1.35rem; font-weight: 800;
  margin: 6px 0 12px; text-shadow: 0 2px 0 rgba(0,0,0,0.15); min-height: 1.6em;
}
.stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; min-height: 0;
}
.progress-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.progress-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.progress-dots i.on { background: var(--gold); }

/* gruppi di gemme */
.gems { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; max-width: 340px; }
.gem { font-size: 2.6rem; line-height: 1; animation: pop .25s ease backwards; }
.gem.leave { animation: puff .5s ease forwards; }

/* five/ten-frame */
.frame { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  background: rgba(255,255,255,0.9); padding: 12px; border-radius: 18px; box-shadow: var(--shadow); }
.frame.rows2 { grid-template-rows: repeat(2, 1fr); }
.cell {
  width: 54px; height: 54px; border-radius: 14px; background: #efe7ff;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  border: 2px dashed #cdbcf0;
}
.cell.filled { border-style: solid; border-color: var(--violet); background: #fff; }
.cell.tappable:active { transform: scale(0.92); }

/* gruppi a confronto (differenza) */
.towers { display: flex; gap: 26px; align-items: flex-end; }
.tower { display: flex; flex-direction: column-reverse; gap: 6px; align-items: center; }
.tower .cap { margin-top: 6px; font-weight: 800; color: #fff; }

/* risposte: bottoni numero grandi */
.choices { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.choice {
  width: 84px; height: 84px; border-radius: 22px; font-size: 2.2rem; font-weight: 800;
  background: #fff; color: var(--violet); box-shadow: var(--shadow);
}
.choice:active { transform: scale(0.93); }
.choice.correct { background: var(--good); color: #fff; animation: pop .3s ease; }
.choice.wrong { background: #ffd2d2; color: #b33; }

/* equazione grande */
.equation { display: flex; align-items: center; gap: 12px; font-size: 2.6rem; font-weight: 800; color: #fff; }
.equation .q { background: var(--gold); color: var(--violet); border-radius: 16px; padding: 4px 18px; }

/* pulsante di controllo (giochi a trascinamento/riempimento) */
.check { margin-top: 6px; }

/* ===== reward ===== */
.reward { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: #fff; }
.reward .big { font-size: 6rem; animation: pop .5s ease; }
.reward h2 { margin: 0; text-shadow: 0 2px 0 rgba(0,0,0,0.18); }
.reward .earned { font-size: 3rem; animation: float 2.6s ease-in-out infinite; }

/* ===== modale (settings / gate) ===== */
.modal-back { position: fixed; inset: 0; background: rgba(20,8,40,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.modal { background: #fff; border-radius: 24px; padding: 22px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 12px; color: var(--violet); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.seg { display: inline-flex; background: #eee; border-radius: 14px; padding: 4px; }
.seg button { padding: 8px 16px; border-radius: 10px; background: transparent; font-weight: 800; color: #777; }
.seg button.on { background: var(--violet); color: #fff; }
.voice-select {
  max-width: 56vw; padding: 10px 12px; border-radius: 12px; border: 2px solid #ddd;
  background: #fff; font-family: inherit; font-size: .9rem; color: var(--ink);
}

/* ===== parent dashboard ===== */
.parent { color: #fff; }
.panel { background: #fff; color: var(--ink); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.skill-row, .word-row { padding: 12px 0; border-bottom: 1px solid #eee; }
.skill-row:last-child, .word-row:last-child { border-bottom: none; }
.skill-head { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--violet); }
.bar { height: 12px; border-radius: 8px; background: #eee; overflow: hidden; margin: 8px 0 4px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--good)); }
.tag { font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.tag.started { background: #fde68a; color: #92660a; }
.tag.consolidating { background: #bfdbfe; color: #1e40af; }
.tag.mastered { background: #bbf7d0; color: #166534; }
.muted { color: #6b6088; font-size: .85rem; }

/* gate matematico (accesso genitore) */
.gate-prompt { font-size: 1.2rem; font-weight: 800; color: var(--violet); text-align: center; margin-bottom: 14px; }

/* ===== effetti ===== */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.spark { position: absolute; font-size: 1.6rem; animation: rise 1s ease-out forwards; }
.confetti { position: absolute; top: -12%; will-change: transform; animation: fall 2.4s linear forwards; }
.shake { animation: shake .4s ease; }

.banner {
  font-size: 2.3rem; font-weight: 800; color: var(--violet);
  background: var(--gold); padding: 6px 20px; border-radius: 16px;
  box-shadow: var(--shadow); animation: pop .5s ease;
}

@keyframes fall {
  0%   { transform: translateY(-12vh) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(115vh) rotate(540deg); opacity: 1; }
}

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop { 0% { transform: scale(0.2); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes puff { to { transform: scale(1.6) translateY(-20px); opacity: 0; } }
@keyframes rise { 0% { transform: translateY(0) scale(0.6); opacity: 1; } 100% { transform: translateY(-120px) scale(1.3); opacity: 0; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }

/* ===== suggerimento dopo un errore (mai la soluzione) ===== */
.hint {
  background: var(--gold-soft); color: var(--ink); border-radius: 16px; padding: 10px 14px;
  font-weight: 700; text-align: center; margin: 0 0 10px; box-shadow: var(--shadow); animation: pop .3s ease;
}
.hint[hidden] { display: none; }
.progress-dots i.late { background: #f59e0b; }
.section-label { color: #fff; font-weight: 800; font-size: 1rem; margin: 8px 0 0; opacity: .95; text-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.holder { display: flex; justify-content: center; width: 100%; }
.holder.words .choice { width: auto; min-width: 84px; padding: 0 18px; font-size: 1.5rem; }
.holder.tall .choice { height: auto; min-height: 84px; white-space: pre-line; line-height: 1.05; font-size: 1.05rem; padding: 8px 12px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ===== Zehner (barre) & Einer (punti), come nel quaderno ===== */
.tenones {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.92); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow);
  min-width: 200px; min-height: 80px;
}
.tens-col { display: flex; flex-direction: column; gap: 7px; min-height: 12px; }
.tbar { display: block; width: 120px; height: 12px; border-radius: 6px; background: #f59e0b; animation: pop .2s ease; }
.ones-row { display: flex; gap: 8px; min-height: 16px; flex-wrap: wrap; max-width: 260px; }
.odot { display: block; width: 16px; height: 16px; border-radius: 50%; background: #f59e0b; animation: pop .2s ease; }
.ones-row .odot:nth-child(6) { margin-left: 12px; }
.tbar.mini { width: 34px; height: 8px; } .odot.mini { width: 12px; height: 12px; }
.build-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tenones.build .tbar, .tenones.build .odot { cursor: pointer; }

/* ===== Eierschachteln (bündeln) ===== */
.eggbox { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.cartons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 360px; }
.carton {
  position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  background: #e8d5b0; border: 3px solid #b98f55; border-radius: 8px; padding: 5px 5px 4px;
}
.carton .egg { font-size: 1rem; line-height: 1; }
.carton .badge {
  position: absolute; top: -10px; right: -8px; background: var(--violet); color: #fff;
  font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 2px 6px;
}
.carton.pop { animation: pop .4s ease; }
.loose { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 320px; min-height: 1.4rem; }
.loose .egg { font-size: 1.4rem; line-height: 1; }
.egg.leave { animation: puff .5s ease forwards; }

/* ===== Stellentafel Z|E ===== */
.pv { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); min-width: 180px; }
.pv .h { background: var(--violet); color: #fff; font-weight: 800; padding: 6px 10px; text-align: center; font-size: 1.1rem; display: flex; flex-direction: column; line-height: 1.1; }
.pv .h small { font-size: .6rem; font-weight: 700; opacity: .9; }
.pv .v { font-size: 2.2rem; font-weight: 800; text-align: center; padding: 6px 16px; color: var(--violet); min-height: 60px; }
.pv .v:nth-child(3) { border-right: 2px solid #eee; }
.pv .v.q { background: var(--gold); }

.equation.small { font-size: 1.5rem; opacity: .9; }

/* ===== Zahlenmauer ===== */
.wall { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wrow { display: flex; gap: 5px; }
.brick {
  width: 64px; height: 54px; border-radius: 10px; background: #fff; color: var(--violet);
  font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.brick.wide { width: 76px; }
.brick.q { background: var(--gold-soft); border: 3px dashed var(--gold); }
.brick.active { background: var(--gold); border-style: solid; animation: pulse 1s ease-in-out infinite; }
.brick.ok { background: var(--good); color: #fff; border: none; animation: pop .3s ease; }

/* ===== Zahlendreieck (SVG) ===== */
.tri { width: min(84vw, 330px); height: auto; overflow: visible; }
.tri text { font-size: 26px; font-weight: 800; fill: var(--violet); font-family: inherit; }
.tri .slot rect { fill: #f5edff; stroke: #cdbcf0; stroke-width: 2; }
.tri .slot.q rect { fill: var(--gold-soft); stroke: var(--gold); stroke-dasharray: 6 4; }
.tri .slot.active rect { fill: var(--gold); stroke: var(--violet); stroke-dasharray: none; }
.tri .slot.ok rect { fill: var(--good); stroke: none; }
.tri .slot.ok text { fill: #fff; }

/* ===== Muster (sequenze) ===== */
.seq { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.seq .item {
  min-width: 54px; height: 54px; padding: 0 8px; border-radius: 14px; background: #fff; font-weight: 800; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; color: var(--violet); box-shadow: var(--shadow);
}
.seq .item.q { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.seq .item.stack { height: auto; padding: 6px 8px; font-size: 1.1rem; line-height: 1.05; white-space: pre-line; text-align: center; }

/* ===== Zahlenstrahl (SVG) ===== */
.nline { width: min(94vw, 380px); height: auto; overflow: visible; }
.nline .base { stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.nline .tick { stroke: #fff; stroke-width: 2; } .nline .tick.big { stroke-width: 3; }
.nline text { fill: #fff; font-weight: 800; font-family: inherit; font-size: 13px; text-anchor: middle; }
.nline .mark text.emo { font-size: 24px; }
.nline .mark.dim { opacity: .3; }
.nline .mark.tappable { cursor: pointer; }
.nline .mark.ok circle { fill: var(--good); fill-opacity: 1; }

/* ===== Hundertertafel ===== */
.board {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; background: rgba(255,255,255,0.92);
  padding: 8px; border-radius: 14px; box-shadow: var(--shadow); width: min(94vw, 380px);
}
.board .c {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800;
  color: var(--violet); background: #f5edff; border-radius: 6px;
}
.board .c.hid { background: #e5dcf7; color: transparent; }
.board .c.q { background: var(--gold); color: var(--violet); font-size: 1rem; animation: pulse 1s ease-in-out infinite; }
.board .c.ok { background: var(--good); color: #fff; }

/* ===== Nachbarzahlen ===== */
.trio { display: flex; align-items: center; gap: 8px; }
.trio .box {
  width: 80px; height: 70px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--violet); box-shadow: var(--shadow);
}
.trio .box.q { background: var(--gold-soft); border: 3px dashed var(--gold); }
.trio .box.active { background: var(--gold); border-style: solid; animation: pulse 1s ease-in-out infinite; }
.trio .box.ok { background: var(--good); color: #fff; border: none; }
.trio .op { color: #fff; font-size: 1.8rem; font-weight: 800; min-width: 12px; text-align: center; }

/* ===== Diktat ===== */
.gapword { display: flex; align-items: center; gap: 2px; font-size: 2.1rem; font-weight: 800; color: #fff; letter-spacing: 1px; flex-wrap: wrap; justify-content: center; }
.gapword .gap { background: var(--gold); color: var(--violet); border-radius: 12px; padding: 0 14px; min-width: 44px; text-align: center; }
.typebox { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.typein {
  width: min(92vw, 420px); font-family: inherit; font-size: 1.6rem; font-weight: 800; padding: 12px 14px;
  border-radius: 16px; border: 3px solid #fff; background: #fff; color: var(--violet); text-align: center; outline: none;
  -webkit-user-select: text; user-select: text;
}
.typein.wide { font-size: 1.15rem; text-align: left; }
.typein:focus { border-color: var(--gold); }
.diff { font-size: 1.6rem; font-weight: 800; color: #fff; background: rgba(255,255,255,0.18); padding: 8px 14px; border-radius: 14px; letter-spacing: 1px; }
.diff .bad { color: #ffb4b4; text-decoration: underline wavy #ff6b6b; }
.sentence { color: #fff; font-size: 1.25rem; font-weight: 700; text-align: center; background: rgba(255,255,255,0.16); padding: 10px 14px; border-radius: 14px; line-height: 1.6; }
.sentence .blank { display: inline-block; min-width: 80px; border-bottom: 3px solid var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

@media print {
  body { background: #fff; }
  body::before, .home-actions, .topbar .icon-btn, .btn { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
  .parent, .title { color: #000; }
}

/* ===== Rechnen bis 100: tastierino numerico (niente scelte da cui andare per esclusione) ===== */
.numpad { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.np-display {
  min-width: 150px; height: 64px; padding: 0 18px; border-radius: 16px; background: #fff; color: var(--violet);
  font-size: 2.2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.np-display.empty { color: #cdbcf0; }
.np-display.correct { background: var(--good); color: #fff; animation: pop .3s ease; }
.np-display.wrong { background: #ffd2d2; color: #b33; }
.np-keys { display: grid; grid-template-columns: repeat(3, 74px); gap: 8px; }
.np-key {
  height: 58px; border-radius: 16px; background: #fff; color: var(--violet);
  font-size: 1.7rem; font-weight: 800; box-shadow: var(--shadow);
}
.np-key:active { transform: scale(0.93); }
.np-key.np-del { background: #f5edff; font-size: 1.4rem; }
.np-key.np-ok { background: var(--good); color: #fff; }

/* Verdoppeln: due gruppi uguali, uno riflesso */
.mirror { display: flex; align-items: center; gap: 12px; }
.mirror .glass { width: 5px; height: 80px; border-radius: 3px; background: var(--sky); box-shadow: 0 0 12px var(--sky); }
.mirror .gems { max-width: 150px; }
.mirror .gem { font-size: 1.9rem; }

/* Malnehmen: gruppi uguali */
.groups { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 380px; }
.group {
  background: rgba(255,255,255,0.92); border-radius: 14px; padding: 6px 8px; box-shadow: var(--shadow);
  display: grid; gap: 3px; justify-content: center;
}
.group span { font-size: 1rem; line-height: 1; }

/* Vergleichen: due lati e il segno in mezzo */
.cmp { display: flex; align-items: center; gap: 12px; }
.cmp .side {
  background: #fff; border-radius: 16px; padding: 8px 16px; font-size: 1.8rem; font-weight: 800;
  color: var(--violet); box-shadow: var(--shadow); white-space: nowrap;
}
.cmp .sign {
  width: 62px; height: 62px; border-radius: 16px; background: var(--gold); color: var(--violet);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800;
  animation: pulse 1s ease-in-out infinite; flex: none;
}
.cmp .sign.ok { background: var(--good); color: #fff; animation: pop .3s ease; }
.holder.ops .choice { font-size: 2.4rem; }

/* ===== Schwere Wörter / Ganzes Diktat ===== */
.merkwort {
  font-size: 2.3rem; font-weight: 800; color: #fff; background: rgba(255,255,255,0.18);
  padding: 10px 22px; border-radius: 16px; letter-spacing: 1px; animation: pop .3s ease;
}
.merkwort .s2 { color: var(--gold); }
.showtext {
  color: #fff; font-size: 1.3rem; font-weight: 700; text-align: center; background: rgba(255,255,255,0.16);
  padding: 12px 16px; border-radius: 14px; line-height: 1.6; max-width: 440px;
}
.showtext[hidden], .typebox-wrap[hidden], .btn[hidden] { display: none; }
.typebox-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.blanks { display: flex; flex-wrap: wrap; gap: 14px 12px; justify-content: center; align-items: flex-end; max-width: 420px; padding: 8px 0; }
.blanks .wline { display: block; height: 4px; border-radius: 2px; background: var(--gold); }
.blanks .dot { color: #fff; font-weight: 800; font-size: 1.6rem; line-height: .4; }

/* ===== Immer 100: Päckchen (colonna di aufgaben legate, si risolve dall'alto in basso) ===== */
.pack { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: min(92vw, 360px); }
.prow {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px; border-radius: 14px;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 1.35rem; font-weight: 800; border: 3px solid transparent;
  transition: transform .08s ease;
}
.prow .pcell { min-width: 44px; text-align: center; }
.prow .pcell.q { background: var(--gold-soft); color: var(--violet); border: 3px dashed var(--gold); border-radius: 10px; min-width: 56px; padding: 2px 6px; }
.prow.active { background: rgba(255,255,255,0.28); border-color: var(--gold); }
.prow.active .pcell.q { background: var(--gold); border-style: solid; animation: pulse 1s ease-in-out infinite; }
.prow.ok .pcell.q { background: var(--good); color: #fff; border: 3px solid transparent; animation: pop .3s ease; }
.prow.tappable { cursor: pointer; background: rgba(255,255,255,0.92); color: var(--violet); box-shadow: var(--shadow); }
.prow.tappable:active { transform: scale(0.97); }
.prow.wrong { background: #ffd2d2; color: #b33; }
.prow .mark { width: 28px; text-align: center; font-size: 1.1rem; }

/* ===== Franken-Rätsel: Tabelle (oben die Zahl, unten das Doppelte / die Hälfte) + Geschichte ===== */
.dtable { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 6px; align-items: stretch; width: min(92vw, 400px); }
.dtable .dhead { display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: .9rem; padding: 0 6px; text-align: center; }
.dtable .dcell {
  background: #fff; color: var(--violet); border-radius: 12px; min-height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; box-shadow: var(--shadow); border: 3px solid transparent;
}
.dtable .dcell.q { background: var(--gold-soft); border: 3px dashed var(--gold); }
.dtable .dcell.active { background: var(--gold); border-style: solid; animation: pulse 1s ease-in-out infinite; }
.dtable .dcell.ok { background: var(--good); color: #fff; border: 3px solid transparent; animation: pop .3s ease; }
.story { font-size: 3rem; line-height: 1; animation: float 2.6s ease-in-out infinite; }
