/* Layout: a bright daytime playground. Sky band with a 3D toy box on top, chunky game tiles below, a quiet parents' corner at the end.
   Deliberately single-theme (bright day) — every colour is set explicitly. */
:root {
  color-scheme: light;
  --sky: #d9efff; --sky-2: #f2f9ff; --paper: #ffffff; --ink: #203040; --muted: #5a6b7a; --line: #d6e4ee;
  --kite: #f26a1b; --sun: #ffc93c; --leaf: #3fb56b; --sea: #2f8fd8; --berry: #e94f86; --grape: #8a5cd6; --teal: #1d6a85;
  --font: 'Baloo Thambi 2', 'Nirmala UI', 'Latha', 'Noto Sans Tamil', system-ui, sans-serif;
  --r: 22px; --shadow: 0 2px 0 rgba(32,48,64,.08), 0 14px 30px -14px rgba(32,48,64,.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sky-2); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); }
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; font-weight: 800; }
button { font-family: inherit; }
:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; border-radius: 10px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.bar { display: flex; align-items: center; gap: 14px; padding-block: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 21px; line-height: 1; }
.logo small { display: block; font-size: 14px; color: var(--teal); font-weight: 700; margin-top: 3px; }
.bar .sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 4px; border-radius: 999px; background: #fff6d6; border: 2px solid var(--sun); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.iconbtn svg { width: 22px; height: 22px; }
.navlinks { display: flex; gap: 18px; } .navlinks a { color: var(--muted); text-decoration: none; font-weight: 600; }
.navlinks a:hover { color: var(--ink); }

