/* Jimbo Jambu — warm, low contrast, big targets, slow fades only. */
:root {
  --jamun: #5B2A86; --mango: #FF9F1C; --cream: #FFF4D6; --teal: #1FA3A3; --night: #2B2D6E; --lotus: #FF6F91;
  --ink: #3A3560; --paper: #FFF9EA; --line: #EADBB8;
  --r: 22px;
  font-family: 'Baloo 2', 'Baloo Bhai 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); }
body { min-height: 100vh; font-size: 18px; line-height: 1.4; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, a.pill, a.tile { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--jamun); }
.art { display: block; }
#app { max-width: 760px; margin: 0 auto; padding: 0 14px calc(20px + env(safe-area-inset-bottom)); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; font-size: 1.35rem; color: var(--jamun); }
.brand-face svg { width: 44px; height: 44px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; min-width: 52px; padding: 6px 14px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--paper); text-decoration: none; font-weight: 600; font-size: 1rem;
  position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pill:disabled { opacity: .6; cursor: default; }
.pill.big { min-height: 64px; font-size: 1.15rem; padding: 8px 22px; }
@media (max-width: 420px) { .top .pill span { display: none; } .brand { font-size: 1.15rem; } }

/* press-and-hold ring (grown-up gate) */
.pill .ring { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--teal); opacity: .7; }
.pill.holding .ring { width: 100%; transition: width var(--hold, 1800ms) linear; }

