/* =========================================================================
   Kido — Design System
   "Storybook meadow": soft dreamy sky, blueberry + mango + watermelon accents.
   Deliberately NOT the flat primary-red/blue/yellow kids cliché.
   ========================================================================= */

:root {
  /* System-bar safe areas. The measured overlap of the WebView with the Android bars (--kido-inset-*, set by
     KidoOrientationPlugin) is authoritative once it exists: it knows where the WebView really sits. Capacitor
     SystemBars' value is only the bar size, so on a Galaxy Tab S6 (Android 12, WebView laid out between the bars)
     taking the max reserved the bars twice (Change #31). Before the plugin reports, and off Android, the largest of
     Capacitor's value and env() is used. On this app's Android WebView env() reported 0 under an edge-to-edge bar. */
  --kido-sa-top: var(--kido-inset-top, max(var(--safe-area-inset-top, 0px), env(safe-area-inset-top, 0px)));
  --kido-sa-right: var(--kido-inset-right, max(var(--safe-area-inset-right, 0px), env(safe-area-inset-right, 0px)));
  --kido-sa-bottom: var(--kido-inset-bottom, max(var(--safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px)));
  --kido-sa-left: var(--kido-inset-left, max(var(--safe-area-inset-left, 0px), env(safe-area-inset-left, 0px)));

  /* --- Core palette (Meadow & Berry) --- */
  --grape:      #6C4BD6;   /* primary brand / actions */
  --grape-deep: #4E32A8;
  --grape-soft: #EDE7FF;
  --mango:      #FFB020;   /* warm reward accent */
  --melon:      #FF6B8A;   /* playful accent */
  --leaf:       #38C172;   /* success / correct */
  --sky:        #63C7FF;   /* info / cool accent */
  --berry:      #B4308E;

  --ink:        #2B2151;   /* soft near-black text (never pure #000) */
  --ink-soft:   #6A5F8F;
  --surface:    #FFFDF8;   /* warm card white */
  --surface-2:  #F6F2FF;

  /* --- Sky background (dreamy vertical gradient) --- */
  --bg-top:     #CFE9FF;
  --bg-mid:     #E7DBFF;
  --bg-bot:     #FFE4EF;

  /* --- Semantic --- */
  --ok:   var(--leaf);
  --warn: var(--mango);
  --bad:  var(--melon);

  /* --- Shape + depth (soft, chunky, "felt" look) --- */
  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 32px;
  --r-pill: 999px;

  /* Layered soft shadows, tinted toward the brand not neutral grey */
  --shadow-sm: 0 3px 0 rgba(76,50,168,.14), 0 6px 16px rgba(76,50,168,.12);
  --shadow-md: 0 6px 0 rgba(76,50,168,.16), 0 14px 30px rgba(76,50,168,.16);
  --shadow-lg: 0 10px 0 rgba(76,50,168,.18), 0 26px 50px rgba(76,50,168,.22);

  --font-display: "Baloo 2", "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body:    "Fredoka", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;

  --tap: 56px;            /* generous default touch target for little fingers */
  --maxw: 1200px;         /* landscape widescreen content column */
  --gutter: clamp(16px, 2.5vw, 32px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bot) 100%);
  background-attachment: fixed;
  overflow: hidden;                 /* app manages its own scrolling regions */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;      /* iOS app / PWA: a long press on a picture must not open the save-image menu */
  touch-action: manipulation;
  font-size: 18px;
  line-height: 1.35;
}

/* Larger base text when the parent enables "Big text" */
body.big-text { font-size: 21px; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }

/* =========================================================================
   App shell
   ========================================================================= */
.app {
  position: relative;
  height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  outline: none;
  padding-bottom: 8px;
}
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: rgba(108,75,214,.25); border-radius: 99px; }

/* =========================================================================
   Splash
   ========================================================================= */
.splash {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, var(--grape) 0%, var(--berry) 100%);
  color: #fff;
  transition: opacity .5s ease, visibility .5s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__logo { display: flex; align-items: baseline; gap: 8px; }
.splash__mark { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 10.5vw, 64px); letter-spacing: -1px; white-space: nowrap; }   /* the app name fits a 320 px phone */
.splash__dot { width: 16px; height: 16px; border-radius: 99px; background: var(--mango); box-shadow: 0 0 0 6px rgba(255,176,32,.35); }
.splash__tag { font-size: 20px; opacity: .9; margin: 0; letter-spacing: 3px; }

/* =========================================================================
   Top bar (child header)
   ========================================================================= */
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: max(10px, var(--kido-sa-top)) var(--gutter) 10px;
  padding-top: calc(var(--kido-sa-top) + 10px);
}
.topbar__back {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--surface); color: var(--grape);
  font-size: 30px; font-weight: 700; line-height: 1;
  box-shadow: var(--shadow-sm);
  display: none; align-items: center; justify-content: center;
  padding-bottom: 3px;
}
.topbar.can-back .topbar__back { display: flex; }

.topbar__id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.avatar {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: var(--r-pill);
  background: var(--mango); box-shadow: var(--shadow-sm);
  font-size: 28px; display: grid; place-items: center;
}
.topbar__text { min-width: 0; }
.topbar__greeting { font-family: var(--font-display); font-weight: 700; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar__stats { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.star-count {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 14px 6px 10px; box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 700; color: var(--grape-deep);
}
.star-count__icon { font-size: 20px; }
.topbar__music {
  width: 46px; height: 46px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-size: 20px;
  cursor: pointer; transition: transform .15s ease, background .2s ease;
}
.topbar__music:hover { transform: scale(1.08); background: #FFF9E6; }
.topbar__music:active { transform: scale(0.94); }
.topbar__music.is-active { background: #FFF3D6; }
/* Change #28: Momo show/hide (js/mascot.js). Off = a faded Momo with a slash; the layer itself goes away. */
.topbar__momo .kido-icon, .scene-ctl__btn.js-momo-toggle .kido-icon { width: 30px; height: 28px; }
.js-momo-toggle { position: relative; }
.js-momo-toggle.is-off .kido-icon { filter: grayscale(1); opacity: .5; }
.js-momo-toggle.is-off::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 3px; border-radius: 2px;
  background: #8C84AE; transform: rotate(-40deg); pointer-events: none;
}
.momo-off .mascot-layer { display: none !important; }
.topbar__parent {
  width: 46px; height: 46px; border-radius: var(--r-pill);
  background: var(--grape); color: #fff; box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}

/* =========================================================================
   Tab bar (bottom nav)
   ========================================================================= */
.tabbar {
  flex: 0 0 auto;
  display: flex; justify-content: space-around; align-items: stretch;
  gap: 4px;
  padding: 8px 8px calc(var(--kido-sa-bottom) + 8px);
  background: rgba(255,253,248,.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 -6px 20px rgba(76,50,168,.12);
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
.tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: var(--r-md);
  color: var(--ink-soft); font-size: 11px; font-weight: 600;
  transition: transform .15s, background .15s, color .15s;
}
.tab__icon { font-size: 24px; line-height: 1; }
.tab.is-active { color: var(--grape-deep); background: var(--grape-soft); }
.tab.is-active .tab__icon { transform: translateY(-1px) scale(1.12); }
.tab:active { transform: scale(.92); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 26px;
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  background: var(--grape); color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform .12s ease, filter .12s;
}
.btn:active { transform: translateY(3px) scale(.98); filter: brightness(.97); box-shadow: var(--shadow-sm); }
.btn--mango { background: var(--mango); color: #5a3c00; }
.btn--melon { background: var(--melon); color: #6a1226; }
.btn--leaf  { background: var(--leaf);  color: #0c3d21; }
.btn--ghost { background: var(--surface); color: var(--grape-deep); }
.btn--block { display: flex; width: 100%; }
.btn--lg { font-size: 24px; min-height: 66px; }

/* =========================================================================
   Cards / generic surfaces
   ========================================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 max(var(--gutter), var(--kido-sa-right)) 0 max(var(--gutter), var(--kido-sa-left)); }

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  margin: 18px 0 12px; display: flex; align-items: center; gap: 10px;
}
.section-title small { font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--ink-soft); }

/* =========================================================================
   Age selection
   ========================================================================= */
.age {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--kido-sa-top) + 20px) max(var(--gutter), var(--kido-sa-right)) 28px max(var(--gutter), var(--kido-sa-left));
  text-align: center;
}
.age__title { font-size: 34px; margin-top: 6px; }
.age__sub { color: var(--ink-soft); margin: 6px 0 20px; font-size: 16px; }
.age__grid {
  display: grid; grid-template-columns: repeat(3, minmax(180px, 260px));
  justify-content: center;
  gap: 20px; width: 100%; max-width: 860px;
}
.age-card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 10px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .14s;
  border: 4px solid transparent;
}
.age-card:active { transform: scale(.95); }
.age-card__face { font-size: 46px; line-height: 1; }
.age-card__age { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--grape-deep); }
.age-card__label { font-size: 13px; color: var(--ink-soft); }
.age-card:nth-child(6n+1) { --tint: var(--melon); }
.age-card:nth-child(6n+2) { --tint: var(--mango); }
.age-card:nth-child(6n+3) { --tint: var(--leaf); }
.age-card:nth-child(6n+4) { --tint: var(--sky); }
.age-card:nth-child(6n+5) { --tint: var(--grape); }
.age-card:nth-child(6n+6) { --tint: var(--berry); }
.age-card__face { color: var(--tint); }

/* =========================================================================
   Activity Grid & Diegetic Floating Tiles
   ========================================================================= */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
  width: 100%;
  max-width: var(--maxw);
  margin: 16px auto 0;
  box-sizing: border-box;
}

/* Change #28: activity collections (tabs, regions, world lists) are one shelf that swipes SIDEWAYS and
   fills the screen, instead of a tall grid needing long vertical scrolls. 1-3 rows by available height;
   each tile's picture shrinks to fit its row. The page itself does not scroll, so there is one scroll. */
.wrap.shelf-page {   /* .wrap.: outranks .pad's tab-bar allowance (the tab bar is in the flow here) */
  height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
  padding-bottom: 10px; container-type: size; overflow: hidden;
}
.shelf-page > .section-title { flex: 0 0 auto; margin-bottom: 0; }
.shelf-page .cat-grid {
  --shelf-rows: 1;
  flex: 1 1 auto; min-height: 0; max-width: none; width: auto;
  margin: 8px calc(-1 * var(--gutter)) 0; padding: 6px var(--gutter) 12px;
  grid-template-columns: none; grid-auto-flow: column;
  grid-template-rows: repeat(var(--shelf-rows), minmax(0, 1fr));
  grid-auto-columns: clamp(150px, calc((100cqh - 70px) / var(--shelf-rows) * .78), 250px);
  gap: 14px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); -webkit-overflow-scrolling: touch;
}
@container (min-height: 360px) { .shelf-page .cat-grid { --shelf-rows: 2; } }
@container (min-height: 800px) { .shelf-page .cat-grid { --shelf-rows: 3; } }
@container (max-height: 499px) { .shelf-page .cat-tile__top { display: none; } }
.shelf-page .cat-tile { min-height: 0; scroll-snap-align: start; }
.shelf-page .cat-tile:hover { transform: translateY(-3px); }          /* no lift out of the shelf's clip */
.shelf-page .cat-tile__preview { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
/* the whole tile is the button: a round play icon leaves the full name room (up to two lines) */
.shelf-page .cat-tile__name {
  white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 16px; line-height: 1.15; overflow-wrap: anywhere;
}
.shelf-page .cat-tile__play-btn { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; padding: 0; justify-content: center; }
.shelf-page .cat-tile__meta { padding: 0 2px; }
@container (min-height: 500px) { .shelf-page .cat-tile__play-btn { top: auto; bottom: 12px; right: 12px; } .shelf-page .cat-tile__meta { padding-right: 40px; } }
.shelf-page .cat-tile__play-btn > span { display: none; }
.shelf-page .cat-grid::-webkit-scrollbar { height: 8px; }
.shelf-page .cat-grid::-webkit-scrollbar-thumb { background: rgba(108, 75, 214, .28); border-radius: 8px; }

.cat-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  border: 3.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px rgba(43, 33, 81, 0.10), 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease, border-color 0.2s;
  overflow: hidden;
  text-align: left;
  user-select: none;
}

.cat-tile:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 24px 46px rgba(43, 33, 81, 0.18), 0 0 0 3.5px var(--tile-border, #6C4BD6);
}

.cat-tile:active, .cat-tile.anim-press {
  transform: scale(0.96) !important;
  box-shadow: 0 6px 14px rgba(43, 33, 81, 0.14);
}

.cat-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cat-tile__tag {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent, var(--grape));
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  border-radius: 99px;
}
.cat-tile__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: #F0FDF4;
  color: #15803D;
}
.cat-tile__badge--new {
  background: #FFF7ED;
  color: #C2410C;
}

