/* ============================================================================
   KIDS' PAGE (kids.html) — on top of core/lamp.css (fonts, paper and ink, the
   header). Bigger type, big tap targets, one bright colour per game, and the
   Story Path: stepping stones joined by a trail the lamp lights as a child
   walks it (core/kids-page.js draws the trail).
   ============================================================================ */
:root.lamp.kids {
  --k-sun: #FCE7B2;  --k-sun-ink: #6B3E00;
  --k-sky: #CFE6FA;  --k-sky-ink: #0D4473;
  --k-rose: #F9D3DC; --k-rose-ink: #7A1935;
  --k-leaf: #D5EDC6; --k-leaf-ink: #2B5414;
  --k-plum: #E3D6F5; --k-plum-ink: #4A2378;
  --k-stone: #FFFFFF;
  --k-bed: #E6DCC6;            /* the unlit trail */
  --k-step: #C2B391;
  --k-lit: #E3A642;            /* the lit trail, the lamp's amber */
  --k-shadow: 0 3px 0 rgba(27, 31, 42, .12), 0 8px 22px rgba(27, 31, 42, .08);
}
@media (prefers-color-scheme: dark) {
  :root.lamp.kids:not([data-lamp-theme="light"]) {
    --k-sun: #3A2E14;  --k-sun-ink: #FFD98A;
    --k-sky: #142B40;  --k-sky-ink: #A9D3F7;
    --k-rose: #3B1A24; --k-rose-ink: #F6B3C4;
    --k-leaf: #1D3214; --k-leaf-ink: #B9E39F;
    --k-plum: #2B1E3E; --k-plum-ink: #D4BEF3;
    --k-stone: #1F2430;
    --k-bed: #2A2F3B;
    --k-step: #474E5E;
    --k-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .25);
  }
}
:root.lamp.kids[data-lamp-theme="dark"] {
  --k-sun: #3A2E14;  --k-sun-ink: #FFD98A;
  --k-sky: #142B40;  --k-sky-ink: #A9D3F7;
  --k-rose: #3B1A24; --k-rose-ink: #F6B3C4;
  --k-leaf: #1D3214; --k-leaf-ink: #B9E39F;
  --k-plum: #2B1E3E; --k-plum-ink: #D4BEF3;
  --k-stone: #1F2430;
  --k-bed: #2A2F3B;
  --k-step: #474E5E;
  --k-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .25);
}

.kids body { font-size: 17px; background: var(--paper); }
.kids .k-tag {
  display: inline-block; margin-left: 4px; padding: 3px 9px 4px; border-radius: 999px;
  background: var(--lamp); color: #1B1F2A; font: 700 14px/1 var(--f-ui); vertical-align: 3px;
}
.kids .kw { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }

/* ---- Hero --------------------------------------------------------------- */
.kids .k-hero { text-align: center; padding: 28px 0 8px; }
.kids .k-lamp { width: 132px; height: auto; color: var(--ink); display: block; margin: 0 auto 6px; overflow: visible; }
.kids .k-flame { transform-origin: 98px 26px; animation: k-flicker 2.6s ease-in-out infinite; }
.kids .k-glow { transform-origin: 98px 22px; animation: k-glow 2.6s ease-in-out infinite; }
@keyframes k-flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.06, .96) rotate(-3deg); } 60% { transform: scale(.96, 1.05) rotate(2deg); } }
@keyframes k-glow { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.35); opacity: 1; } }
.kids h1 {
  margin: 0 auto; max-width: 16em;
  font: 700 clamp(30px, 7vw, 46px)/1.1 var(--f-display); letter-spacing: -.01em;
}
.kids .k-verse { margin: 12px auto 0; max-width: 30em; font: italic 17px/1.5 var(--f-read); color: var(--muted); }
.kids .k-verse cite { display: block; margin-top: 2px; font: 500 14px/1.4 var(--f-ui); font-style: normal; color: var(--accent); }
.kids .k-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px 0 0; }
.kids .k-jump a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 26px;
  border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none;
  font: 700 20px/1 var(--f-ui); box-shadow: var(--k-shadow);
}
.kids .k-jump a span { font-size: 26px; }
.kids .k-jump a:hover { color: var(--paper); transform: translateY(-1px); }
.kids .k-jump a:active { transform: translateY(2px); box-shadow: none; }