/* home */
.hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 12px; }
.hero-art { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.hero-art .mango-girl { width: 120px; height: 132px; }
.hero-art .jimbo { width: 136px; height: 136px; }
.bubble { background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 8px 16px; font-weight: 600; text-align: center; }
.hero-bubble { font-size: 1.1rem; max-width: 22rem; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 124px; border-radius: var(--r);
  background: var(--tint); border: 2px solid #00000010; text-decoration: none; color: var(--night); font-weight: 700; font-size: 1.15rem; text-align: center; padding: 10px; }
.tile:active { filter: brightness(.97); }
.tile-icon { font-size: 2.6rem; line-height: 1.1; }
.toys { display: flex; align-items: center; gap: 12px; margin: 22px 0 8px; padding: 14px; border-radius: var(--r); background: #F6ECFA; border: 2px dashed #D9C3EA; }
.toys-art svg { width: 84px; height: 84px; }
.toys h2 { margin: 0; font-size: 1.15rem; color: var(--jamun); }
.toys p { margin: 2px 0 8px; font-size: .95rem; }
.foot { text-align: center; font-size: .95rem; color: #6C6688; padding: 8px 0; }
.foot p { margin: 4px 0; }
.gate-hint { font-size: .85rem; }

/* game shell */
.game { padding-top: 10px; }
.gbar { display: flex; align-items: center; gap: 8px; }
.gbar h1 { flex: 1; margin: 0; font-size: 1.3rem; color: var(--night); text-align: center; }
.dots { display: flex; justify-content: center; gap: 6px; min-height: 16px; margin: 8px 0 2px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: #E9DFC8; }
.dots span.done { background: var(--teal); opacity: .7; }
.dots span.now { background: var(--mango); }
.caption { min-height: 3.2em; margin: 6px 0 10px; padding: 10px 14px; border-radius: 18px; background: var(--tint, var(--paper)); text-align: center; font-weight: 600; font-size: 1.15rem; color: var(--night); transition: background .4s ease; }
.caption.soft { background: #F3EEE3; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* answer buttons */
.choices { display: grid; gap: 12px; width: 100%; grid-template-columns: repeat(2, 1fr); }
.choices.n3 { grid-template-columns: repeat(3, 1fr); }
.choices.n2 { grid-template-columns: repeat(2, 1fr); }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 10px; border-radius: var(--r);
  background: var(--paper); border: 3px solid var(--line); transition: opacity .5s ease, border-color .4s ease, background .4s ease; touch-action: manipulation; }
.choice .shape, .choice .planet { width: 84px; height: 84px; }
.choice.right { border-color: var(--teal); background: #E3F5F2; }
.choice.tryagain { opacity: .35; }
.choice .cap, .pot .cap, .bowl .cap { font-weight: 600; font-size: 1rem; text-transform: capitalize; }
.emo { font-size: 2.8rem; line-height: 1.15; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.num { font-size: 3rem; font-weight: 700; color: var(--jamun); line-height: 1; }

/* colours */
.mixer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pot, .bowl { display: flex; flex-direction: column; align-items: center; background: var(--paper); border: 3px solid var(--line); border-radius: var(--r); padding: 8px; min-width: 96px; transition: opacity .5s ease; }
.pot .shape, .bowl .shape { width: 72px; height: 72px; }
.pot.used { opacity: .55; }
.paint { transition: fill .9s ease; }
.plus { font-size: 2rem; font-weight: 700; color: #9C93B5; }

/* counting */
.count-wrap, .sum { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.fruits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 360px; }
.fruit-btn { position: relative; width: 66px; height: 66px; border: 0; background: transparent; padding: 0; transition: opacity .5s ease; }
.fruit-btn .fruit { width: 66px; height: 66px; }
.fruit-btn .tag { position: absolute; top: -2px; right: -2px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--jamun); color: #fff; font-weight: 700; font-size: .95rem; line-height: 26px; display: none; }
.fruit-btn.counted .tag { display: block; }
.fruit-btn.gone { opacity: .22; }
.fruits.mini svg { width: 34px; height: 34px; }

/* letters */
.letter-top { display: flex; align-items: center; justify-content: center; gap: 16px; }
.big-letter { font-size: 4rem; font-weight: 700; color: var(--jamun); background: var(--paper); border: 3px solid var(--line); border-radius: var(--r); min-width: 120px; min-height: 110px; line-height: 1; }
.big-letter small { font-size: 2.4rem; margin-left: 6px; color: var(--teal); }
.word { display: flex; flex-direction: column; align-items: center; font-weight: 600; font-size: 1.2rem; }
.trace canvas { background: var(--paper); border: 3px dashed var(--line); border-radius: var(--r); touch-action: none; display: block; }
.next-btn { margin-top: 4px; }

/* patterns */
.pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; background: var(--paper); border-radius: var(--r); border: 2px solid var(--line); }
.pattern .emo { font-size: 2.3rem; }
.pattern .q { display: inline-flex; align-items: center; justify-content: center; width: 52px; border: 3px dashed var(--mango); border-radius: 14px; color: var(--mango); font-weight: 700; }

/* memory */
.memory { display: grid; gap: 10px; width: 100%; grid-template-columns: repeat(3, 1fr); }
.memory.n8 { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; border: 3px solid var(--line); background: #EFE3F8; padding: 0; overflow: hidden; }
.card .back, .card .front { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .45s ease; }
.card .back svg { width: 70%; opacity: .55; }
.card .front { opacity: 0; background: var(--paper); }
.card.open .front { opacity: 1; }
.card.open .back { opacity: 0; }
.card.matched { border-color: var(--teal); }

/* teach Jimbo */
.teach { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; }
.teach-jimbo { position: relative; }
.teach-jimbo svg { width: 120px; height: 120px; }
.teach-jimbo.big svg { width: 170px; height: 170px; }
.teach-jimbo .bubble { position: absolute; top: -18px; right: -30px; font-size: 1.05rem; text-transform: capitalize; }
.teach-item { width: 130px; height: 130px; display: flex; align-items: center; justify-content: center; background: var(--paper); border: 3px solid var(--line); border-radius: var(--r); }
.teach-item .emo { font-size: 4.2rem; }
.teach-item .face { width: 110px; height: 110px; }
.learned, .ask { margin: 0; font-weight: 600; }
.lesson { margin: 0; padding: 12px 16px; background: var(--paper); border-left: 6px solid var(--teal); border-radius: 12px; font-size: 1.1rem; max-width: 30rem; }

/* planets */
.space { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 12px; background: var(--night); border-radius: var(--r); color: var(--cream); }
.space h3 { margin: 0; font-size: 1.5rem; }
.planet-btn { background: transparent; border: 0; padding: 0; }
.planet-btn .planet { width: 200px; height: 200px; }
.orbit { display: flex; gap: 6px; }
.orbit .dot { width: 12px; height: 12px; border-radius: 50%; opacity: .45; }
.orbit .dot.on { opacity: 1; outline: 2px solid var(--cream); outline-offset: 2px; }

/* habits */
.slots { display: flex; gap: 10px; }
.slot { width: 86px; height: 86px; border-radius: 18px; border: 3px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #A99FC0; transition: background .4s ease; }
.slot.filled { border-style: solid; border-color: var(--teal); background: #E3F5F2; }
.slot .emo { font-size: 2rem; }
.choice.step .cap { font-size: .95rem; text-transform: none; text-align: center; line-height: 1.2; }
.choice.placed { opacity: .3; }
.share { display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.share-girl { display: flex; flex-direction: column; align-items: center; }
.share-girl .mango-girl { width: 110px; height: 120px; }
.share-friend .jimbo { width: 110px; height: 110px; }

/* finish */
.finish { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.finish-art { display: flex; align-items: flex-end; }
.finish-art .mango-girl { width: 120px; height: 132px; }
.finish-art .jimbo { width: 130px; height: 130px; }
.finish h2 { margin: 4px 0; color: var(--jamun); font-size: 1.4rem; }
.finish-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* grown-ups page */
.parents h1 { color: var(--jamun); margin: 6px 0; }
.parents .lead { font-size: 1.1rem; }
.card h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--night); }
.parents .card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; }
.parents .card h3 { margin: 10px 0 4px; font-size: 1rem; }
.parents ul { margin: 0; padding-left: 1.2rem; }
.parents li { margin: 4px 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 14px; border: 2px solid var(--line); border-radius: 999px; background: #fff; }
.opt input { width: 20px; height: 20px; accent-color: var(--teal); }
.small { font-size: .9rem; color: #6C6688; }

/* rest your eyes */
.rest { position: fixed; inset: 0; z-index: 50; background: #2B2D6Ef2; color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; animation: fadein 1.2s ease; }
.rest-art { display: flex; align-items: flex-end; }
.rest-art svg { width: 150px; height: 150px; }
.rest h2 { margin: 0; font-size: 1.6rem; }
.rest p { max-width: 24rem; margin: 0; font-size: 1.1rem; }
.rest .count { font-size: 2.6rem; font-weight: 700; color: var(--mango); }
.rest-btns { display: flex; flex-direction: column; gap: 10px; }
.rest .pill { color: var(--ink); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
