/* Okos Kaland – megjelenés */
:root {
  --ink: #3b2f63;
  --ink-soft: #6f6496;
  --card: #ffffff;
  --bg1: #c9e6ff;
  --bg2: #ffe0f0;
  --bg3: #fff4cc;

  --pink: #ff6fa8;   --pink-d: #e0457f;
  --orange: #ffa94d; --orange-d: #e8830f;
  --yellow: #ffd43b; --yellow-d: #e0b100;
  --green: #40c057;  --green-d: #2b9a3e;
  --blue: #4dabf7;   --blue-d: #1c7ed6;
  --violet: #845ef7; --violet-d: #6741d9;
  --red: #ff6b6b;    --red-d: #e03131;

  --r: 26px;
  --lift: 0 6px 0 rgba(59, 47, 99, .16), 0 14px 28px rgba(59, 47, 99, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Baloo 2', 'Comic Sans MS', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  background: linear-gradient(165deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid var(--violet); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.1; }

/* ---------- Háttér ---------- */
.sky { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud {
  position: absolute; width: 160px; height: 52px; background: #fff; border-radius: 60px; opacity: .8;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 70px; height: 70px; top: -34px; left: 24px; }
.cloud::after { width: 90px; height: 90px; top: -50px; right: 22px; }
.c1 { top: 8%;  animation-duration: 70s; animation-delay: -10s; }
.c2 { top: 30%; animation-duration: 95s; animation-delay: -60s; transform: scale(.7); }
.c3 { top: 62%; animation-duration: 80s; animation-delay: -35s; transform: scale(.9); opacity: .6; }
.c4 { top: 85%; animation-duration: 110s; animation-delay: -80s; transform: scale(.6); opacity: .7; }
@keyframes drift { from { left: -220px; } to { left: 110%; } }

.floaty { position: absolute; font-size: 34px; opacity: .45; animation: floaty 9s ease-in-out infinite; }
.f1 { top: 14%; left: 6%; } .f2 { top: 70%; left: 4%; animation-delay: -2s; }
.f3 { top: 22%; right: 6%; animation-delay: -4s; } .f4 { top: 52%; right: 3%; animation-delay: -1s; }
.f5 { top: 88%; right: 12%; animation-delay: -6s; } .f6 { top: 4%; right: 30%; animation-delay: -3s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-22px) rotate(6deg); } }

#app { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; min-height: 100vh; min-height: 100dvh; }
#confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; z-index: 50; }

/* ---------- Animációk ---------- */
.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.bounce { animation: bounce .8s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes bounce { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
.shake { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
.bump { animation: bump .45s; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------- Általános elemek ---------- */
.screen { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.center { text-align: center; }
.narrow { max-width: 620px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--lift); padding: 22px; }
.title { font-size: clamp(26px, 5vw, 36px); margin: 18px 0 14px; }
.lead { text-align: center; color: var(--ink-soft); margin: 6px 0 14px; }
.muted { color: var(--ink-soft); }
.err { color: var(--red-d); min-height: 1.2em; margin: 8px 0; font-weight: 700; }
.ok { color: var(--green-d); min-height: 1.2em; font-weight: 700; }
code { background: #f1ecff; padding: 1px 6px; border-radius: 6px; font-size: .85em; }

.big-btn {
  --b: var(--green); --bd: var(--green-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 64px; padding: 10px 26px; border-radius: 22px;
  background: var(--b); color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 6px 0 var(--bd), 0 10px 20px rgba(0,0,0,.12);
  transition: transform .1s, box-shadow .1s;
  text-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.big-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bd); }
.big-btn small { background: rgba(255,255,255,.3); border-radius: 12px; padding: 0 8px; font-size: 16px; }
.big-btn.green { --b: var(--green); --bd: var(--green-d); }
.big-btn.blue { --b: var(--blue); --bd: var(--blue-d); }
.big-btn.yellow { --b: var(--yellow); --bd: var(--yellow-d); color: #5c3d00; text-shadow: none; }
.big-btn.red { --b: var(--red); --bd: var(--red-d); }
.big-btn.small { min-height: 52px; font-size: 19px; padding: 8px 20px; margin-top: 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }
.row-btns.left { justify-content: flex-start; margin-top: 10px; }

.icon-btn {
  width: 56px; height: 56px; flex: none; border-radius: 18px; background: #fff; font-size: 24px;
  box-shadow: 0 5px 0 rgba(59,47,99,.18); display: grid; place-items: center;
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59,47,99,.18); }
.link-btn { margin-top: 30px; color: var(--ink-soft); font-weight: 700; font-size: 17px; padding: 10px 16px; border-radius: 14px; }
@media (hover: hover) { .link-btn:hover { background: rgba(255,255,255,.6); } }
.link-btn.inline { margin: 0; padding: 0 4px; text-decoration: underline; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: #eef3ff; color: var(--ink); box-shadow: 0 3px 0 #cdd8f5; cursor: pointer;
}
.mini-btn.red { background: #ffe8e8; box-shadow: 0 3px 0 #ffc4c4; }
.pill { background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 800; box-shadow: 0 4px 0 rgba(59,47,99,.15); white-space: nowrap; }
.pill.star { background: #fff6cc; color: #8a5a00; }

.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.topbar h2 { flex: 1; font-size: clamp(22px, 4.5vw, 30px); }

/* ---------- Logó, kabala ---------- */
.logo { margin-top: 10px; }
.logo-owl { font-size: 92px; display: inline-block; filter: drop-shadow(0 8px 0 rgba(59,47,99,.12)); }
.logo h1 {
  font-size: clamp(44px, 10vw, 72px); font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--green), var(--blue), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #fff);
}
.tag { margin: 16px 0 0; color: var(--ink-soft); font-weight: 700; }

.mascot-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.mascot { font-size: 64px; flex: none; filter: drop-shadow(0 5px 0 rgba(59,47,99,.12)); }
.bubble {
  position: relative; flex: 1; background: #fff; border-radius: 24px; padding: 14px 20px; font-weight: 700;
  font-size: clamp(19px, 3.6vw, 24px); box-shadow: var(--lift); display: flex; align-items: center; gap: 10px;
}
.bubble > span { flex: 1; }
.bubble::before {
  content: ''; position: absolute; left: -14px; top: 50%; margin-top: -12px;
  border: 12px solid transparent; border-right: 16px solid #fff; border-left: 0;
}
.speak { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #f1ecff; font-size: 22px; }
.speak:active { transform: scale(.9); }

/* ---------- Játékosválasztó ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; max-width: 760px; margin: 0 auto; }
.profile-card {
  --c: var(--pink);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px;
  background: #fff; border-radius: var(--r); border: 5px solid var(--c);
  box-shadow: 0 7px 0 var(--c), 0 14px 26px rgba(0,0,0,.1);
  transition: transform .15s;
}
@media (hover: hover) { .profile-card:hover { transform: translateY(-4px) rotate(-1deg); } }
.profile-card:active { transform: translateY(4px); }
.profile-card.add { border-style: dashed; --c: #b9addb; background: rgba(255,255,255,.7); }
.pc-avatar { font-size: 64px; line-height: 1.1; }
.pc-name { font-size: 24px; font-weight: 800; word-break: break-word; }
.pc-meta { color: var(--ink-soft); font-size: 16px; font-weight: 700; }

/* ---------- Profil űrlap ---------- */
.form { display: flex; flex-direction: column; }
.form p { margin: 0 0 10px; }
.preview {
  --c: var(--pink); width: 120px; height: 120px; margin: 0 auto 8px; border-radius: 50%;
  background: #f3eeff; background: color-mix(in srgb, var(--c) 30%, white); border: 6px solid var(--c);
  display: grid; place-items: center; font-size: 66px; transition: border-color .2s, background .2s;
}
.lbl { font-weight: 800; margin: 16px 0 8px; font-size: 21px; }
.txt {
  font: inherit; font-size: 24px; font-weight: 700; color: var(--ink); padding: 12px 18px; border-radius: 18px;
  border: 4px solid #e2dbf7; background: #faf8ff; width: 100%;
}
.txt:focus { border-color: var(--violet); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-width: 56px; height: 56px; border-radius: 16px; background: #f1ecff; font-weight: 800; font-size: 22px;
  box-shadow: 0 4px 0 #d9cff5; padding: 0 12px;
}
.chip.on { background: var(--violet); color: #fff; box-shadow: 0 4px 0 var(--violet-d); }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; }
.av { height: 62px; font-size: 38px; border-radius: 18px; background: #f7f4ff; border: 4px solid transparent; }
.av.on { border-color: var(--violet); background: #ece5ff; transform: scale(1.08); }
.colors { display: flex; flex-wrap: wrap; gap: 12px; }
.sw { width: 52px; height: 52px; border-radius: 50%; background: var(--c); border: 5px solid #fff; box-shadow: 0 0 0 3px #e2dbf7; }
.sw.on { box-shadow: 0 0 0 4px var(--ink); transform: scale(1.1); }
.form .big-btn { margin-top: 18px; }

/* ---------- Főoldal ---------- */
.userbar {
  --c: var(--pink); display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--r);
  padding: 10px 16px 10px 10px; box-shadow: var(--lift); border: 4px solid var(--c);
}
.ub-av { width: 66px; height: 66px; flex: none; border-radius: 50%; font-size: 42px; background: #f3eeff; background: color-mix(in srgb, var(--c) 25%, white); }
.ub-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ub-info b { font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-info span { color: var(--ink-soft); font-weight: 700; font-size: 17px; }
.rankbar {
  position: relative; height: 34px; margin-top: 12px; border-radius: 999px; background: rgba(255,255,255,.75);
  overflow: hidden; box-shadow: inset 0 3px 0 rgba(59,47,99,.08);
}
.rb-fill { position: absolute; top: 0; right: auto; bottom: 0; left: 0; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 999px; transition: width .6s; }
.rankbar span { position: relative; display: block; text-align: center; font-size: 15px; font-weight: 800; line-height: 34px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.subject-card {
  --c1: var(--blue); --c2: var(--violet); --cd: var(--violet-d);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 24px 16px 20px;
  border-radius: 30px; color: #fff; overflow: hidden;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: 0 8px 0 var(--cd), 0 18px 30px rgba(0,0,0,.15);
  transition: transform .15s;
}
.subject-card::after {
  content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.14); top: -60px; right: -50px;
}
@media (hover: hover) { .subject-card:hover { transform: translateY(-5px) scale(1.02); } }
.subject-card:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--cd); }
.sc-icon { font-size: 70px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); }
.sc-title { font-size: 32px; font-weight: 800; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.sc-desc { font-weight: 700; opacity: .95; font-size: 18px; }
.sc-count { margin-top: 8px; background: rgba(255,255,255,.28); padding: 2px 14px; border-radius: 999px; font-weight: 800; font-size: 16px; }

.s-matek { --c1: #4dabf7; --c2: #5c7cfa; --cd: #3b5bdb; --accent: #4c6ef5; --soft: #e7efff; }
.s-nyelvtan { --c1: #ff8fab; --c2: #f06595; --cd: #c2255c; --accent: #e64980; --soft: #ffe8f1; }
.s-irodalom { --c1: #38d9a9; --c2: #40c057; --cd: #2b8a3e; --accent: #2f9e44; --soft: #e3fbec; }

/* ---------- Játéklista ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.game-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 18px 12px 16px; background: #fff; border-radius: var(--r);
  border: 4px solid var(--accent, var(--violet)); box-shadow: 0 6px 0 var(--accent, var(--violet)), 0 12px 22px rgba(0,0,0,.08);
  transition: transform .15s;
}
@media (hover: hover) { .game-card:hover { transform: translateY(-4px) rotate(.5deg); } }
.game-card:active { transform: translateY(4px); }
.gc-icon { font-size: 50px; width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; background: var(--soft, #f1ecff); }
.gc-title { font-size: 22px; font-weight: 800; margin-top: 4px; }
.gc-desc { font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.gc-best, .gc-new { margin-top: 8px; font-size: 15px; font-weight: 800; padding: 2px 12px; border-radius: 999px; }
.gc-best { background: #fff6cc; color: #8a5a00; }
.gc-new { background: var(--soft, #f1ecff); color: var(--accent, var(--violet)); }

/* ---------- Játék képernyő ---------- */
.play { max-width: 760px; margin: 0 auto; }
.playbar { display: flex; align-items: center; gap: 12px; }
.progress { position: relative; flex: 1; height: 30px; background: rgba(255,255,255,.8); border-radius: 999px; overflow: hidden; box-shadow: inset 0 3px 0 rgba(59,47,99,.08); }
.pg-fill { position: absolute; top: 0; right: auto; bottom: 0; left: 0; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 999px; transition: width .5s; }
.progress span { position: relative; display: block; text-align: center; font-weight: 800; font-size: 16px; line-height: 30px; }

.task-card {
  background: #fff; border-radius: 30px; padding: 22px 18px; text-align: center; box-shadow: var(--lift);
  border: 5px solid var(--soft); margin-bottom: 12px;
}
.hint { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 17px; margin: 4px 8px 12px; }
.eq { font-size: clamp(40px, 10vw, 64px); font-weight: 800; letter-spacing: 2px; color: var(--ink); }
.qmark { display: inline-block; min-width: 1.2em; color: var(--accent); animation: bob 2s ease-in-out infinite; }
.slot { display: inline-block; min-width: 1.3em; border: 4px dashed var(--accent); border-radius: 16px; color: var(--accent); margin: 0 6px; }
.emoji-xl { font-size: clamp(64px, 16vw, 96px); line-height: 1.15; }
.emoji-xl.small { font-size: 54px; }
.word { font-size: clamp(34px, 8vw, 52px); font-weight: 800; letter-spacing: 2px; }
.big-word { letter-spacing: 1px; }
.gap {
  display: inline-block; width: 1.4em; height: 1.05em; vertical-align: -0.12em; margin: 0 4px;
  border: 4px dashed var(--accent); border-radius: 12px; background: var(--soft);
}
.sentence { font-size: clamp(26px, 6vw, 38px); font-weight: 800; }
.poem { font-size: clamp(22px, 5vw, 30px); font-weight: 700; line-height: 1.5; }
.source { margin-top: 10px; color: var(--ink-soft); font-style: italic; font-size: 17px; }
.book-title { display: inline-block; margin-top: 6px; background: var(--soft); color: var(--accent); padding: 4px 16px; border-radius: 999px; font-weight: 800; }

.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.grp { background: var(--soft); border-radius: 16px; padding: 4px 10px; font-size: 26px; letter-spacing: 2px; }
.count-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: clamp(34px, 8vw, 46px); max-width: 560px; margin: 0 auto; }
.count-grid span { display: inline-block; animation: pop .4s both; }
.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bead {
  min-width: 74px; height: 74px; padding: 0 10px; border-radius: 37px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; background: var(--soft); color: var(--ink); border: 4px solid var(--accent);
}
.bead.q { background: var(--accent); color: #fff; animation: bob 2s ease-in-out infinite; }

.coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.coin {
  width: 90px; height: 90px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; color: #5c4400; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15), 0 5px 0 rgba(0,0,0,.12);
  background: radial-gradient(circle at 35% 30%, #fff3bf, #f2c94c 60%, #d4a017);
  border: 4px solid #c99a12;
}
.coin b { font-size: 30px; line-height: 1; } .coin small { font-size: 15px; }
.coin.silver { background: radial-gradient(circle at 35% 30%, #fff, #d0d5dc 60%, #9aa3ad); border-color: #8a939e; color: #3b4048; }
.coin.copper { background: radial-gradient(circle at 35% 30%, #ffd8b0, #d9824a 60%, #a85a2a); border-color: #9c5426; color: #4a2300; }
.coin.bi1 { background: radial-gradient(circle at 50% 50%, #e3e7ec 0 45%, #f2c94c 47%, #d4a017 100%); border-color: #c99a12; }
.coin.bi2 { background: radial-gradient(circle at 50% 50%, #f2c94c 0 45%, #e3e7ec 47%, #9aa3ad 100%); border-color: #8a939e; color: #3b4048; }
.coin.bi1, .coin.bi2 { width: 100px; height: 100px; }

.clock { width: min(240px, 62vw); height: auto; }
.ck-rim { fill: var(--accent); }
.ck-face { fill: #fff; }
.ck-tick { stroke: #c5bfe0; stroke-width: 2; }
.ck-tick5 { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.ck-num { font-family: inherit; font-size: 20px; font-weight: 800; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.ck-hour { stroke: var(--ink); stroke-width: 9; stroke-linecap: round; }
.ck-min { stroke: #ff6b6b; stroke-width: 6; stroke-linecap: round; }
.ck-dot { fill: var(--ink); }

/* Válaszgombok */
.answers { display: grid; gap: 14px; margin-top: 6px; }
.cols-1 { grid-template-columns: 1fr; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.ans {
  min-height: 74px; padding: 10px 14px; border-radius: 22px; background: #fff; font-size: clamp(22px, 5vw, 30px); font-weight: 800;
  border: 4px solid var(--soft); box-shadow: 0 6px 0 var(--accent), 0 10px 18px rgba(0,0,0,.08);
  transition: transform .1s, background .2s; word-break: break-word;
}
.cols-1 .ans { font-size: clamp(20px, 4.5vw, 26px); }
.ans.sym { font-size: 48px; line-height: 1; }
.cols-3 .ans { font-size: clamp(18px, 4.5vw, 28px); }
.cols-3 .ans.sym { font-size: 52px; }
@media (hover: hover) { .ans:hover { background: var(--soft); } }
.ans:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--accent); }
.ans.right, .slots.right .slot-box { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 6px 0 var(--green-d); animation: bump .5s; }
.ans.wrong { background: #ffe3e3; border-color: var(--red); color: var(--red-d); box-shadow: 0 2px 0 var(--red); animation: shake .45s; opacity: .7; }
.ans.reveal, .slot-box.reveal { background: #d3f9d8; border-color: var(--green); color: var(--green-d); animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(64,192,87,.35), 0 6px 0 var(--green-d); } }

/* Sorba rakós feladat */
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 18px; }
.slots.wrong { animation: shake .45s; }
.slot-box {
  min-width: 66px; height: 70px; padding: 0 12px; border-radius: 18px; border: 4px dashed var(--accent); background: rgba(255,255,255,.7);
  font-size: 28px; font-weight: 800;
}
.slot-box.filled { border-style: solid; background: #fff; box-shadow: 0 5px 0 var(--accent); }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tile {
  min-width: 70px; height: 74px; padding: 0 16px; border-radius: 20px; font-size: 30px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2)); box-shadow: 0 6px 0 var(--cd);
}
.tile:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd); }
.tile.used { opacity: .2; transform: scale(.9); box-shadow: none; }

.msg { text-align: center; margin-top: 16px; min-height: 40px; }
.encourage { display: inline-block; background: #fff4e6; color: #b35c00; font-weight: 800; padding: 10px 20px; border-radius: 18px; margin: 0; }
.reveal-box { background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--lift); font-weight: 700; }
.reveal-box b { color: var(--green-d); font-size: 1.15em; }

/* ---------- Felugró ablak ---------- */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(59, 47, 99, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeUp .2s both;
}
.modal { width: min(440px, 100%); background: #fff; border-radius: 34px; padding: 26px 22px; text-align: center; box-shadow: 0 10px 0 rgba(59,47,99,.2), 0 30px 60px rgba(0,0,0,.25); border: 6px solid var(--yellow); }
.pp-emoji { font-size: 86px; line-height: 1.1; }
.pp-text { font-size: 32px; font-weight: 800; margin: 6px 0; }
.pp-sub { font-size: 22px; font-weight: 800; color: #b07800; }
.pp-explain { margin: 14px 0 4px; background: #f1ecff; border-radius: 16px; padding: 10px 14px; font-weight: 700; font-size: 19px; color: var(--ink); }
.modal .big-btn { margin-top: 16px; }
.modal .row-btns { margin-top: 8px; }

#toast {
  position: fixed; left: 50%; top: 16px; z-index: 60; transform: translate(-50%, calc(-100% - 40px));
  background: var(--violet); color: #fff; font-weight: 800; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 6px 0 var(--violet-d); transition: transform .35s cubic-bezier(.3,1.6,.5,1); max-width: calc(100% - 32px); text-align: center;
}
#toast.show { transform: translate(-50%, 0); }

/* ---------- Eredmény ---------- */
.result .trophy { font-size: 120px; line-height: 1.1; margin-top: 10px; }
.score { font-size: 26px; font-weight: 800; margin: 0; }
.stars-earned { display: inline-block; margin-top: 12px; background: #fff6cc; color: #8a5a00; font-size: 30px; font-weight: 800; padding: 8px 26px; border-radius: 999px; box-shadow: 0 5px 0 var(--yellow-d); }
.perfect { font-weight: 800; color: var(--violet); font-size: 22px; }
.rankup { display: inline-block; background: var(--violet); color: #fff; font-weight: 800; padding: 8px 20px; border-radius: 18px; }
.note { font-weight: 700; color: var(--ink-soft); }
.sticker-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 18px; }
.sticker-reveal {
  width: 190px; padding: 18px 10px 14px; background: #fff; border-radius: 28px; border: 5px solid var(--pink);
  box-shadow: 0 7px 0 var(--pink-d); animation: flipIn .8s cubic-bezier(.3,1.5,.5,1) both;
}
.sticker-reveal.rare { border-color: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d), 0 0 30px rgba(255,212,59,.8); background: linear-gradient(160deg, #fff, #fff6cc); }
@keyframes flipIn { from { transform: rotateY(90deg) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.sr-e { font-size: 80px; line-height: 1.1; }
.sr-n { font-size: 22px; font-weight: 800; }
.sr-t { font-size: 15px; font-weight: 800; color: var(--pink-d); }
.sticker-reveal.rare .sr-t { color: #b07800; }

/* ---------- Matricaalbum ---------- */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
.stk {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff;
  border-radius: 24px; border: 4px solid #ffd0e3; box-shadow: 0 5px 0 #ffb3d1; animation: pop .4s both;
}
.stk span { font-size: 48px; line-height: 1.1; }
.stk small { font-size: 14px; font-weight: 800; }
.stk.rare { border-color: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d), 0 0 16px rgba(255,212,59,.6); background: linear-gradient(160deg, #fff, #fff6cc); }
.stk.locked { background: rgba(255,255,255,.5); border-style: dashed; border-color: #cfc6ea; box-shadow: none; color: #b5abd6; }
.stk.locked span { font-size: 38px; }

/* ---------- Szülői sarok ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab { padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.7); font-weight: 800; font-size: 17px; }
.tab.on { background: var(--violet); color: #fff; box-shadow: 0 4px 0 var(--violet-d); }
.panel { font-size: 18px; }
.panel h3 { margin: 22px 0 10px; font-size: 22px; }
.pp-row { --c: var(--pink); border-left: 8px solid var(--c); background: #faf8ff; border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; }
.pp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-head > div:nth-child(2) { flex: 1; min-width: 180px; }
.pp-av { font-size: 44px; }
.pp-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 16px; }
.stats th, .stats td { text-align: left; padding: 5px 8px; border-bottom: 2px solid #ece7fb; }
.stats th { color: var(--ink-soft); }
.cform { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.cform label { display: flex; flex-direction: column; font-weight: 800; font-size: 16px; gap: 4px; }
.cform input, .cform select { font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 14px; border: 3px solid #e2dbf7; background: #faf8ff; color: var(--ink); }
.clist { list-style: none; padding: 0; margin: 0; }
.clist li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px; background: #faf8ff; border-radius: 14px; margin-bottom: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 2px solid #f1ecff; flex-wrap: wrap; }
.toggle { width: 70px; height: 40px; border-radius: 999px; background: #d9d3ee; position: relative; transition: background .2s; flex: none; }
.toggle i { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: left .2s; }
.toggle.on { background: var(--green); }
.toggle.on i { left: 34px; }
.help li { margin-bottom: 8px; }

/* ---------- Nyelvváltó ---------- */
.toprow { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 10px; }
.toprow .mini-logo { margin-right: auto; }

/* ---------- Logó ---------- */
.logo-img {
  display: block; width: min(520px, 100%); height: auto; margin: 0 auto;
  border-radius: 34px; border: 6px solid #fff;
  box-shadow: 0 8px 0 rgba(59,47,99,.18), 0 20px 40px rgba(14,60,80,.28);
}
.mini-logo {
  height: 72px; width: auto; border-radius: 16px; border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(59,47,99,.15), 0 8px 16px rgba(14,60,80,.2);
}
/* Indítókép (plakát) */
.splash {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(180deg, #8fd3ff 0%, #f6c6ea 55%, #bfe9a8 100%);
  animation: fadeUp .4s ease both; transition: opacity .45s, transform .45s;
}
.splash img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: auto; height: 100vh; height: 100dvh; object-fit: contain; box-shadow: 0 0 60px rgba(0,0,0,.18); }
.splash.out { opacity: 0; transform: scale(1.06); }
.splash-tap { position: absolute; bottom: 4vh; right: 8vw; font-size: 44px; animation: bob 1.2s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.mini-logo { cursor: pointer; background: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.langs { display: inline-flex; gap: 6px; background: rgba(255,255,255,.7); padding: 5px; border-radius: 999px; box-shadow: 0 3px 0 rgba(59,47,99,.1); }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.lang-btn.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(59,47,99,.18); }
.flag { width: 28px; height: 19px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.big-btn.pink { --b: var(--pink); --bd: var(--pink-d); }
.big-btn.wide { width: 100%; margin-top: 18px; }

/* ---------- Nehézségválasztó ---------- */
.setup-hero { text-align: center; background: #fff; border-radius: 30px; padding: 18px; box-shadow: var(--lift); border: 5px solid var(--soft, #f1ecff); }
.setup-hero .sh-icon { font-size: 70px; display: inline-grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; background: var(--soft, #f1ecff); }
.setup-hero p { margin: 8px 0 0; font-weight: 700; color: var(--ink-soft); }
.setup-h { text-align: center; font-size: 26px; margin: 22px 0 12px; }
.lvl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lvl {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px 14px;
  background: #fff; border-radius: 24px; border: 4px solid #ece7fb; box-shadow: 0 6px 0 #ddd5f5; transition: transform .12s;
}
.lvl:active { transform: translateY(4px); }
.lvl-e { font-size: 46px; line-height: 1.1; }
.lvl b { font-size: 22px; }
.lvl small { font-size: 14px; color: var(--ink-soft); font-weight: 700; text-align: center; }
.lvl em { position: absolute; top: -12px; font-style: normal; font-size: 12px; font-weight: 800; background: var(--yellow); color: #5c3d00; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.lvl.on { transform: scale(1.04); }
.lvl1.on { border-color: var(--green); box-shadow: 0 6px 0 var(--green-d); background: #ebfbee; }
.lvl2.on { border-color: var(--orange); box-shadow: 0 6px 0 var(--orange-d); background: #fff4e6; }
.lvl3.on { border-color: var(--red); box-shadow: 0 6px 0 var(--red-d); background: #fff0f0; }
.timed-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-top: 18px; background: #fff; border-radius: 22px; padding: 14px 18px; box-shadow: var(--lift); }
.timed-row span { display: flex; flex-direction: column; }
.timed-row b { font-size: 21px; }
.timed-row small { color: var(--ink-soft); font-weight: 600; font-size: 15px; }

/* ---------- Időzítő, villámfeladat ---------- */
.lightning { margin: 12px auto 0; width: fit-content; background: linear-gradient(90deg, #ffd43b, #ffa94d); color: #5c3d00; font-weight: 800; padding: 6px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--orange-d); }
.timer { position: relative; height: 34px; margin: 12px 0 0; background: rgba(255,255,255,.85); border-radius: 999px; overflow: hidden; box-shadow: inset 0 3px 0 rgba(59,47,99,.08); }
.tm-fill { position: absolute; top: 0; right: auto; bottom: 0; left: 0; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #51cf66, #94d82d); border-radius: 999px; }
.timer.hurry .tm-fill { background: linear-gradient(90deg, #ff6b6b, #ffa94d); }
.timer.hurry { animation: shake .5s infinite; }
.tm-num { position: relative; display: block; text-align: center; font-weight: 800; line-height: 34px; font-size: 20px; }
.tm-ico { position: absolute; left: 10px; top: 3px; font-size: 20px; }

/* ---------- Mesekészítő ---------- */
.story-screen { max-width: 760px; margin: 0 auto; }
.story-chip { flex: 1; text-align: center; background: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-page {
  position: relative; margin-top: 16px; padding: 22px 22px 18px; border-radius: 28px;
  background: linear-gradient(180deg, #fffdf5, #fff6e0); border: 5px solid #f3d9a4;
  box-shadow: 0 7px 0 #e2bf7b, 0 16px 30px rgba(120,80,0,.15);
}
.story-page::before { content: ''; position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px; inset: 10px; border: 2px dashed #ecd3a0; border-radius: 20px; pointer-events: none; }
.sp-art { text-align: center; font-size: clamp(52px, 13vw, 78px); line-height: 1.15; letter-spacing: 4px; }
.sp-text { position: relative; font-size: clamp(20px, 4.4vw, 25px); font-weight: 600; line-height: 1.5; margin: 10px 4px 4px; color: #4a3520; }
.story-page .speak { position: absolute; right: 14px; top: 14px; background: #fff; }
.story-act { margin-top: 16px; }
.sp-q { text-align: center; font-size: 26px; margin: 8px 0 14px; }
.sp-q small { display: block; font-size: 16px; color: var(--ink-soft); margin-top: 4px; }
.story-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; background: #fff; border-radius: 24px;
  border: 4px solid #e5dbff; box-shadow: 0 6px 0 var(--violet), 0 12px 20px rgba(0,0,0,.08); transition: transform .12s;
}
@media (hover: hover) { .choice-card:hover { transform: translateY(-4px) rotate(-1deg); background: #faf7ff; } }
.choice-card:active { transform: translateY(4px); }
.cc-e { font-size: 54px; line-height: 1.1; }
.cc-l { font-size: 19px; font-weight: 800; text-align: center; }
.sp-taskhint { text-align: center; font-weight: 800; color: var(--violet-d); margin: 6px 0; }
.story-screen .task-card { --soft: #efe9ff; --accent: var(--violet); }
.story-screen .ans { --soft: #efe9ff; --accent: var(--violet); }
.story-screen .gap, .story-screen .slot, .story-screen .qmark, .story-screen .bead { --soft: #efe9ff; --accent: var(--violet); }
.rb-head { font-size: 24px; font-weight: 800; color: var(--red-d); margin-bottom: 4px; }
.game-card.featured { background: linear-gradient(160deg, #fff, #fff6cc); }
.game-card.featured .gc-icon { background: #ffe8a3; }

/* Illusztrációk (Higgsfield) */
.mascot-img { width: 92px; height: 92px; display: block; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 5px 0 rgba(59,47,99,.12); object-fit: cover; }
.sc-icon .sc-img { width: 120px; height: 120px; display: block; border-radius: 50%; border: 5px solid rgba(255,255,255,.85); box-shadow: 0 6px 0 rgba(0,0,0,.12); object-fit: cover; }
.gc-icon { overflow: hidden; }
.gi-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.setup-hero .sh-icon { overflow: hidden; border: 5px solid #fff; box-shadow: 0 5px 0 rgba(59,47,99,.12); }
.lvl-img { width: 76px; height: 76px; display: block; border-radius: 50%; object-fit: cover; }
.enc-img { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; flex: none; }
.encourage { display: inline-flex !important; align-items: center; gap: 10px; }
.pp-img { width: 140px; height: 140px; display: block; margin: 0 auto; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 0 rgba(59,47,99,.12); }
.trophy-img { width: 170px; height: 170px; display: block; margin: 0 auto; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 8px 0 rgba(59,47,99,.14), 0 14px 30px rgba(0,0,0,.12); }
.game-card .gc-icon { width: 104px; height: 104px; }

/* Figurák, matricák, rangok, érmek, jelenetek */
.av-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.pc-avatar { width: 96px; height: 96px; display: block; }
.preview { overflow: hidden; }
.preview #pf-av { width: 100%; height: 100%; display: block; }
.av { padding: 3px; overflow: hidden; }
.ub-av { overflow: hidden; padding: 0; }
.pp-av { width: 52px; height: 52px; display: inline-block; flex: none; }
.rank-img { width: 64px; height: 64px; flex: none; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 3px 4px rgba(0,0,0,.15)); }
.rankup .rank-img { width: 44px; height: 44px; margin-right: 8px; }
.rank-mini { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-right: 5px; }
.rankbar .rank-mini { width: 20px; height: 20px; margin: 0 3px 0 4px; }
.stk-img { width: 84%; height: auto; display: block; }
.sr-img { width: 130px; height: 130px; display: block; margin: 0 auto; object-fit: contain; }
.medal-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.medal-img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); }
.medal-row .stars-earned { margin-top: 0; }
.sp-img.wide { width: 100%; max-width: 620px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
.bp-img.wide { width: 120px; height: 90px; border-radius: 14px; }
.stk.locked .stk-img { display: none; }

/* Csapatmese: több szereplő kiválasztása */
.choice-card { position: relative; }
.choice-card.picked { border-color: var(--green); box-shadow: 0 6px 0 var(--green-d), 0 0 0 4px rgba(64,192,87,.25); background: #f2fff4; }
.choice-card.lead { border-color: var(--yellow-d); box-shadow: 0 6px 0 var(--yellow-d), 0 0 0 5px rgba(255,212,59,.45); background: #fffbe6; }
.pick-badge {
  position: absolute; top: -10px; right: -10px; min-width: 38px; height: 38px; border-radius: 50%; display: none;
  place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: var(--green); box-shadow: 0 3px 0 var(--green-d); z-index: 2;
}
.choice-card.picked .pick-badge { display: grid; }
.choice-card.lead .pick-badge { background: var(--yellow); color: #5c3d00; box-shadow: 0 3px 0 var(--yellow-d); }
.lead-tag { display: none; font-size: 13px; font-weight: 800; background: var(--yellow); color: #5c3d00; padding: 1px 10px; border-radius: 999px; }
.choice-card.lead .lead-tag { display: inline-block; }
.pick-bar { position: sticky; bottom: 14px; display: flex; justify-content: center; margin-top: 16px; z-index: 5; min-height: 10px; }
.pick-bar .big-btn { box-shadow: 0 6px 0 var(--green-d), 0 10px 30px rgba(0,0,0,.25); }
.team-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.team-img { width: min(130px, 22vw); height: auto; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 0 #e2bf7b; margin: 0 -8px; }
.bc-img.small { width: 92px; height: 92px; margin: 0 -10px; }

/* Családtagok nevei (szülői sarok) */
.family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.fam-row { display: flex; align-items: center; gap: 10px; background: #faf8ff; border-radius: 14px; padding: 6px 10px; font-weight: 800; font-size: 16px; }
.fam-row img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.fam-row span { width: 90px; flex: none; }
.txt.small { font-size: 18px; padding: 8px 12px; border-width: 3px; border-radius: 12px; min-width: 0; }

.name-input { margin: 14px 0 4px; text-align: center; }

/* Rajzolt kép a feladatkártyán */
.task-img { display: block; width: 130px; height: 130px; margin: 0 auto 10px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 5px 0 rgba(59,47,99,.12); }

.pic-img { display: block; width: 140px; height: 140px; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }

/* Rajzolt ikonok a gombokon */
.btn-ico { width: 1.7em; height: 1.7em; object-fit: contain; vertical-align: middle; margin: -8px 2px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.speak .btn-ico { width: 34px; height: 34px; margin: 0; }
.pc-avatar .btn-ico { width: 100%; height: 100%; margin: 0; }
.link-btn .btn-ico { width: 1.4em; height: 1.4em; }
.sp-img { display: block; width: min(240px, 60vw); height: auto; margin: 0 auto; border-radius: 26px; border: 4px solid #fff; box-shadow: 0 5px 0 #e2bf7b; }
.cc-img { width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
.bc-img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.bp-img { width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: 16px; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(120,80,0,.2); }
.bk-img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 4px solid #fff; }

/* Mesekönyv */
.book { text-align: left; margin: 22px auto 0; max-width: 640px; background: #fffdf5; border-radius: 26px; border: 5px solid #f3d9a4; box-shadow: 0 7px 0 #e2bf7b, 0 16px 30px rgba(120,80,0,.15); overflow: hidden; }
.book-cover { text-align: center; padding: 22px 16px 18px; background: linear-gradient(160deg, #845ef7, #f06595); color: #fff; }
.bc-art { font-size: 70px; line-height: 1.1; }
.book-cover h2 { font-size: clamp(26px, 6vw, 34px); text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.book-cover p { margin: 6px 0 0; font-weight: 700; opacity: .95; }
.book-page { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 2px dashed #f0dcb4; }
.bp-art { font-size: 34px; flex: none; min-width: 48px; text-align: center; }
.book-page p { margin: 0; font-size: 19px; line-height: 1.5; color: #4a3520; font-weight: 600; }
.book-end { text-align: center; font-weight: 800; font-size: 20px; color: var(--violet-d); margin: 16px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.book-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border-radius: 10px 24px 24px 10px;
  background: linear-gradient(160deg, #9775fa, #f783ac); color: #fff; box-shadow: inset 10px 0 0 rgba(0,0,0,.12), 0 6px 0 #7048e8, 0 12px 20px rgba(0,0,0,.12);
}
.bk-e { font-size: 50px; }
.bk-t { font-weight: 800; font-size: 19px; text-align: center; }
.bk-d { font-size: 14px; opacity: .9; font-weight: 700; }

/* ---------- Mobil ---------- */
@media (max-width: 560px) {
  body { font-size: 18px; }
  .mascot { font-size: 46px; }
  .mascot-img { width: 66px; height: 66px; }
  .sc-icon .sc-img { width: 96px; height: 96px; }
  .lvl-img { width: 58px; height: 58px; }
  .pp-img { width: 110px; height: 110px; }
  .pc-avatar { width: 76px; height: 76px; }
  .rank-img { width: 48px; height: 48px; }
  .bp-img.wide { width: 84px; height: 63px; }
  .cols-4, .cols-5 { grid-template-columns: repeat(3, 1fr); }
  .answers.cols-2 .ans { min-height: 68px; }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .pc-avatar { font-size: 52px; }
  .big-btn { font-size: 20px; min-height: 58px; padding: 8px 18px; }
  .row-btns .big-btn { flex: 1 1 100%; }
  .bead { min-width: 60px; height: 60px; font-size: 24px; }
  .coin { width: 74px; height: 74px; } .coin b { font-size: 24px; }
  .coin.bi1, .coin.bi2 { width: 82px; height: 82px; }
  .floaty { display: none; }
  .lvl-grid { gap: 8px; }
  .lvl b { font-size: 18px; }
  .lvl small { font-size: 12px; }
  .lvl em { font-size: 10px; padding: 2px 6px; }
  .lang-btn span { display: none; }
  .mini-logo { height: 52px; border-radius: 12px; }
  .logo-img { border-radius: 24px; border-width: 4px; }
  .lang-btn { padding: 6px 8px; }
  .story-choices { grid-template-columns: repeat(2, 1fr); }
  .cc-l { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Visszajelzés */
.fb-text { min-height: 130px; margin: 12px 0 4px; font-size: 18px; resize: vertical; font-family: inherit; }

/* ---------- Egyforma működés minden eszközön ---------- */
/* kivágásos (notch) kijelzők: a tartalom ne kerüljön a kamera / kerek sarok alá */
#app {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px));
}
#toast { top: max(16px, env(safe-area-inset-top)); }
/* iOS: ne nagyítson rá a mezőkre gépeléskor, ne jelöljön ki szöveget véletlen hosszú érintésre */
input, select, textarea { font-size: max(16px, 1em); }
button, .choice-card, .game-card, .subject-card, .profile-card, .tile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* aspect-ratio tartalék régebbi Safarihoz */
@supports not (aspect-ratio: 1) { .stk { height: 110px; } .cc-img { height: 150px; } }
.inst-steps { text-align: left; font-size: 18px; line-height: 1.7; margin: 10px 0 4px; background: #f1ecff; border-radius: 16px; padding: 12px 16px; }
.ios-share { display: inline-block; border: 2px solid #1c7ed6; color: #1c7ed6; border-radius: 6px; padding: 0 6px; font-weight: 800; line-height: 1.2; }
/* iOS Safari: az animációk (felugró matrica, konfetti) közben se lehessen oldalra húzni az oldalt */
html, body { overflow-x: hidden; overscroll-behavior-x: none; }
.result, .story-screen { overflow-x: clip; }

/* Készítette: BimPex */
.made-by { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: 26px auto 6px; padding: 8px 14px; border-radius: 14px; color: var(--ink-soft); font-size: 13px; font-weight: 700; text-decoration: none; opacity: .85; }
.made-by img { width: 130px; height: auto; display: block; }
@media (hover: hover) { .made-by:hover { opacity: 1; background: rgba(255,255,255,.6); } }
.made-by-row { width: 100%; flex-basis: 100%; display: flex; justify-content: center; }

/* Beépített felolvasó hang */
.tts-row { align-items: flex-start; gap: 12px; }
.tts-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; max-width: 46%; }
.tts-btns .mini-btn { white-space: normal; text-align: center; }
.tts-del { font-size: 14px; }
.tts-bar { display: block; height: 8px; margin-top: 8px; border-radius: 6px; background: rgba(0,0,0,.08); overflow: hidden; }
.tts-bar[hidden] { display: none; }
.tts-bar i { display: block; height: 100%; width: 0; background: var(--green, #40c057); transition: width .3s; }

/* ===================== Új funkciók ===================== */
.big-btn.orange { --b: var(--orange); --bd: var(--orange-d); }
.big-btn.violet { --b: var(--violet); --bd: var(--violet-d); }
.mini-btn.green { background: var(--green); color: #fff; }
.gc-rec { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 800; color: #8a5a00; background: #fff3bf; border-radius: 999px; padding: 1px 10px; }
.set-row.wrap { flex-wrap: wrap; }
.set-row.wrap .chips { flex: 1 1 100%; }

/* napi küldetés */
.daily-card { position: relative; z-index: 1; background: rgba(255,255,255,.85); border-radius: 20px; padding: 12px 16px; margin: 12px 0; box-shadow: var(--lift); }
.daily-card.done { background: #ebfbee; }
.dl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill.streak { background: #ffe8cc; color: #a34700; }
.pill.limit { background: #e7f5ff; color: #1864ab; }
.dl-text { margin-top: 4px; font-weight: 700; }
.dl-text small { color: var(--ink-soft); }
.dl-bar { position: relative; height: 22px; margin-top: 8px; border-radius: 12px; background: #f1eefc; overflow: hidden; }
.dl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 12px; transition: width .5s; }
.dl-bar span { position: absolute; inset: 0; top: 0; left: 0; right: 0; bottom: 0; text-align: center; font-size: 14px; font-weight: 800; line-height: 22px; }
.lvl-note { font-weight: 800; color: var(--violet-d); background: #f3f0ff; border-radius: 14px; padding: 8px 14px; display: inline-block; }

/* szülői kimutatás */
.report { background: #f8f9ff; border-radius: 14px; padding: 10px 14px; margin: 10px 0; font-size: 16px; }
.report p { margin: 4px 0; }
.rp-bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 44px; gap: 8px; align-items: center; margin: 4px 0; }
.rp-bar div { height: 12px; background: #e9ecef; border-radius: 8px; overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: 8px; }
.rp-bar i.low { background: var(--red); } .rp-bar i.mid { background: var(--yellow); } .rp-bar i.hi { background: var(--green); }

/* csillagbolt + hátterek */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.shop-item { background: #fff; border-radius: 20px; padding: 12px; text-align: center; box-shadow: var(--lift); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.shop-item.on { outline: 4px solid var(--green); }
.shop-img { width: 100px; height: 100px; object-fit: contain; }
.shop-sw { width: 100px; height: 70px; border-radius: 14px; display: block; border: 2px solid rgba(0,0,0,.06); }
.shop-on { color: var(--green-d); font-weight: 800; font-size: 15px; }
.shop-need { color: var(--ink-soft); font-size: 14px; }
html[data-theme="ocean"]  { --bg1: #a5e8ff; --bg2: #c3fae8; --bg3: #e7f5ff; }
html[data-theme="forest"] { --bg1: #c3f0c8; --bg2: #ebfbee; --bg3: #fff9db; }
html[data-theme="candy"]  { --bg1: #ffd6e7; --bg2: #f3d9fa; --bg3: #fff0f6; }
html[data-theme="sunset"] { --bg1: #ffd8a8; --bg2: #ffc9c9; --bg3: #fff3bf; }
html[data-theme="space"]  { --bg1: #b9c4ff; --bg2: #d8c8ff; --bg3: #ffe3f1; }
html[data-theme="mint"]   { --bg1: #c3fae8; --bg2: #e6fcf5; --bg3: #fff5f5; }

/* új feladattípusok */
.input-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.big-in { font-size: 30px; text-align: center; max-width: 320px; font-weight: 700; letter-spacing: 1px; }
.big-in.right { border-color: var(--green); background: #ebfbee; }
.big-in.wrong { border-color: var(--red); background: #fff5f5; animation: shake .4s; }
.big-in.reveal { border-color: var(--green); background: #fff9db; }
.big-speak { font-size: 64px; width: 120px; height: 120px; border-radius: 50%; background: #fff; box-shadow: var(--lift); }
.reading { font-size: 19px; line-height: 1.5; text-align: left; margin: 8px 0 0; }
.big-word, .big-sentence { font-size: 34px; font-weight: 800; margin-top: 8px; }
.big-sentence { font-size: 26px; }
.big-word .gap, .big-sentence .gap { display: inline-block; min-width: 1.6em; border-bottom: 4px dashed var(--violet); margin: 0 4px; height: 1em; vertical-align: -0.1em; }
.big-eq { font-size: 38px; font-weight: 800; }
.shape-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.shape { display: inline-block; }

/* QR-átvitel */
.qr-box svg { width: min(78vw, 340px); height: auto; background: #fff; border-radius: 12px; }
.qr-part { font-weight: 800; }
.qr-cam video { width: min(80vw, 360px); border-radius: 14px; background: #000; }

/* mesekönyv nyomtatása / PDF */
@media print {
  body.printing { background: #fff !important; }
  body.printing .sky, body.printing #toast, body.printing #layer, body.printing #confetti { display: none !important; }
  body.printing #app > .screen > *:not(.book) { display: none !important; }
  body.printing .book { box-shadow: none !important; animation: none !important; max-width: none; }
  body.printing .book-page { break-inside: avoid; page-break-inside: avoid; }
  body.printing .book-cover { break-after: page; page-break-after: always; }
}
