/* New sections: accounts, Learn to Code, AI for Kids, Fun Learning Games, rewards, privacy.
   Mobile-first; big touch targets (min 44px) and bright, high-contrast cards on the navy theme. */

/* ---------- Big colourful cards ---------- */
.section-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.big-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.big-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px;
  padding: 18px; border-radius: 22px; text-decoration: none; color: #10142a;
  box-shadow: 0 6px 0 rgba(0,0,0,.25), 0 12px 28px rgba(0,0,0,.35); transition: transform .15s, box-shadow .15s;
  border: 3px solid rgba(255,255,255,.55);
}
.big-card:hover, .big-card:focus-visible { transform: translateY(-3px) rotate(-.5deg); box-shadow: 0 9px 0 rgba(0,0,0,.25), 0 16px 34px rgba(0,0,0,.4); }
.big-card b { font: 800 clamp(20px, 2.4vw, 26px)/1.1 var(--font-head); }
.big-card small { font-size: 15px; font-weight: 700; opacity: .9; }
.bc-ic { font-size: 44px; line-height: 1; }
.bc-foot { margin-top: auto; align-self: flex-start; padding: 7px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.big-card-xl { min-height: 170px; }
.big-card-xl .bc-ic { font-size: 54px; }
.big-card.is-done::after { content: '✅'; position: absolute; top: 12px; right: 14px; font-size: 24px; }
.big-card.is-locked { background: #1c2747; color: var(--muted); border-color: #2c3b66; box-shadow: none; }
/* Card colours; --j-base/--j-top let jelly buttons (course picker) wear the same colour */
.c-yellow { --j-base: #ffd84a; --j-top: #fff08a; background: linear-gradient(160deg, #fff08a, #ffc72c); }
.c-green { --j-base: #5ee0a8; --j-top: #a7f3c0; background: linear-gradient(160deg, #a7f3c0, #34d399); }
.c-blue { --j-base: #86bffc; --j-top: #bfe1ff; background: linear-gradient(160deg, #bfe1ff, #60a5fa); }
.c-purple { --j-base: #d3a8fd; --j-top: #e9d5ff; background: linear-gradient(160deg, #e9d5ff, #c084fc); }
.c-red { --j-base: #fc9aa8; --j-top: #fecdd3; background: linear-gradient(160deg, #fecdd3, #fb7185); }
.c-pink { --j-base: #f7a0d2; --j-top: #fbcfe8; background: linear-gradient(160deg, #fbcfe8, #f472b6); }

.section-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0 14px; flex-wrap: wrap; }
.sh-art { font-size: clamp(38px, 7vw, 72px); letter-spacing: 6px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.cat-title { font-size: 24px; margin: 0 0 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.big-chip { padding: 10px 16px; font-size: 16px; text-decoration: none; color: var(--ink); min-height: 44px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.welcome h2 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 4px; }
.welcome p { margin: 0; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; place-items: start center; padding: 10px 0 30px; }
.auth-card { width: min(100%, 560px); padding: clamp(18px, 4vw, 30px); display: flex; flex-direction: column; gap: 10px; }
.auth-card .assistant-ava { align-self: center; }
.auth-title { font-size: clamp(26px, 5vw, 36px); margin: 0 0 6px; }
.f-form { display: flex; flex-direction: column; gap: 14px; }
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-label { font-weight: 800; font-size: 17px; }
.f-input, .f-form select.input { font-size: 18px; padding: 12px 14px; min-height: 50px; width: 100%; }
.f-row { display: flex; gap: 8px; align-items: center; }
.f-row .f-input { flex: 1; }
.f-row .btn { min-height: 50px; min-width: 50px; }
.f-check { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; cursor: pointer; padding: 4px 0; }
.f-check input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--gold); }
.f-parent { padding: 14px; border-radius: 14px; background: rgba(255,199,44,.1); border: 2px dashed rgba(255,199,44,.55); display: flex; flex-direction: column; gap: 8px; }
.f-parent p { margin: 0; }
.f-links { margin: 0; text-align: center; font-weight: 700; }
.auth-done { text-align: center; }
.big-emoji { font-size: 64px; margin: 0; }
.consent-list li { margin: 6px 0; }

/* ---------- Safety & privacy ---------- */
.safety-card { border: 2px solid rgba(74,222,128,.55); background: linear-gradient(180deg, rgba(20,83,45,.6), rgba(9,20,48,.9)); }
.safety-card h2 { font-size: 22px; }
.safety-card ul { margin: 0; padding-left: 20px; }
.safety-card li { margin: 6px 0; font-weight: 700; }
.rules { list-style: none; padding: 0 !important; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.rules li { display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,.05); padding: 12px; border-radius: 14px; margin: 0 !important; }
.rules li > span { font-size: 28px; flex: none; }
.privacy-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.privacy-sec h2 { font-size: 22px; }
.privacy-sec li { margin: 6px 0; }

/* ---------- Lessons ---------- */
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.track-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 16px; border-radius: 22px; text-align: left; min-height: 120px; --j-bw: 2px; }
.track-card b { font: 800 20px var(--font-head); }
.track-ic { font-size: 34px; }
.track-prog { font-weight: 800; font-size: 14px; }
.lesson-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.lesson-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 120px; border-radius: 16px; background: #0d2252; border: 2px solid var(--line); color: var(--ink); text-decoration: none; }
.lesson-tile:hover, .lesson-tile:focus-visible { border-color: var(--gold); }
.lesson-tile.is-done { border-color: #4ade80; background: #0d3328; }
.lt-num { position: absolute; top: 10px; right: 12px; font-weight: 900; color: var(--muted); }
.lt-ic { font-size: 32px; }
.lesson-tile b { font-size: 17px; }
.lesson-tile small { color: var(--muted); }
.lt-done { font-weight: 800; color: #4ade80; font-size: 14px; }
.lesson-top { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
.explain p { font-size: 18px; margin: 0 0 8px; }
.challenge { border-color: rgba(255,199,44,.6); }
.challenge-text { font-size: 19px; font-weight: 800; }
.hint-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hint-list { margin: 0; padding-left: 22px; }
.hint-list li { background: rgba(255,199,44,.12); border-radius: 10px; padding: 6px 10px; margin: 4px 0; white-space: pre-wrap; font-weight: 700; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.lesson-stage { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Block editor ---------- */
.grid-lesson { display: grid; gap: 18px; grid-template-columns: 1fr; }
.gl-world { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gl-legend { margin: 0; font-size: 14px; }
.blk-editor { display: grid; gap: 12px; grid-template-columns: 1fr; }
.blk-h { font-size: 18px; margin: 0 0 6px; }
.blk-tip { margin: 0 0 8px; font-size: 14px; }
.blk-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.blk {
  display: flex; align-items: center; gap: 8px; border-radius: 12px; color: #10142a; font-weight: 800; font-size: 16px;
  border: 0; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); background: var(--j-base);
}
.blk-pal { padding: 10px 14px; min-height: 48px; border-radius: 14px; touch-action: none; user-select: none; }
.blk-ic { font-size: 20px; }
/* Block colours are jelly tokens, so palette buttons and placed blocks share them */
.b-move { --j-base: #7dd3fc; }
.b-turn { --j-base: #a5b4fc; }
.b-loop { --j-base: #fcd34d; }
.b-if { --j-base: #f9a8d4; }
.b-act { --j-base: #86efac; }
.b-event { --j-base: #fdba74; }
.blk-area { background: #061330; border: 2px dashed var(--line); border-radius: 14px; padding: 10px; min-height: 140px; }
.blk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 36px; }
.blk-list.is-target { outline: 2px dashed var(--gold); outline-offset: 3px; border-radius: 10px; }
.blk-empty { color: var(--muted); font-weight: 700; padding: 10px; text-align: center; border-radius: 10px; background: rgba(255,255,255,.03); }
.blk-prog { flex-direction: column; align-items: stretch; padding: 4px; }
.blk-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; flex-wrap: wrap; }
.blk-label { flex: 1; min-width: 80px; }
.blk-grip { cursor: grab; touch-action: none; font-size: 22px; padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,.1); user-select: none; }
.blk-tools { display: flex; gap: 6px; }
.blk-tool { min-width: 36px; min-height: 36px; border-radius: 12px; font-weight: 900; --j-base: #1a2552; }
.blk-num { border-radius: 8px; border: 0; padding: 6px; font-weight: 800; background: #fff8dc; color: #10142a; }
.blk-slot { margin: 2px 0 4px 18px; padding: 6px; border-left: 6px solid rgba(0,0,0,.2); background: rgba(255,255,255,.35); border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.blk-else { margin-left: 10px; font-weight: 900; padding: 2px 8px; }
.blk-into { align-self: flex-start; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.blk-area > .blk-into { margin-bottom: 10px; }
.blk-marker { height: 6px; border-radius: 99px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.blk-ghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: .9; transform-origin: top left; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.blk-dragging { opacity: .45; }
.blk-count.shake, .shake { animation: shake .35s; color: #f87171; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.grid-world { position: relative; display: grid; gap: 3px; background: #0e5a2c; padding: 3px; border-radius: 16px; width: 100%; max-width: 520px; touch-action: manipulation; }
.gw-cell { aspect-ratio: 1; display: grid; place-items: center; background: #b7f0c5; border-radius: 8px; font-size: clamp(18px, 5vw, 34px); }
.gw-wall { background: #3f9b5a; }
.gw-hero { position: absolute; display: grid; place-items: center; font-size: clamp(20px, 6vw, 38px); transition: left .28s, top .28s; pointer-events: none; }
.gw-hero > span { filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.gw-dir { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: clamp(12px, 3vw, 18px); color: #10142a; font-weight: 900; background: #ffc72c; border-radius: 50%; width: 1.4em; height: 1.4em; display: grid; place-items: center; }
.gw-hero.bump > span { animation: shake .3s; }
.py-bridge { background: #061330; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.py-bridge summary { cursor: pointer; font-weight: 800; min-height: 32px; }
.code-out { background: #030a1f; color: #c6f6d5; border-radius: 10px; padding: 12px; font: 600 15px/1.5 ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; min-height: 60px; }
.code-editor { width: 100%; min-height: 240px; resize: vertical; background: #030a1f; color: #eef4ff; border: 2px solid var(--line); border-radius: 12px; padding: 12px; font: 600 16px/1.5 ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; tab-size: 4; }
.code-editor:focus { border-color: var(--gold); outline: none; }
.py-cols { display: grid; gap: 14px; grid-template-columns: 1fr; }
.py-cols h3 { margin: 0 0 6px; }

/* ---------- Pattern / tiles / order ---------- */
.pattern-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.pattern-item, .pattern-slot { width: clamp(48px, 13vw, 72px); height: clamp(48px, 13vw, 72px); display: grid; place-items: center; font-size: clamp(28px, 8vw, 44px); border-radius: 14px; background: #0d2252; border: 2px solid var(--line); }
.pattern-slot { border: 3px dashed var(--gold); color: var(--gold); font-weight: 900; }
.pattern-slot.over { background: rgba(255,199,44,.25); }
.pattern-slot.right { border-style: solid; border-color: #4ade80; background: #0f5132; }
.pattern-slot.wrong { border-color: #f87171; background: #5c1a1a; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.tile { min-width: 60px; min-height: 60px; padding: 6px 12px; font-size: 32px; border-radius: 18px; touch-action: none; user-select: none; --j-base: #1d4596; }
.tile-ghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; }
.sortable { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.sort-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #13306b; border: 2px solid var(--line); font-size: 18px; font-weight: 800; counter-increment: s; }
.sort-item::before { content: counter(s); width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1b1300; font-weight: 900; }
.sort-item.dragging { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,199,44,.4); }
.sort-grip { cursor: grab; touch-action: none; font-size: 24px; user-select: none; }
.sort-text { flex: 1; }
.sort-tools { display: flex; gap: 4px; }

/* ---------- Reward screen ---------- */
.reward-backdrop { position: fixed; inset: 0; z-index: 250; background: rgba(3,8,24,.75); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.reward { width: min(100%, 480px); max-height: 92vh; overflow: auto; text-align: center; padding: 24px; border-radius: 26px; background: linear-gradient(180deg, #fff6c8, #ffd650); color: #1b1300; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.reward h2 { font-size: clamp(28px, 6vw, 38px); margin: 4px 0; }
.reward-burst { font-size: 72px; line-height: 1; }
.reward-xp { font: 800 22px var(--font-head); }
.reward-level { font-weight: 900; }
.reward-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.reward-badges .award { color: var(--ink); opacity: 1; min-width: 120px; }
.reward-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 14px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Games ---------- */
.mini-game { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; background: #1e3a8a; padding: 3px; border-radius: 14px; max-width: 480px; }
.mg-cell { aspect-ratio: 1; background: #bfdbfe; border-radius: 6px; display: grid; place-items: center; font-size: clamp(18px, 5vw, 30px); }
.pad { display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 52px); gap: 6px; justify-content: start; }
.pad .btn { padding: 0; font-size: 24px; border-radius: 16px; min-height: 0; }
.pad-ArrowUp { grid-column: 2; grid-row: 1; }
.pad-ArrowLeft { grid-column: 1; grid-row: 2; }
.pad-ArrowRight { grid-column: 3; grid-row: 2; }
.pad-ArrowDown { grid-column: 2; grid-row: 3; }
.simon { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.simon-board { display: grid; grid-template-columns: repeat(2, clamp(110px, 32vw, 160px)); gap: 12px; }
.simon-pad { aspect-ratio: 1; border-radius: 30px; font: 900 28px var(--font-head); opacity: .7; --j-bw: 3px; --j-depth: 6px; --j-dur: 100ms; }
.simon-pad.lit { opacity: 1; transform: scale(1.05); --j-edge: #fff; --j-glow: rgba(255,255,255,.85); --j-lift: 22px; }
.rewards-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.rs-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
.rs-item > span { font-size: 28px; }
.rs-link { text-decoration: none; color: var(--ink); border: 2px solid var(--gold); }
.game-end { text-align: center; }
.scr-answer { font: 900 clamp(30px, 8vw, 48px) var(--font-head); letter-spacing: 6px; min-height: 1.3em; text-align: center; color: var(--gold); }
.scramble .tiles { justify-content: center; }
.scramble .tile { font: 900 28px var(--font-head); }

/* ---------- Jump & Code ---------- */
.jc-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 16px; padding: 16px 18px; border-radius: 18px; color: #10142a; text-decoration: none; border: 3px solid transparent; }
.jc-card:hover, .jc-card:focus-visible { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.jc-card-art { font-size: clamp(30px, 6vw, 44px); grid-row: span 2; }
.jc-card-text { display: flex; flex-direction: column; gap: 2px; }
.jc-card-text b { font: 800 22px var(--font-head); }
.jc-card-text small { font-weight: 800; }
.jc-card-go { grid-column: 2; justify-self: start; font-weight: 800; border-radius: 999px; padding: 6px 16px; }
.jc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.jc-heroes { display: flex; flex-wrap: wrap; gap: 8px; }
.jc-hero-pick { font-size: 34px; width: 60px; height: 60px; border-radius: 18px; --j-bw: 2px; }
.jc-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.jc-hud { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 800; }
.jc-hud > span { background: rgba(255,255,255,.06); border-radius: 999px; padding: 4px 12px; }
.jc-scroll { overflow-x: auto; border-radius: 16px; }
.jc-world {
  position: relative; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); width: 100%; min-width: calc(var(--w) * 26px);
  aspect-ratio: var(--w) / var(--h); overflow: hidden; border-radius: 16px; touch-action: manipulation;
  background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 70%, #e0f2fe 100%);
}
.jc-cell { display: grid; place-items: center; min-width: 0; min-height: 0; overflow: visible; font-size: clamp(14px, 3.4vw, 28px); line-height: 1; position: relative; }
.jc-ground { background: #9a5b2e; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.jc-ground.jc-top { background: linear-gradient(180deg, #4ade80 0 24%, #9a5b2e 24%); }
.jc-spike { align-items: end; grid-template-columns: repeat(3, 1fr); }
.jc-spike i { display: block; width: 100%; height: 55%; background: #64748b; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.jc-gem { animation: jc-bob 1.4s ease-in-out infinite; }
.jc-gem.got { visibility: hidden; }
.jc-gate { background: repeating-linear-gradient(90deg, #f97316 0 18%, #1f2937 18% 34%); transition: opacity .2s; }
.jc-gate.open { opacity: .15; }
.jc-hero { position: absolute; display: grid; place-items: center; font-size: clamp(16px, 3.8vw, 32px); transition: left .22s linear, top .22s ease-out; pointer-events: none; z-index: 2; }
.jc-face { filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); display: inline-block; }
.jc-hero.is-jump .jc-face { transform: rotate(-12deg) scale(1.08); }
.jc-hero.is-bump .jc-face, .jc-hero.is-spike .jc-face { animation: shake .3s; }
.jc-hero.is-spike .jc-face, .jc-hero.is-pit .jc-face { filter: grayscale(1) drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.jc-hero.is-flag .jc-face, .jc-hero.is-collect .jc-face { animation: pop .35s; }
.jc-say { position: absolute; bottom: 92%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff; color: #10142a; font: 800 13px var(--font-body, sans-serif); padding: 3px 8px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.jc-cmds { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.jc-cmds code { background: #030a1f; color: #c6f6d5; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.jc-lesson .gl-code h3 { margin: 0 0 6px; }
@keyframes jc-bob { 50% { transform: translateY(-12%); } }
@media (prefers-reduced-motion: reduce) { .jc-gem { animation: none; } .jc-hero { transition: none; } }

/* ---------- Explorer (ages 5-7) ---------- */
.ex-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ex-bag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 800; min-height: 1.6em; }
.ex-bag-item { font-size: 26px; padding: 2px 6px; border-radius: 10px; background: rgba(255,255,255,.08); filter: grayscale(1); opacity: .55; transition: filter .2s, opacity .2s; }
.ex-bag-item.got { filter: none; opacity: 1; animation: pop .35s; }
.ex-world {
  position: relative; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr);
  width: min(100%, calc(var(--w) * 96px)); aspect-ratio: var(--w) / var(--h); border-radius: 18px; overflow: hidden; touch-action: manipulation;
  background: #fde68a; border: 4px solid #0e5a2c;
}
.ex-cell { display: grid; place-items: center; min-width: 0; min-height: 0; font-size: clamp(22px, 7vw, 48px); line-height: 1; box-shadow: inset 0 0 0 1px rgba(14,90,44,.15); }
.ex-bush { background: #4ade80; }
.ex-pond { background: #38bdf8; }
.ex-goal { animation: jc-bob 1.6s ease-in-out infinite; }
.ex-shape.got { visibility: hidden; }
.ex-hero { position: absolute; display: grid; place-items: center; font-size: clamp(26px, 8vw, 54px); transition: left .35s ease-in-out, top .35s ease-in-out; pointer-events: none; z-index: 2; }
.ex-face { display: inline-block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.ex-hero.is-bump .ex-face { animation: shake .3s; }
.ex-hero.is-pick .ex-face, .ex-hero.is-home .ex-face { animation: pop .35s; }
.ex-hero.is-wave .ex-face { animation: ex-wave .6s ease-in-out; }
.ex-say { position: absolute; bottom: 88%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff; color: #10142a; font: 800 14px var(--font-body, sans-serif); padding: 3px 9px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ex-read { margin-top: 6px; }
.ex-lesson .blk { font-size: 18px; min-height: 52px; }
.ex-lesson .blk-ic { font-size: 26px; }
@keyframes ex-wave { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .ex-goal, .ex-hero.is-wave .ex-face { animation: none; } .ex-hero { transition: none; } }

/* ---------- Robot Inventor ---------- */
.jc-game-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.iv-card { grid-template-columns: minmax(96px, 150px) 1fr; }
.iv-card-img { grid-row: span 2; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.iv-hero > div { flex: 1 1 320px; }
.iv-cover { flex: 1 1 280px; max-width: 460px; width: 100%; height: auto; border-radius: 18px; border: 3px solid rgba(255,255,255,.18); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.iv-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.iv-mat {
  position: relative; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); width: 100%; min-width: calc(var(--w) * 30px);
  aspect-ratio: var(--w) / var(--h); overflow: hidden; border-radius: 16px; touch-action: manipulation;
  background: #1e6f8a linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / calc(100% / var(--w)) calc(100% / var(--h)),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / calc(100% / var(--w)) calc(100% / var(--h)), #1e6f8a;
}
.iv-cell { display: grid; place-items: center; min-width: 0; min-height: 0; font-size: clamp(14px, 3.2vw, 28px); line-height: 1; position: relative; }
.iv-wall { background: linear-gradient(160deg, #475569, #1e293b); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.12); }
.iv-hole::after { content: ''; width: 72%; height: 72%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #000 55%, #334155 100%); box-shadow: 0 0 0 3px rgba(250,204,21,.6); }
.iv-pad { background: radial-gradient(circle, rgba(74,222,128,.55) 0 45%, transparent 70%); }
.iv-gear { display: inline-block; animation: iv-spin 4s linear infinite; }
.iv-cell.got .iv-gear { visibility: hidden; }
.iv-bot { position: absolute; display: grid; place-items: center; font-size: clamp(16px, 3.6vw, 32px); transition: left .18s linear, top .18s linear; pointer-events: none; z-index: 2; }
.iv-face { filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); display: inline-block; }
.iv-dir { position: absolute; inset: 0 -14% 0 -14%; display: flex; align-items: center; justify-content: flex-end; font-size: .45em; color: #facc15; text-shadow: 0 1px 2px #000; transition: transform .15s; }
.iv-bot.is-bump .iv-face { animation: shake .3s; }
.iv-bot.is-hole .iv-face { transform: scale(.4); opacity: .4; transition: transform .4s, opacity .4s; }
.iv-bot.is-gear .iv-face, .iv-bot.is-win .iv-face { animation: pop .35s; }
.iv-say { position: absolute; bottom: 92%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff; color: #10142a; font: 800 13px var(--font-body, sans-serif); padding: 3px 8px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.iv-editor { display: grid; grid-template-columns: auto 1fr; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #030a1f; }
.iv-editor:focus-within { border-color: var(--gold); }
.iv-gutter { margin: 0; padding: 12px 8px 12px 10px; color: #64748b; text-align: right; font: 600 16px/1.5 ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; overflow: hidden; user-select: none; background: #020617; max-height: 100%; }
.iv-editor .iv-code { border: 0; border-radius: 0; min-height: 300px; overflow: auto; white-space: pre; }
.iv-lesson .gl-code h3, .iv-lesson .gl-world h3 { margin: 0 0 6px; }
.iv-lesson .panel-actions { margin-top: 10px; }
.iv-fb { white-space: pre-line; }
.iv-tests { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.iv-tests li { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 2px solid var(--line); font-weight: 700; }
.iv-tests li.ok { border-color: #4ade80; }
.iv-tests li.bad { border-color: #f87171; }
.iv-tests small { display: block; color: #fca5a5; font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.iv-pad-keys { display: grid; grid-template-columns: repeat(3, 56px); grid-template-areas: '. up .' 'left down right'; gap: 6px; justify-content: center; margin-top: 4px; }
.iv-key { font-size: 24px; min-height: 52px; padding: 0; border-radius: 16px; }
.iv-key-up { grid-area: up; } .iv-key-left { grid-area: left; } .iv-key-down { grid-area: down; } .iv-key-right { grid-area: right; }
@keyframes iv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .iv-gear { animation: none; } .iv-bot, .iv-dir { transition: none; } }

/* ---------- Smart City Builder ---------- */
.cb-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cb-plots { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.cb-plot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.04); border: 2px dashed var(--line); text-align: center; }
.cb-plot.is-built { border: 2px solid #4ade80; background: linear-gradient(180deg, rgba(56,189,248,.18), rgba(74,222,128,.15)); }
.cb-plot-ic { font-size: 34px; line-height: 1.1; }
.cb-plot:not(.is-built) .cb-plot-ic { opacity: .5; }
.cb-plot small { font-weight: 800; }
/* Street with lamps */
.cb-street { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(#7dd3fc, #e0f2fe); transition: background .3s; color: #10142a; }
.cb-street.is-night { background: linear-gradient(#0b1240, #312e81); color: #fff; }
.cb-sky { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 0; font-size: 26px; }
.cb-clock { font: 800 22px var(--font-head); background: rgba(0,0,0,.25); color: #fff; padding: 2px 12px; border-radius: 999px; }
.cb-lamps { display: flex; justify-content: space-around; align-items: flex-end; height: 120px; padding: 0 8px; }
.cb-lamp { position: relative; width: 8px; height: 90px; background: #475569; border-radius: 4px 4px 0 0; }
.cb-bulb { position: absolute; top: -10px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: #1f2937; border: 3px solid #475569; transition: background .2s, box-shadow .2s; }
.cb-lamp.is-on .cb-bulb { background: #fde047; box-shadow: 0 0 18px 8px rgba(253,224,71,.7), 0 40px 60px 10px rgba(253,224,71,.25); }
.cb-lamp.is-dim .cb-bulb { background: #fef3c7; box-shadow: 0 0 8px 3px rgba(253,224,71,.35); }
.cb-pavement { min-height: 40px; background: #64748b; border-top: 4px solid #94a3b8; padding: 4px 12px; font-size: 24px; color: #fff; font-weight: 800; }
.cb-day { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.cb-day li { text-align: center; font: 700 12px ui-monospace, Menlo, Consolas, monospace; padding: 4px 0; border-radius: 6px; background: rgba(255,255,255,.06); }
.cb-day li.ok { background: rgba(74,222,128,.35); }
.cb-day li.bad { background: rgba(248,113,113,.6); }
/* Traffic light and road */
.cb-road-scene { display: flex; align-items: flex-end; gap: 12px; padding: 12px; border-radius: 16px; background: linear-gradient(#bae6fd, #86efac); }
.cb-tl { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #1e293b; border-radius: 14px; border: 3px solid #0f172a; }
.cb-tl i { width: 34px; height: 34px; border-radius: 50%; background: #334155; transition: background .15s, box-shadow .15s; }
.cb-tl .cb-tl-red.on { background: #ef4444; box-shadow: 0 0 14px #ef4444; }
.cb-tl .cb-tl-yellow.on { background: #facc15; box-shadow: 0 0 14px #facc15; }
.cb-tl .cb-tl-green.on { background: #22c55e; box-shadow: 0 0 14px #22c55e; }
.cb-road { position: relative; flex: 1; height: 56px; border-radius: 10px; background: #475569 repeating-linear-gradient(90deg, transparent 0 22px, #fde68a 22px 40px) center / 100% 4px no-repeat; }
.cb-car { position: absolute; top: 50%; transform: translateY(-50%) scaleX(-1); font-size: 34px; transition: left .3s linear; }
.cb-plan { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.cb-plan small { font-weight: 800; }
.cb-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cb-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.1); }
.cb-dot.is-green { background: #22c55e; } .cb-dot.is-yellow { background: #facc15; } .cb-dot.is-red { background: #ef4444; } .cb-dot.is-off { background: #0f172a; }
.cb-dot.bad { outline: 3px solid #fff; outline-offset: 1px; }
/* Crossroads */
.cb-cross { position: relative; aspect-ratio: 1; width: min(100%, 360px); margin: 0 auto; border-radius: 16px; overflow: hidden; background: #4ade80; }
.cb-road-v, .cb-road-h { position: absolute; background: #475569; }
.cb-road-v { left: 40%; width: 20%; top: 0; bottom: 0; }
.cb-road-h { top: 40%; height: 20%; left: 0; right: 0; }
.cb-cross.is-flash .cb-road-v, .cb-cross.is-flash .cb-road-h { animation: cb-flash 1s steps(2) infinite; }
.cb-q { position: absolute; display: flex; gap: 2px; font-size: clamp(16px, 4vw, 22px); line-height: 1; align-items: center; }
.cb-q-ns { left: 40%; width: 20%; top: 2%; height: 37%; flex-direction: column-reverse; justify-content: flex-start; overflow: hidden; }
.cb-q-ew { top: 40%; height: 20%; left: 2%; width: 37%; flex-direction: row-reverse; justify-content: flex-start; overflow: hidden; }
.cb-q-ew span { transform: scaleX(-1); }
.cb-q small { font-weight: 800; font-size: 12px; color: #fff; }
.cb-amb { animation: pop .4s; }
.cb-tag { position: absolute; display: flex; align-items: center; gap: 4px; background: #0f172a; color: #fff; font-weight: 800; padding: 3px 8px; border-radius: 999px; font-size: 14px; }
.cb-tag-ns { right: 4%; top: 6%; } .cb-tag-ew { left: 4%; bottom: 6%; }
.cb-tag b.over { color: #f87171; }
.cb-city-pair { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); align-items: start; }
/* Elevator tower */
.cb-tower { position: relative; display: grid; grid-template-rows: repeat(var(--floors), 1fr); border-radius: 16px; overflow: hidden; background: #1e3a5f; border: 3px solid #0f172a; --shaft: 72px; }
.cb-floor { display: grid; grid-template-columns: 40px var(--shaft) 1fr; align-items: center; min-height: 52px; border-bottom: 2px solid rgba(255,255,255,.12); }
.cb-fnum { text-align: center; font: 800 18px var(--font-head); color: #facc15; }
.cb-shaft { align-self: stretch; background: #0f172a; }
.cb-wait { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px; }
.cb-person { font-size: 26px; display: inline-flex; align-items: baseline; gap: 1px; }
.cb-person small { font-size: 12px; font-weight: 800; color: #fff; }
.cb-person.is-done small { color: #4ade80; }
.cb-car-box { position: absolute; left: 40px; width: var(--shaft); display: grid; place-items: center; transition: top .3s ease-in-out; }
.cb-doors { display: grid; place-items: center; width: 92%; height: 88%; border-radius: 8px; background: #cbd5e1; border: 3px solid #94a3b8; font-size: 18px; letter-spacing: -2px; overflow: hidden; }
.cb-car-box.is-doors .cb-doors { background: #fef9c3; border-color: #facc15; }
.cb-car-box.is-bump .cb-doors { animation: shake .3s; }
/* Delivery map */
.cb-map {
  position: relative; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); width: 100%; min-width: calc(var(--w) * 32px);
  aspect-ratio: var(--w) / var(--h); border-radius: 16px; overflow: hidden; background: #64748b; touch-action: manipulation;
}
.cb-cell { display: grid; place-items: center; min-width: 0; min-height: 0; font-size: clamp(14px, 3.4vw, 28px); line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.cb-block { background: #86efac; }
.cb-house { background: #64748b; }
.cb-house.got { animation: pop .35s; }
.cb-depot { background: #94a3b8; }
.cb-truck { position: absolute; display: grid; place-items: center; font-size: clamp(16px, 3.8vw, 32px); transition: left .2s linear, top .2s linear; pointer-events: none; z-index: 2; }
.cb-truck-face { display: inline-block; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); transition: transform .15s; }
.cb-truck.is-bump, .cb-truck.is-oops { animation: shake .3s; }
.cb-truck.is-win { animation: pop .35s; }
.cb-java pre { white-space: pre; overflow-x: auto; }
@keyframes cb-flash { 50% { background-color: #a16207; } }
@media (prefers-reduced-motion: reduce) { .cb-car, .cb-car-box, .cb-truck, .cb-truck-face, .cb-bulb { transition: none; } .cb-cross.is-flash .cb-road-v, .cb-cross.is-flash .cb-road-h { animation: none; } }

/* ---------- AI for Kids ---------- */
.slide { text-align: center; padding: clamp(18px, 4vw, 32px); }
.slide-ic { font-size: 72px; }
.slide-text { font-size: clamp(18px, 2.4vw, 22px); max-width: 52ch; margin: 0 auto 12px; }
.slide .panel-actions { justify-content: center; }
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; margin: 12px 0; }
.train-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); }
.train-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.train-btns .chip { min-height: 40px; }
.shape { display: block; background: #f8fafc; border-radius: 12px; }
.robot-guess { margin: 0; font-weight: 800; }
.snd-wave { display: block; width: 100%; max-width: 480px; height: 90px; margin: 10px 0; border-radius: 12px; background: #0a1a3d; border: 1px solid var(--line); }
.snd-emoji { font-size: 44px; line-height: 1; }
.snd-q { margin: 12px 0; }
.snd-meters, .snd-guesses { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.snd-meter { display: grid; grid-template-columns: 9.5em 1fr; gap: 2px 10px; align-items: center; }
.snd-meter small { grid-column: 2; }
.snd-guesses { list-style: none; padding: 0; }
.snd-guesses li { display: grid; grid-template-columns: 7em 1fr 3em; gap: 10px; align-items: center; }
.snd-guesses b { text-align: right; }
.snd-animals { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.snd-windy { font-weight: 800; }
.bc-age { align-self: flex-start; background: rgba(16,20,42,.16); color: inherit; }
.robo-bot { display: flex; flex-direction: column; gap: 10px; }
.robo-top { display: flex; align-items: center; gap: 14px; }
.robo-face { font-size: clamp(64px, 12vw, 92px); line-height: 1; flex: none; transition: transform .2s; }
.robo-face.is-happy { animation: robo-hop .5s; }
.robo-face.is-think { animation: robo-tilt 1s ease-in-out; }
.robo-face.is-sad { transform: rotate(-8deg) translateY(4px); filter: saturate(.6); }
.robo-bubble { position: relative; flex: 1; padding: 12px 16px; border-radius: 18px; background: #f8fafc; color: #10142a; font-weight: 800; font-size: clamp(17px, 2.2vw, 21px); }
.robo-bubble::before { content: ''; position: absolute; left: -10px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-left: 0; border-right-color: #f8fafc; }
.robo-bubble p { margin: 0; }
.robo-bot > .btn { align-self: flex-start; }
.robo-brain h3 { margin: 4px 0 8px; }
.robo-baskets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.robo-basket { padding: 8px; border-radius: 14px; background: #0d2252; border: 2px dashed var(--line); min-width: 0; }
.robo-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.robo-mini .robo-pic { width: 38px; height: 38px; border-radius: 8px; }
.robo-pic { display: block; width: 72px; height: 72px; background: #f8fafc; border-radius: 14px; }
.robo-pic svg { display: block; width: 100%; height: 100%; }
.robo-pic.is-big { width: clamp(150px, 40vw, 200px); height: clamp(150px, 40vw, 200px); border-radius: 24px; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.robo-stage { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; margin: 12px 0; }
.robo-guess { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 160px; font-size: 22px; }
.robo-guess .progress { width: 100%; }
.robo-ask { font-size: clamp(18px, 2.4vw, 22px); font-weight: 800; }
.robo-choices .option { font-size: 22px; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.robo-c-ic { font-size: 30px; line-height: 1; }
.robo-topics .big-card { border: 3px solid rgba(255,255,255,.55); font: inherit; text-align: left; cursor: pointer; }
@keyframes robo-hop { 40% { transform: translateY(-14px) rotate(4deg); } }
@keyframes robo-tilt { 30% { transform: rotate(-10deg); } 70% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: reduce) { .robo-face { animation: none !important; } }
.mistake-list { display: flex; flex-direction: column; gap: 8px; }
.mistake { text-align: left; font-size: 17px; }
.story-fields { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 12px; }
.story-edit { width: 100%; font-size: 17px; line-height: 1.6; margin: 8px 0 12px; }
.learn-stats { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.learn-stats li { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
  .section-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-top { grid-template-columns: 1fr 1fr; }
  .story-fields { grid-template-columns: repeat(3, 1fr); }
  .py-cols { grid-template-columns: 1.2fr 1fr; }
}
@media (min-width: 1100px) {
  .section-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-lesson { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
}
@media (max-width: 420px) {
  .big-card { min-height: 130px; padding: 14px; }
  .bc-ic { font-size: 36px; }
  .blk-pal { font-size: 14px; padding: 8px 10px; }
}
.ai-games h2 { margin-bottom: 4px; }
.aoh-art { max-width: 460px; margin: 10px 0; border-radius: 16px; overflow: hidden; border: 3px solid var(--line); background: #fffdf6; color: #10142a; }
.aoh-art svg { display: block; width: 100%; height: auto; }
.aoh-story { padding: 16px 18px; }
.aoh-story p { margin: 0 0 10px; font-size: clamp(18px, 2.4vw, 22px); font-family: 'Comic Sans MS', 'Chalkboard SE', cursive; line-height: 1.5; }
.aoh-story .btn { color: #10142a; }
.aoh-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.aoh-pick { font-size: clamp(18px, 2.4vw, 22px); min-height: 64px; }
.aoh-card { margin: 10px 0; padding: 12px 16px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); }
.aoh-card p { margin: 6px 0; }
.aoh-who { font-size: 22px; font-weight: 800; }
/* Build your first AI */
.bya-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 10px; }
.bya-steps li { padding: 4px 12px; border-radius: 999px; background: #0a1a3d; border: 1px solid var(--line); font-weight: 800; font-size: 14px; opacity: .65; }
.bya-steps li.is-done { opacity: 1; }
.bya-steps li.is-now { opacity: 1; background: #facc15; color: #10142a; border-color: #facc15; }
.bya-learn { margin: 8px 0 14px; padding-left: 20px; }
.bya-learn li { margin: 4px 0; }
.bya-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 12px 0; }
.bya-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px; background: #0d2252; border: 2px solid var(--line); min-width: 0; }
.bya-card.is-right { border-color: #22c55e; }
.bya-card.is-wrong { border-color: #ef4444; }
.bya-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; container-type: inline-size; background: #f8fafc; }
.bya-pic svg { display: block; width: 100%; height: 100%; }
.bya-emoji { position: absolute; left: 50%; top: 58%; line-height: 1; }
.bya-pic.is-blurry > * { filter: blur(3px); }
.bya-lbls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bya-lbl { padding: 8px 4px; border-radius: 12px; border: 2px solid var(--line); background: #071433; color: var(--ink); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; min-height: 44px; }
.bya-lbl[aria-pressed="true"] { background: #facc15; color: #10142a; border-color: #facc15; }
.bya-lbl.right { background: #22c55e; border-color: #22c55e; color: #fff; }
.bya-lbl.wrong { background: #ef4444; border-color: #ef4444; color: #fff; animation: bya-shake .3s; }
.bya-guess { margin: 0; font-weight: 800; font-size: 17px; }
.bya-bar { height: 18px; margin: 8px 0; }
.bya-table { display: grid; gap: 8px; margin: 10px 0; }
.bya-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 10px 14px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); }
.bya-acc { margin: 10px 0; }
.bya-acc-big { margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 800; }
.bya-compare { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin: 12px 0; }
.bya-compare figure { margin: 0; width: min(200px, 40vw); text-align: center; font-weight: 800; }
.bya-compare figcaption { margin-top: 6px; }
.bya-vs { font-size: 40px; font-weight: 800; }
.bya-why { grid-template-columns: 1fr; }
.bya-why .option { text-align: left; }
@keyframes bya-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .bya-lbl.wrong { animation: none; } }
/* Machine Learning Maze */
.mlm-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin: 12px 0; }
@media (max-width: 720px) { .mlm-layout { grid-template-columns: 1fr; } }
.mlm-board { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; padding: 6px; border-radius: 16px; background: #071433; border: 2px solid var(--line); max-width: 520px; }
.mlm-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; background: #13306b; transition: background .25s; }
.mlm-cell.is-wall { background: #334155; box-shadow: inset 0 -4px 0 rgba(0,0,0,.35); }
.mlm-cell.is-lava { box-shadow: inset 0 0 0 3px #f97316; }
.mlm-cell.is-trail { outline: 3px solid #facc15; outline-offset: -3px; }
.mlm-ic { font-size: clamp(16px, 4vw, 30px); line-height: 1; }
.mlm-arrow { font-size: clamp(11px, 2.4vw, 18px); font-weight: 800; opacity: .85; }
.mlm-toggle { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 14px; }
.mlm-rewards { margin: 6px 0 12px; padding-left: 20px; }
.mlm-rewards li { margin: 3px 0; font-weight: 700; }
.mlm-slider { display: grid; gap: 4px; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); }
.mlm-slider output { font-weight: 800; color: #facc15; }
.mlm-slider input { width: 100%; accent-color: #facc15; min-height: 32px; }
.mlm-actions { flex-wrap: wrap; }
.mlm-stats { font-weight: 700; }
.mini-chart { margin: 12px 0; padding: 10px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); max-width: 640px; }
.mini-chart svg { display: block; width: 100%; height: auto; color: var(--ink); }
.mini-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; }
.mini-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mini-legend i { width: 14px; height: 4px; border-radius: 2px; }
/* AI Smart City */
.sca-districts { display: grid; gap: 8px; margin: 12px 0; }
.sca-cross { display: grid; gap: 8px; margin: 12px 0; }
.sca-lane { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: #1e293b; border: 2px dashed #64748b; }
.sca-lane b { min-width: 170px; }
.sca-lane span { font-size: 20px; letter-spacing: 2px; }
.sca-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; margin: 6px 0 12px; }
.sca-choices .bya-lbl { display: grid; gap: 2px; text-align: left; padding: 10px 12px; }
.sca-choices .bya-lbl small { font-weight: 600; opacity: .8; }
.sca-choices .bya-lbl[aria-checked="true"] { background: #facc15; color: #10142a; border-color: #facc15; }
.sca-rule { padding: 10px 14px; border-radius: 14px; background: #071433; border: 2px solid #22d3ee; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.sca-day { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 110px; padding: 6px 6px 18px; border-radius: 14px; background: #7dd3fc; position: relative; }
.sca-hour { position: relative; display: flex; align-items: flex-end; border-radius: 4px; background: rgba(255,255,255,.35); }
.sca-hour.is-dark { background: #0f172a; }
.sca-hour i { display: block; width: 100%; background: #facc15; border-radius: 3px; box-shadow: 0 0 8px #facc15; }
.sca-hour small { position: absolute; bottom: -16px; left: 0; font-size: 11px; color: #10142a; font-weight: 800; }
.sca-goals { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.sca-goals li { padding: 8px 12px; border-radius: 12px; background: #0d2252; border: 2px solid var(--line); font-weight: 700; }
.sca-goals li.is-ok { border-color: #22c55e; }
.sca-goals li.is-bad { border-color: #ef4444; }

/* Learn to Code steps: 1 Lessons → 2 Practice → 3 Games */
.step-path { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.step-pill a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #0d2252; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; }
.step-pill b { font-size: 22px; }
.step-pill.now a { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,199,44,.25); }
.step-pill.fin a { border-color: #4ade80; background: #0d3328; }
.step-pill.locked a { opacity: .6; }
.code-step .step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 8px; border-radius: 50%; background: var(--gold); color: #1a1200; font-weight: 900; font-size: 18px; vertical-align: middle; }
.code-step.is-locked { opacity: .75; }
.step-lock { margin: 0; padding: 14px; border-radius: 14px; border: 2px dashed var(--line); font-weight: 800; }
@media (max-width: 520px) { .step-pill a { flex-direction: column; gap: 2px; text-align: center; font-size: 14px; } }

/* Guest lock: one free lesson per subject, the rest need a login (js/guest-lock.js). */
.lock-tag { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 999px; background: #1c2747; border: 2px solid #2c3b66; color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.free-tag { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #1a1200; font-size: 13px; font-weight: 900; white-space: nowrap; }
.lock-panel { max-width: 620px; margin: 24px auto; text-align: center; }
.lock-panel .lock-big { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.lock-panel .plan-tools { justify-content: center; margin: 16px 0 0; }
.is-guest-locked { opacity: .7; }

/* Kid sign-in (#/account/kid): pick a profile, then type the PIN. */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.kid-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; min-height: 44px; }
.kid-pick:hover:not(:disabled), .kid-pick:focus-visible { border-color: var(--gold); }
.kid-pick:disabled { opacity: .55; cursor: not-allowed; }
.kid-pick small { color: var(--muted); font-weight: 700; }
.kid-ava { width: 72px; height: 72px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 32px; background: rgba(47,128,255,.2); overflow: hidden; }
.kid-ava img { width: 100%; height: 100%; object-fit: cover; }

/* Parent dashboard (#/parent). */
.view-parent { display: flex; flex-direction: column; gap: 16px; }
.pd-panel { display: flex; flex-direction: column; gap: 10px; }
.pd-children { display: grid; gap: 14px; }
.pd-child { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 10px; }
.pd-child-head { display: flex; align-items: center; gap: 12px; }
.pd-child-head h3 { margin: 0; }
.pd-ava { width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 26px; background: rgba(47,128,255,.2); overflow: hidden; flex: none; }
.pd-ava img { width: 100%; height: 100%; object-fit: cover; }
.pd-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: rgba(47,128,255,.16); border: 1px solid var(--line); }
.pd-pill.granted, .pd-pill.open, .pd-pill.review-approved, .pd-pill.not_required { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.5); }
.pd-pill.pending, .pd-pill.review-pending { background: rgba(255,199,44,.14); border-color: rgba(255,199,44,.5); }
.pd-pill.withdrawn, .pd-pill.locked, .pd-pill.review-rejected { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.5); }
.pd-more { border-top: 1px solid var(--line); padding-top: 8px; }
.pd-more summary { cursor: pointer; font-weight: 800; min-height: 36px; display: flex; align-items: center; }
.pd-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; margin: 6px 0; }
.pd-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pd-row .f-input { flex: 1 1 140px; width: auto; }
.pd-block { display: flex; flex-direction: column; gap: 8px; }
.pd-consent { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pd-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pd-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.pd-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.pd-msg { padding: 8px 12px; border-radius: 12px; max-width: 85%; background: var(--panel-2); border: 1px solid var(--line); }
.pd-msg.parent { align-self: flex-end; background: rgba(47,128,255,.18); }
.pd-msg p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-msg small { color: var(--muted); }
