/* =========================================================
   🧩 Óvodás játékok: Hangfigyelő, Mi tűnt el?, Formák és irányok
   ========================================================= */

/* Hangfigyelő */
.snd { color: var(--cd, #ff8a3d); white-space: nowrap; }
.hw-word { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: .04em; }

/* Mi tűnt el? */
.kim-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 460px; margin: 10px auto 18px; }
.kim-grid.kim-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 360px; }
.kim-item {
  display: grid; place-items: center; aspect-ratio: 1; font-size: clamp(2.2rem, 8vw, 3.2rem);
  background: var(--card); border: 3px solid var(--line); border-radius: 18px;
}
.kim-item.gone { border-style: dashed; color: var(--muted); font-size: clamp(1.6rem, 6vw, 2.2rem); }
.kim-item.back { border-color: var(--good, #2db86a); animation: pop .4s ease; }
.kim-go { display: block; margin: 0 auto; }

/* Formák */
.shape-opts .opt { min-height: 110px; }
.shape-opts .shape { width: 72px; height: 72px; display: block; }

/* Irányok: 3×3 rács a doboz körül */
.dir-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 6px; justify-content: center; margin: 6px auto; }
.dir-cell {
  display: grid; place-items: center; height: 72px; font-size: 2.6rem;
  background: var(--card); border: 3px solid var(--line); border-radius: 14px;
}
.dir-cell.empty { background: transparent; border-style: dashed; opacity: .5; }

/* Dobókocka */
.dice { display: flex; justify-content: center; gap: 18px; margin: 6px 0; }
.die { width: 110px; height: 110px; }
.die rect { fill: #fff; stroke: #2b2d42; stroke-width: 5; }
.die circle { fill: #2b2d42; }
[data-theme="dark"] .die rect { fill: #f4f2ff; stroke: #f4f2ff; }


/* Páros vagy páratlan: pöttyök párokba rendezve */
.pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px auto; max-width: 420px; }
.pr-col { display: flex; flex-direction: column; gap: 5px; }
.pr-col i { width: 18px; height: 18px; border-radius: 50%; background: var(--c, #3a86ff); display: block; }
.pr-col i.odd { background: #ef476f; outline: 3px dashed #ef476f; outline-offset: 3px; }

/* Mondatkirakó */
.sentence-builder .slot, .sentence-builder .b-tile { font-size: 1.5rem; min-width: 70px; }
.sentence-builder .slots { gap: 6px; }

/* ABC-rend */
.abc-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 1.4rem; font-weight: 900; }

/* Mérés: vonalzó */
.ruler { width: 100%; max-width: 520px; display: block; margin: 4px auto; }
.ruler .r-body { fill: #ffe9a8; stroke: #c99a1c; stroke-width: 2; }
.ruler line { stroke: #5a4500; stroke-width: 2; }
.ruler text { font: 800 14px Nunito, sans-serif; fill: #5a4500; text-anchor: middle; }
.ruler .r-pencil { fill: #3a86ff; }
.ruler .r-tip { fill: #f4c58f; }
.ruler .r-guide { stroke: #ef476f; stroke-width: 2; stroke-dasharray: 4 3; }

/* Szófajok */
.pos-word { font-size: 2.6rem; font-weight: 900; color: var(--cd, #2b2d42); margin: 6px 0; }
.pos-sentence, .saying { font-size: 1.5rem; font-weight: 800; line-height: 1.4; margin: 8px auto; max-width: 560px; }
.saying { font-style: italic; }

/* Számok 1000-ig: helyiérték-táblázat */
.pv-table { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 1.2rem; font-weight: 800; margin: 6px 0; }
.pv-table span { background: var(--cl, #eee); border-radius: 14px; padding: 8px 14px; }
.pv-table b { font-size: 1.8rem; display: block; text-align: center; }

/* Térkép: iránytű */
.compass { width: 190px; height: 190px; display: block; margin: 0 auto; }
.compass circle { fill: var(--card); stroke: var(--line); stroke-width: 3; }
.compass .needle { fill: #b9bdd0; }
.compass .needle-n { fill: #ef476f; }
.compass text { font: 900 9px Nunito, sans-serif; text-anchor: middle; fill: var(--ink); }
.compass text.ask { fill: #ef476f; font-size: 13px; }

/* Térkép: rács északi nyíllal */
.map-wrap { display: flex; justify-content: center; align-items: flex-start; gap: 10px; }
.g-grid { display: grid; grid-template-columns: repeat(5, 46px); grid-auto-rows: 46px; gap: 3px; }
.g-cell { display: grid; place-items: center; font-size: 1.7rem; background: #e7f6dc; border-radius: 8px; }
[data-theme="dark"] .g-cell { background: #2c3d2a; }
.north { font-weight: 900; font-size: 1.3rem; text-align: center; line-height: 1.1; color: #ef476f; }

/* Sudoku */
.sd-grid { display: grid; grid-template-columns: repeat(4, 64px); grid-auto-rows: 64px; gap: 4px; justify-content: center; margin: 8px auto; }
.sd-cell {
  font: inherit; font-size: 1.9rem; font-weight: 900; cursor: pointer; border-radius: 10px;
  background: var(--card); color: var(--ink); border: 3px solid var(--line);
}
.sd-cell.given { background: var(--cl, #eee); cursor: default; }
.sd-cell.solved { background: #e0f2ea; color: #1e6e47; }
.sd-cell.sel { border-color: var(--c); box-shadow: 0 0 0 3px var(--c); }
/* a 2×2-es kis négyzetek elválasztása */
.sd-cell:nth-child(4n + 2) { margin-right: 6px; }
.sd-cell:nth-child(n + 5):nth-child(-n + 8) { margin-bottom: 6px; }
.sd-palette { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Tükrözés */
.mir-wrap { display: flex; justify-content: center; align-items: stretch; gap: 0; margin: 6px 0; }
.mir-line { width: 4px; background: #ef476f; margin: 0 6px; border-radius: 2px; }
.mir-grid { display: inline-grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 26px; gap: 3px; }
.mir-grid i { background: var(--card); border: 2px solid var(--line); border-radius: 5px; }
.mir-grid i.on { background: #3a86ff; border-color: #2a66cc; }
.mir-grid.blank i { border-style: dashed; }
.mir-opts .mir-grid { grid-template-columns: repeat(3, 20px); grid-auto-rows: 20px; }
.mir-opts .opt { min-height: 120px; }

/* Mesék */
.tale-text { font-size: 1.45rem; line-height: 1.9; font-weight: 700; max-width: 640px; margin: 10px auto; text-align: left; }
.tale-text .tw { cursor: pointer; border-radius: 6px; padding: 0 1px; }
.tale-text .ts.on { background: #fff3c4; border-radius: 8px; box-shadow: 0 0 0 4px #fff3c4; }
.tale-text .tw.on { background: var(--gold, #ffd23f); }
[data-theme="dark"] .tale-text .ts.on { background: #4a4020; box-shadow: 0 0 0 4px #4a4020; }
.tale-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Betűvadász */
.hunt-text { font-size: 1.9rem; font-weight: 800; line-height: 2.1; text-align: center; }
.hunt-text .hw { display: inline-block; white-space: nowrap; margin: 0 .25em; }
.hl { font: inherit; letter-spacing: 0; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit; border-radius: 8px; }
.hl.found { background: #2db86a; color: #fff; }
.mix-word { font-size: 2.6rem; letter-spacing: .08em; }

/* Számházikó */
.house { display: inline-flex; flex-direction: column; align-items: center; margin: 4px auto; }
.hs-roof { width: 0; height: 0; border-left: 90px solid transparent; border-right: 90px solid transparent;
  border-bottom: 62px solid #e8384f; position: relative; }
.hs-roof span { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); color: #fff; font-size: 1.8rem; font-weight: 900; }
.hs-floor { display: grid; grid-template-columns: 1fr 1fr; width: 150px; border: 3px solid var(--ink); border-top: 0; background: var(--card); }
.hs-floor span { display: grid; place-items: center; height: 46px; font-size: 1.6rem; font-weight: 900; }
.hs-floor span + span { border-left: 3px solid var(--ink); }
.hs-floor .blank { margin: 4px 8px; height: 38px; }

/* Hol van több? / Hányadik? */
.more-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.more-box { border: 3px dashed var(--line); border-radius: 16px; padding: 10px; min-width: 140px; max-width: 220px; }
.ord-row { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 2.2rem; flex-wrap: wrap; }
.ord-flag { font-size: 1.6rem; opacity: .8; }

/* Matekos színező */
.cl-palette { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cl-color { display: flex; align-items: center; gap: 6px; font: inherit; font-weight: 900; font-size: 1.2rem; padding: 6px 12px 6px 6px;
  border-radius: 999px; border: 3px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.cl-color.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold, #ffd23f); }
.cl-swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--col); border: 2px solid rgba(0, 0, 0, .2); }
.cl-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 52px)); gap: 2px; justify-content: center; }
.cl-cell { aspect-ratio: 1; font: inherit; font-size: .78rem; font-weight: 800; padding: 0; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; border-radius: 4px; }
.cl-cell.bg { background: transparent; border-color: transparent; cursor: default; }
.cl-cell.done { border-color: transparent; }
.cl-grid.finished { animation: pop .5s ease; }
@media (max-width: 480px) { .cl-cell { font-size: .62rem; } }

/* Kalandtérkép */
.kaland { max-width: 760px; margin: 0 auto; text-align: center; }
.kl-sub { font-weight: 700; color: var(--muted); }
.kl-map { position: relative; margin: 18px auto 0; max-width: 100%; overflow: hidden; border-radius: 24px; }
.kl-world { position: absolute; left: 0; right: 0; border-radius: 24px; text-align: left; padding-left: 12px; }
.kl-world span { position: sticky; top: 0; display: inline-block; margin-top: 8px; padding: 4px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); font-weight: 900; color: #2b2d42; }
.w-dino { background: linear-gradient(#d9f5c9, #bfe8a8); }
.w-mine { background: linear-gradient(#d6dbe6, #aeb8cc); }
.w-fire { background: linear-gradient(#ffd9b8, #ffb38a); }
.kl-path { position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.kl-road { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 18; opacity: .9; }
.kl-done { fill: none; stroke: var(--gold, #ffd23f); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.kl-stop { position: absolute; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 4px solid #c9c4d8; filter: grayscale(.8); opacity: .75; }
.kl-stop.reached { filter: none; opacity: 1; border-color: var(--gold, #ffd23f); }
.kl-stop.here { box-shadow: 0 0 0 6px rgba(255, 210, 63, .6); }
.kl-stop.final { width: 72px; height: 72px; }
.kl-e { font-size: 1.6rem; line-height: 1; }
.kl-stop small { position: absolute; bottom: -18px; font-weight: 900; font-size: .75rem; color: #2b2d42; }
.kl-owl { position: absolute; top: -34px; font-size: 2rem; animation: pop .6s ease; }
.kaland-banner .mb-dots i { font-style: normal; }

/* Párbaj */
.pb-task { text-align: center; margin-bottom: 10px; }
.pb-task small { display: block; font-weight: 800; color: var(--muted); }
.pb-q { font-size: 2.6rem; font-weight: 900; }
.pb-count, .pb-emoji { font-size: 2.2rem; letter-spacing: .1em; }
.pb-arena { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pb-side { border-radius: 20px; padding: 12px; }
.pb-blue { background: #dbe8ff; }
.pb-red { background: #ffdbe0; }
[data-theme="dark"] .pb-blue { background: #23324f; }
[data-theme="dark"] .pb-red { background: #4a2630; }
.pb-name { font-weight: 900; font-size: 1.2rem; text-align: center; margin-bottom: 8px; }
.pb-name b { display: inline-block; min-width: 40px; padding: 2px 10px; border-radius: 999px; background: var(--card); }
.pb-btns { display: grid; gap: 8px; }
.pb-opt { position: relative; font: inherit; font-size: 2rem; font-weight: 900; min-height: 74px; border-radius: 16px; cursor: pointer;
  border: 3px solid var(--line); background: var(--card); color: var(--ink); }
.pb-opt small { position: absolute; left: 8px; top: 4px; font-size: .7rem; color: var(--muted); }
.pb-opt.correct { background: #2db86a; color: #fff; border-color: #1e8a4e; }
.pb-opt.wrong { background: #ffd0d6; opacity: .6; }
.pb-msg { margin: 14px auto 0; text-align: center; }

/* Közlekedési lámpa */
.tl-wrap { display: flex; justify-content: center; }
.tlight { width: 90px; height: auto; }
.tlight rect { fill: #2b2d42; }
.tlight circle { fill: #4a4c60; }
.tlight .tl-red.on { fill: #ff3b4f; }
.tlight .tl-yellow.on { fill: #ffc93c; }
.tlight .tl-green.on { fill: #2fd06e; }
.tl-fig { font-size: 26px; text-anchor: middle; }

/* Különbségkereső */
.df-pair { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.df-grid { display: grid; grid-template-columns: repeat(var(--n), 52px); grid-auto-rows: 52px; gap: 4px; padding: 8px;
  background: #fff8e1; border-radius: 16px; border: 3px solid var(--line); }
[data-theme="dark"] .df-grid { background: #2d2a20; }
.df-cell { font-size: 1.9rem; border: 0; background: transparent; cursor: pointer; border-radius: 10px; padding: 0; }
.df-cell.found { background: #c9f2d9; box-shadow: 0 0 0 3px #2db86a; }

/* Árnyékok */
.shadow-pic { filter: brightness(0); opacity: .82; display: inline-block; }
[data-theme="dark"] .shadow-pic { filter: brightness(0) invert(.85); }

/* Labirintus */
.mz-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(420px, 86vw); aspect-ratio: 1; margin: 6px auto;
  border: 4px solid #5a4500; border-radius: 6px; touch-action: none; user-select: none; background: #fff8e1; }
[data-theme="dark"] .mz-grid { background: #2d2a20; }
.mz-cell { position: relative; display: grid; place-items: center; font-size: clamp(1rem, calc(15rem / var(--n)), 2rem); cursor: pointer; }
.mz-cell.wN { border-top: 3px solid #5a4500; }
.mz-cell.wS { border-bottom: 3px solid #5a4500; }
.mz-cell.wE { border-right: 3px solid #5a4500; }
.mz-cell.wW { border-left: 3px solid #5a4500; }
.mz-cell.trail { background: #ffe9a8; }
[data-theme="dark"] .mz-cell.trail { background: #5a4a1a; }
.mz-hero, .mz-goal { font-style: normal; line-height: 1; }
.mz-hero { position: absolute; }

/* Pontösszekötő */
.dt-svg { width: min(420px, 86vw); display: block; margin: 0 auto; touch-action: manipulation; }
.dt-fill { opacity: 0; transition: opacity .8s; }
.dt-svg.complete .dt-fill { opacity: .85; }
.dt-line { fill: none; stroke: #2b2d42; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
[data-theme="dark"] .dt-line { stroke: #e9e6f7; }
.dt-hit { fill: transparent; cursor: pointer; }
.dt-dot { fill: #2b2d42; }
[data-theme="dark"] .dt-dot { fill: #e9e6f7; }
.dt-pt text { font: 900 5px Nunito, sans-serif; fill: var(--ink); pointer-events: none; }
.dt-pt.next .dt-dot { fill: #ef476f; r: 2.8; }
.dt-pt.done .dt-dot { fill: #2db86a; }

/* Negyedikes matek */
.col-calc { display: inline-grid; justify-items: end; font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; gap: 2px; margin: 4px auto; }
.col-line { width: 100%; height: 4px; background: var(--ink); border-radius: 2px; }
.frac { display: inline-grid; justify-items: center; line-height: 1.05; vertical-align: middle; font-weight: 900; }
.frac b { padding: 0 6px; border-bottom: 3px solid currentColor; }
.frac i { font-style: normal; padding: 0 6px; }
.pies { display: flex; justify-content: center; gap: 22px; }
.pie { width: 130px; height: 130px; }
.grid-rect { display: block; margin: 4px auto; max-width: 100%; }
.grid-rect rect { fill: #c9f2d9; stroke: #1e6e47; stroke-width: 3; }
.grid-rect line { stroke: #1e6e47; stroke-width: 1; opacity: .6; }
.roman { font-family: Georgia, 'Times New Roman', serif; letter-spacing: .08em; }

/* Robotprogramozás */
.rb-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(330px, 80vw); aspect-ratio: 1; margin: 6px auto 12px; }
.rb-cell { position: relative; display: grid; place-items: center; background: #e7f0ff; border-radius: 8px; font-size: clamp(1.1rem, calc(11rem / var(--n)), 2rem); }
[data-theme="dark"] .rb-cell { background: #26324a; }
.rb-cell.rock { background: #f1d9c9; }
.rb-bot { position: absolute; font-style: normal; line-height: 1; }
.rb-prog { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 52px; padding: 6px; margin: 0 auto 10px; max-width: 520px;
  border: 3px dashed var(--line); border-radius: 14px; }
.rb-empty { color: var(--muted); font-weight: 700; align-self: center; }
.rb-chip { font: inherit; font-size: 1.4rem; font-weight: 900; min-width: 44px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 3px solid var(--line); background: var(--card); color: var(--ink); }
.rb-chip small { font-size: .8rem; margin-left: 2px; }
.rb-chip.on { background: var(--gold, #ffd23f); border-color: #e0a100; color: #2b2d42; }
.rb-keys { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rb-keys .b-tile { min-width: 58px; height: 58px; font-size: 1.7rem; }

/* Szülői oldal: csoport-áttekintés és heti összefoglaló */
.group-table { display: grid; gap: 4px; overflow-x: auto; }
.group-row { display: grid; grid-template-columns: minmax(150px, 2fr) repeat(4, minmax(70px, 1fr)); gap: 8px; align-items: center; text-align: center;
  font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.group-row > span:first-child { text-align: left; }
.group-row small { color: var(--muted); font-weight: 700; }
.group-head { background: transparent; border-color: transparent; font-weight: 900; font-size: .85rem; cursor: default; }
.group-row.on { border-color: var(--gold, #ffd23f); background: #fff6d6; }
[data-theme="dark"] .group-row.on { background: #3d3520; }
.week-line { font-size: 1.1rem; }
.week-top { margin: 4px 0 8px; padding-left: 22px; font-weight: 700; }