.cat-tile__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.95) 0%, rgba(240,240,250,0.65) 100%);
}
.cat-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.cat-tile:hover .cat-tile__img {
  transform: scale(1.08);
}
.cat-tile__preview img[src$=".png"], .cat-tile__preview img[src*="/fruits/art/"] {
  object-fit: contain;
  padding: 8px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.25));
}
.cat-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.cat-tile__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.cat-tile__play-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent, var(--grape));
  padding: 4px 10px;
  border-radius: 99px;
}

/* ---- Stepping Stone Daily Journey Trail ---- */
.journey {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 24px;
}
.journey-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(43, 33, 81, 0.08);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.journey-step:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px rgba(43, 33, 81, 0.14);
}
.journey-step:active {
  transform: scale(0.96) !important;
}
.journey-step.done {
  background: #F0FDF4;
  border-color: #86EFAC;
}
.journey-step.current {
  border-color: #FFB020;
  box-shadow: 0 10px 26px rgba(255, 176, 32, 0.24);
}
.journey-step__dot {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #EDE7FF;
  color: var(--grape);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}
.journey-step.done .journey-step__dot {
  background: #22C55E;
  color: #FFFFFF;
}
.journey-step.current .journey-step__dot {
  background: #FFB020;
  color: #FFFFFF;
}
.journey-step__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.journey-step__state {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* =========================================================================
   Full-Screen Minimal Gameplay HUD
   Change #28: the HUD floats OVER the game (the world-view pattern) instead of taking a row of the
   layout, so every game's own background fills the whole app viewport; no strip of the app's sky
   gradient shows above it. Game content starts below the HUD and the status-bar safe area (--hud-h).
   ========================================================================= */
body.in-gameplay { --hud-h: calc(var(--kido-sa-top) + 64px); }
body.in-gameplay .topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: none !important;
  padding: calc(var(--kido-sa-top) + 8px) max(16px, var(--kido-sa-right)) 8px max(16px, var(--kido-sa-left)) !important;
  pointer-events: none;
}
body.in-gameplay .screen > .game,
body.in-gameplay .screen > .runner,
body.in-gameplay .screen > .kd,
body.in-gameplay .screen > .pz,
body.in-gameplay .screen > .fruit-game-wrap,
body.in-gameplay .screen > .result { padding-top: var(--hud-h); box-sizing: border-box; }
/* In landscape the camera cutout is a side inset (36px on a OnePlus Nord CE4 Lite): keep game content out of it.
   The padding sits on the container, so its background still paints under the cutout. The runner stays full-bleed;
   results keep their own gutter (.result). */
body.in-gameplay .screen > .game,
body.in-gameplay .screen > .kd,
body.in-gameplay .screen > .pz,
body.in-gameplay .screen > .fruit-game-wrap { padding-left: var(--kido-sa-left); padding-right: var(--kido-sa-right); }
body.in-gameplay .topbar > * {
  pointer-events: auto;
}
body.in-gameplay .topbar__id {
  display: none !important;
}
body.in-gameplay .topbar__back {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  font-size: 32px !important;
}
body.in-gameplay .topbar__stats {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(8px);
  padding: 4px 12px !important;
  border-radius: 99px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
}
body.in-gameplay .topbar__parent {
  display: none !important;
}
body.in-gameplay .tabbar {
  display: none !important;
}
body.in-gameplay .screen {
  padding-bottom: 0 !important;
}

/* Category Theme Gradients */
.cat-tile--games {
  background: linear-gradient(165deg, #FFFFFF 0%, #FFF1F7 100%);
  --tile-border: #FF6B8A;
  --accent: #E11D48;
}
.cat-tile--animals {
  background: linear-gradient(165deg, #FFFFFF 0%, #F0FDF4 100%);
  --tile-border: #38C172;
  --accent: #15803D;
}
.cat-tile--birds {
  background: linear-gradient(165deg, #FFFFFF 0%, #F0F9FF 100%);
  --tile-border: #38BDF8;
  --accent: #0284C7;
}
.cat-tile--numbers {
  background: linear-gradient(165deg, #FFFFFF 0%, #FFFBEB 100%);
  --tile-border: #FBBF24;
  --accent: #D97706;
}
.cat-tile--words, .cat-tile--alphabet {
  background: linear-gradient(165deg, #FFFFFF 0%, #F5F3FF 100%);
  --tile-border: #818CF8;
  --accent: #6C4BD6;
}
.cat-tile--flowers {
  background: linear-gradient(165deg, #FFFFFF 0%, #FDF4FF 100%);
  --tile-border: #E879F9;
  --accent: #A21CAF;
}
.cat-tile--stories {
  background: linear-gradient(165deg, #FFFFFF 0%, #FFF7ED 100%);
  --tile-border: #FB923C;
  --accent: #C2410C;
}
.cat-tile--science, .cat-tile--structures, .cat-tile--habits {
  background: linear-gradient(165deg, #FFFFFF 0%, #ECFDF5 100%);
  --tile-border: #34D399;
  --accent: #047857;
}

/* Tile Top: Tag and Badge */
.cat-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 4px 0;
  gap: 6px;
}
.cat-tile__tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--accent, #6C4BD6);
  background: rgba(255, 255, 255, .85);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}
.cat-tile__badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.cat-tile__badge--new {
  background: linear-gradient(135deg, #FF6B8A, #F43F5E);
  color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(244, 63, 94, .35);
}
.cat-tile__badge--played {
  background: linear-gradient(135deg, #FDE047, #F59E0B);
  color: #713F12;
  box-shadow: 0 3px 8px rgba(245, 158, 11, .30);
}

/* Tile Preview / Artwork Frame — fit entire object cleanly without cropping */
.cat-tile__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F5F7FB 100%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .06), 0 6px 14px rgba(43, 33, 81, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
.cat-tile__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .12));
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.cat-tile:hover .cat-tile__img {
  transform: scale(1.06);
}
.cat-tile__gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .32) 0%, transparent 45%);
  pointer-events: none;
}
.cat-tile__preview--emoji {
  background: radial-gradient(circle, #FFFFFF 40%, rgba(237, 231, 255, .6) 100%);
}
/* One look for every tile picture (Change #11): a round medallion, like Kido's puzzle
   tokens and the Continue / Today's Adventure thumbnails. Photos fill the circle;
   cut-out art sits centred on a soft disc. Same size for every tile. */
.cat-tile__medal {
  position: relative; height: 100%; max-width: 100%; aspect-ratio: 1 / 1; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 30%, #FFFFFF 0%, #F6F2FF 60%, #E8E0F6 100%);
  box-shadow: 0 0 0 4px #FFFFFF, 0 8px 18px rgba(43, 33, 81, .16);
}
.cat-tile .cat-tile__preview--photo .cat-tile__img {
  width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover;
  padding: 0; border-radius: 0; filter: none;
}
.cat-tile .cat-tile__preview--art .cat-tile__img {
  width: 76%; height: 76%; object-fit: contain; padding: 0; border-radius: 0;
  filter: drop-shadow(0 6px 10px rgba(43, 33, 81, .18));
}
.cat-tile__glyph {
  font-size: clamp(52px, 14vw, 76px);
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15));
  transition: transform .25s ease;
}
.cat-tile:hover .cat-tile__glyph {
  transform: scale(1.15) rotate(3deg);
}

/* Tile Meta / Title + Play Action */
.cat-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0 4px;
}
.cat-tile__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: #2B2151;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.cat-tile__play-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent, #6C4BD6);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  flex: 0 0 auto;
  transition: transform .15s ease, filter .15s;
}
.cat-tile:hover .cat-tile__play-btn {
  transform: scale(1.08);
  filter: brightness(1.08);
}
.cat-tile.is-locked { opacity: .55; }
.cat-tile.is-locked::after { content: "🔒"; position: absolute; top: 10px; right: 12px; font-size: 18px; }

/* =========================================================================
   Daily journey
   ========================================================================= */
.journey { display: flex; flex-direction: column; gap: 10px; }
.journey-step {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.journey-step__dot {
  width: 40px; height: 40px; border-radius: 99px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 22px; color: #fff; background: var(--grape);
}
.journey-step__body { flex: 1 1 auto; min-width: 0; }
.journey-step__name { font-family: var(--font-display); font-weight: 700; }
.journey-step__state { font-size: 13px; color: var(--ink-soft); }
.journey-step.done .journey-step__dot { background: var(--leaf); }
.journey-step.locked { opacity: .6; }
.journey-step.locked .journey-step__dot { background: var(--ink-soft); }
.journey-step.current { outline: 3px solid var(--mango); }

/* =========================================================================
   Game surface (shared by engines)
   ========================================================================= */
.game { display: flex; flex-direction: column; min-height: 100%; }
.game__head {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 8px var(--gutter) 4px; text-align: center;
}
.game__prompt {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 6vw, 28px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.game__prompt:empty { display: none; }
.showcase--tappable { transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.showcase--tappable:active { transform: scale(0.92); }
.game__hint { font-size: 14px; color: var(--ink-soft); }
.game__progress {
  display: flex; gap: 6px; margin: 4px 0 2px;
}
.game__progress i { width: 12px; height: 12px; border-radius: 99px; background: rgba(76,50,168,.2); }
.game__progress i.done { background: var(--leaf); }
.game__progress i.current { background: var(--mango); transform: scale(1.25); }

.stage {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 10px var(--gutter) 20px; width: 100%; max-width: var(--maxw); margin: 0 auto;
}

/* The big "showcase" object at the top of a question */
.showcase {
  font-size: clamp(72px, 26vw, 150px); line-height: 1;
  filter: drop-shadow(0 12px 18px rgba(76,50,168,.22));
}
.showcase-word { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 10vw, 56px); color: var(--grape-deep); letter-spacing: 1px; }

/* Object row for "count the objects" (Realistic 3D Fruit Showcase) */
.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 3.5vw, 22px);
  justify-content: center;
  align-items: center;
  max-width: 580px;
  min-height: 95px;
  margin: 8px auto 14px;
  position: relative;
  z-index: 3;
}
.count-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.count-fruit-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: fruit-float 3s ease-in-out infinite alternate;
}
.count-fruit-wrap:nth-child(2) { animation-delay: -0.6s; }
.count-fruit-wrap:nth-child(3) { animation-delay: -1.2s; }
.count-fruit-wrap:nth-child(4) { animation-delay: -1.8s; }
.count-fruit-wrap:nth-child(5) { animation-delay: -2.4s; }
.count-fruit-wrap:nth-child(6) { animation-delay: -0.9s; }

.count-fruit-img {
  width: clamp(74px, 18vw, 115px);
  height: clamp(74px, 18vw, 115px);
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.count-fruit-wrap:hover .count-fruit-img {
  transform: scale(1.12) rotate(4deg);
}

@keyframes fruit-float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(2deg); }
}

.count-mini-group {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.8vw, 14px);
  justify-content: center;
  align-items: center;
  padding: 8px;
  max-width: 250px;
}
.count-fruit-img--mini {
  width: clamp(50px, 10.5vw, 76px) !important;
  height: clamp(50px, 10.5vw, 76px) !important;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
}
.count-mini-img {
  width: clamp(38px, 9vw, 54px);
  height: clamp(38px, 9vw, 54px);
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* =========================================================================
   Kids-Attractive & Attentive Sunlit Orchard Background (Count It!)
   ========================================================================= */
.game--orchard {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% 15%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 245, 190, 0.3) 40%, rgba(135, 206, 250, 0) 80%),
    linear-gradient(180deg, #87CEEB 0%, #BFE7FF 32%, #E8F5E9 55%, #C8E6C9 70%, #81C784 100%);
}