/* ---- Sections ------------------------------------------------------------ */
.kids .k-sec { margin-top: 44px; scroll-margin-top: 16px; }
.kids .k-sec h2 { margin: 0; font: 700 clamp(26px, 5.4vw, 34px)/1.15 var(--f-display); }
.kids .k-sub { margin: 6px 0 18px; color: var(--muted); font-size: 17px; max-width: 36em; }

/* ---- Games: big bright buttons -------------------------------------------- */
.kids .k-games, .kids .k-more, .kids .k-path { list-style: none; margin: 0; padding: 0; }
.kids .k-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kids .k-game {
  display: flex; align-items: center; gap: 16px; min-height: 112px; height: 100%; padding: 16px 18px;
  border-radius: 22px; text-decoration: none; box-shadow: var(--k-shadow);
  transition: transform .12s ease;
}
.kids .k-game:hover { transform: translateY(-2px); }
.kids .k-game:active { transform: translateY(2px); box-shadow: none; }
.kids .hue-sun  { background: var(--k-sun);  color: var(--k-sun-ink); }
.kids .hue-sky  { background: var(--k-sky);  color: var(--k-sky-ink); }
.kids .hue-rose { background: var(--k-rose); color: var(--k-rose-ink); }
.kids .hue-leaf { background: var(--k-leaf); color: var(--k-leaf-ink); }
.kids .hue-plum { background: var(--k-plum); color: var(--k-plum-ink); }
.kids .k-game:hover { color: inherit; }
.kids .hue-sun:hover { color: var(--k-sun-ink); } .kids .hue-sky:hover { color: var(--k-sky-ink); }
.kids .hue-rose:hover { color: var(--k-rose-ink); } .kids .hue-leaf:hover { color: var(--k-leaf-ink); }
.kids .hue-plum:hover { color: var(--k-plum-ink); }
.kids .k-game-icon {
  flex: none; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255, 255, 255, .7); font-size: 36px; line-height: 1;
}
:root.lamp.kids[data-mode="dark"] .k-game-icon { background: rgba(255, 255, 255, .1); }
.kids .k-game-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kids .k-game-title { font: 700 22px/1.15 var(--f-display); }
.kids .k-game-line { font-size: 16px; line-height: 1.4; }
.kids .k-go { margin-left: auto; flex: none; font: 700 16px/1 var(--f-ui); opacity: .8; }