/* hero */
.hero { background: linear-gradient(180deg, var(--sky) 0%, #eaf6ff 70%, var(--sky-2) 100%); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 24px; align-items: center; padding-block: 36px 28px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 62px); }
.hero h1 .ta { display: block; color: var(--teal); font-size: .62em; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 20px; max-width: 32ch; margin: 14px 0 22px; }
.free-badge { display: inline-block; background: var(--leaf); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 14px 3px; border-radius: 999px; transform: rotate(-2deg); margin-bottom: 14px; }
.cta { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; border: 0; cursor: pointer;
       padding: 14px 26px 11px; border-radius: 999px; background: var(--kite); color: #fff; box-shadow: 0 5px 0 #b84a0c; transition: transform .12s; }
.cta:active { transform: translateY(4px); box-shadow: 0 1px 0 #b84a0c; }
.cta.alt { background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.stage { position: relative; height: 440px; max-width: 100%; }
#three { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: pointer; }
.stage-hint { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); background: rgba(255,255,255,.9); padding: 4px 14px 2px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.bubble { position: absolute; top: 14px; left: 50%; transform: translateX(-50%) scale(.9); background: var(--paper); border-radius: 20px; padding: 6px 22px 2px; font-size: 44px; font-weight: 800; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.bubble.on { opacity: 1; transform: translateX(-50%) scale(1); }

/* games grid */
section.block { padding-block: 52px; }
.sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 24px; }
.sec-title h2 { font-size: clamp(30px, 3.6vw, 42px); }
.sec-title span { color: var(--muted); font-size: 20px; font-weight: 600; }
[hidden] { display: none !important; }
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile { --c: var(--kite); position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: var(--r);
        padding: 18px 20px 18px; border: 3px solid transparent; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 35%, white), var(--shadow); transition: transform .15s; overflow: hidden; }
.tile:hover { transform: translateY(-4px) rotate(-.6deg); border-color: var(--c); }
.tile .art { height: 92px; display: flex; align-items: center; gap: 6px; }
.tile .art .big { font-size: 66px; font-weight: 800; line-height: 1; color: var(--c); }
.tile h3 { font-size: 24px; } .tile .ta { color: var(--c); font-weight: 700; font-size: 18px; line-height: 1.2; }
.tile p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.tile .age { position: absolute; top: 14px; right: 14px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--c) 14%, white); color: var(--ink); padding: 2px 10px 0; border-radius: 999px; }

/* game screen */
.screen { min-height: 70vh; padding-block: 18px 60px; }
.gh { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 800; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 8px 18px 6px; }
.gh h2 { font-size: clamp(26px, 3.4vw, 38px); } .gh .ta { color: var(--teal); font-size: 20px; font-weight: 700; }
.ask { font-size: 22px; font-weight: 700; margin: 0 0 14px; } .ask .ta { color: var(--teal); }
.panel { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.btn { font-weight: 800; font-size: 19px; border: 0; border-radius: 16px; padding: 12px 20px 9px; cursor: pointer; background: var(--sea); color: #fff; box-shadow: 0 4px 0 #1d6aa8; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d6aa8; }
.btn.soft { background: #eef4f8; color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* letter grid */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.lbtn { aspect-ratio: 1; border-radius: 20px; border: 0; cursor: pointer; font-size: 52px; font-weight: 800; color: #fff; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .12s; max-width: 100%; }
.lbtn:hover { transform: translateY(-3px); } .lbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.lbtn.sel { outline: 5px solid var(--sun); outline-offset: 2px; }
.show { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 18px; }
.show .L { font-size: clamp(90px, 14vw, 150px); font-weight: 800; line-height: 1; color: var(--kite); min-width: 1.2em; text-align: center; }
.show .pic svg { width: min(160px, 36vw); height: auto; }
.show .w { font-size: clamp(30px, 4vw, 46px); font-weight: 800; line-height: 1.15; } .show .w small { display: block; font-size: 22px; color: var(--muted); font-weight: 600; }
.show .row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

/* trace */
.trace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.tbox { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.tbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 340px; overflow: auto; padding: 4px; }
.mini button { aspect-ratio: 1; border: 2px solid var(--line); background: var(--paper); border-radius: 12px; font-size: 24px; font-weight: 800; cursor: pointer; font-family: inherit; color: var(--ink); }
.mini button.sel { background: var(--kite); color: #fff; border-color: var(--kite); }
.mini button.done { border-color: var(--leaf); }
.meter { height: 16px; border-radius: 999px; background: #eef4f8; overflow: hidden; margin: 10px 0 4px; } .meter i { display: block; height: 100%; width: 0; background: var(--leaf); border-radius: 999px; transition: width .25s; }

/* count / odd / pattern */
.objs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 180px; align-items: center; padding: 10px; }
.objs svg { width: 74px; height: 74px; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 16px; }
.choice { min-width: 110px; border: 0; border-radius: 22px; background: var(--paper); box-shadow: 0 6px 0 var(--line), var(--shadow); cursor: pointer; padding: 10px 18px 6px; font-size: 44px; font-weight: 800; color: var(--ink); }
.choice small { display: block; font-size: 17px; color: var(--teal); font-weight: 700; }
.choice:active { transform: translateY(4px); }
.choice.right { background: #dff5e6; box-shadow: 0 6px 0 var(--leaf); }
.choice.wrong { animation: shake .35s; background: #ffe6ec; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.choice svg { width: 84px; height: 84px; display: block; }
.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-items: center; }
.seq > div { width: 86px; height: 86px; border-radius: 18px; background: #f3f8fb; display: grid; place-items: center; }
.seq > div svg { width: 70px; height: 70px; }
.seq .q { border: 3px dashed var(--kite); background: #fff4ec; font-size: 44px; font-weight: 800; color: var(--kite); }

/* memory */
.mem { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 640px; margin: 0 auto; }
.card { aspect-ratio: 3/4; perspective: 800px; border: 0; background: none; padding: 0; cursor: pointer; max-width: 100%; }
.card .in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.card.open .in, .card.got .in { transform: rotateY(180deg); }
.card .f, .card .b { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; display: grid; place-items: center; box-shadow: var(--shadow); }
.card .b { background: repeating-linear-gradient(45deg, var(--kite) 0 14px, #f7894a 14px 28px); }
.card .b svg { width: 55%; height: 55%; }
.card .f { background: var(--paper); transform: rotateY(180deg); padding: 6px; text-align: center; }
.card .f svg { width: 78%; height: auto; }
.card .f .w { font-size: clamp(18px, 3.6vw, 30px); font-weight: 800; line-height: 1.1; } .card .f .w small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
.card.got .f { box-shadow: 0 0 0 4px var(--leaf); }

/* maze & colour */
.mazebox { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; touch-action: none; }
.mazebox canvas { width: 100%; height: 100%; display: block; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; margin-top: 14px; }
.pad button { height: 64px; border-radius: 16px; border: 0; background: var(--sea); color: #fff; font-size: 28px; cursor: pointer; box-shadow: 0 4px 0 #1d6aa8; }
.colour { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
.canvasart { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; display: grid; place-items: center; }
.canvasart svg { width: 100%; max-width: 460px; height: auto; }
.canvasart svg * { cursor: pointer; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatches button.sel { box-shadow: 0 0 0 4px var(--ink); }
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.picks button { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; padding: 6px; }
.picks button svg { width: 100%; height: 100%; }

/* shop + parents */
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prod { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.prod img { width: 100%; max-width: 200px; margin: 0 auto; border-radius: 8px; border: 1px solid var(--line); transform: rotate(-2deg); }
.prod .covers { display: flex; justify-content: center; } .prod .covers img { width: 48%; } .prod .covers img + img { margin-left: -12%; transform: rotate(4deg); }
.prod h3 { font-size: 22px; } .prod p { margin: 0; color: var(--muted); font-size: 16px; }
.price { display: flex; align-items: baseline; gap: 10px; margin-top: auto; } .price b { font-size: 34px; } .price s { color: var(--muted); }
.prod .cta { justify-content: center; font-size: 18px; }
.prod.best { outline: 4px solid var(--sun); position: relative; } .prod.best::after { content: "Best value"; position: absolute; top: -14px; right: 18px; background: var(--sun); font-weight: 800; padding: 3px 12px 1px; border-radius: 999px; font-size: 14px; }
.freebar { margin-top: 22px; background: var(--leaf); color: #fff; border-radius: var(--r); padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.freebar h3 { font-size: 24px; } .freebar p { margin: 0; opacity: .95; }
.freebar .num { font-weight: 800; font-size: 22px; background: rgba(255,255,255,.18); padding: 6px 14px 3px; border-radius: 12px; user-select: all; }
.freebar .cta { background: #fff; color: var(--leaf); box-shadow: 0 5px 0 rgba(0,0,0,.15); margin-left: auto; }
.parents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.parents div { background: var(--paper); border-radius: var(--r); padding: 20px; border: 2px solid var(--line); }
.parents h3 { font-size: 21px; margin-bottom: 6px; } .parents p { margin: 0; color: var(--muted); font-size: 16px; }
footer { background: var(--paper); border-top: 2px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 24px; color: var(--muted); font-size: 15px; align-items: center; }

/* celebration */
#party { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.6); z-index: 31; background: var(--paper); border-radius: 28px; padding: 18px 34px 12px; box-shadow: var(--shadow); text-align: center; opacity: 0; pointer-events: none; transition: all .25s cubic-bezier(.3,1.6,.6,1); }
.toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast b { display: block; font-size: 46px; color: var(--kite); line-height: 1.1; } .toast span { font-size: 22px; font-weight: 700; color: var(--teal); }
.note { font-size: 14px; color: var(--muted); margin-top: 8px; }


/* real life challenges */
.lifebanner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: center; background: var(--paper); border-radius: 28px; padding: 22px 26px; box-shadow: 0 6px 0 #c9dff0, var(--shadow); text-decoration: none; color: var(--ink); border: 3px solid transparent; transition: transform .15s; }
.lifebanner:hover { transform: translateY(-3px); border-color: var(--sea); }
.lifebanner h2 { font-size: clamp(28px, 3.4vw, 40px); } .lifebanner .ta { color: var(--teal); font-weight: 700; font-size: 20px; }
.lifebanner p { color: var(--muted); margin: 6px 0 14px; }
.lifebanner .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; } .lifebanner .chips span { font-size: 14px; font-weight: 700; padding: 3px 12px 1px; border-radius: 999px; background: #f0f6fb; }
.scene { width: 100%; height: auto; display: block; }
.lhero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; margin-bottom: 26px; }
.lhero h2 { font-size: clamp(32px, 4.4vw, 52px); } .lhero p { color: var(--muted); font-size: 19px; max-width: 40ch; }
.lsmall { color: var(--muted); font-size: 15px; font-weight: 600; }
.ltog { display: inline-flex; background: #eef4f8; border-radius: 999px; padding: 4px; gap: 2px; }
.ltog button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px 5px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--muted); }
.ltog button.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(32,48,64,.15); }
.lcats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lcat { --c: var(--kite); background: var(--paper); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 35%, white), var(--shadow); border: 3px solid transparent; transition: transform .15s; display: flex; flex-direction: column; }
.lcat:hover { transform: translateY(-4px); border-color: var(--c); }
.lcat .scene { border-radius: 0; }
.lcat-b { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lcat h3 { font-size: 23px; color: var(--c); } .lcat p { margin: 4px 0 10px; color: var(--muted); font-size: 15.5px; }
.lrow { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.lprog { display: flex; gap: 5px; } .lprog i { width: 14px; height: 14px; border-radius: 50%; background: #e3ecf2; } .lprog i.on { background: var(--c); }
.lplay { margin-left: auto; background: var(--c); color: #fff; font-weight: 800; padding: 6px 16px 4px; border-radius: 999px; }
.badge { width: 120px; height: 120px; } .badge.sm { width: 34px; height: 34px; }
.lnote { color: var(--muted); font-size: 15px; margin-top: 22px; max-width: 70ch; }
.lplayw .gh { align-items: center; } .lplayw .sp { flex: 1; }
.lsteps { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; color: var(--muted); }
.lsteps i { width: 44px; height: 10px; border-radius: 999px; background: #e3ecf2; } .lsteps i.done { background: var(--c); } .lsteps i.now { background: color-mix(in srgb, var(--c) 45%, white); }
.lcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: center; background: var(--paper); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.lqt { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; line-height: 1.3; margin: 0 0 6px; }
.lwhat { font-size: 19px; font-weight: 700; color: var(--teal); margin-bottom: 12px; }
.lsay { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.lopts { display: grid; gap: 12px; margin-top: 18px; }
.lopt { display: flex; align-items: center; gap: 14px; text-align: left; border: 3px solid transparent; background: var(--paper); border-radius: 20px; padding: 14px 18px; font-size: clamp(18px, 2vw, 22px); font-weight: 700; color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 var(--line), var(--shadow); min-height: 72px; transition: transform .12s; }
.lopt:hover:not(:disabled) { border-color: var(--c); transform: translateY(-2px); }
.lopt b { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 22px; }
.lopt.right { border-color: var(--leaf); background: #e5f7ec; } .lopt.right b { background: var(--leaf); }
.lopt.soft-no { opacity: .55; } .lopt:disabled { cursor: default; }
.lfb { margin-top: 16px; border-radius: var(--r); padding: 18px 22px; }
.lfb.ok { background: #e5f7ec; border: 3px solid var(--leaf); } .lfb.try { background: #fff6e0; border: 3px solid var(--sun); }
.lfbh { font-size: 26px; font-weight: 800; } .lfb.ok .lfbh { color: #24854a; } .lfb.try .lfbh { color: #a86f00; }
.lfb p { font-size: 19px; margin: 6px 0 12px; } .lfb.try p { margin-bottom: 0; }
.lparent { margin-top: 22px; background: #f3f8fb; border: 2px dashed var(--line); border-radius: var(--r); padding: 14px 20px; }
.lparent summary { cursor: pointer; font-weight: 800; font-size: 19px; color: var(--teal); }
.lparent dl { margin: 10px 0 0; display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 16px; }
.lparent dt { font-weight: 700; } .lparent dd { margin: 0; color: var(--muted); }
.lfinish { text-align: center; background: var(--paper); border-radius: 28px; padding: 36px 20px; box-shadow: var(--shadow); max-width: 640px; margin: 20px auto; }
.lfinish h2 { font-size: 40px; color: var(--c); } .lfinish p { font-size: 20px; }
@media (max-width: 900px) { .lifebanner, .lhero, .lcard { grid-template-columns: 1fr; } .lcats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lcats { grid-template-columns: 1fr; } .lparent dl { grid-template-columns: 1fr; } .lsteps i { width: 30px; } .lplayw .gh h2 { font-size: 24px; } }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 24px 16px; }
  .stage { height: 330px; }
  .trace, .colour { grid-template-columns: 1fr; }
  .shop, .parents { grid-template-columns: 1fr; }
  .navlinks { display: none; }
}
@media (max-width: 700px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .tile { padding: 14px; } .tile .art { height: 64px; } .tile .art .big { font-size: 46px; } .tile .art svg { width: 62px; height: 62px; }
  .tile h3 { font-size: 20px; } .tile .ta { font-size: 16px; } .tile p { display: none; } .tile .age { top: 10px; right: 10px; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .show { grid-template-columns: 1fr; text-align: center; } .show .row2 { justify-content: center; }
  .mem { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); } .lbtn { font-size: 40px; }
  .choice { min-width: 86px; font-size: 36px; }
  .objs svg { width: 56px; height: 56px; }
  .seq > div { width: 64px; height: 64px; } .seq > div svg { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

/* flagship cards + simulator */
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flags .lifebanner { grid-template-columns: 1fr; gap: 10px; }
.flags .lifebanner:hover { border-color: var(--fc); }
.flags .lifebanner > div:last-child { order: -1; }
.mascot { display: flex; align-items: center; gap: 12px; justify-content: center; }
.mascot svg { flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) { .mascot svg { animation: bob2 4s ease-in-out infinite; } @keyframes bob2 { 50% { transform: translateY(-8px) rotate(3deg); } } }
.speech { background: var(--paper); border-radius: 22px; padding: 14px 20px 10px; font-weight: 800; font-size: 21px; box-shadow: var(--shadow); position: relative; max-width: 300px; }
.speech::before { content: ""; position: absolute; left: -10px; top: 40%; border: 10px solid transparent; border-right-color: var(--paper); border-left: 0; }
.lcats.sims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mk { display: grid; grid-template-columns: 230px minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.mk-side { display: grid; gap: 14px; }
.wallet .big { font-size: 40px; font-weight: 800; line-height: 1.1; }
.moneyrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.slist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.slist li { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 4px 8px; border-radius: 12px; background: #f3f8fb; }
.slist li.got { background: #e5f7ec; } .slist li.got span::after { content: " ✓"; color: var(--leaf); }
.mk-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; background: linear-gradient(transparent 0 calc(100% - 10px), #e8b46b 0); padding: 6px; }
.prod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--paper); border: 3px solid transparent; border-radius: 18px; padding: 10px 6px 8px; cursor: pointer; box-shadow: 0 4px 0 var(--line), var(--shadow); color: var(--ink); }
.prod:hover:not(:disabled) { border-color: var(--sea); transform: translateY(-2px); } .prod:disabled { opacity: .6; cursor: default; }
.prod .pn { font-weight: 700; font-size: 15px; line-height: 1.15; text-align: center; }
.prod .tag { background: var(--sun); font-weight: 800; padding: 1px 10px 0; border-radius: 8px; font-size: 17px; }
.prod .cost { font-size: 12px; color: var(--muted); }
.prod .qty { position: absolute; top: -8px; right: -8px; background: var(--kite); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.mk-cart { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 74px); }
.citems { display: grid; gap: 6px; margin: 8px 0; min-height: 40px; }
.ci { display: grid; grid-template-columns: 30px 1fr auto 34px; align-items: center; gap: 8px; font-size: 15px; }
.minus { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #ffe6ec; font-size: 22px; font-weight: 800; cursor: pointer; color: var(--ink); }
.sums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 2px dashed var(--line); padding-top: 8px; font-variant-numeric: tabular-nums; }
.sums div { display: flex; flex-direction: column; } .sums span { font-size: 14px; color: var(--muted); } .sums b { font-size: 28px; } .sums b.neg { color: var(--berry); }
.sfb { color: #a86f00; font-weight: 700; min-height: 1.4em; margin: 8px 0; }
.sq { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-top: 20px; text-align: center; }
.sqq { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; margin: 0 0 8px; } .sq .moneyrow { justify-content: center; }
.hint { display: block; font-size: 18px; color: var(--teal); font-weight: 700; }
.choice.txt { font-size: 20px; padding: 14px 20px; }
.cashbox { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: #fff6d6; border: 2px solid var(--sun); border-radius: 999px; padding: 2px 12px 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.sh-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-bottom: 14px; }
.sh-scene { position: relative; } .order { position: absolute; left: 44%; top: 7%; width: 50%; font-weight: 800; font-size: clamp(14px, 1.6vw, 18px); line-height: 1.3; }
.olines { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; } .olines span { display: flex; align-items: center; gap: 4px; }
.bag { display: flex; flex-wrap: wrap; gap: 4px; min-height: 90px; align-items: center; background: #fbf3e6; border: 2px dashed #e8b46b; border-radius: 16px; padding: 8px; margin-top: 8px; }
table.pl { margin: 10px auto; font-size: 22px; border-collapse: collapse; font-variant-numeric: tabular-nums; } table.pl td { padding: 4px 14px; text-align: left; } table.pl td:last-child { text-align: right; font-weight: 800; } table.pl tr.p td { border-top: 3px solid var(--ink); color: #24854a; }
.slots { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.slots li { position: relative; min-height: 130px; border: 3px dashed var(--line); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 15px; padding: 6px; background: #f8fbfd; }
.slots li > span:first-child { position: absolute; top: 6px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.slots li.filled { border-style: solid; border-color: var(--leaf); background: #e5f7ec; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.scard { width: 140px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.2; background: var(--paper); border: 3px solid transparent; border-radius: 18px; padding: 10px 8px; cursor: pointer; box-shadow: 0 5px 0 var(--line), var(--shadow); color: var(--ink); }
.scard:hover { border-color: var(--leaf); } .scard.sel { border-color: var(--sea); background: #e6f2fd; } .scard.right { border-color: var(--leaf); background: #e5f7ec; } .scard.wrong { animation: shake .35s; background: #ffe6ec; }
.mm { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.jar { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; } .jar b { font-size: 17px; }
.jarbar { position: relative; width: 120px; height: 180px; border: 4px solid #203040; border-radius: 18px 18px 30px 30px; overflow: hidden; background: #f3f8fb; }
.jarbar i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#ffd34d, #e8a600); transition: height .5s; }
.jarbar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.week { margin-bottom: 12px; }
.witems { display: grid; gap: 10px; }
.witem { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); }
.witem b { display: block; font-size: 18px; } .witem .tag { background: var(--sun); font-weight: 800; padding: 0 8px; border-radius: 8px; margin-right: 6px; }
.nw { font-size: 13px; font-weight: 800; padding: 1px 8px; border-radius: 999px; } .nw.need { background: #dcefff; color: #1d6aa8; } .nw.want { background: #ffe3ee; color: #b0315f; }
.bs { display: flex; gap: 6px; } .bs .btn { padding: 8px 14px 6px; font-size: 16px; } .bs .btn.on { background: var(--sea); color: #fff; box-shadow: 0 4px 0 #1d6aa8; }
@media (max-width: 1000px) { .mk { grid-template-columns: 1fr 1fr; } .mk-shelf { grid-column: 1 / -1; order: 3; } .mk-cart { position: static; } }
@media (max-width: 900px) { .flags, .lcats.sims, .sh-top, .mm { grid-template-columns: 1fr; } .order { position: static; width: auto; margin-top: 8px; } }
@media (max-width: 600px) { .mk { grid-template-columns: 1fr; } .mk-cart { position: sticky; bottom: 0; top: auto; z-index: 4; } .mk-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } .prod svg { width: 54px; height: 54px; } .scard { width: calc(50% - 8px); } .witem { grid-template-columns: 48px 1fr; } .witem svg { width: 48px; height: 48px; } .witem .bs { grid-column: 1 / -1; } .speech { font-size: 17px; } }
.sh-scene .order { position: static; width: auto; margin-top: 10px; background: var(--paper); border: 3px solid var(--kite); border-radius: 18px; padding: 10px 14px; font-size: 18px; }
@media (max-width: 600px) { .mk-shelf { order: 2; } .mk-cart { order: 3; box-shadow: 0 -6px 20px rgba(32,48,64,.18); } .mk-cart .citems { max-height: 96px; overflow: auto; } .mk-cart .sums b { font-size: 22px; } }