.game--orchard::before {
  content: "";
  position: absolute;
  inset: -15px;
  background: url("../assets/img/sunny-park.svg") center 40% / cover no-repeat;
  filter: blur(2.5px) brightness(1.05) saturate(1.18);
  transform: scale(1.04);
  opacity: 0.90;
  z-index: 0;
  pointer-events: none;
}

.game--orchard::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* Center focal glow on the fruit showcase */
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.25) 32%, transparent 62%),
    /* Soft framing vignette */
    linear-gradient(180deg, rgba(20, 45, 15, 0.22) 0%, transparent 22%, transparent 75%, rgba(15, 35, 10, 0.35) 100%);
  pointer-events: none;
  z-index: 1;
}

.game--orchard .game__head,
.game--orchard .stage {
  position: relative;
  z-index: 2;
}

.game--orchard .game__prompt {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: clamp(24px, 6.5vw, 32px);
  font-weight: 700;
  color: #1F2937;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 24px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

/* =========================================================================
   Lush 3D Pixar Jungle Safari Theme (Find the Bird & Find the Animal)
   Atmospheric jungle environment with high-contrast spotlight focus on animals
   ========================================================================= */
.game--safari {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(254, 240, 138, 0.35) 0%, rgba(34, 197, 94, 0.15) 45%, transparent 80%),
    linear-gradient(180deg, #14532D 0%, #166534 30%, #15803D 60%, #052E16 100%);
}

.game--safari::before {
  content: "";
  position: absolute;
  inset: -15px;
  background: url("../assets/img/scenes/jungle-safari-bg.svg") center 40% / cover no-repeat;
  filter: blur(2.5px) brightness(0.96) saturate(1.22);
  transform: scale(1.05);
  opacity: 0.95;
  z-index: 0;
  pointer-events: none;
}

.game--safari::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* Center luminous spotlight directly illuminating the animal & bird cards */
    radial-gradient(ellipse 80% 60% at 50% 55%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.14) 42%, transparent 72%),
    /* Soft tropical canopy vignette */
    linear-gradient(180deg, rgba(5, 25, 10, 0.35) 0%, transparent 18%, transparent 75%, rgba(4, 18, 8, 0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

.game--safari .game__head,
.game--safari .stage {
  position: relative;
  z-index: 2;
}

/* Crisp Frosted Prompt Badge */
.game--safari .game__prompt {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: clamp(24px, 6.5vw, 32px);
  font-weight: 700;
  color: #14532D;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 30, 10, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border: 2.5px solid rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}
.game--safari .game__prompt b {
  color: #E11D48;
}

/* Change #16 (M-2): the hint under the badge sat straight on the dark foliage (< 2.1:1).
   A small frosted pill — lighter than the title badge, so it stays secondary — keeps it readable. */
.game--safari .game__hint {
  font-size: 15px; font-weight: 600; color: #14532D;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 14px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 30, 10, 0.18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.game--safari .game__hint:empty { display: none; }

/* Safari Progress Indicator Dots */
.game--safari .game__progress i {
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.game--safari .game__progress i.done {
  background: #22C55E;
  border-color: #DCFCE7;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}
.game--safari .game__progress i.current {
  background: #FACC15;
  border-color: #FEF08A;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.9);
}

/* Focus and Enhance Animal / Bird Option Cards */
.game--safari .options {
  max-width: 580px;
}
.game--safari .options .opt--pic {
  background: #FFFFFF !important;
  border: 4.5px solid #FFFFFF !important;
  border-radius: 34px !important;
  box-shadow:
    0 20px 42px rgba(4, 28, 12, 0.36),
    0 6px 16px rgba(0, 0, 0, 0.14),
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease !important;
  overflow: visible !important;
}
.game--safari .options .opt--pic img,
.game--safari .options .opt--pic svg {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.15));
  transition: transform 0.2s ease;
}
.game--safari .options .opt--pic:hover {
  transform: translateY(-8px) scale(1.04) !important;
  border-color: #FDE047 !important;
  box-shadow:
    0 26px 50px rgba(4, 35, 14, 0.44),
    0 0 0 4px #FACC15,
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
}
.game--safari .options .opt--pic:hover img,
.game--safari .options .opt--pic:hover svg {
  transform: scale(1.05);
}
.game--safari .options .opt--pic:active {
  transform: scale(0.96) !important;
}
.game--safari .options .opt--pic.is-correct {
  background: #DCFCE7 !important;
  border-color: #22C55E !important;
  box-shadow:
    0 0 0 6px rgba(34, 197, 94, 0.4),
    0 22px 44px rgba(22, 101, 52, 0.45) !important;
}

/* =========================================================================
   Vibrant 3D Indian Courtyard Theme (Hindi Swar, Vyanjan & Varnamala)
   Festive palace courtyard with warm sunbeams, marigold garlands, and bokeh depth
   ========================================================================= */
.game--hindi {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 25%, rgba(254, 240, 138, 0.4) 0%, rgba(251, 146, 60, 0.2) 45%, transparent 80%),
    linear-gradient(180deg, #7C2D12 0%, #C2410C 30%, #EA580C 60%, #431407 100%);
}

.game--hindi::before {
  content: "";
  position: absolute;
  inset: -18px;
  background: url("../assets/img/scenes/hindi-courtyard-bg.svg") center 45% / cover no-repeat;
  filter: blur(2.5px) brightness(0.97) saturate(1.18);
  transform: scale(1.05);
  opacity: 0.94;
  z-index: 0;
  pointer-events: none;
}

.game--hindi::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* Center warm golden spotlight directly behind the Hindi letter showcase & options */
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 245, 220, 0.24) 42%, transparent 72%),
    /* Soft festive framing vignette */
    linear-gradient(180deg, rgba(67, 20, 7, 0.32) 0%, transparent 18%, transparent 75%, rgba(67, 20, 7, 0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

.game--hindi .game__head,
.game--hindi .stage {
  position: relative;
  z-index: 2;
}

/* Festive Marigold Progress Dots */
.game--hindi .game__progress i {
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.game--hindi .game__progress i.done {
  background: #16A34A;
  border-color: #DCFCE7;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.85);
}
.game--hindi .game__progress i.current {
  background: #F59E0B;
  border-color: #FEF3C7;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.95);
  transform: scale(1.3);
}

/* Showcase Object in Hindi Courtyard */
.game--hindi .showcase {
  filter: drop-shadow(0 14px 24px rgba(67, 20, 7, 0.35));
}

/* Enhanced High-Contrast Hindi Letter Option Cards */
.game--hindi .options .opt {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 3.5px solid #FFFFFF !important;
  border-radius: 32px !important;
  box-shadow:
    0 18px 36px rgba(67, 20, 7, 0.24),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
  color: #431407 !important;
  font-family: var(--font-display, "Baloo 2", sans-serif) !important;
  font-weight: 800 !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease !important;
}
.game--hindi .options .opt:hover {
  transform: translateY(-8px) scale(1.05) !important;
  border-color: #FBBF24 !important;
  box-shadow:
    0 24px 48px rgba(67, 20, 7, 0.34),
    0 0 0 4px #F59E0B,
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
}
.game--hindi .options .opt:active {
  transform: scale(0.95) !important;
}
.game--hindi .options .opt.is-correct {
  background: #FEF3C7 !important;
  border-color: #F59E0B !important;
  box-shadow:
    0 0 0 6px rgba(245, 158, 11, 0.45),
    0 22px 44px rgba(180, 83, 9, 0.4) !important;
}

/* =========================================================================
   Hindi Match Presentation in Courtyard
   ========================================================================= */
.game--hindi .match {
  position: relative;
  z-index: 2;
}
.game--hindi .match__pool .chip {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 3px solid #FEF3C7 !important;
  box-shadow: 0 12px 28px rgba(67, 20, 7, 0.28) !important;
  color: #431407 !important;
  font-weight: 800;
}
.game--hindi .match__targets .slot {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 3.5px dashed #F59E0B !important;
  box-shadow: 0 14px 30px rgba(67, 20, 7, 0.22) !important;
}
.game--hindi .slot__key {
  color: #7C2D12 !important;
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
}

/* =========================================================================
   Real Human Body Parts Theme (game--body)
   Bright, modern Montessori / wellness learning studio
   ========================================================================= */
.game--body {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 65% at 50% 25%, rgba(224, 242, 254, 0.7) 0%, rgba(186, 230, 253, 0.35) 45%, transparent 80%),
    linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 35%, #F0FDF4 70%, #DCFCE7 100%);
}

.game--body::before {
  content: "";
  position: absolute;
  inset: -15px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.8) 0%, transparent 28%),
    radial-gradient(circle at 82% 35%, rgba(254, 240, 138, 0.5) 0%, transparent 32%),
    radial-gradient(circle at 50% 80%, rgba(220, 252, 231, 0.6) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 60%, rgba(240, 253, 244, 0.8) 100%);
  pointer-events: none;
  z-index: 0;
}

.game--body .game__head,
.game--body .stage {
  position: relative;
  z-index: 2;
}

/* Real Child Body Showcase */
.body-showcase-real {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  width: clamp(140px, 26vw, 210px);
  height: clamp(180px, 34vw, 270px);
  position: relative;
}

.body-real-child-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(15, 23, 42, 0.22));
  animation: child-gentle-breathe 4s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes child-gentle-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.02); }
}

/* Real Human Body Option Cards */
.game--body .options {
  max-width: 580px;
}
.game--body .options .opt--pic {
  background: #FFFFFF !important;
  border: 4px solid #FFFFFF !important;
  border-radius: 32px !important;
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
  padding: 12px !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.game--body .options .opt--pic img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease;
}
.game--body .options .opt--pic svg.body-opt-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: block;
}
.game--body .options .opt--pic:hover {
  transform: translateY(-8px) scale(1.05) !important;
  border-color: #38BDF8 !important;
  box-shadow:
    0 24px 48px rgba(2, 132, 199, 0.25),
    0 0 0 4px #7DD3FC,
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
}
.game--body .options .opt--pic.is-correct {
  background: #DCFCE7 !important;
  border-color: #22C55E !important;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.4), 0 22px 44px rgba(22, 101, 52, 0.3) !important;
}

/* =========================================================================
   Cozy Home & Good Habits Theme (game--home)
   Sunlit children's bedroom / morning playroom
   ========================================================================= */
.game--home {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(254, 240, 138, 0.5) 0%, rgba(253, 186, 116, 0.3) 40%, transparent 75%),
    linear-gradient(180deg, #FEF3C7 0%, #FFEDD5 40%, #FED7AA 75%, #FDBA74 100%);
}

.game--home::before {
  content: "";
  position: absolute;
  inset: -15px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.7) 0%, transparent 35%),
    radial-gradient(circle at 75% 25%, rgba(254, 215, 170, 0.6) 0%, transparent 40%),
    /* Soft morning sunbeams */
    linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, transparent 45%, rgba(251, 146, 60, 0.15) 100%);
  pointer-events: none;
  z-index: 0;
}

.game--home .game__head,
.game--home .stage {
  position: relative;
  z-index: 2;
}

/* Habit Choice Large Photo Cards */
.habit-opt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
}
.habit-opt-card__img {
  width: clamp(100px, 20vw, 150px);
  height: clamp(100px, 20vw, 150px);
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(180, 83, 9, 0.18);
  transition: transform 0.22s ease;
}
.habit-opt-card__name {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 800;
  color: #7C2D12;
  text-align: center;
  line-height: 1.25;
}
.habit-opt-card__emoji {
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 1;
}

