/* Kids Zone: readable choices, generous touch targets, and calm play surfaces. */
body.kids-mode { --header-h: 72px; }
body.kids-mode .brand-logo { height: 55px; animation: none; }
body.kids-mode .sticky-cta { display: none; }
body.kids-mode .dot-field .dot { opacity: .09; animation: none; }
body.kids-mode .primary-nav a[aria-current=page]:not(.nav-cta) { color: #6544d5; }
body.kids-mode #app { animation: none; }
.kz { --kz-gap: 1rem; --kz-purple: #6544d5; padding: 1.5rem 0 2.5rem; }
.kz > .container { max-width: 1080px; }
.kz [hidden] { display: none !important; }
.kz button, .kz summary, .kz select { font: inherit; touch-action: manipulation; }
.kz button { cursor: pointer; font-weight: 800; }
.kz button:disabled { opacity: .48; cursor: default; transform: none; }
.kz :focus-visible { outline: 3px solid #48318c; outline-offset: 4px; }
.kz-bar { display: flex; justify-content: space-between; align-items: center; gap: .65rem; margin-bottom: .8rem; }
.kz-bar-tools { display: flex; gap: .5rem; }
.kz-back, .kz-sound, .kz-fs { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; border: 2px solid #d8ccf3; border-radius: 14px; padding: .45rem .75rem; background: #fff; color: #51388e; font-weight: 800; white-space: nowrap; }
.kz-sound[aria-pressed=true], .kz-fs[aria-pressed=true] { color: #fff; background: var(--kz-purple); border-color: var(--kz-purple); }
.kz-title { font-size: clamp(1.85rem, 4vw, 2.7rem); margin: 0 0 .3rem; }
.kz-intro { font-size: 1.05rem; color: #594d67; margin-bottom: 1.1rem; max-width: 65ch; }
.kz-body { background: #fff; padding: clamp(.85rem, 2vw, 1.5rem); border: 1px solid #e5dcf2; border-radius: 26px; box-shadow: 0 6px 0 #eae1f2; min-width: 0; }
.kz-body:has(.kz-grid) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.kz-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.kz-row + .kz-row { margin-top: .65rem; }
.kz-chip, .kz-tool, .kz-ttt-modeBtn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 2px solid #ded5f2; border-radius: 14px; background: #fff; color: #44305e; font-weight: 800; padding: .5rem .85rem; line-height: 1.35; }
.kz-chip { font-size: .9rem !important; }
.kz-chip > span:first-child { font-size: 1.25rem; }
.kz-chip-l { display: inline; }
.kz-chip[aria-pressed=true], .kz-tool[aria-pressed=true], .kz-ttt-modeBtn[aria-pressed=true] { background: #f0eaff; border-color: var(--kz-purple); color: #4d3197; }
.kz-chip:hover:not(:disabled), .kz-tool:hover:not(:disabled) { border-color: #a48cdd; background: #faf6ff; }
.kz-tool-save { background: #6544d5; border-color: #6544d5; color: #fff; }
.kz .btn-primary { background: #6544d5; color: #fff; }
.kz .btn-primary:hover { background: #5033b0; }
.kz-tool-save:hover:not(:disabled) { background: #5033b0; color: #fff; }
.kz-swatch { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; border: 4px solid white; outline: 1px solid #c9c2d4; border-radius: 50%; background: var(--sw); position: relative; }
.kz-swatch[aria-pressed=true] { outline: 3px solid #51318f; box-shadow: inset 0 0 0 2px #fff; }
.kz-swatch[aria-pressed=true]::after { content: '✓'; display: grid; place-items: center; width: 17px; height: 17px; position: absolute; bottom: -6px; right: -5px; color: #fff; background: #51318f; border-radius: 50%; font-size: 12px; }
.kz-swatches { padding: .4rem .2rem; }
.kz-tool-heading { font-size: 1rem; margin: .35rem 0 .6rem; }
.kz-label { font-weight: 800; color: #594d67; }
.kz-help { margin: .5rem 0; border-radius: 12px; padding: .65rem .85rem; background: #f4efff; color: #51388e; font-weight: 800; font-size: .95rem; line-height: 1.5; }
.kz-hint { margin: .5rem 0 0; color: #675974; font-size: .88rem; }
.kz-message:empty { display: none; }
.kz-message { color: #51388e; font-weight: 700; margin: 1rem 0; }
.kz-safety { font-size: .82rem; color: #675974; margin: 1.4rem .35rem .6rem; line-height: 1.65; }
.kz-safety a { color: #51388e; text-decoration: underline; }
.kz-book { margin-top: 1rem; padding: 1.2rem 1.4rem; border-radius: 22px; background: #f0e8fa; border: 1px solid #e1d5ef; position: relative; }
.kz-book-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.kz-book-inner > div { max-width: 52ch; }
.kz-book strong { display: block; color: #57416f; font-size: .95rem; font-weight: 600; }
.kz-parent-label { display: block; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; color: #6544a1; }
.kz-book .btn { background: #6544d5; color: #fff; padding: .6rem 1rem; min-height: 44px; }
.kz-book-dot { display: none; }
.kz-win, .kz-mem-win { padding: 1rem; border-radius: 18px; background: #fff4ce; border: 2px solid #f3d372; text-align: center; margin: 1rem auto 0; }
.kz-win p, .kz-mem-win p { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: .75rem; }
.kz-mem-win-btns { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
/* Hub */
.kz-hub-filters { margin-bottom: 1.2rem; }
.kz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.15rem; }
.kz-card { display: flex; flex-direction: column; position: relative; overflow: hidden; background: #fff; color: var(--ink); border-radius: 24px; border: 1px solid #e9e0f2; padding: 1.2rem; box-shadow: 0 5px 0 #eae1f2; transition: transform .15s; }
.kz-card:hover { transform: translateY(-3px); }
.kz-card-dot { position: absolute; top: -28px; right: -28px; width: 100px; height: 100px; border-radius: 50%; background: var(--kz-accent); opacity: .18; }
.kz-card-emoji { font-size: 2.6rem; width: 76px; height: 76px; display: grid; place-items: center; background: #f9f4ff; border-radius: 20px; margin-bottom: .9rem; }
.kz-card strong { font: 800 1.3rem/1.3 var(--font-display); margin-bottom: .35rem; }
.kz-card-desc { font-size: .92rem; color: #675974; margin-bottom: 1rem; }
.kz-card-go { margin-top: auto; font-weight: 900; color: #6544d5; font-size: .9rem; }
/* Canvases */
.kz-stage { position: relative; width: 100%; height: clamp(330px, 52vh, 510px); border-radius: 20px; overflow: hidden; background: linear-gradient(145deg, #ebf9ff, #f8f0ff); border: 2px solid #e8def5; }
.kz-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: pointer; }
.kz-hud { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .5rem; flex-wrap: wrap; pointer-events: none; }
.kz-pill { display: inline-flex; gap: .35rem; align-items: center; border-radius: 12px; padding: .4rem .7rem; background: #fff; color: #463257; font-size: .9rem; font-weight: 800; }
.kz-pill b { color: #6544d5; }
.kz-combo { background: #fff1c4; color: #705023; }
.kz-game-controls { margin-top: .85rem; }
.kz-soccer-stage { height: clamp(340px, 45vw, 520px); }
/* Face studio */
.kz-studio { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr); gap: 1.5rem; align-items: start; }
.kz-art-panel { min-width: 0; }
.kz-paint-stage { aspect-ratio: 1; height: auto; max-width: 440px; margin-inline: auto; }
.kz-paint-stage .kz-canvas { touch-action: none; cursor: grab; }
.kz-paint-tools { min-width: 0; }
.kz-paint-choose { display: none; }
.kz-paint-tools > .kz-tool-heading:not(:first-child) { margin-top: 1rem; }
.kz-design-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.kz-design-grid .kz-chip { padding: .55rem .25rem; flex-direction: column; gap: .25rem; font-size: .8rem !important; min-height: 68px; }
.kz-design-grid .kz-chip > span:first-child { font-size: 1.5rem; }
.kz-more-designs { margin-top: .7rem; }
.kz-more-designs summary { cursor: pointer; color: #51388e; font-weight: 800; min-height: 44px; padding: .5rem; }
.kz-more-designs .kz-design-grid { margin-top: .5rem; }
.kz-art-panel .kz-row { margin-top: .8rem; }
/* Coloring */
.kz-color { display: flex; flex-direction: column; gap: .7rem; max-width: 710px; margin-inline: auto; }
.kz-color-stage { aspect-ratio: 1; height: auto; max-width: 520px; margin-inline: auto; background: #fff; }
.kz-color-stage .kz-canvas { touch-action: none; cursor: crosshair; }
.kz-picture-picker { border: 2px solid #e2d8f2; border-radius: 14px; padding: .65rem .85rem; }
.kz-picture-picker summary { min-height: 44px; cursor: pointer; color: #51388e; }
.kz-picture-picker .kz-design-grid { margin-top: .8rem; }
.kz-brush-size { display: inline-flex; gap: .5rem; align-items: center; color: #594d67; font-size: .9rem; }
.kz-brush-size select { min-height: 48px; border: 2px solid #ded5f2; background: white; border-radius: 12px; padding: .4rem; }
/* Picture puzzles */
.kz-puzzle-toolbar { margin: .8rem 0 1rem; }
.kz-puzzle-toolbar .kz-help { margin: 0; margin-right: auto; }
.kz-puzzle-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 920px; margin-inline: auto; }
.kz-puzzle-board, .kz-puzzle-tray { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 5px; border-radius: 16px; padding: 8px; background: #eee7f8; }
.kz-puzzle-tray { background: #f8f5ff; }
.kz-puzzle-slot, .kz-puzzle-piece { border: 2px solid #d3c5eb; border-radius: 8px; position: relative; aspect-ratio: 1; padding: 0; background-color: #fff; overflow: hidden; min-width: 0; }
.kz-puzzle-piece { border-color: #fff; background-repeat: no-repeat; touch-action: none; box-shadow: 0 2px 3px #ded5eb; }
.kz-puzzle-piece[aria-pressed=true] { outline: 4px solid #6544d5; outline-offset: -4px; }
.kz-puzzle-ghost { position: absolute; inset: 0; background-repeat: no-repeat; opacity: 0; }
.kz-puzzle-board--hint .kz-puzzle-ghost { opacity: .25; }
.kz-puzzle-slot.kz-puzzle-slot--placed:disabled { opacity: 1; border-color: #63b498; }
.kz-puzzle-slot--placed .kz-puzzle-ghost { opacity: 1; }
.kz-puzzle-drag { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%); border-radius: 10px; border: 3px solid #6544d5; opacity: .92; box-shadow: 0 8px 20px #49356540; }
/* Dot pictures */
.kz-connect { max-width: 760px; margin-inline: auto; }
.kz-dotboard { position: relative; width: min(100%, 570px); aspect-ratio: 1; margin: 1rem auto 0; border: 2px solid #e4d9f2; background: #fffbf2; border-radius: 20px; }
.kz-dotboard svg { width: 100%; height: 100%; }
.kz-dot { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; border: 2px solid #b7a4d6; border-radius: 50%; background: #fff; font-weight: 900 !important; color: #51388e; padding: 0; font-size: 1rem !important; }
.kz-dot--next { background: #6544d5; border-color: #6544d5; color: #fff; box-shadow: 0 0 0 5px #e6dcfa; }
.kz-dot.kz-dot--done:disabled { background: #e6f5ed; border-color: #76b196; color: #286b4b; opacity: 1; transform: translate(-50%, -50%); }
/* Memory */
.kz-memory-levels { margin-bottom: .9rem; }
.kz-memory-hud { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.kz-mem-newgame { min-height: 48px; padding: .5rem .9rem; }
.kz-mem-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; max-width: 460px; margin: 1rem auto 0; }
.kz-mcard { aspect-ratio: 1; border: 2px solid #6a49cf; border-radius: 16px; background: #7d59dd; color: #fff; padding: 0; position: relative; min-width: 0; box-shadow: 0 4px 0 #5339a3; }
.kz-mcard-inner, .kz-mcard-front, .kz-mcard-back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 14px; }
.kz-mcard-front { background: #fff4d7; display: none; font-size: clamp(2rem, 7vw, 3.5rem); }
.kz-mcard-back { font-size: clamp(1.7rem, 5vw, 2.3rem); }
.kz-mcard--up .kz-mcard-front, .kz-mcard--done .kz-mcard-front { display: grid; }
.kz-mcard--up .kz-mcard-back, .kz-mcard--done .kz-mcard-back { display: none; }
.kz-mcard.kz-mcard--done:disabled { opacity: 1; border-color: #5eac87; box-shadow: 0 3px 0 #5eac87; }
/* Tic-tac-toe */
.kz-ttt-wrap { max-width: 440px; margin-inline: auto; }
.kz-ttt-hud { display: flex; gap: .6rem; flex-wrap: wrap; }
.kz-ttt-status { margin: 1rem 0; text-align: center; color: #51388e; font-weight: 800; }
.kz-ttt-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.kz-ttt-cell { aspect-ratio: 1; min-width: 0; border: 3px solid #cfc0ed; border-radius: 18px; background: #fcf9ff; font-size: clamp(2.2rem, 7vw, 3.5rem) !important; }
.kz-ttt-cell.kz-ttt-cell--x:disabled, .kz-ttt-cell.kz-ttt-cell--o:disabled { opacity: 1; background: #f1eaff; }
.kz-ttt-cell.kz-ttt-cell--win:disabled { background: #fff0b1; border-color: #ca9820; }
.kz-ttt-score { display: flex; gap: .5rem; justify-content: center; margin: 1rem 0 .5rem; }
.kz-ttt-reset { display: block; margin: 1rem auto 0; }
/* Sound pads */
.kz-soundboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.kz-spad { border: 2px solid #e3d8f2; border-radius: 20px; padding: 1.3rem .6rem; background: #fff; color: #44305e; box-shadow: 0 5px 0 #dfd3ec; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; }
.kz-spad-emoji { display: grid; place-items: center; font-size: 2.5rem; width: 68px; height: 68px; border-radius: 20px; background: color-mix(in srgb, var(--spad) 22%, white); }
.kz-spad-label { font-size: 1rem; font-weight: 900; }
.kz-spad--pressed, .kz-spad:active { transform: translateY(3px); box-shadow: 0 2px 0 #b8a4d5; border-color: #6544d5; }
/* Balloon workshop */
.kz-bal-wrap { position: relative; max-width: 460px; margin: 1rem auto; }
.kz-bal-canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 20px; border: 2px solid #e4d9f2; }
.kz-bal-hud { position: absolute; top: .5rem; left: .5rem; }
.kz-bal-ctrl { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
#kz-bal-progress { display: block; width: min(100%, 460px); height: 12px; accent-color: #6544d5; margin: 0 auto .8rem; }
/* Full screen preserves each activity's geometry and scrolls on small screens. */
.kz-isfull { overflow: auto; background: #fbf7ff; padding: 1rem 0; }
.kz-isfull .container { max-width: 1200px; width: calc(100% - 2rem); min-height: 100%; }
.kz-isfull .kz-book, .kz-isfull .kz-safety { display: none; }
@media (max-width: 760px) {
  body.kids-mode { --header-h: 64px; }
  body.kids-mode .brand-logo { height: 46px; }
  .kz { padding-top: 1rem; }
  .kz > .container { width: calc(100% - 1.5rem); }
  .kz-studio, .kz-puzzle-layout { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .kz-paint-choose { display: inline-flex; margin: .25rem 0 .4rem; }
  .kz-puzzle-layout { max-width: 440px; }
  .kz-soundboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .kz-back, .kz-sound, .kz-fs { padding: .45rem .55rem; font-size: .85rem !important; }
  .kz-fs-label { display: none; }
  .kz-fs { width: 44px; font-size: 1.25rem !important; }
  .kz-bar { gap: .35rem; }
  .kz-title { font-size: 1.85rem; }
  .kz-intro { font-size: .98rem; }
  .kz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .kz-card { padding: .9rem; border-radius: 19px; }
  .kz-card-emoji { width: 62px; height: 62px; font-size: 2.2rem; }
  .kz-card strong { font-size: 1.05rem; }
  .kz-card-desc { font-size: .85rem; }
  .kz-design-grid { gap: .4rem; }
}
@media (max-width: 360px) {
  .kz-body { padding: .65rem; }
  .kz-design-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kz-chip { padding: .45rem .6rem; font-size: .84rem !important; }
}
