/* Naki Kids Arcade — a bright, calm, uncluttered skin.
   Rules this stylesheet keeps to, from the research in the grown-ups section:
   - every tap target is at least 64px, most are much bigger
   - body text is 18px or larger, and lines stay short
   - one job on screen at a time, generous space between choices
   - nothing flashes, nothing counts down, nothing nags */

:root{
  --paper:#fdf6e9;
  --ink:#182b36;
  --ink-soft:#4a6272;
  --line:#e2d3bb;
  --card:#ffffff;
  --navy:#0b2a40;
  --orange:#e07b1a;
  --teal:#0d8f92;
  --berry:#c3255a;
  --sun:#f7c132;
  --leaf:#3f9a54;
  --shadow:0 4px 0 #0000001a;
}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font:19px/1.5 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  min-height:100dvh;overscroll-behavior-y:none;
  -webkit-tap-highlight-color:transparent;
}
body.playing{-webkit-user-select:none;user-select:none}

.wrap{
  max-width:560px;margin:0 auto;
  padding:calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- header ---------- */
.kids-exit{display:flex;align-items:center;min-height:48px;margin:0 0 14px;padding:10px 16px;border:2px solid var(--navy);border-radius:14px;background:var(--navy);color:#fff;font-weight:800;text-decoration:none}
.kids-exit:focus-visible{outline:4px solid var(--teal);outline-offset:3px}
.kid-head{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.kid-head img{width:48px;height:48px;border-radius:26%;flex:0 0 auto}
.kid-head h1{margin:0;font-size:1.4rem;line-height:1.1;letter-spacing:-.01em}
.kid-head .eyebrow{
  display:block;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--orange);font-weight:800;margin-bottom:2px;
}
.kid-head .spacer{flex:1}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:0;border-radius:16px;cursor:pointer;font-family:inherit;font-weight:800;
  font-size:1.05rem;padding:16px 22px;min-height:64px;
  background:var(--orange);color:#fff;box-shadow:var(--shadow);
  text-decoration:none;text-align:center;
}
.btn:active{transform:translateY(2px);box-shadow:0 2px 0 #0000001a}
.btn.teal{background:var(--teal)}
.btn.navy{background:var(--navy)}
.btn.ghost{background:transparent;color:var(--ink-soft);border:2px solid var(--line);box-shadow:none}
.btn.wide+.btn.wide{margin-top:12px}
.btn.wide{width:100%}
.btn:focus-visible{outline:4px solid #0d8f92;outline-offset:3px}
.btn[disabled]{opacity:.5;cursor:default}

.backbtn{
  width:56px;height:56px;border-radius:50%;border:2px solid var(--line);
  background:var(--card);color:var(--ink);font-size:1.5rem;cursor:pointer;
  display:grid;place-items:center;flex:0 0 auto;
}

/* ---------- home tiles ---------- */
.tiles{display:grid;gap:16px;margin:0 0 26px}
.tile{
  display:grid;grid-template-columns:78px minmax(0,1fr);gap:16px;align-items:center;
  width:100%;text-align:left;border:3px solid var(--line);border-radius:22px;
  background:var(--card);padding:16px;cursor:pointer;font-family:inherit;color:inherit;
  box-shadow:0 5px 0 #0000000f;
}
.tile:active{transform:translateY(2px);box-shadow:0 3px 0 #0000000f}
.tile:focus-visible{outline:4px solid var(--teal);outline-offset:3px}
.tile .badge{
  width:78px;height:78px;border-radius:20px;display:grid;place-items:center;
  font-size:2.4rem;background:var(--sun);
}
.tile.t2 .badge{background:#ffd9a0}
.tile.t3 .badge{background:#bfe8d3}
.tile.t4 .badge{background:#d5edb8}
.tile.t5 .badge{background:#e6d6f7}
.tile b{display:block;font-size:1.2rem;line-height:1.2;margin-bottom:3px}
.tile .learns{
  display:block;font-size:.78rem;letter-spacing:.09em;text-transform:uppercase;
  font-weight:800;color:var(--teal);margin-bottom:5px;
}
.tile span.desc{display:block;font-size:.96rem;color:var(--ink-soft);line-height:1.4}

.hello{
  background:var(--navy);color:#fff8e9;border-radius:22px;padding:20px;margin-bottom:22px;
}
.hello h2{margin:0 0 8px;font-size:1.25rem;line-height:1.2}
.hello p{margin:0;font-size:1rem;color:#c8dbe4;line-height:1.45}

/* ---------- screens ---------- */
.screen[hidden]{display:none!important}

.stage{
  background:var(--card);border:3px solid var(--line);border-radius:24px;
  padding:20px;margin-bottom:18px;
}
.stage h2{margin:0 0 10px;font-size:1.25rem;line-height:1.25}
.scene-text{font-size:1.15rem;line-height:1.5;margin:0 0 6px}
.ask{
  font-weight:800;font-size:1.05rem;margin:20px 0 12px;color:var(--navy);
}

.choices{display:grid;gap:12px}
.choice{
  width:100%;min-height:68px;padding:16px 18px;border-radius:18px;
  border:3px solid var(--line);background:var(--card);color:var(--ink);
  font:inherit;font-weight:700;font-size:1.05rem;text-align:left;cursor:pointer;
  line-height:1.35;
}
.choice:active{transform:translateY(2px)}
.choice:focus-visible{outline:4px solid var(--teal);outline-offset:2px}
.choice.picked-good{border-color:var(--leaf);background:#eaf7ee}
.choice.picked-close{border-color:var(--sun);background:#fff8e0}
.choice.picked-off{border-color:#c9b9a3;background:#f4ede1}
.choice.dim{opacity:.45}

.feedback{
  margin-top:16px;border-radius:18px;padding:16px 18px;font-size:1.02rem;line-height:1.5;
  background:#eef6f6;border-left:8px solid var(--teal);
}
.feedback.good{background:#eaf7ee;border-left-color:var(--leaf)}
.feedback.close{background:#fff8e0;border-left-color:var(--sun)}
.feedback b{display:block;margin-bottom:4px}

.progress{
  display:flex;gap:7px;align-items:center;justify-content:center;
  margin:0 0 16px;
}
.progress i{
  width:14px;height:14px;border-radius:50%;background:var(--line);display:block;
}
.progress i.done{background:var(--teal)}
.progress i.now{background:var(--orange);transform:scale(1.35)}

/* ---------- the washing machine ---------- */
.machine{
  width:100%;max-width:300px;margin:0 auto 18px;display:block;
}
.machine .drum{transform-origin:150px 150px}
.wobble-0 .machine-body{transform:none}
@media (prefers-reduced-motion:no-preference){
  .wobble-1 .machine-body{animation:wob .55s ease-in-out infinite}
  .wobble-2 .machine-body{animation:wob .34s ease-in-out infinite}
  .wobble-3 .machine-body{animation:wob .18s ease-in-out infinite}
  @keyframes wob{25%{transform:translateX(-3px) rotate(-.7deg)}75%{transform:translateX(3px) rotate(.7deg)}}
  .machine .drum{animation:spin 2.4s linear infinite}
  .wobble-3 .machine .drum{animation-duration:.7s}
  .wobble-2 .machine .drum{animation-duration:1.2s}
  .settled .machine .drum{animation-duration:9s}
  @keyframes spin{to{transform:rotate(360deg)}}
}

/* ---------- breathing ---------- */
.breathe-wrap{text-align:center;padding:6px 0 4px}
.breathe-word{
  font-size:1.5rem;font-weight:800;margin:0 0 4px;color:var(--navy);min-height:1.8rem;
}
.breathe-sub{margin:0 0 16px;color:var(--ink-soft);font-size:1rem}
.bubble{
  width:170px;height:170px;margin:0 auto 16px;border-radius:50%;
  background:radial-gradient(circle at 35% 32%,#9fe4e3,#0d8f92);
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:1.6rem;
  transition:transform 1s linear;transform:scale(.55);
}
.bubble.big{transform:scale(1)}
@media (prefers-reduced-motion:reduce){.bubble{transition:none}}
.breath-dots{display:flex;gap:10px;justify-content:center;margin-bottom:4px}
.breath-dots i{width:16px;height:16px;border-radius:50%;background:var(--line)}
.breath-dots i.done{background:var(--teal)}

/* ---------- the round ---------- */
.person{
  width:100%;max-width:230px;margin:0 auto 14px;display:block;
}
.who{
  font-weight:800;font-size:1.1rem;color:var(--orange);
  text-transform:uppercase;letter-spacing:.06em;font-size:.85rem;margin:0 0 6px;
}
.truckbar{
  display:flex;align-items:center;gap:10px;margin-bottom:16px;
  background:var(--card);border:3px solid var(--line);border-radius:18px;padding:10px 14px;
}
.truckbar .load{flex:1;height:16px;border-radius:8px;background:var(--line);overflow:hidden}
.truckbar .load i{display:block;height:100%;background:var(--teal);width:0;transition:width .4s}
.truckbar small{font-weight:800;color:var(--ink-soft);font-size:.85rem}

/* ---------- the sorter ---------- */
.rulecard{
  background:var(--navy);color:#fff8e9;border-radius:20px;padding:14px 18px;
  text-align:center;margin-bottom:14px;
}
.rulecard .now{
  display:block;font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--sun);font-weight:800;margin-bottom:4px;
}
.rulecard b{font-size:1.25rem;line-height:1.2;display:block}
.rulecard.flash{animation:ruleflash .8s ease-out}
@keyframes ruleflash{0%{background:var(--berry)}100%{background:var(--navy)}}
@media (prefers-reduced-motion:reduce){.rulecard.flash{animation:none}}

#belt{
  width:100%;display:block;border-radius:20px;border:3px solid var(--line);
  background:#eef2f4;touch-action:manipulation;
}
.beltbar{display:flex;gap:12px;align-items:center;margin:12px 0 0}
.beltbar .pill{
  background:var(--card);border:3px solid var(--line);border-radius:14px;
  padding:8px 14px;font-weight:800;font-size:.95rem;
}
.beltbar .pill b{color:var(--teal)}
.beltbar .grow{flex:1}
.toast{
  margin-top:12px;border-radius:16px;padding:13px 16px;font-size:1rem;line-height:1.45;
  background:#eaf7ee;border-left:8px solid var(--leaf);min-height:52px;
}
.toast.warn{background:#fdeceb;border-left-color:var(--berry)}
.toast.info{background:#eef6f6;border-left-color:var(--teal)}

/* ---------- results ---------- */
.level-label{display:block}
select{width:100%;min-height:64px;padding:12px;border:3px solid var(--line);border-radius:14px;background:white;color:var(--ink);font:inherit}
.learn-progress{font-size:1rem;color:var(--ink-soft);margin:0}
.garden{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:22px 0 12px}
.garden-cell{aspect-ratio:1;display:grid;place-items:center;background:#eff4e6;border:2px dashed #a7bb89;border-radius:12px;font-size:clamp(1.3rem,6vw,2.1rem);color:#55733a}
.garden-cell.planted{background:#e4f0cf;border-style:solid}
.garden-count{text-align:center;font-weight:800;margin:10px 0}
.garden-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.garden-buttons .btn{padding:12px 6px;font-size:1rem}
.pattern-strip{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:24px 0}
.pattern-token{display:inline-grid;place-items:center;min-width:44px;min-height:54px;font-size:1.9rem;font-weight:800;border:2px solid var(--line);border-radius:12px;background:#fdf6e9;padding:4px}
.pattern-token.missing{border-style:dashed;color:var(--ink-soft)}
.pattern-choice{display:flex;align-items:center;gap:14px;text-transform:capitalize}
.pattern-choice .pattern-token{border:0;background:transparent;min-height:32px}
#sortPause{margin-top:14px}

.result{text-align:center}
.result .big{font-size:2.6rem;font-weight:800;margin:6px 0 0;color:var(--teal)}
.result h2{font-size:1.5rem;margin:0 0 6px}
.wordbank{
  display:flex;flex-wrap:wrap;gap:9px;justify-content:center;margin:16px 0 4px;
}
.wordbank span{
  background:var(--sun);border-radius:999px;padding:9px 16px;font-weight:800;font-size:1rem;
  color:#3b2c07;
}
.takeaway{
  background:var(--navy);color:#fff8e9;border-radius:20px;padding:18px;margin:18px 0;
  text-align:left;line-height:1.5;
}
.takeaway b{display:block;color:var(--sun);font-size:.75rem;letter-spacing:.14em;
  text-transform:uppercase;margin-bottom:6px}

/* ---------- grown-ups ---------- */
.grownups{
  border:3px dashed var(--line);border-radius:22px;padding:4px 18px;background:#fffdf7;
  margin-bottom:20px;
}
.grownups summary{
  cursor:pointer;font-weight:800;font-size:1.05rem;padding:16px 0;list-style:none;
  display:flex;align-items:center;gap:10px;min-height:56px;
}
.grownups summary::-webkit-details-marker{display:none}
.grownups summary::after{content:'▾';margin-left:auto;color:var(--ink-soft)}
.grownups[open] summary::after{content:'▴'}
.grownups h3{font-size:1.02rem;margin:18px 0 6px}
.grownups p,.grownups li{font-size:.96rem;line-height:1.5;color:var(--ink-soft)}
.grownups ul{padding-left:20px;margin:6px 0}

.footnote{
  text-align:center;color:var(--ink-soft);font-size:.88rem;line-height:1.5;margin:24px 0 0;
}
.footnote a{color:var(--teal)}

@media (max-width:360px){
  body{font-size:18px}
  .tile{grid-template-columns:62px minmax(0,1fr);gap:12px}
  .tile .badge{width:62px;height:62px;font-size:1.9rem}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