.game--home .options {
  max-width: 620px;
}
.game--home .options .opt {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 4px solid #FFFFFF !important;
  border-radius: 34px !important;
  box-shadow:
    0 18px 40px rgba(154, 52, 18, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
  padding: 16px 14px !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.game--home .options .opt:hover {
  transform: translateY(-8px) scale(1.04) !important;
  border-color: #FBBF24 !important;
  box-shadow:
    0 26px 52px rgba(180, 83, 9, 0.28),
    0 0 0 4px #F59E0B,
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
}
.game--home .options .opt:hover .habit-opt-card__img {
  transform: scale(1.06);
}
.game--home .options .opt.is-correct {
  background: #DCFCE7 !important;
  border-color: #22C55E !important;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.45), 0 24px 48px rgba(22, 101, 52, 0.35) !important;
}

/* =========================================================================
   Vehicle City Theme (game--city)
   ========================================================================= */
.game--city {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% 20%, rgba(186, 230, 253, 0.5) 0%, transparent 70%),
    linear-gradient(180deg, #38BDF8 0%, #7DD3FC 35%, #E0F2FE 65%, #94A3B8 100%);
}
.game--city::before {
  content: "";
  position: absolute;
  inset: -15px;
  background: url("../assets/img/scenes/city-runner-bg.svg") center bottom / cover no-repeat;
  filter: blur(2px) brightness(0.98);
  opacity: 0.88;
  transform: scale(1.04);
  pointer-events: none;
  z-index: 0;
}
.game--city .game__head,
.game--city .stage {
  position: relative;
  z-index: 2;
}

/* =========================================================================
   Enchanted Alphabet Meadow (game--alphabet)
   ========================================================================= */
.game--alphabet {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 65% at 50% 20%, rgba(254, 240, 138, 0.45) 0%, transparent 65%),
    linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 30%, #BBF7D0 65%, #4ADE80 100%);
}
.game--alphabet .game__head,
.game--alphabet .stage {
  position: relative;
  z-index: 2;
}

/* =========================================================================
   Shapes & Logic Arcade Room (game--shapes)
   ========================================================================= */
.game--shapes {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 65% at 50% 20%, rgba(233, 213, 255, 0.6) 0%, transparent 65%),
    linear-gradient(180deg, #F3E8FF 0%, #E9D5FF 35%, #DDD6FE 70%, #C4B5FD 100%);
}
.game--shapes .game__head,
.game--shapes .stage {
  position: relative;
  z-index: 2;
}

/* Sound Games Safari Presentation */
.game--safari .sound-game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 28px;
  position: relative;
  z-index: 2;
}

.game--safari .arcade__status {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 20, 10, 0.6);
  background: rgba(20, 83, 45, 0.65);
  padding: 5px 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  display: inline-block;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game--safari .btn--play-sound {
  font-family: var(--font-display, "Baloo 2", sans-serif) !important;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem) !important;
  font-weight: 700 !important;
  padding: 12px 34px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #22C55E 0%, #15803D 100%) !important;
  color: #FFFFFF !important;
  border: 3px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 12px 28px rgba(4, 35, 14, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 14px auto 0 !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease !important;
}
.game--safari .btn--play-sound:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 18px 36px rgba(4, 35, 14, 0.55), 0 0 0 4px #FACC15 !important;
}
.game--safari .btn--play-sound:active {
  transform: scale(0.96) !important;
}

.sound-game-options {
  display: grid !important;
  gap: clamp(16px, 3.5vw, 32px) !important;
  width: 100% !important;
  max-width: clamp(380px, 85vw, 680px) !important;
  margin: 22px auto 0 !important;
  justify-content: center !important;
  align-items: center !important;
  position: relative !important;
  z-index: 2 !important;
}
.sound-game-options.cols-2 {
  grid-template-columns: repeat(2, minmax(180px, 240px)) !important;
}
.sound-game-options.cols-3 {
  grid-template-columns: repeat(3, minmax(150px, 200px)) !important;
}
.sound-game-options.cols-4 {
  grid-template-columns: repeat(2, minmax(160px, 220px)) !important;
}

.sound-game-options .opt--animal-card {
  width: 100% !important;
  aspect-ratio: 1 / 1.18 !important;
  min-height: clamp(200px, 32vw, 290px) !important;
}

.sound-game-options .opt--animal-card .opt__name {
  display: block !important;
  font-family: var(--font-display, "Baloo 2", sans-serif) !important;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem) !important;
  font-weight: 700 !important;
  margin-top: 10px !important;
  color: #14532D !important;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8) !important;
  line-height: 1.1 !important;
}

/* Answer options */
.options {
  display: grid;
  gap: clamp(10px, 2.5vw, 14px);
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
}
.options.cols-1 { grid-template-columns: 1fr; }
.options.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.options.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 40% Reduced Compact Option Boxes for Numbers */
.options:has(.opt--number),
.game--orchard .options:has(.opt--number) {
  max-width: 310px !important;
  gap: 12px;
  margin: 0 auto;
}

/* Fruit Group Comparison Cards (More or Less) - Frosted Glass Aesthetics */
.options:has(.opt--fruit-group),
.options:has(.count-mini-group),
.game--orchard .options:has(.opt--fruit-group),
.game--orchard .options:has(.count-mini-group) {
  max-width: 620px !important;
  width: 92% !important;
  gap: clamp(14px, 3vw, 24px) !important;
  margin: 0 auto !important;
  grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
}

.opt--fruit-group,
.opt:has(.count-mini-group) {
  background: rgba(255, 255, 255, 0.40) !important;
  backdrop-filter: blur(14px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
  border: 3.5px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: 28px !important;
  box-shadow: 0 14px 34px rgba(20, 45, 20, 0.16), 0 4px 10px rgba(0, 0, 0, 0.08), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
  padding: clamp(12px, 2.5vw, 20px) !important;
  min-height: clamp(160px, 34vh, 250px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease !important;
  cursor: pointer;
  overflow: visible !important;
}

.opt--fruit-group:hover,
.opt:has(.count-mini-group):hover {
  transform: translateY(-5px) scale(1.025) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  border-color: #68D391 !important;
  box-shadow: 0 18px 40px rgba(25, 60, 25, 0.24), 0 6px 16px rgba(0, 0, 0, 0.1) !important;
}

.opt--fruit-group:active,
.opt:has(.count-mini-group):active {
  transform: scale(0.96) !important;
}

.opt--fruit-group.is-correct,
.opt:has(.count-mini-group).is-correct {
  background: rgba(72, 187, 120, 0.45) !important;
  border-color: #48BB78 !important;
  box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.35), 0 16px 36px rgba(40, 140, 70, 0.3) !important;
}

.opt {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 78px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 6.5vw, 30px);
  padding: 12px; transition: transform .12s, background .2s, color .2s, box-shadow .2s;
  border: 4px solid transparent; line-height: 1.05;
  overflow: hidden;
}

/* Compact 40% Reduced Number Button */
.opt--number {
  min-height: 0 !important;
  max-width: 145px !important;
  max-height: 140px !important;
  aspect-ratio: 1.05 / 1 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 8px 20px rgba(25, 45, 20, 0.14), 0 2px 5px rgba(0, 0, 0, 0.06), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
  border: 3.5px solid rgba(255, 255, 255, 0.92) !important;
  font-family: var(--font-display, "Baloo 2", sans-serif) !important;
  font-size: clamp(34px, 8vw, 44px) !important;
  font-weight: 800 !important;
  color: #2D3748 !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.15s ease !important;
  user-select: none;
}

.opt--number:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 12px 24px rgba(25, 45, 20, 0.22) !important;
  border-color: #68D391 !important;
}

.opt--number:active {
  transform: scale(0.94) !important;
}

