:root {
  --bg: #fff9f2;
  --card: #ffffff;
  --ink: #2d2a3a;
  --muted: #777186;
  --purple: #7c5cff;
  --purple-dark: #5d43d8;
  --pink: #ff72a8;
  --yellow: #ffd85a;
  --mint: #6ed9b5;
  --sky: #63b9ff;
  --orange: #ff9a54;
  --line: #ebe6f5;
  --success: #2cb67d;
  --danger: #ef5b5b;
  --shadow: 0 10px 28px rgba(71, 52, 117, .12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; overscroll-behavior: none; }
body { min-height: 100dvh; }
button, input { font: inherit; }
button { touch-action: manipulation; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; min-height: calc(70px + var(--safe-top)); padding: calc(10px + var(--safe-top)) 14px 10px; background: rgba(255,249,242,.92); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(124,92,255,.08); }
.brand { display: flex; align-items: center; gap: 10px; justify-self: center; min-width: 0; }
.brand-mark { font-size: 30px; }
.brand strong { display: block; font-size: 18px; line-height: 1.05; }
.brand span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 22px; }
.hidden { visibility: hidden; }
.main-content { flex: 1; width: min(100%, 820px); margin: 0 auto; padding: 18px 16px calc(98px + var(--safe-bottom)); }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 30; width: min(100%, 820px); display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 8px 12px calc(8px + var(--safe-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav-btn { border: 0; background: transparent; color: var(--muted); border-radius: 16px; padding: 7px 4px 5px; }
.nav-btn span { display: block; font-size: 24px; line-height: 1; }
.nav-btn small { display: block; margin-top: 4px; font-weight: 700; font-size: 11px; }
.nav-btn.active { color: var(--purple-dark); background: #f1edff; }
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 22px; background: linear-gradient(135deg,#7c5cff,#a66cff 60%,#ff7eb3); color: #fff; box-shadow: var(--shadow); }
.hero::after { content:""; position:absolute; width:150px; height:150px; right:-55px; top:-55px; border-radius:50%; background:rgba(255,255,255,.16); }
.hero h1 { margin: 0 0 8px; font-size: clamp(27px,8vw,38px); line-height: 1; }
.hero p { margin: 0; font-size: 15px; max-width: 34ch; line-height: 1.45; }
.hero .hero-row { display:flex; align-items:end; justify-content:space-between; gap:16px; }
.hero .mascot { font-size: 64px; filter: drop-shadow(0 8px 8px rgba(70,30,110,.2)); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 12px; }
.section-title h2 { margin: 0; font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.game-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.game-card { min-height: 150px; border: 0; text-align: left; border-radius: 24px; padding: 16px; color: var(--ink); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.game-card:active { transform: scale(.98); }
.game-card .emoji { display:block; font-size: 40px; margin-bottom: 14px; }
.game-card strong { display:block; font-size:17px; line-height:1.05; }
.game-card small { display:block; margin-top:6px; color:#5b546a; font-weight:600; line-height:1.25; }
.game-card .stars { position:absolute; top:12px; right:12px; font-size:12px; background:rgba(255,255,255,.72); border-radius:20px; padding:4px 7px; }
.c1{background:#f1ecff}.c2{background:#e8f7ff}.c3{background:#fff0f6}.c4{background:#fff6d9}.c5{background:#e7fbf4}.c6{background:#fff0e2}.c7{background:#eef0ff}.c8{background:#f7edff}
.panel { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.game-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.game-head h1 { margin:0; font-size:27px; }
.game-head p { margin:6px 0 0; color:var(--muted); line-height:1.35; font-size:14px; }
.badge { flex:0 0 auto; background:#fff4cc; border:1px solid #ffe186; padding:7px 10px; border-radius:999px; font-weight:800; font-size:13px; }
.primary-btn, .secondary-btn, .answer-btn { border:0; border-radius:18px; min-height:50px; padding:12px 18px; font-weight:800; }
.primary-btn { background:var(--purple); color:#fff; box-shadow:0 8px 18px rgba(124,92,255,.28); }
.secondary-btn { background:#f3f0fb; color:var(--purple-dark); }
.button-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.memory-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.memory-card { aspect-ratio:1; border:0; border-radius:18px; background:linear-gradient(135deg,#8c70ff,#6b4cf3); color:#fff; font-size:0; box-shadow:0 6px 14px rgba(91,64,183,.2); transform-style:preserve-3d; transition:.2s; }
.memory-card.open, .memory-card.matched { background:#fff; font-size:34px; border:2px solid #e8e1ff; }
.memory-card.matched { background:#e7fbf4; border-color:#a4ecd4; }
.canvas-wrap { border-radius:22px; overflow:hidden; background:#fff; border:2px dashed #ded6f4; }
canvas { display:block; width:100%; height:auto; touch-action:none; }
.palette { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.color-chip { width:44px; height:44px; border-radius:50%; border:4px solid #fff; box-shadow:0 0 0 2px #ddd; }
.color-chip.active { box-shadow:0 0 0 4px var(--ink); }
.coloring-scene { background:#fffdf6; border-radius:22px; padding:8px; border:2px solid #f1ead7; }
.coloring-scene svg { width:100%; height:auto; display:block; }
.coloring-scene [data-fill] { cursor:pointer; stroke:#4c4556; stroke-width:5; }
.dot-status, .task-status { margin:12px 0 0; text-align:center; font-weight:800; color:var(--purple-dark); }
.puzzle-grid { width:min(100%,390px); margin:0 auto; display:grid; grid-template-columns:repeat(3,1fr); gap:4px; background:#d9d1ef; padding:4px; border-radius:20px; overflow:hidden; }
.puzzle-tile { aspect-ratio:1; border:0; background-image:url('assets/puzzle-scene.svg'); background-size:300% 300%; border-radius:8px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.55); }
.puzzle-tile.blank { background-image:none; background:rgba(255,255,255,.42); box-shadow:none; }
.math-card { text-align:center; padding:18px 8px; }
.math-equation { font-size:clamp(42px,15vw,72px); font-weight:900; letter-spacing:2px; margin:16px 0 20px; }
.answers { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.answer-btn { min-height:68px; background:#f5f1ff; color:var(--ink); font-size:24px; }
.answer-btn.correct { background:#dff8ee; color:#187251; }
.answer-btn.wrong { background:#ffe6e6; color:#a42d2d; }
.letter-big { width:130px; height:130px; margin:6px auto 12px; display:grid; place-items:center; border-radius:34px; background:linear-gradient(135deg,#fff0f6,#f1ecff); font-size:84px; font-weight:900; color:var(--purple-dark); box-shadow:var(--shadow); }
.letter-word { text-align:center; font-size:24px; font-weight:800; margin:10px 0 18px; }
.letter-emoji { font-size:48px; vertical-align:middle; margin-right:8px; }
.school-prompt { text-align:center; font-size:22px; font-weight:900; margin:8px 0 16px; line-height:1.25; }
.school-visual { text-align:center; font-size:38px; line-height:1.7; min-height:90px; display:grid; place-items:center; }
.choice-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.choice-btn { min-height:72px; border:0; border-radius:18px; background:#f7f4ff; font-size:26px; font-weight:800; }
.progress-ring { width:150px; height:150px; border-radius:50%; display:grid; place-items:center; margin:10px auto 20px; background:conic-gradient(var(--purple) var(--pct,0%),#eee7fa 0); position:relative; }
.progress-ring::before { content:""; position:absolute; inset:13px; border-radius:50%; background:#fff; }
.progress-ring span { position:relative; z-index:1; font-size:27px; font-weight:900; }
.progress-list { display:grid; gap:10px; }
.progress-item { display:grid; grid-template-columns:42px 1fr auto; align-items:center; gap:10px; background:#faf8ff; padding:12px; border-radius:17px; }
.progress-item .pi-emoji { font-size:28px; }
.progress-item strong { display:block; }
.progress-item small { color:var(--muted); }
.progress-stars { font-weight:900; color:#b37b00; }
.info-card { background:#fff; border-radius:20px; padding:16px; box-shadow:var(--shadow); margin-bottom:12px; }
.info-card h2,.info-card h3 { margin:0 0 8px; }
.info-card p,.info-card li { color:#5f596c; line-height:1.5; }
.info-card ul { padding-left:20px; }
.install-banner { display:flex; align-items:center; gap:12px; padding:14px; border-radius:20px; background:#fff4cc; margin:14px 0; }
.install-banner .ib-icon{font-size:32px}.install-banner strong{display:block}.install-banner small{color:#6d6243}
.toast { position:fixed; z-index:80; left:50%; bottom:calc(92px + var(--safe-bottom)); transform:translate(-50%,20px); max-width:calc(100% - 32px); background:#2f2b3a; color:#fff; border-radius:999px; padding:11px 16px; opacity:0; pointer-events:none; transition:.25s; font-weight:700; text-align:center; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.confetti-layer { pointer-events:none; position:fixed; inset:0; z-index:90; overflow:hidden; }
.confetti { position:absolute; top:-20px; font-size:22px; animation:fall 1.35s ease-in forwards; }
@keyframes fall { to { transform:translateY(110vh) rotate(540deg); opacity:.2; } }
.kid-note { text-align:center; color:var(--muted); font-size:13px; margin-top:14px; }
.session-dots { display:flex; gap:6px; justify-content:center; margin:10px 0; }
.session-dot { width:10px;height:10px;border-radius:50%;background:#e3ddec; }
.session-dot.done { background:var(--mint); }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
@media (min-width:620px){ .game-grid{grid-template-columns:repeat(4,1fr)} .memory-grid{grid-template-columns:repeat(4,1fr)} .game-card{min-height:165px}.main-content{padding-left:22px;padding-right:22px} }
@media (max-width:380px){ .brand span{display:none}.game-card{min-height:138px;padding:14px}.game-card .emoji{font-size:34px;margin-bottom:10px}.game-card strong{font-size:15px}.memory-grid{gap:8px}.memory-card.open,.memory-card.matched{font-size:29px} }
.coloring-title { text-align:center; font-weight:900; color:var(--purple-dark); padding:4px 0 8px; font-size:18px; }

/* v1.2 – egyértelmű helyes/hibás válasz-visszajelzés */
.answer-btn, .choice-btn { transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease; border:3px solid transparent; }
.answer-btn.correct, .choice-btn.correct { background:#dff8ee; color:#176a4d; border-color:#35ad7c; box-shadow:0 0 0 4px rgba(53,173,124,.13); }
.answer-btn.wrong, .choice-btn.wrong { background:#ffdede; color:#9e2020; border-color:#e53935; box-shadow:0 0 0 5px rgba(229,57,53,.16); animation:wrongShake .34s ease; }
.task-status.feedback-error { margin-top:14px; padding:12px 14px; border-radius:16px; background:#ffe3e3; color:#a51f1f; border:3px solid #ef5350; font-size:18px; }
.task-status.feedback-success { margin-top:14px; padding:12px 14px; border-radius:16px; background:#e1f8ee; color:#176a4d; border:3px solid #45b98a; font-size:18px; }
@keyframes wrongShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
@media (prefers-reduced-motion: reduce){ .answer-btn.wrong, .choice-btn.wrong { animation:none; } }
.memory-card.wrong { background:#ffe1e1; border:4px solid #e53935; box-shadow:0 0 0 5px rgba(229,57,53,.15); animation:wrongShake .34s ease; }
.dot-status.feedback-error { margin-top:14px; padding:12px 14px; border-radius:16px; background:#ffe3e3; color:#a51f1f; border:3px solid #ef5350; font-size:18px; }