/* ---- The Story Path ------------------------------------------------------- */
.kids .k-path-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.kids .k-trail { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.kids .k-trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kids .k-trail-bed { stroke: var(--k-bed); stroke-width: 22; }
.kids .k-trail-steps { stroke: var(--k-step); stroke-width: 4; stroke-dasharray: 2 14; }
.kids .k-trail-glow { stroke: var(--k-lit); stroke-width: 30; opacity: .25; filter: blur(4px); }
.kids .k-trail-lit { stroke: var(--k-lit); stroke-width: 10; }
.kids .k-path { position: relative; display: flex; flex-direction: column; gap: 22px; }
.kids .k-start {
  align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 700 15px/1.2 var(--f-ui); color: var(--accent);
}
.kids .k-start-lamp {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, #FFE7A8 0 40%, rgba(255, 211, 107, 0) 72%); font-size: 36px;
}
.kids .k-stop { width: 78%; max-width: 420px; }
.kids .k-stop.k-right { align-self: flex-end; }
.kids .k-stone {
  display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 10px 16px 10px 10px;
  border-radius: 999px; background: var(--k-stone); color: var(--ink); text-decoration: none;
  box-shadow: var(--k-shadow); border: 2px solid transparent;
}
.kids .k-right .k-stone { flex-direction: row-reverse; padding: 10px 10px 10px 18px; text-align: right; }
.kids .k-stone:hover { color: var(--ink); border-color: var(--k-lit); }
.kids .k-stone:active { transform: translateY(2px); box-shadow: none; }
.kids .k-dot {
  position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--soft); font-size: 34px; line-height: 1;
}
.kids .k-seen .k-dot { background: #FFE7A8; box-shadow: 0 0 0 4px var(--k-lit); }
.kids .k-num {
  position: absolute; right: -4px; bottom: -4px; min-width: 26px; height: 26px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: var(--paper);
  font: 700 13px/1 var(--f-ui);
}
.kids .k-right .k-num { right: auto; left: -4px; }
.kids .k-stone-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kids .k-stone-title { font: 700 19px/1.2 var(--f-display); }
.kids .k-stone-ref { font-size: 14px; color: var(--muted); }
.kids .k-heard { font: 600 13px/1.3 var(--f-ui); color: var(--accent); }

/* ---- More to explore ---------------------------------------------------- */
.kids .k-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kids .k-card {
  display: flex; align-items: center; gap: 14px; min-height: 88px; height: 100%; padding: 14px 16px;
  border-radius: 18px; background: var(--card); color: var(--ink); text-decoration: none;
  border: 1px solid var(--rule);
}
.kids .k-card:hover { color: var(--ink); border-color: var(--k-lit); }
.kids .k-card-icon { flex: none; font-size: 32px; line-height: 1; }
.kids .k-card-body { display: flex; flex-direction: column; gap: 3px; }
.kids .k-card-title { font: 700 18px/1.2 var(--f-display); }
.kids .k-card-line { font-size: 15px; line-height: 1.4; color: var(--muted); }

/* ---- For grown-ups -------------------------------------------------------- */
.kids .k-foot { margin-top: 56px; background: var(--soft); border-top: 1px solid var(--rule); }
.kids .k-foot-in { max-width: 980px; margin: 0 auto; padding: 22px 16px max(28px, env(safe-area-inset-bottom)); }
.kids .k-foot-h { margin: 0; font: 600 13px/1.3 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kids .k-foot-p { margin: 6px 0 14px; font-size: 15px; color: var(--muted); max-width: 40em; }
.kids .k-foot-row, .kids .k-dialog-row { display: flex; flex-wrap: wrap; gap: 10px; }
.kids .k-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 600 15px/1 var(--f-ui); text-decoration: none; cursor: pointer;
}
.kids .k-btn:hover { color: var(--paper); }
.kids .k-btn-quiet { background: transparent; color: var(--ink); border-color: var(--border); }
.kids .k-btn-quiet:hover { color: var(--ink); border-color: var(--ink); }
.kids .k-btn[hidden] { display: none; }

.kids .k-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 22px 20px 18px; border: 0; border-radius: 18px;
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.kids .k-dialog::backdrop { background: rgba(11, 13, 18, .55); }
.kids .k-dialog h2 { margin: 0 0 6px; font: 700 24px/1.2 var(--f-display); }
.kids .k-dialog p { margin: 0 0 12px; font-size: 15px; }
.kids .k-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; font: 600 14px/1.3 var(--f-ui); }
.kids .k-field[hidden] { display: none; }
.kids .k-field input {
  width: 9.5em; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--paper); font: 600 22px/1 var(--f-ui); letter-spacing: .4em;
}
.kids .k-error { color: #B3261E; font-weight: 600; min-height: 0; }
:root.lamp.kids[data-mode="dark"] .k-error { color: #F2B8B5; }
.kids .k-error:empty, .kids .k-note:empty { display: none; }
.kids .k-note { color: var(--muted); font-size: 14px !important; }
.kids .k-dialog-row { justify-content: flex-end; margin-top: 6px; }

/* ---- Phone -------------------------------------------------------------- */
@media (max-width: 640px) {
  .kids .lh-in { flex-wrap: nowrap; }
  .kids .lh-brand { font-size: 19px; min-width: 0; white-space: nowrap; }
  .kids .lh-theme { flex: none; min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .kids .lh-theme span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .kids .k-hero { padding-top: 20px; }
  .kids .k-lamp { width: 104px; }
  .kids .k-jump { flex-direction: column; align-items: stretch; }
  .kids .k-jump a { justify-content: center; }
  .kids .k-games, .kids .k-more { grid-template-columns: 1fr; }
  .kids .k-game { min-height: 100px; padding: 14px; gap: 14px; }
  .kids .k-game-icon { width: 58px; height: 58px; font-size: 30px; }
  .kids .k-game-title { font-size: 20px; }
  .kids .k-go { display: none; }
  .kids .k-stop { width: 88%; }
  .kids .k-dot { width: 56px; height: 56px; font-size: 29px; }
  .kids .k-stone-title { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .kids .k-flame, .kids .k-glow { animation: none; }
  .kids .k-game, .kids .k-jump a { transition: none; }
}