.opt--number.is-correct {
  background: linear-gradient(135deg, #48BB78 0%, #38A169 100%) !important;
  color: #FFFFFF !important;
  border-color: #2F855A !important;
  box-shadow: 0 8px 24px rgba(56, 161, 105, 0.45) !important;
}

.opt--number.is-wrong {
  background: linear-gradient(135deg, #F56565 0%, #E53E3E 100%) !important;
  color: #FFFFFF !important;
  border-color: #C53030 !important;
  box-shadow: 0 8px 24px rgba(229, 62, 62, 0.4) !important;
}

/* Pictorial options (emoji / letter / creature photo) */
.opt--pic {
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: clamp(6px, 2vw, 12px);
  font-size: clamp(48px, 14vw, 84px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.options.cols-3 .opt--pic {
  padding: clamp(6px, 1.6vw, 10px);
  font-size: clamp(38px, 11vw, 68px);
}
.opt--pic .opt__label {
  font-family: var(--font-body); font-weight: 700; font-size: clamp(13px, 4vw, 17px);
  color: var(--ink-soft); line-height: 1;
}
.opt small { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.opt:active { transform: scale(.95); }
.opt.is-correct { background: var(--leaf); color: #06371d; border-color: #1f8a4d; }
.opt.is-wrong { background: var(--melon); color: #6a1226; animation: shake .4s; }
.opt.is-disabled { pointer-events: none; opacity: .6; }

/* Staggered sequential option pop-in */
.opt--staged {
  opacity: 0 !important;
  transform: scale(0.65) translateY(14px) !important;
  pointer-events: none !important;
  transition: none !important;
}
.opt.anim-pop-in {
  animation: optPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}
@keyframes optPopIn {
  0% { opacity: 0; transform: scale(0.65) translateY(14px); }
  70% { opacity: 1; transform: scale(1.06) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 3D Boy Hero Showcase in My Body Game */
.showcase-boy {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 8px !important;
  width: 100% !important;
  max-width: 240px !important;
  height: clamp(160px, 26vh, 230px) !important;
  position: relative !important;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15)) !important;
  animation: boyGentleFloat 3.5s ease-in-out infinite !important;
}
.body-boy-hero {
  height: 100% !important;
  width: auto !important;
  max-height: 230px !important;
  max-width: 100% !important;
  object-fit: contain !important;
  display: block !important;
}
@keyframes boyGentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* =========================================================================
   Match / drag-drop
   ========================================================================= */
.match { display: flex; flex-direction: row; gap: clamp(20px, 3vw, 40px); width: 100%; max-width: var(--maxw); justify-content: center; align-items: flex-start; }
.match__pool { flex: 1 1 45%; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; min-height: 84px; }
.chip {
  min-width: 82px; min-height: 82px; padding: 8px 14px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: clamp(44px, 13vw, 62px); font-family: var(--font-display); font-weight: 700;
  touch-action: none; transition: transform .1s, opacity .2s;
}
.chip.dragging { opacity: .35; }
.chip.ghost {
  position: fixed; z-index: 60; pointer-events: none; margin: 0;
  transform: translate(-50%, -50%) scale(1.1); box-shadow: var(--shadow-lg);
}
.chip small { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

.match__targets { flex: 1 1 55%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.slot {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--r-lg); background: var(--surface-2);
  border: 3px dashed rgba(108,75,214,.35);
  padding: 10px; min-height: 88px;
}
.slot__key { font-size: clamp(48px, 14vw, 66px); flex: 0 0 auto; }
.slot__label { font-size: 13px; color: var(--ink-soft); }
.slot__drop {
  flex: 1 1 auto; min-height: 72px; border-radius: var(--r-md);
  display: grid; place-items: center; background: rgba(255,255,255,.6);
  font-size: clamp(44px, 13vw, 60px);
}
.slot.over { border-color: var(--grape); background: var(--grape-soft); transform: scale(1.02); }
.slot.filled { border-style: solid; border-color: var(--leaf); background: #E9FBEF; }

/* =========================================================================
   Soundboard (tap animals/vehicles/birds)
   ========================================================================= */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.board-tile {
  border-radius: 24px; background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(43, 33, 81, .1), 0 2px 6px rgba(0, 0, 0, .04);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding: 8px 8px 12px; gap: 8px;
  cursor: pointer; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
  overflow: hidden;
}
.board-tile:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 32px rgba(43, 33, 81, .16), 0 0 0 3px #FFC24B;
}
.board-tile:active { transform: scale(.94); }
.board-tile__emoji {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 18px;
  overflow: hidden;
  background: #F8F9FD;
  font-size: clamp(74px, 20vw, 98px);
  user-select: none;
}
.board-tile__name {
  font-size: 15px;
  font-weight: 700;
  color: #2B2151;
  letter-spacing: .2px;
  line-height: 1.2;
}

/* =========================================================================
   Sequence / ordering
   ========================================================================= */
.seq { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 520px; align-items: center; }
.seq__track { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.seq__box {
  width: 76px; height: 76px; border-radius: var(--r-md);
  background: var(--surface-2); border: 3px dashed rgba(108,75,214,.35);
  display: grid; place-items: center; font-size: clamp(36px, 11vw, 50px); font-family: var(--font-display); font-weight: 700;
}
.seq__box.filled { background: var(--surface); border-style: solid; border-color: var(--leaf); }
.seq__box.q { background: var(--mango); color: #5a3c00; border: none; }

/* =========================================================================
   Assembly (electronics / build)
   ========================================================================= */
.assembly { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 560px; }
.assembly__frame {
  position: relative; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-md); min-height: 280px; padding: 16px; overflow: hidden;
}
.assembly__backdrop-bridge,
.assembly__backdrop-house {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  border-radius: var(--r-lg); overflow: hidden;
}
.assembly__backdrop-bridge svg,
.assembly__backdrop-house svg {
  width: 100%; height: 100%; display: block;
}
.assembly__frame--bridge .assembly__base,
.assembly__frame--house .assembly__base {
  display: none;
}
.assembly__base {
  position: absolute; inset: 16px; border-radius: var(--r-md);
  border: 3px dashed rgba(108,75,214,.25); display: grid; place-items: center;
  color: var(--ink-soft); font-size: 14px; text-align: center;
}
.build-slot {
  position: absolute; border-radius: var(--r-sm);
  border: 3px dashed rgba(108,75,214,.55); background: rgba(255,255,255,.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink);
  transition: background .2s, border-color .2s, transform .2s; z-index: 2;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}
.build-slot.over { background: var(--grape-soft); border-color: var(--grape); transform: scale(1.02); }
.build-slot.filled {
  border: none; background: transparent; padding: 0; font-size: 0;
  box-shadow: none; pointer-events: none;
}
.build-slot.filled svg {
  width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2));
}
.chip__art-preview {
  width: 58px; height: 38px; display: flex; align-items: center; justify-content: center;
}
.chip__art-preview svg {
  max-width: 100%; max-height: 100%; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.bridge-crossing-car {
  position: absolute; pointer-events: none; z-index: 12;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}
.assembly__frame.house-built-celebrate {
  animation: housePulse 0.8s ease-in-out infinite alternate;
}
@keyframes housePulse {
  0% { filter: drop-shadow(0 0 6px rgba(254, 240, 138, 0.4)); }
  100% { filter: drop-shadow(0 0 20px rgba(254, 240, 138, 0.9)); }
}

/* =========================================================================
   Electronics / Build a Computer Workstation
   ========================================================================= */
.board--gadget {
  max-width: 920px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
}
.board-tile--gadget {
  min-height: 190px;
  padding: 14px 12px 18px;
  border-radius: 24px;
  border: 2px solid rgba(2, 132, 199, 0.15);
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.board-tile--gadget:hover {
  border-color: #0284C7;
  box-shadow: 0 16px 32px rgba(2, 132, 199, 0.2), 0 0 0 4px rgba(56, 189, 248, 0.35);
}
.board-tile--gadget .board-tile__emoji {
  height: 110px;
  background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.board-tile--gadget .board-tile__emoji svg {
  max-width: 90%;
  max-height: 90%;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.15));
}
.board-tile--gadget .board-tile__name {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.assembly--electronics {
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  gap: 20px;
}
.assembly--electronics .assembly__frame--desk {
  min-height: 420px;
  height: clamp(380px, 48vh, 460px);
  position: relative;
  border-radius: 28px;
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 58%, #78350F 58%, #92400E 63%, #B45309 68%, #D97706 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), inset 0 2px 0 rgba(255,255,255,0.7);
  border: 4px solid #FFFFFF;
  overflow: hidden;
  padding: 0;
}
.assembly--electronics .assembly__base {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  inset: auto;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 800;
  color: #0369A1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
  letter-spacing: 0.4px;
  z-index: 1;
}
.build-slot--gadget {
  position: absolute;
  border-radius: 20px;
  border: 3px dashed #0284C7;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #0369A1;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.14);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  padding: 8px;
  text-align: center;
  cursor: pointer;
}
.build-slot--gadget:hover,
.build-slot--gadget.over {
  border-color: #22C55E;
  background: rgba(240, 253, 244, 0.95);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.25), 0 10px 24px rgba(34, 197, 94, 0.3);
  transform: scale(1.04);
  color: #15803D;
}
.build-slot--gadget.filled {
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  padding: 0;
}
.build-slot--gadget.filled svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.3));
  animation: gadgetSnap 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gadgetSnap {
  0% { transform: scale(0.6); opacity: 0.4; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.match__pool--gadget {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding: 10px;
  min-height: 120px;
}
.chip--gadget {
  min-width: 124px;
  min-height: 114px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: grab;
  touch-action: none;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease;
  border: 2px solid transparent;
}
.chip--gadget:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.25), 0 0 0 3px #38BDF8;
  border-color: #38BDF8;
}
.chip--gadget:active {
  cursor: grabbing;
  transform: scale(0.96);
}
.chip--gadget .chip__art {
  width: 90px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip--gadget .chip__art svg {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.chip--gadget small {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.3px;
}
/* Ghost clone when dragging — stays large, bold, and easy to aim */
.chip--gadget.ghost {
  min-width: 154px;
  min-height: 138px;
  padding: 12px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(2, 132, 199, 0.45), 0 0 0 5px #0284C7;
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 1000;
  pointer-events: none;
}
.chip--gadget.ghost .chip__art {
  width: 115px;
  height: 82px;
}
.chip--gadget.ghost .chip__art svg {
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.22));
}
.chip--gadget.ghost small {
  font-size: 17px;
  font-weight: 900;
  color: #0284C7;
}

/* =========================================================================
   Result / celebration screen
   ========================================================================= */
.result {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 30px max(var(--gutter), var(--kido-sa-right)) 30px max(var(--gutter), var(--kido-sa-left));
}
.result__emoji { font-size: 96px; }
.result__title { font-size: 34px; }
.result__stars { display: flex; gap: 8px; margin: 10px 0; }
.result__stars span { font-size: 46px; }
.result__msg { color: var(--ink-soft); max-width: 360px; }
.result__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; width: 100%; max-width: 340px; }
.result__hero, .result__more { display: contents; }   /* Change #28: grouping only used side by side (responsive.css) */

/* =========================================================================
   Rewards screen
   ========================================================================= */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.badge {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 16px 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.badge__icon { font-size: 44px; }
.badge__name { font-size: 12px; font-weight: 700; }
.badge.locked { opacity: .45; filter: grayscale(.7); }

/* =========================================================================
   Toast + mascot bubble
   ========================================================================= */
.toast-layer { position: fixed; left: 0; right: 0; bottom: 84px; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; box-shadow: var(--shadow-md);
  animation: pop-in .3s ease, fade-out .3s ease 1.4s forwards;
}
.toast--ok { background: var(--leaf); color: #06371d; }
.toast--bad { background: var(--melon); color: #6a1226; }

.mascot-layer { position: fixed; left: 12px; bottom: 92px; z-index: 65; display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.mascot-bubble {
  background: var(--surface); color: var(--ink); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 6px;
  padding: 12px 16px; box-shadow: var(--shadow-md); font-weight: 600; max-width: 260px;
  animation: pop-in .35s ease;
}
.mascot-avatar { width: 72px; height: 72px; flex: 0 0 auto; }

/* =========================================================================
   Modal (parent gate, settings, dialogs)
   ========================================================================= */
.modal-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(43,33,81,.5); backdrop-filter: blur(3px); }
/* Change #28: dialogs stay clear of the Android status / navigation bars */
.modal-layer:not(.is-zone) { padding: calc(var(--kido-sa-top) + 16px) calc(var(--kido-sa-right) + 16px) calc(var(--kido-sa-bottom) + 16px) calc(var(--kido-sa-left) + 16px); }
.modal-layer:not(.is-zone) > .modal { max-height: min(88vh, calc(100dvh - var(--kido-sa-top) - var(--kido-sa-bottom) - 32px)); }
.modal {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 22px; max-height: 88vh; overflow-y: auto;
  animation: pop-in .3s ease;
}
.modal__title { font-size: 24px; margin-bottom: 6px; }
.modal__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(108,75,214,.12); }
.modal__row:last-of-type { border-bottom: none; }
.modal__label { font-weight: 600; }
.modal__label small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }

/* Toggle switch */
.switch { position: relative; width: 62px; height: 34px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch__track { position: absolute; inset: 0; background: rgba(108,75,214,.25); border-radius: 99px; transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 99px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch__track { background: var(--leaf); }
.switch input:checked + .switch__track::after { transform: translateX(28px); }
/* Parent area — Sound panel (Change #6): Mute all, Music, one slider per channel */
.sound-panel { margin: 10px 0 4px; padding: 6px 12px 12px; background: var(--surface-2); border-radius: 16px; }
.sound-panel__title { padding-top: 6px; }
.sound-panel .modal__row { padding: 9px 0; }
.vol { cursor: pointer; }
.vol__ctl { display: flex; align-items: center; gap: 8px; flex: 0 0 210px; min-width: 0; }
.vol__range { flex: 1 1 auto; min-width: 0; height: 34px; margin: 0; accent-color: var(--grape); cursor: pointer; }
@media (max-width: 480px) {          /* phones: label above a full-width slider, every row alike */
  .vol { flex-direction: column; align-items: stretch; gap: 0; }
  .vol__ctl { flex: 1 1 auto; }
}
.vol__range:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; border-radius: 8px; }
.vol__pct { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-soft, inherit); }
.sound-panel__reset { margin-top: 8px; min-height: 44px; }
/* Characters talk while their line is spoken (story cast, Momo). .is-talking sits on the
   actor's wrapper; the mood classes live on the inner .kido-char (scene.css, loaded later),
   hence the extra specificity. */
.is-talking .kido-char .kc-mouth.kc-mouth { display: none; }
.is-talking .kido-char .m-open.kc-mouth { display: block; transform-box: fill-box; transform-origin: 50% 20%; animation: kc-talk .28s ease-in-out infinite alternate; }
@keyframes kc-talk { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.reduce-motion .is-talking .kido-char .m-open.kc-mouth { animation: none; }
@media (prefers-reduced-motion: reduce) { .is-talking .kido-char .m-open.kc-mouth { animation: none; } }

/* Stat readouts in parent area */
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 8px 0 16px; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 12px; text-align: center; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--grape-deep); }
.stat__label { font-size: 12px; color: var(--ink-soft); }

.hold-btn {
  position: relative; overflow: hidden; width: 100%;
}
.hold-btn__fill { position: absolute; inset: 0; background: rgba(255,255,255,.35); width: 0%; }

/* =========================================================================
   Word Run (runner) game
   ========================================================================= */
.runner { display: flex; flex-direction: column; min-height: 100%; }
.runner__head { text-align: center; padding: 8px var(--gutter) 0; }
.runner__head .game__prompt { justify-content: center; }
.runner__head b { color: var(--melon); font-size: 1.3em; }
.runner__scene {
  position: relative; flex: 1 1 auto; min-height: 330px; overflow: hidden;
  margin: 10px 0;
  background-color: #BAE6FD;
  background-image: url("../assets/img/scenes/city-runner-bg.svg");
  background-repeat: repeat-x;
  background-position: 0 bottom;
  background-size: auto 100%;
  border-radius: var(--r-lg, 24px);
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.runner__road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 18%;
  background: linear-gradient(180deg, #334155 0%, #1E293B 40%, #0F172A 100%);
  border-top: 4px solid #64748B;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 1;
}
.runner__curb {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: repeating-linear-gradient(90deg, #F8FAFC 0 30px, #E2E8F0 30px 60px);
}
.runner__lane-stripes {
  position: absolute; top: 50%; left: 0; right: 0; height: 4px;
  margin-top: -2px;
  background: repeating-linear-gradient(90deg, #FACC15 0 45px, transparent 45px 85px);
  opacity: 0.9;
}
.runner__char {
  position: absolute; left: 14%; bottom: 14%; width: 104px; height: 104px; z-index: 4;
  transform-origin: 50% 50%;
  will-change: transform;
  filter: drop-shadow(0 12px 14px rgba(15, 23, 42, 0.38)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.22));
  pointer-events: none;
  transition: none;
}
.runner__char svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.runner__char.flipping {
  filter: drop-shadow(0 16px 24px rgba(15, 23, 42, 0.48)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Hero picker: shown before the run (Change #28); the run starts once a hero is chosen */
.runner { position: relative; }
.runner__pick {
  position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 16px; background: rgba(30, 27, 75, .42); backdrop-filter: blur(3px);
}
.runner__pick-title {
  font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--grape-deep);
  background: #fff; border-radius: 999px; padding: 6px 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.runner__pick-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.runner__pick-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 170px; padding: 10px 10px 12px;
  background: #fff; border: 4px solid transparent; border-radius: 24px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.runner__pick-card:active { transform: scale(.96); }
.runner__pick-card.is-last { border-color: var(--mango); }
.runner__pick-card:focus-visible { outline: 4px solid var(--grape); outline-offset: 3px; }
.runner__pick-art { width: 120px; height: 120px; display: block; }
.runner__pick-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.runner__bubbles { position: absolute; inset: 0 8% 26% 32%; z-index: 2; display: flex; align-items: center; justify-content: space-around; }
.run-bubble {
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-md);
  font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--grape-deep);
  display: grid; place-items: center; animation: bubble-bob 2.2s ease-in-out infinite;
}
.run-bubble.got { background: var(--leaf); color: #06371d; transform: scale(1.1); }
.run-bubble.miss { background: var(--melon); color: #6a1226; }
.runner__word { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 6px var(--gutter) 20px; }
.run-box {
  min-width: 44px; height: 52px; padding: 0 6px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 3px dashed rgba(108,75,214,.3);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--grape-deep);
}
.run-box:not(.got) { color: rgba(76, 52, 160, .32); }   /* the word, faint until each letter is caught */
.run-box.got { background: var(--leaf); color: #06371d; border-style: solid; border-color: #1f8a4d; }
.run-box.next { border-color: var(--mango); animation: pulse 1.2s ease-in-out infinite; }

/* Tap-to-jump runner: floating letters + rolling obstacles. Positioned by
   inline left/bottom (percent of scene); centred with margin so `transform`
   stays free for the bob animation. Layer ignores pointer events so a tap
   anywhere reaches the scene and makes the hero jump. */
.runner__items { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.run-letter {
  position: absolute; margin-left: -32px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #FEF08A 0%, #FACC15 50%, #CA8A04 100%);
  border: 3px solid #FEF9C3;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.7), 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  display: grid; place-items: center;
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-weight: 800; font-size: 32px; color: #713F12;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8), 0 -1px 1px rgba(0, 0, 0, 0.2);
  animation: letter-float 1.8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 3;
}
@keyframes letter-float {
  0% { transform: translateY(0) scale(1); filter: brightness(1); }
  100% { transform: translateY(-8px) scale(1.06); filter: brightness(1.14); }
}
.run-rock {
  position: absolute; margin-left: -27px; width: 54px; height: 54px;
  display: grid; place-items: center;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.run-rock svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25)); }
.run-rock.cleared { opacity: 0.45; transform: scale(0.9); }
.run-rock.hit { opacity: 0.55; filter: grayscale(0.5); transform: rotate(15deg); }

.runner-reveal-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 220px; height: 260px;
  background: #fff;
  border: 4px solid #FFD700;
  border-radius: 24px;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.75), 0 16px 36px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 10px; box-sizing: border-box;
  z-index: 10;
  animation: pop-in .4s cubic-bezier(.34, 1.56, .64, 1);
}
.runner-reveal-pic {
  width: 100%; height: 180px;
  border-radius: 16px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #f4f6fc;
}
.runner-reveal-pic .kido-creature { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.runner-reveal-pic .creature-img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.runner-reveal-badge {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 6px 10px; border-radius: 12px;
  background: var(--grape-deep, #4E32A8); color: #fff;
  font-family: var(--font-display, 'Baloo 2', sans-serif); font-weight: 800; font-size: 20px;
}

/* =========================================================================
   Story player
   ========================================================================= */
.story { display: flex; flex-direction: column; min-height: 100%; }
.story__stage {
  position: relative; flex: 1 1 auto; min-height: 220px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #d9ecff, #fef0f6);
}
.story__bg { font-size: clamp(64px, 24vw, 130px); text-align: center; line-height: 1.2; animation: float 4s ease-in-out infinite; }
.story__card {
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg); padding: 20px var(--gutter) calc(var(--kido-sa-bottom) + 20px);
  display: flex; flex-direction: column; gap: 14px;
}
.story__text { font-size: 20px; font-weight: 500; margin: 0; line-height: 1.4; }
.story__q { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--grape-deep); }
.story__choices { display: flex; flex-direction: column; gap: 10px; }
.story__choices .btn { font-size: 18px; }

.pad { padding: 12px max(var(--gutter), var(--kido-sa-right)) calc(var(--kido-sa-bottom) + 96px) max(var(--gutter), var(--kido-sa-left)); }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { height: 10px; }
[hidden] { display: none !important; }

/* =========================================================================
   WORLD-CLASS POLISH — living mascot, tactile juice, depth, stickers
   Appended enhancements; reduced-motion is neutralised globally in
   animations.css, so these stay calm automatically when motion is reduced.
   ========================================================================= */

/* ---- Momo, alive: the rigged Scene-Engine character as global guide ---- */
.actor.mascot-momo {
  position: relative; inset: auto;
  width: 84px; height: 104px; flex: 0 0 auto;
  cursor: pointer; transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 12px rgba(76,50,168,.28));
}
.mascot-momo.mascot-pop { animation: mascot-pop .5s cubic-bezier(.34,1.56,.64,1); }
.mascot-bubble { transform-origin: bottom left; }
.mascot-bubble--pop { animation: mascot-bubble-pop .4s cubic-bezier(.34,1.56,.64,1); }

/* Change #28: in a game Momo docks in the HUD's top-right corner as a small talking guide, so he never
   covers the game's instructions or controls. His line is still spoken; the bubble shows beside him
   only where the HUD row has room for it (the game shows its own instruction text). */
body.in-gameplay .mascot-layer {
  top: calc(var(--kido-sa-top) + 2px); bottom: auto; left: auto; right: max(10px, var(--kido-sa-right));
  flex-direction: row-reverse; align-items: center; gap: 6px; max-width: none; z-index: 21; pointer-events: none;
}
body.in-gameplay .actor.mascot-momo { width: 50px !important; height: 60px !important; pointer-events: auto; transform-origin: 50% 0; }
body.in-gameplay .mascot-bubble { display: none; }
@media (min-width: 720px) {
  body.in-gameplay .mascot-bubble {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    max-width: min(360px, calc(100vw - 420px)); padding: 7px 12px; font-size: 14px; line-height: 1.3;
    border-radius: var(--r-lg) 6px var(--r-lg) var(--r-lg); transform-origin: top right;
  }
}

/* ---- Tactile buttons & tiles: spring press, hover-lift, focus ring ---- */
.btn { transition: transform .14s cubic-bezier(.34,1.56,.64,1), filter .12s, box-shadow .14s; }
.opt, .cat-tile, .age-card, .board-tile, .journey-step, .chip {
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, background .2s, border-color .2s;
}
@media (hover: hover) {
  .btn:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .opt:hover, .cat-tile:hover, .age-card:hover, .board-tile:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-lg);
  }
  .stop__node:hover { transform: scale(1.05) rotate(-2deg); }
  .journey-step:hover { transform: translateX(3px); }
}
.btn:focus-visible, .opt:focus-visible, .cat-tile:focus-visible, .age-card:focus-visible,
.board-tile:focus-visible, .tab:focus-visible, .stop__node:focus-visible, .journey-step:focus-visible,
.chip:focus-visible, .slot:focus-visible, .build-slot:focus-visible, .bubble:focus-visible {
  outline: 4px solid var(--sky); outline-offset: 3px;
}
/* Tap/keyboard placement: a "picked up" chip stands out until it is dropped on a slot. */
.chip.is-picked {
  outline: 4px solid var(--grape); outline-offset: 2px;
  transform: translateY(-4px) scale(1.06); box-shadow: var(--shadow-lg);
  background: var(--grape-soft); z-index: 3;
}
/* Soft top highlight gives option/cat cards a chunky "candy" depth. */
.opt, .cat-tile, .age-card { background-image: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0) 44%); }
.opt.is-correct { background-image: none; }

/* Each freshly-rendered screen eases in. */
.screen > * { animation: screen-in .32s ease both; }

/* ---- Collectible stickers (rewards collection) ---- */
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
.sticker {
  position: relative; aspect-ratio: 1;
  background: radial-gradient(circle at 50% 36%, #fff 0%, var(--surface-2) 80%);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 3px solid rgba(255,255,255,.9);
}
.sticker__emoji { font-size: clamp(38px, 11vw, 52px); line-height: 1; filter: drop-shadow(0 4px 6px rgba(76,50,168,.25)); }
.sticker__name { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: center; padding: 0 4px; }
.sticker.locked { filter: grayscale(1) opacity(.4); }
.sticker.locked .sticker__emoji { filter: none; }
.sticker.is-new::after {
  content: "NEW"; position: absolute; top: -8px; right: -6px;
  background: var(--melon); color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 10px; letter-spacing: .5px; padding: 3px 8px; border-radius: 99px; box-shadow: var(--shadow-sm);
}
/* ---- Sticker reveal on the result screen ---- */
.result__stickers { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.reveal-sticker {
  width: 96px; padding: 12px 8px 10px; border-radius: var(--r-lg);
  background: radial-gradient(circle at 50% 32%, #fff, var(--grape-soft));
  box-shadow: var(--shadow-md); text-align: center;
  animation: sticker-pop .6s cubic-bezier(.34,1.56,.64,1) both;
}
.reveal-sticker:nth-child(2) { animation-delay: .12s; }
.reveal-sticker:nth-child(3) { animation-delay: .24s; }
.reveal-sticker__emoji { font-size: 48px; line-height: 1; }
.reveal-sticker__label { font-size: 12px; font-weight: 700; color: var(--grape-deep); margin-top: 4px; }
.reveal-sticker__tag { font-size: 10px; font-weight: 800; color: var(--melon); text-transform: uppercase; letter-spacing: .5px; }

/* High contrast: firmer sticker edges. */
.high-contrast .sticker, .high-contrast .reveal-sticker { border: 2px solid var(--ink); }

/* =========================================================================
   ARCADE — mini-games (Tic-Tac-Toe, Memory Match, Shape Sorter, Bubble Pop, Beat)
   ========================================================================= */
.arcade { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.arcade__status {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--grape-deep); min-height: 22px; text-align: center;
}

/* --- Tic-Tac-Toe --- */
.ttt {
  /* minmax(0,1fr) — not the default minmax(auto,1fr) — so a track can shrink
     below its content's intrinsic size. Explicit rows do the same vertically.
     This stops a placed piece from ever widening/heightening its track. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%; max-width: min(340px, calc(100% - 32px)); aspect-ratio: 1;
  margin-inline: auto;
  background: var(--grape-soft); padding: 12px; border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.ttt__cell {
  /* min-width/height:0 lets the cell honour the 0-min track; container-type:size
     makes the cell size independent of its contents; overflow:hidden guarantees
     a piece is clipped to the cell rather than spilling into the board. */
  min-width: 0; min-height: 0; overflow: hidden; container-type: size;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; line-height: 1;
  transition: transform .12s, background .2s;
}
.ttt__cell:active { transform: scale(.94); }
.ttt__cell.win { background: #E9FBEF; animation: pop-correct .55s ease; }
.ttt__cell > span {
  display: inline-block; line-height: 1; animation: pop-in .3s ease;
  /* Fallback for engines without container units — still clipped by the cell. */
  font-size: clamp(28px, 11vw, 60px);
  /* Preferred: sized to the cell itself, so the piece always fits inside it. */
  font-size: 70cqmin;
}

/* --- Memory Match (flip cards) --- */
.memory { display: grid; gap: 14px; width: 100%; max-width: 700px; }
.mem-card { position: relative; aspect-ratio: 1; border-radius: var(--r-md); background: transparent; border: 0; padding: 0; cursor: pointer; perspective: 700px; }
.mem-card__inner { position: absolute; inset: 0; border-radius: var(--r-md); transition: transform .35s; transform-style: preserve-3d; }
.mem-card.flipped .mem-card__inner, .mem-card.done .mem-card__inner { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; border-radius: var(--r-md); display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-sm); }
.mem-face--back { background: linear-gradient(160deg, var(--grape), var(--berry)); color: #fff; font-size: clamp(26px, 9vw, 40px); }
.mem-face--front { background: var(--surface); transform: rotateY(180deg); font-size: clamp(40px, 13vw, 66px); }
.mem-card.done .mem-face--front { background: #E9FBEF; animation: pop-correct .55s ease; }

/* --- Safari Memory Match (Jungle Theme) --- */
.game--safari .arcade {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: 24px;
}

.game--safari .memory {
  display: grid;
  gap: clamp(12px, 2.5vw, 20px);
  width: 100%;
  max-width: 680px;
  margin: 12px auto 0;
  perspective: 1000px;
}

.game--safari .mem-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 26px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  perspective: 900px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game--safari .mem-card:hover {
  transform: translateY(-5px) scale(1.03);
}
.game--safari .mem-card:active {
  transform: scale(0.96);
}

.game--safari .mem-card__inner {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform-style: preserve-3d;
}

.game--safari .mem-face {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* Safari Mystery Card Back: Lush emerald leaves texture, golden border, glowing embossed mark */
.game--safari .mem-face--back {
  background:
    radial-gradient(circle at 50% 25%, rgba(254, 240, 138, 0.3) 0%, transparent 65%),
    linear-gradient(145deg, #15803D 0%, #166534 50%, #052E16 100%);
  border: 3.5px solid rgba(254, 240, 138, 0.9);
  box-shadow:
    0 12px 28px rgba(0, 30, 15, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.35);
  color: #FEF08A;
}

.game--safari .mem-face--back .mem-back-mark {
  font-size: clamp(34px, 8vw, 54px);
  filter: drop-shadow(0 4px 10px rgba(0, 30, 10, 0.7)) drop-shadow(0 0 14px rgba(254, 240, 138, 0.75));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game--safari .mem-card:hover .mem-face--back .mem-back-mark {
  transform: scale(1.18) rotate(6deg);
}

/* Safari Animal Card Front: Clean studio white backing, emerald border, crisp animal photography */
.game--safari .mem-face--front {
  background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%);
  border: 3.5px solid #22C55E;
  box-shadow:
    0 14px 30px rgba(0, 30, 15, 0.4),
    inset 0 2px 0 #FFFFFF;
  transform: rotateY(180deg);
  padding: 10px;
}

.game--safari .mem-face--front .kido-creature {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.game--safari .mem-face--front .creature-img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.16));
}

.game--safari .mem-face--front svg {
  width: 86%;
  height: 86%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.16));
}

.game--safari .mem-face--front .creature-emoji {
  font-size: clamp(44px, 12vw, 68px);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2));
}

/* Matched celebration state */
.game--safari .mem-card.done .mem-face--front {
  background: linear-gradient(180deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: #16A34A;
  box-shadow:
    0 0 28px rgba(34, 197, 94, 0.75),
    0 0 0 4px #4ADE80,
    0 14px 28px rgba(0, 30, 15, 0.35);
  animation: pop-correct 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* --- Bubble Pop (falling bubbles, tap the target) --- */
.bubble-field {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: clamp(420px, 66vh, 580px);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 45%, #F0FDF4 80%, #BBF7D0 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.8);
  border: 4px solid #FFFFFF;
}
.bubble-field__clouds {
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 50px;
  pointer-events: none;
  opacity: 0.6;
  background: radial-gradient(ellipse 70px 22px at 18% 40%, #FFFFFF 70%, transparent 100%),
              radial-gradient(ellipse 90px 28px at 78% 30%, #FFFFFF 70%, transparent 100%),
              radial-gradient(ellipse 60px 18px at 48% 50%, #FFFFFF 70%, transparent 100%);
}
.bubble-field__grass {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(34, 197, 94, 0.2) 100%);
  border-bottom: 8px solid #4ADE80;
}
.bubble {
  position: absolute;
  top: 0;
  left: 0;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.65) 20%, rgba(186,230,253,0.35) 45%, rgba(192,132,252,0.22) 70%, rgba(56,189,248,0.45) 100%);
  box-shadow: inset 0 -8px 16px rgba(14,165,233,0.25), inset 0 6px 12px rgba(255,255,255,0.8), 0 8px 24px rgba(56,189,248,0.22);
  border: 2px solid rgba(255,255,255,0.85);
  transition: transform 0.12s ease;
  will-change: transform;
  z-index: 2;
}
.bubble::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 14px;
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-35deg);
  pointer-events: none;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: 9px;
  right: 14px;
  width: 14px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  transform: rotate(-30deg);
  pointer-events: none;
}
.bubble__content {
  font-size: 46px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
}
.bubble__content img,
.bubble__content .creature-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}
.bubble--target {
  border-color: #FEF08A;
  box-shadow: inset 0 -8px 16px rgba(250,204,21,0.25), inset 0 6px 12px rgba(255,255,255,0.9), 0 0 20px rgba(250,204,21,0.45), 0 8px 24px rgba(56,189,248,0.22);
}
.bubble:active {
  transform: scale(0.92) !important;
}
.bubble.pop {
  animation: bubblePopBurst 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none;
}
@keyframes bubblePopBurst {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.35); opacity: 0.95; filter: brightness(1.6); }
  100% { transform: scale(1.85); opacity: 0; filter: blur(4px); }
}
.bubble.wobble {
  animation: bubbleWobble 0.4s ease-in-out !important;
}
@keyframes bubbleWobble {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(0.85, 1.18) rotate(-9deg); }
  50% { transform: scale(1.18, 0.85) rotate(9deg); }
  75% { transform: scale(0.92, 1.08) rotate(-4deg); }
}
.bubble-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3.5px solid #38BDF8;
  pointer-events: none;
  animation: bubbleRingExpand 0.38s ease-out forwards;
  z-index: 3;
}
@keyframes bubbleRingExpand {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}

/* --- Beat (Rainbow Piano keyboard, repeat-the-melody memory keys) --- */
.piano-chassis {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border-radius: 32px;
  padding: 20px 20px 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14), inset 0 2px 0 #FFFFFF;
  border: 4px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  user-select: none;
}
.piano-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}
.piano-brand {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}
.piano-brand span {
  background: linear-gradient(90deg, #FF6584, #FF9234, #FFD13B, #3BD671, #26C6DA, #5C6BC0, #AB47BC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.piano-speaker {
  width: 50px;
  height: 18px;
  background: radial-gradient(circle, #CBD5E1 30%, transparent 35%) 0 0 / 8px 8px;
  opacity: 0.7;
}
.piano-tracker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 4px 16px;
  background: #F1F5F9;
  border-radius: 999px;
  width: fit-content;
  margin: 0 auto;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.piano-dot {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
  opacity: 0.45;
}
.piano-dot.active {
  opacity: 1;
  transform: scale(1.3);
  animation: dotPulse 0.8s ease-in-out infinite alternate;
}
.piano-dot.done {
  opacity: 1;
  transform: scale(1.15);
}
@keyframes dotPulse {
  0% { transform: scale(1.15); filter: drop-shadow(0 0 2px #FDE047); }
  100% { transform: scale(1.35); filter: drop-shadow(0 0 8px #F59E0B); }
}

.piano-bed {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  padding: 18px 14px 22px;
  border-radius: 22px;
  box-shadow: inset 0 6px 14px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.1);
  overflow-x: auto;
  overflow-y: hidden;
}

.piano-key {
  position: relative;
  flex: 1;
  min-width: 44px;
  max-width: 84px;
  height: clamp(190px, 32vh, 240px);
  border-radius: 12px 12px 20px 20px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 6px 16px;
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.22), 0 8px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.4, 1), box-shadow 0.12s ease, filter 0.12s ease;
  overflow: visible;
}
.piano-key__top-reflect {
  position: absolute;
  top: 8px;
  left: 10%;
  width: 80%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}
.piano-key__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.piano-key__note {
  font-family: var(--font-display, "Baloo 2", sans-serif);
  font-size: 26px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  line-height: 1;
}
.piano-key__solfege {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
}

/* Individual Piano Key Rainbow Colors */
.piano-key--c4 { background: linear-gradient(180deg, #FF7B95 0%, #FF5376 70%, #E11D48 100%); --key-glow: #FF5376; }
.piano-key--d4 { background: linear-gradient(180deg, #FFA756 0%, #FF8A22 70%, #EA580C 100%); --key-glow: #FF8A22; }
.piano-key--e4 { background: linear-gradient(180deg, #FFE066 0%, #FFCC00 70%, #D97706 100%); --key-glow: #FFCC00; }
.piano-key--f4 { background: linear-gradient(180deg, #5EE48E 0%, #34D366 70%, #16A34A 100%); --key-glow: #34D366; }
.piano-key--g4 { background: linear-gradient(180deg, #48DCF0 0%, #06B6D4 70%, #0891B2 100%); --key-glow: #06B6D4; }
.piano-key--a4 { background: linear-gradient(180deg, #818CF8 0%, #6366F1 70%, #4338CA 100%); --key-glow: #6366F1; }
.piano-key--b4 { background: linear-gradient(180deg, #C084FC 0%, #A855F7 70%, #7E22CE 100%); --key-glow: #A855F7; }
.piano-key--c5 { background: linear-gradient(180deg, #F472B6 0%, #EC4899 70%, #BE185D 100%); --key-glow: #EC4899; }

/* Lit (Pressed / Playing) State */
.piano-key.lit,
.piano-key:active {
  transform: translateY(8px);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 30px var(--key-glow), 0 2px 6px rgba(0, 0, 0, 0.2);
  filter: brightness(1.28);
}

/* Floating Musical Note */
.piano-floating-note {
  position: absolute;
  top: -12px;
  left: 50%;
  font-size: 28px;
  color: #FFFFFF;
  text-shadow: 0 0 12px var(--key-glow), 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: floatNoteUp 0.6s ease-out forwards;
  z-index: 10;
}
@keyframes floatNoteUp {
  0% { transform: translate(-50%, 0) scale(0.6) rotate(0deg); opacity: 0; }
  25% { opacity: 1; transform: translate(-50%, -20px) scale(1.2) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1.4) rotate(15deg); }
}

/* --- Shape Sorter uses the shared .match / .slot / .chip system with a big
       greyed target silhouette behind each hole. --- */
.slot__key.shape-hole { filter: grayscale(1) opacity(.45); }

/* =========================================================================
   SHADOW MATCH — drag each colourful animal onto its dark silhouette on an
   old jungle "spot-the-animal" scroll. Styled after the storybook video:
   a parchment scroll framed by jungle green, scattered black shadows, and a
   pop + sparkle when a shadow "lights up" into the real animal.
   ========================================================================= */
.shadow-stage {
  background:
    radial-gradient(120% 80% at 50% 0%, #CDEBB0 0%, rgba(205,235,176,0) 60%),
    linear-gradient(180deg, #BFE3A6 0%, #A9D98C 46%, #8F9B63 100%);
  border-radius: var(--r-lg);
  padding: 14px 10px 18px;
  width: 100%; max-width: 560px; margin: 0 auto;
}
/* Change #28: the jungle green is the whole game's background (full screen), not a card on the app sky */
.game--shadow { background: radial-gradient(120% 70% at 50% 0%, #CDEBB0 0%, rgba(205,235,176,0) 60%), linear-gradient(180deg, #BFE3A6 0%, #A9D98C 46%, #8F9B63 100%); }
.game--shadow .shadow-stage { background: transparent; }
.shadow-board { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }

/* The parchment scroll: warm aged paper with soft torn-looking edges. */
.shadow-scroll {
  position: relative; width: 100%; max-width: 520px;
  aspect-ratio: 4 / 3; min-height: 300px;
  border-radius: 16px 22px 18px 20px;
  background: radial-gradient(140% 120% at 30% 12%, #F3E4C0 0%, #EAD6A6 55%, #DFC488 100%);
  box-shadow: inset 0 0 0 6px rgba(139,105,52,.28), inset 0 0 40px rgba(120,88,40,.22), var(--shadow-md);
  overflow: hidden;
}
.shadow-scroll::before, .shadow-scroll::after {
  content: ""; position: absolute; left: 0; right: 0; height: 16px;
  background: radial-gradient(circle at 8px -4px, transparent 8px, #B79357 9px) repeat-x;
  background-size: 22px 16px; opacity: .55;
}
.shadow-scroll::before { top: -2px; transform: rotate(180deg); }
.shadow-scroll::after { bottom: -2px; }

/* Scattered silhouettes = drop targets (override the boxy shared .slot). */
.shadow-spot {
  position: absolute; transform: translate(-50%, -50%);
  border: 0 !important; background: transparent !important; padding: 0 !important;
  min-height: 0 !important; display: grid; place-items: center;
  width: clamp(58px, 18vw, 84px); height: clamp(58px, 18vw, 84px);
}
.shadow-sil, .shadow-reveal { font-size: clamp(40px, 13vw, 62px); line-height: 1; }
.shadow-sil { filter: brightness(0) opacity(.82); animation: sil-bob 3s ease-in-out infinite; }
.shadow-spot.over { transform: translate(-50%, -50%) scale(1.14); }
.shadow-spot.over .shadow-sil { filter: brightness(0) opacity(.82) drop-shadow(0 0 8px rgba(255,255,255,.9)); }
.shadow-tray { background: rgba(255,255,255,.35); border-radius: var(--r-lg); padding: 10px; }

@keyframes sil-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes anim-reveal { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 55% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.anim-reveal { animation: anim-reveal .5s cubic-bezier(.2,1.3,.5,1) both; }
@keyframes anim-scroll-in { 0% { transform: translateY(18px) scale(.96); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
.anim-scroll-in { animation: anim-scroll-in .5s ease both; }

.reduce-motion .shadow-sil, .reduce-motion .anim-reveal, .reduce-motion .anim-scroll-in { animation: none !important; }

/* ---- Concept quizzes: Hot/Cold and Good/Bad habit answers are coloured (over every theme's white card) ---- */
.options .opt.opt--good, .options .opt.opt--bad, .options .opt.opt--hot, .options .opt.opt--cold, .options .opt.opt--sky {
  color: #FFFFFF; font-weight: 700; font-size: clamp(20px, 4.4vw, 28px); min-height: 72px;
  border: 4px solid rgba(255, 255, 255, .85) !important; border-radius: 28px !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.options .opt.opt--good { background: linear-gradient(180deg, #34D399, #16A34A) !important; box-shadow: 0 6px 0 #15803D, 0 10px 18px rgba(22, 163, 74, .3) !important; }
.options .opt.opt--bad  { background: linear-gradient(180deg, #F87171, #DC2626) !important; box-shadow: 0 6px 0 #B91C1C, 0 10px 18px rgba(220, 38, 38, .3) !important; }
.options .opt.opt--hot  { background: linear-gradient(180deg, #FB923C, #EA580C) !important; box-shadow: 0 6px 0 #C2410C, 0 10px 18px rgba(234, 88, 12, .3) !important; }
.options .opt.opt--sky  { background: linear-gradient(180deg, #C084FC, #7C3AED) !important; box-shadow: 0 6px 0 #6D28D9, 0 10px 18px rgba(124, 58, 237, .3) !important; }
.options .opt.opt--cold { background: linear-gradient(180deg, #60A5FA, #2563EB) !important; box-shadow: 0 6px 0 #1D4ED8, 0 10px 18px rgba(37, 99, 235, .3) !important; }
.options .opt.opt--good.is-correct, .options .opt.opt--bad.is-correct, .options .opt.opt--hot.is-correct, .options .opt.opt--cold.is-correct {
  border-color: #FDE047 !important; }
.options .opt.opt--good.is-wrong, .options .opt.opt--bad.is-wrong, .options .opt.opt--hot.is-wrong, .options .opt.opt--cold.is-wrong { opacity: .5; }
.cls-showcase { display: flex; justify-content: center; margin: 0 auto 12px; }
.cls-item { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #FFFFFF; border-radius: 24px;
  padding: 12px 22px; box-shadow: 0 10px 24px rgba(43, 33, 81, .1); }
.cls-item__pic { font-size: clamp(76px, 20vw, 110px); line-height: 1; display: flex; align-items: center; justify-content: center; }
.cls-item__pic img { width: clamp(90px, 26vw, 140px); height: clamp(90px, 26vw, 140px); object-fit: cover; border-radius: 18px; }
.cls-item__name { font-weight: 700; font-size: clamp(16px, 3.6vw, 22px); color: #2B2151; text-align: center; }
/* ---- Big & Small / Tall & Short: every card the same size, the picture scaled inside ---- */
.cmp-pic { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; }
.cmp-pic > * { transform: scale(var(--s, 1)); transform-origin: 50% 100%; }   /* themes force picture sizes; scale is never overridden */
.cmp-pic img { width: 100% !important; height: 100% !important; max-width: none !important; object-fit: contain !important; border-radius: 12px; }
.cmp-pic .kido-creature > svg, .cmp-pic .creature-img { width: 100% !important; height: 100% !important; }
.cmp-tall { width: 100%; aspect-ratio: 1 / 1; display: block; }
/* ---- A to Z / वर्णमाला books: a big letter over its picture ---- */
.board--abc .board-tile__emoji { background: #FFF8E7; }
.abc-card { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; gap: 2px; }
.abc-card__L { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 11vw, 56px); line-height: 1.25; padding-top: 4px; color: #6C4BD6; }   /* room for Devanagari matras */
.abc-card__L small { font-size: .6em; margin-left: 4px; color: #FF7A45; }
.abc-card__pic { flex: 1 1 auto; min-height: 0; width: 70%; display: flex; align-items: center; justify-content: center; font-size: clamp(34px, 9vw, 48px); }
.abc-card__pic img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.abc-card__emoji { line-height: 1; }
/* ---- Trace Letters ---- */
.trace { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; position: relative; z-index: 2; }   /* above the theme backdrops */
.trace__box { width: min(86vw, 420px); aspect-ratio: 1 / 1; background: #FFFFFF; border-radius: 28px;
  box-shadow: 0 10px 24px rgba(43, 33, 81, .12); overflow: hidden; }
.trace__canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.trace__tools { display: flex; gap: 12px; justify-content: center; }
.trace__btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; padding: 8px 12px; border: 0;
  border-radius: 18px; background: #FFFFFF; box-shadow: 0 4px 12px rgba(43, 33, 81, .12); font-size: 24px; cursor: pointer; }
.trace__btn span { font-size: 13px; font-weight: 700; color: #2B2151; }
.trace__ch { color: #6C4BD6; font-size: 1.2em; }

/* ---- Change #30 activities (js/data/moreActivities.js) ---- */
.cnt-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 10px; font-size: clamp(34px, 9vw, 52px); line-height: 1; justify-content: center; }
.cnt-grid--many { grid-template-columns: repeat(4, auto); font-size: clamp(28px, 7vw, 42px); }
.cnt-grid > span { display: flex; width: 1.15em; height: 1.15em; align-items: center; justify-content: center; }
.cnt-grid img, .cnt-grid .kido-creature { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 10px; }
.options .opt > img { width: 86%; height: 86%; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 16px; display: block; margin: auto; }   /* raw photos as answers */
.cls-item__pic .kido-creature { display: flex; width: clamp(90px, 26vw, 140px); height: clamp(90px, 26vw, 140px); }
.cls-item__pic .kido-creature img { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 18px; }
.seq-show { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 9vw, 56px); color: #6C4BD6; letter-spacing: 4px; white-space: nowrap; }
.seq-show b { color: #FF7A45; }
.seq-show--emoji { font-size: clamp(26px, 6vw, 40px); letter-spacing: 2px; }
.seq-letter { font-family: var(--font-display); font-weight: 700; font-size: 1.6em; color: #6C4BD6; line-height: 1; }
.match-word, .read-word { font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 3.4vw, 20px); color: #2B2151; line-height: 1.1; text-align: center; }
.read-word { font-size: clamp(20px, 4.6vw, 30px); letter-spacing: 2px; }
.spell-show { font-size: clamp(24px, 6vw, 36px) !important; letter-spacing: 6px; color: #6C4BD6 !important; }
.more-svg { width: clamp(110px, 30vw, 170px); height: clamp(110px, 30vw, 170px); display: block; }
.opt .more-svg--blob { width: 70%; height: 70%; margin: auto; }
.more-svg--block { width: 100%; height: auto; }
.chip .more-svg--block:not(#_) { width: 96px !important; height: 38px !important; }
.seq__box .more-svg--block:not(#_) { width: 64px !important; height: 26px !important; }
.slot__key > img, .slot__drop > img, .chip > img { width: 1.7em; height: 1.7em; object-fit: contain; border-radius: 10px; }   /* photos in match games */
.board-emoji { font-size: clamp(64px, 18vw, 90px); line-height: 1; }
.board-emoji img { width: 80%; height: 80%; object-fit: contain; }
.story-page .cls-item__pic { font-size: clamp(40px, 11vw, 64px); letter-spacing: 4px; white-space: nowrap; }

/* ---- Chiku, the body-parts child (js/data/chiku.js, js/activities/bodyTap.js) ---- */
.chiku-crop { display: block; width: 100%; aspect-ratio: 1 / 1; background-repeat: no-repeat; border-radius: 16px; background-color: #E5E7EB; }
.chiku-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.cls-item__pic .chiku-crop, .cls-item__pic .chiku-photo { width: clamp(100px, 28vw, 150px); height: clamp(100px, 28vw, 150px); }
.slot__key .chiku-crop, .chip .chiku-crop, .slot__drop .chiku-crop { width: 1.8em; }
.chip .chiku-crop { width: 64px; } .seq__box .chiku-crop { width: 58px; }
.chiku-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; position: relative; z-index: 2; }
.chiku-scene { position: relative; aspect-ratio: var(--ar); width: min(100%, calc(62vh * var(--ar)), calc(520px * var(--ar)));   /* fits width AND height */
  border-radius: 24px; overflow: hidden; box-shadow: 0 10px 24px rgba(43, 33, 81, .14); background: #D9DDE3; }
.chiku-scene img { position: absolute; max-width: none; user-select: none; }   /* size/offset set inline from the scene view */
.chiku-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; }
.chiku-holder { width: 100%; display: flex; justify-content: center; }
.chiku-zone { fill: transparent; stroke: none; cursor: pointer; }
.chiku-zone.on { fill: rgba(250, 204, 21, .1); stroke: #FACC15; stroke-width: 6; vector-effect: non-scaling-stroke; animation: chikuPulse 1s ease-in-out infinite; }
.chiku-zone.miss { fill: rgba(249, 115, 22, .2); stroke: #F97316; stroke-width: 4; vector-effect: non-scaling-stroke; }
@keyframes chikuPulse { 50% { fill: rgba(250, 204, 21, .24); } }
.chiku-card { background: #FFFFFF; border-radius: 22px; padding: 12px 16px; box-shadow: 0 8px 20px rgba(43, 33, 81, .12); text-align: center; max-width: 320px; }
.chiku-card__name { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 5vw, 32px); color: #6C4BD6; }
.chiku-card__fact { font-size: 15px; color: #2B2151; margin-top: 4px; }
.chiku-card .chiku-crop { width: 110px; margin: 8px auto 0; }
.chiku-card.is-hidden { visibility: hidden; }   /* find mode: no hint while the question is open; keeps Chiku in place */
.chiku-flip { margin-top: 10px; border: 0; border-radius: 16px; padding: 10px 14px; font-weight: 700; background: #EDE9FE; color: #4C1D95; cursor: pointer; }
