@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

/* Palette from the Somali landscape and its crafts: flag blue, Laas Geel
   ochre, saffron, Indian Ocean teal and the bright purples and pinks of dirac
   cloth, on warm sand. */
:root {
  /* Easing from motion-anything's MOTION-SPEC: ease-out for most things, a spring with overshoot for presses. */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --bg: #FBF1E2;
  --bg-2: #F5E3C6;
  --card: #FFFCF6;
  --cream: #FFF8EC;
  --ink: #2E2118;
  --ink-soft: #76604A;
  --orange: #EE6A3F;
  --orange-d: #C04B26;
  --purple: #7A5CF0;
  --purple-d: #5A3DD0;
  --teal: #14A89D;
  --teal-d: #0B7E77;
  --pink: #EC5B86;
  --pink-d: #C63B66;
  --yellow: #F7B32B;
  --yellow-d: #D98C10;
  --blue: #4189DD;
  --blue-d: #2A68BE;
  --green: #46B86C;
  --green-d: #2A9150;
  --red: #E5484D;
  --red-d: #B8323A;
  --sky: #BDE3FA;
  /* the painted sky at the top of the backgrounds (images/scene), and their plain sand, by day and night */
  --sky-top: #74C9FD;
  --sand-day: #FEC16A;
  --sand-night: #DFA04F;
  --radius: 28px;
  --tap: 64px;
  --shadow: 0 6px 0 rgba(46, 33, 24, .1);
  /* Woven band, after the coloured rows on a haan basket. */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='16' height='2.5' fill='%23fff' fill-opacity='.4'/%3E%3Cpath d='M0 15L4 6L8 15Z' fill='%23fff' fill-opacity='.38'/%3E%3Cpath d='M8 6L12 15L16 6Z' fill='%23fff' fill-opacity='.16'/%3E%3C/svg%3E");
  /* Faint diamond lattice for the page background. */
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 5L39 22L22 39L5 22Z' fill='none' stroke='%232E2118' stroke-opacity='.035' stroke-width='1.5'/%3E%3Ccircle cx='22' cy='22' r='2.2' fill='%23EE6A3F' fill-opacity='.09'/%3E%3C/svg%3E");
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
  /* A white outline drawn with text-shadow (works on every browser). */
  --outline-3: -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff, 3px 3px 0 #fff, 0 -3px 0 #fff, 0 3px 0 #fff, -3px 0 0 #fff, 3px 0 0 #fff;
  --outline-5: -5px -5px 0 #fff, 5px -5px 0 #fff, -5px 5px 0 #fff, 5px 5px 0 #fff, 0 -5px 0 #fff, 0 5px 0 #fff, -5px 0 0 #fff, 5px 0 0 #fff, -4px -2px 0 #fff, 4px 2px 0 #fff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* iPhones turned sideways make text bigger unless told not to (the layouts are already sized for it); and
   pictures can't be dragged off as a ghost image with a mouse. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { -webkit-user-drag: none; }
/* An app, not a web page: no bounce or stretch past the top or the bottom (it showed a strip of plain
   page above the sky). The root scroller takes this from html, not body. */
html { overscroll-behavior: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }

/* ---------- Top bar ---------- */
/* Laid out like an app: the top bar stays where it is, with no colour of its own, so behind it is always the
   painted sky itself, by day and by night; only the screen under it scrolls (.view), and what scrolls fades
   away just before it reaches the bar instead of sliding under it. (The page used to scroll as a whole, and
   the bar needed a sky-blue band to hide what passed under it, which never matched the painting.) */
body { display: flex; flex-direction: column; height: 100vh; height: 100svh; overflow: hidden; }
.topbar {
  position: relative; z-index: 10; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
}
.topbar-title { flex: 1; font-size: clamp(1.55rem, 6.6vw, 2.1rem); font-weight: 700; text-align: center; line-height: 1.05; }
/* In the section's colour with a white outline and soft shadow, like the logo. */
.topbar-title .tt { white-space: nowrap; color: var(--title-c, var(--ink)); letter-spacing: .5px; text-shadow: var(--outline-3), 0 4px 0 rgba(46, 33, 24, .13); display: inline-block; animation: pop .35s cubic-bezier(.3, 1.6, .6, 1); }
.topbar-title small { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-soft); margin-top: 2px; }
/* A home tile's screen: its name big, between sun rays, its English on a gold ribbon under it. */
.topbar-title.hero { font-size: clamp(2.3rem, 9.5vw, 3.6rem); display: grid; justify-items: center; }
.topbar-title.hero .ht-line { display: flex; align-items: center; justify-content: center; gap: .12em; max-width: 100%; min-width: 0; }
.topbar-title.hero .tt { letter-spacing: .02em; text-shadow: var(--outline-3), 0 5px 0 rgba(46, 33, 24, .16); }
.ht-rays { width: .62em; height: .7em; flex: none; animation: htRays 2.4s ease-in-out infinite; }
.ht-rays.r { transform: scaleX(-1); }
@keyframes htRays { 50% { opacity: .75; translate: 0 -.03em; } }
.ht-ribbon { position: relative; display: inline-block; margin-top: -.12em; font-size: clamp(.95rem, 3.4vw, 1.3rem); animation: pop .4s .08s cubic-bezier(.3, 1.6, .6, 1) both; }
.ht-band { position: relative; display: block; padding: .2em 1.25em .26em; border-radius: .3em; background: linear-gradient(#FFDB6E, #F6B93A); color: #4A2E10; font-weight: 700; white-space: nowrap; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #D18F25, 0 6px 10px rgba(46, 33, 24, .14); }
.ht-tail { position: absolute; top: .38em; bottom: -.32em; width: 1.3em; background: #E9A52E; box-shadow: 0 3px 0 #C3811F; }
.ht-tail.l { left: -.75em; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 38% 50%); }
.ht-tail.r { right: -.75em; clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%); }
/* (a title with letters hanging below the line, Higgaad, Ciyaaro: the ribbon lower, clear of them) */
.topbar-title.hero.desc .ht-ribbon { margin-top: .16em; }
html.is-night .ht-band { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #D18F25, 0 6px 12px rgba(0, 0, 0, .3); }
@media (prefers-reduced-motion: reduce) { .ht-rays, .ht-ribbon { animation: none; } }
.icon-btn {
  width: var(--tap); height: var(--tap); flex: none;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  transition: transform .1s;
}
.icon-btn:active { transform: translateY(3px) scale(.96); box-shadow: 0 3px 0 rgba(58,38,21,.12); }
.icon-btn svg { width: 32px; height: 32px; }
.home .back { visibility: hidden; }
/* Home screen: Settings (the gear) in the back button's place, with the
   full-screen button beside it where the browser allows full screen. */
.settings-btn { display: none; color: var(--ink-soft); }
body.home .settings-btn { display: grid; }
body.home .back { display: none; }
.settings-btn svg { width: 30px; height: 30px; }
/* The smallest phones: a more compact top bar, so everything fits. */
@media (max-width: 359px) {
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .topbar .icon-btn { width: 50px; height: 50px; }
  .topbar .icon-btn svg { width: 26px; height: 26px; }
  .star-pill { min-height: 50px; padding: 0 12px; }
}
.fs-btn { display: none; }
body.home.fs-ok .back { display: none; }
body.home.fs-ok .fs-btn { display: grid; }
.star-pill {
  min-height: var(--tap); min-width: var(--tap); padding: 0 18px;
  display: flex; align-items: center; gap: 6px;
  border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  font-size: 1.5rem; font-weight: 700;
}
.star-pill.bump { animation: pressPop 420ms var(--ease-out); }
.star-icon { display: grid; }
.star-icon .coin { width: 30px; height: 30px; }

/* Shared art and glyphs */
.art { display: block; width: 100%; height: 100%; overflow: visible; }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.coin { width: 1em; height: 1em; flex: none; vertical-align: -.12em; filter: drop-shadow(0 2px 0 rgba(46, 33, 24, .14)); }
.icon-btn svg.i { width: 30px; height: 30px; }

/* ---------- Views ---------- */
.view {
  padding: 4px 16px calc(28px + var(--safe-b));
  max-width: 1100px; margin: 0 auto;
  animation: viewIn .28s ease-out;
}
/* The screen scrolls by itself, under the top bar, as wide as the window (so a finger or a mouse wheel anywhere
   scrolls it), its content kept to --view-max in the middle. Once it is scrolled, its top edge fades. */
.view { --view-max: 1100px; --view-pad: 16px; flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0;
  padding-left: max(var(--view-pad), calc((100% - var(--view-max)) / 2 + var(--view-pad)));
  padding-right: max(var(--view-pad), calc((100% - var(--view-max)) / 2 + var(--view-pad)));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.view.scrolled { -webkit-mask-image: linear-gradient(transparent, #000 18px); mask-image: linear-gradient(transparent, #000 18px); }
.view.leaving { animation: none; }
h2.section { font-size: 1.3rem; margin: 18px 4px 10px; color: var(--ink-soft); }

/* ---------- Home ---------- */
.mascot-stage { position: relative; display: grid; justify-items: center; }
/* Geesi with his name tag (drawn in his SVG, hanging from his collar) is taller than wide. */
svg.mascot.tagged { height: auto; aspect-ratio: 200 / 238; }
.mascot-stage::after {
  content: ""; width: 130px; height: 16px; margin-top: -10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 33, 24, .16), transparent);
}
/* A fixed-height space for Geesi's bubble, so the page doesn't jump as it
   changes from one line to two, or back to the logo. */
.bubble-slot { height: 150px; display: flex; align-items: flex-end; justify-content: center; }
/* Geesi from his master illustration (js/geesihd.js), standing in the stage; he brings his own shadow */
.mascot-stage .g-host { width: 150px; }
.mascot-stage:has(.geesi-hd)::after { display: none; }
.bubble {
  position: relative; background: var(--card); padding: 10px 22px; border-radius: 24px;
  font-size: 1.9rem; font-weight: 700; box-shadow: var(--shadow); margin-bottom: 6px;
  animation: pop .45s cubic-bezier(.3,1.6,.6,1);
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  border: 12px solid transparent; border-top-color: var(--card); border-bottom: 0;
}
.bubble.small { font-size: 1.3rem; padding: 8px 16px; }
/* Geesi's introduction, one line at a time. */
.bubble.talking { font-size: clamp(1.25rem, 5.4vw, 1.7rem); max-width: min(320px, 86vw); text-align: center; line-height: 1.2; animation: pop .3s cubic-bezier(.3,1.6,.6,1); }
/* The Baro logos (js/brand.js): "Baro" in four colours with a white outline,
   and "Somali" on a tilted blue pill, as on baro.kids. */
/* The white outline grows and shrinks with the logo, so it never covers the
   letter beside it. */
.wm { display: inline-flex; align-items: baseline; font-weight: 700; letter-spacing: .04em; line-height: 1; text-shadow: -.055em -.055em 0 #fff, .055em -.055em 0 #fff, -.055em .055em 0 #fff, .055em .055em 0 #fff, 0 -.075em 0 #fff, 0 .075em 0 #fff, -.075em 0 0 #fff, .075em 0 0 #fff; white-space: nowrap; }
.wm b { display: inline-block; transform-origin: 50% 100%; }
.wm-pill { display: inline-block; margin-left: .2em; padding: .05em .32em .1em; border-radius: 999px; background: var(--pill, var(--blue)); color: #fff; font-size: .62em; text-shadow: none; box-shadow: 0 .12em 0 var(--pill-d, var(--blue-d)); translate: 0 -.1em; rotate: -3deg; }
/* In Geesi's bubble: the letters pop in once. */
.logo { font-size: 2.7rem; filter: drop-shadow(0 3px 0 rgba(46, 33, 24, .12)); }
.logo b, .logo .wm-pill { animation: letterPop .5s cubic-bezier(.3, 1.7, .6, 1) both calc(.15s + var(--i) * .08s); }
.home-grid {
  width: 100%; max-width: 640px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.big-btn {
  position: relative; overflow: hidden; min-height: 176px; padding: 16px 12px 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: var(--radius); color: #fff; text-align: center;
  box-shadow: 0 8px 0 var(--d, rgba(0,0,0,.2));
  transition: transform .1s, box-shadow .1s;
}
/* A soft light from above, and the Somali woven band along the bottom: still, faint, the one
   thing that says "Baro" on every tile. */
.big-btn::before, .pack-tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 46%);
}
.big-btn::after, .pack-tile::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; pointer-events: none;
  background: var(--band) repeat-x left bottom; opacity: .6;
}
.big-btn:active { box-shadow: 0 2px 0 var(--d); }
.big-btn .ico, .pack-tile .ico {
  position: relative; display: grid; place-items: center; flex: none;
  width: 96px; height: 96px; border-radius: 26%; background: var(--cream);
  box-shadow: 0 4px 0 rgba(46, 33, 24, .14);
  margin-bottom: 6px;
}
.big-btn .ico .art, .pack-tile .ico .art { width: 78%; height: 78%; position: relative; z-index: 1; }
/* the Sheeko tile: the real covers of the first two books, fanned, in the same rounded square as the others */
.big-btn .ico.covers { overflow: hidden; }
.ico.covers .cv { position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 1 / 1.34; height: auto; margin: -30% 0 0 -22%; object-fit: cover; border-radius: 2px 5px 5px 2px;
  box-shadow: 0 0 0 1.5px #fff, 0 2px 4px rgba(80, 40, 5, .35); }
.ico.covers .c0 { transform: translateX(-30%) rotate(-9deg); }
.ico.covers .c1 { transform: translateX(30%) rotate(8deg); z-index: 1; }
.big-btn .ico .emoji, .pack-tile .ico .emoji { font-size: 3rem; }
.big-btn .lbl { position: relative; font-size: 1.55rem; font-weight: 700; letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0,0,0,.16); }
.big-btn .sub { position: relative; font-size: .95rem; opacity: .92; }
.c-orange { background-color: var(--orange); --d: var(--orange-d); }
.c-purple { background-color: var(--purple); --d: var(--purple-d); }
.c-teal   { background-color: var(--teal);   --d: var(--teal-d); }
.c-pink   { background-color: var(--pink);   --d: var(--pink-d); }
.c-blue   { background-color: var(--blue);   --d: var(--blue-d); }
.c-yellow { background-color: var(--yellow); --d: var(--yellow-d); }
.c-green  { background-color: var(--green);  --d: var(--green-d); }
.c-red    { background-color: var(--red);    --d: var(--red-d); }

.parent-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  padding: 0 20px; border-radius: 999px; color: var(--ink-soft); font-size: 1rem;
  background: rgba(255,255,255,.55);
}
.streak-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 1.2rem; font-weight: 700; color: var(--ink-soft); }
.streak-chip svg.i, .stat svg.i { width: 1em; height: 1em; }

/* ---------- Mascot ---------- */
.mascot { width: 180px; height: 180px; display: block; overflow: visible; }
.mascot.sm { width: 110px; height: 110px; }
.mascot .head { transform-origin: 100px 120px; transition: transform .3s; }
.mascot .eyes { transition: transform .3s; transform: translate(calc(var(--lx, 0) * 5px), calc(var(--ly, 0) * 4px)); }
.mascot:not(.think):not(.sad) .head { transform: translate(calc(var(--lx, 0) * 2.5px), calc(var(--ly, 0) * 2px)) rotate(calc(var(--lx, 0) * 4deg)); }
/* Breathing while he waits: a slow rise and fall from his feet. */
.mascot { transform-origin: 50% 100%; animation: geesiBreathe 3.6s ease-in-out infinite; }
.mascot .paw { transform-origin: 150px 175px; }
.mascot .mouth-open, .mascot .mouth-o, .mascot .think-bubble, .mascot .sparkles, .mascot .mouth-sad, .mascot .brows-sad { opacity: 0; transition: opacity .2s; }
.mascot.wave .paw { animation: wave 1s ease-in-out 2; }
.mascot.cheer { animation: geesiJump .95s cubic-bezier(.33, .7, .45, 1); }
.mascot.cheer .name-tag-g { animation: tagSwing 1.3s ease-out; transform-origin: 100px 199px; transform-box: view-box; }
.mascot.cheer .mouth-smile { opacity: 0; }
.mascot.cheer .mouth-open, .mascot.cheer .sparkles { opacity: 1; }
.mascot.think .head { transform: rotate(-8deg); }
.mascot.think .eyes { transform: translate(4px, -5px); }
.mascot.think .mouth-smile { opacity: 0; }
.mascot.think .mouth-o, .mascot.think .think-bubble { opacity: 1; }
.mascot.talk .mouth-smile { opacity: 0; }
.mascot.talk .mouth-open { animation: talkMouth .26s ease-in-out infinite alternate; }
@keyframes talkMouth { from { opacity: 0; } to { opacity: 1; } }
.mascot.sad .head { transform: rotate(6deg) translateY(6px); }
.mascot.sad .eyes { transform: translateY(4px); }
.mascot.sad .mouth-smile { opacity: 0; }
.mascot.sad .mouth-sad, .mascot.sad .brows-sad { opacity: 1; }
.mascot .blink { animation: blink 4.5s infinite; transform-origin: center 95px; transform-box: view-box; }

/* ---------- Grids & cards ---------- */
/* Grids of tiles: rows of --cols equal tiles, and a last row that isn't full
   sits in the middle (never a lonely tile at the left). */
.letter-grid, .pack-list, .who-grid, .sticker-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.letter-grid > *, .pack-list > *, .who-grid > *, .sticker-grid > * { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
.letter-grid { --cols: 3; --gap: 12px; gap: var(--gap); }
@media (min-width: 440px) { .letter-grid { --cols: 4; } }
@media (min-width: 560px) { .letter-grid { --cols: 5; } }
.letter-tile {
  position: relative; aspect-ratio: 1; min-height: var(--tap);
  border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
  font-size: 2.3rem; font-weight: 700; display: grid; place-items: center;
  transition: transform .1s;
}
.letter-tile:nth-child(6n+1) { color: var(--orange-d); }
.letter-tile:nth-child(6n+2) { color: var(--purple-d); }
.letter-tile:nth-child(6n+3) { color: var(--teal-d); }
.letter-tile:nth-child(6n+4) { color: var(--pink-d); }
.letter-tile:nth-child(6n+5) { color: #C77800; }
.letter-tile:nth-child(6n)   { color: var(--green-d); }
.letter-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.letter-tile .sym { line-height: 1; }
.letter-tile .ar { font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", system-ui, sans-serif; font-size: 1.15rem; font-weight: 700; line-height: 1.1; color: var(--ink-soft); opacity: .8; margin-top: 2px; }
.letter-tile:active, .letter-tile.playing { transform: scale(.93); }
.letter-tile.special::after {
  content: ""; position: absolute; top: 9px; right: 9px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--pink);
}
.legend { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 1rem; margin: 16px 4px 0; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); flex: none; }

.pack-list { --cols: 1; --gap: 16px; gap: var(--gap); }
@media (min-width: 580px) { .pack-list { --cols: 2; } }
@media (min-width: 880px) { .pack-list { --cols: 3; } }
.pack-tile {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px; min-height: 132px; padding: 16px 20px 24px;
  border-radius: var(--radius); color: #fff; text-align: left;
  background: var(--c); box-shadow: 0 8px 0 rgba(0,0,0,.18);
  transition: transform .1s, box-shadow .1s;
}
.pack-tile > span { position: relative; }
/* Wax Walba: first, full width, bigger, in the logo's colours. */
.pack-list > .mix-tile { flex-basis: 100%; }
.pack-tile.mix-tile { min-height: 164px; background: var(--c, #14A89D); }
.pack-tile.mix-tile .ico { width: 112px; height: 112px; }
.pack-tile.mix-tile .t { font-size: 2.2rem; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.pack-tile.mix-tile .e { font-size: 1.1rem; }
.pack-tile:active { box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.pack-tile .ico { width: 88px; height: 88px; margin: 0; }
.pack-tile .t { font-size: 1.6rem; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.pack-tile .e { font-size: 1rem; opacity: .92; }
.pack-tile .progress { display: block; margin-top: 8px; height: 10px; border-radius: 99px; background: rgba(255,255,255,.35); overflow: hidden; }
.pack-tile .progress i { display: block; height: 100%; background: #fff; border-radius: 99px; }

/* Cards in rows that wrap, centred, so a shorter last row sits in the middle.
   --cols sets how many fit across: 2 on phones, more on wider screens. */
.card-grid { --cols: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.card-grid > .word-card { flex: 0 0 calc((100% - (var(--cols) - 1) * 14px) / var(--cols)); min-width: 0; }
@media (min-width: 520px) { .card-grid { --cols: 3; } }
@media (min-width: 760px) { .card-grid { --cols: 4; } }
@media (min-width: 1040px) { .card-grid { --cols: 5; } }
.word-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 170px; padding: 14px 8px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); transition: transform .12s;
}
.word-card:active { transform: scale(.95); }
.word-card.playing { animation: wiggle-pop .5s; outline: 4px solid var(--yellow); }
.word-card .so { font-size: 1.55rem; font-weight: 700; }
.word-card .en { font-size: .95rem; color: var(--ink-soft); }

.pic { display: grid; place-items: center; line-height: 1; }
.pic .emoji { font-size: 4.2rem; }
.pic img { width: 96px; height: 96px; object-fit: contain; }
.pic .swatch {
  width: 86px; height: 86px; border-radius: 50%;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.12), 0 0 0 4px #fff, 0 0 0 6px rgba(58,38,21,.15);
}
.pic .art { width: 96px; height: 96px; overflow: hidden; }
.pic.tile .art { background: radial-gradient(circle at 50% 38%, #EEF6FD, #CFE3F5); border-radius: 22%; box-shadow: inset 0 -3px 0 rgba(42, 104, 190, .1); }
.pic.lg .art { width: 170px; height: 170px; }
.pic.lg .emoji { font-size: 7rem; }
.pic.lg img { width: 160px; height: 160px; }
.pic.lg .swatch { width: 140px; height: 140px; }

/* ---------- Sheet (letter detail) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(58,38,21,.4);
  display: grid; place-items: center; padding: 16px;
  animation: fade .3s var(--ease-out);
}
.sheet {
  position: relative; width: min(440px, 100%); max-height: 92vh; overflow: auto;
  background: var(--bg); border-radius: 36px; padding: 24px 20px 22px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: sheetIn .46s cubic-bezier(.32, 1.3, .5, 1);
}
/* Closing: the sheet drops away and the shade fades (ease-in, quicker than arriving). */
.sheet-backdrop.closing { animation: fadeOut .22s cubic-bezier(.4, 0, 1, 1) forwards; }
.sheet-backdrop.closing .sheet { animation: sheetOut .22s cubic-bezier(.4, 0, 1, 1) forwards; }
.sheet .close { position: absolute; top: 14px; right: 14px; }
.sheet .big-letter { font-size: 6rem; font-weight: 700; color: var(--orange-d); line-height: 1; display: inline-flex; align-items: baseline; gap: 14px; }
.sheet .big-letter .ar { font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", system-ui, sans-serif; font-size: 2.6rem; color: var(--ink-soft); opacity: .75; }
.word-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.word-nav .dots { display: flex; gap: 8px; }
.word-nav .dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(46,33,24,.15); transition: background .2s, transform .2s; }
.word-nav .dots i.on { background: var(--teal); transform: scale(1.25); }
.next-word { width: 52px; height: 52px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--teal-d); }
.next-word svg.i { width: 26px; height: 26px; }
.next-word.prev svg.i { transform: scaleX(-1); }
.next-word:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(46,33,24,.1); }
.example-slot .example { animation: pop .3s cubic-bezier(.3,1.5,.6,1); }
.sheet .example { margin: 12px auto 0; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); width: 100%; display: grid; gap: 6px; justify-items: center; }
.sheet .example .so { font-size: 2rem; font-weight: 700; }
/* Words spelled sound by sound: the first sound in its pack's colour, and each
   sound hopping and lighting up in turn while the word is spoken. */
.so i, .listen-word i, .fb-word i { font-style: normal; display: inline-block; }
.wd { display: inline-block; white-space: nowrap; }
i.first { color: var(--c); }
i.lit { animation: readHop .42s ease-out; }
@keyframes readHop { 35% { transform: translateY(-.2em) scale(1.16); color: var(--yellow-d); } }
.sheet .example .en { color: var(--ink-soft); }
.sheet .row { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.parent-note {
  margin-top: 14px; padding: 12px 14px; border-radius: 18px; text-align: left;
  background: #FFE2EC; color: #7A2342; font-size: 1rem; line-height: 1.4;
}
.parent-note strong { display: block; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }

.pill-btn {
  min-height: var(--tap); padding: 0 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  box-shadow: 0 6px 0 var(--d); transition: transform .1s, box-shadow .1s;
}
.pill-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--d); }
.pill-btn.ghost { background: var(--card); color: var(--ink); --d: rgba(46,33,24,.15); }
.pill-btn svg.i { width: 28px; height: 28px; }
.pill-btn .chip {
  width: 46px; height: 46px; margin-left: -16px; border-radius: 50%; background: var(--cream);
  display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(46,33,24,.1);
}
.pill-btn .chip .art { width: 38px; height: 38px; }
/* All the cards (or letters) have been seen: the games are next. Each button
   gets a gold outline and soft rings that keep spreading out from it, until one
   is tapped (motion-anything's attention-pulse). */
/* Room below, so both buttons can be scrolled up clear of the toasts. */
.games-row.ready { padding-bottom: 130px; }
.games-row.ready .pill-btn { position: relative; outline: 4px solid #FFD36B; outline-offset: 3px; }
.games-row.ready .pill-btn::before, .games-row.ready .pill-btn::after {
  content: ""; position: absolute; inset: -7px; border-radius: inherit; border: 4px solid #FFC446;
  opacity: 0; pointer-events: none; animation: readyPulse 2s var(--ease-out) infinite;
}
.games-row.ready .pill-btn::after { animation-delay: 1s; }
.games-row.ready .pill-btn:nth-child(2)::before { animation-delay: .5s; }
.games-row.ready .pill-btn:nth-child(2)::after { animation-delay: 1.5s; }
@keyframes readyPulse { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.3, 1.6); } }
/* A letter already opened gets a small green dot at the bottom (the pink top dot marks special sounds). */
/* ---------- Higgaad ---------- */
/* Rows of syllables: the letter (tap it to hear its row), then ba be bi bo bu,
   each vowel in its column's colour so children see the pattern. */
.hig { display: grid; gap: 10px; width: 100%; max-width: 580px; margin: 0 auto; }
.hig-row { display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); gap: 8px; align-items: center; }
.v0 { --vc: var(--orange); --vd: var(--orange-d); }
.v1 { --vc: var(--teal); --vd: var(--teal-d); }
.v2 { --vc: var(--blue); --vd: var(--blue-d); }
.v3 { --vc: var(--yellow); --vd: var(--yellow-d); }
.v4 { --vc: var(--purple); --vd: var(--purple-d); }
.hig-vowel { height: 42px; border-radius: 14px; background: var(--vc); color: #fff; font-size: 1.3rem; font-weight: 700; box-shadow: 0 4px 0 var(--vd); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.hig-letter { position: relative; height: 60px; border-radius: 18px; background: var(--green); color: #fff; font-size: 1.55rem; font-weight: 700;
  box-shadow: 0 5px 0 var(--green-d); display: flex; align-items: center; justify-content: center; gap: 3px; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); transition: transform .12s; }
.hig-letter i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.hig-letter i svg { width: 10px; height: 10px; }
.hig-syl { position: relative; height: 60px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); color: var(--ink);
  font-size: clamp(1.2rem, 5.2vw, 1.6rem); font-weight: 700; transition: transform .12s, box-shadow .12s; }
.hig-syl b { color: var(--vd); font-weight: 700; }
.hig-syl.playing { transform: scale(1.1); box-shadow: 0 0 0 4px var(--vc), var(--shadow); }
.hig-letter.playing { transform: scale(1.05); }
.hig-syl.seen::before { content: ""; position: absolute; right: 7px; bottom: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
@media (max-width: 380px) { .hig-row { gap: 6px; } .hig-syl, .hig-letter { height: 54px; border-radius: 15px; } .hig-letter { font-size: 1.35rem; } .hig-letter i { display: none; } }
@media (prefers-reduced-motion: reduce) { .hig-syl.playing, .hig-letter.playing { transform: none; } }

.letter-tile.seen::before { content: ""; position: absolute; right: 9px; bottom: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }

/* ---------- Games ---------- */
.game-head { display: grid; justify-items: center; gap: 10px; margin-top: 4px; }
.speaker-btn {
  width: 116px; height: 116px; border-radius: 50%;
  background: var(--purple); color: #fff; box-shadow: 0 8px 0 var(--purple-d);
  display: grid; place-items: center; transition: transform .1s, box-shadow .1s;
}
.speaker-btn svg { width: 60px; height: 60px; }
.speaker-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--purple-d); }
.speaker-btn.playing { animation: pulse 0.9s ease-in-out infinite; }
.game-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(58,38,21,.15); }
.dots i.done { background: var(--yellow); box-shadow: 0 0 0 2px var(--yellow-d) inset; }
.dots i.now { background: var(--purple); }

.choices { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.choice {
  aspect-ratio: 1; min-height: 96px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; transition: transform .12s, opacity .3s;
}
.choice .pic .emoji { font-size: clamp(3rem, 12vw, 5.5rem); }
.choice .pic .art { width: clamp(76px, 24vw, 140px); height: clamp(76px, 24vw, 140px); }
.choice .pic .swatch { width: clamp(60px, 18vw, 110px); height: clamp(60px, 18vw, 110px); }
.choice:active { transform: scale(.94); }
.choice.right { background: #DFF7E6; outline: 5px solid var(--green); animation: pressPop 420ms var(--ease-out); }
.choice.wrong { animation: shake .45s; opacity: .45; }

.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 16px; }
.match-col { display: grid; gap: 14px; align-content: start; }
.m-item {
  touch-action: none;
  min-height: 96px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px;
  transition: transform .12s, opacity .3s, background .2s;
}
.m-item .so { font-size: 1.45rem; font-weight: 700; }
.m-item .spk { display: grid; opacity: .5; }
.m-item .spk svg.i { width: 22px; height: 22px; }
.m-item .pic .emoji { font-size: 3.4rem; }
.m-item .pic .art { width: 76px; height: 76px; }
.m-item .pic .swatch { width: 66px; height: 66px; }
.m-item.selected { outline: 5px solid var(--purple); transform: scale(1.03); }
.m-item.matched { background: #DFF7E6; opacity: .55; box-shadow: none; pointer-events: none; }
.m-item.wrong { animation: shake .45s; }
.m-item.dragging { opacity: .4; }
.m-item.drop-hover { outline: 5px dashed var(--purple); }
.drag-ghost {
  position: fixed; z-index: 40; pointer-events: none; transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 16px 30px rgba(0,0,0,.2);
}
.hint { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); margin: 6px 0 0; }
.hint svg.i { width: 30px; height: 30px; }
.hint svg.i:nth-child(2) { width: 22px; height: 22px; opacity: .6; }

.done-screen { display: grid; justify-items: center; gap: 14px; text-align: center; padding-top: 10px; }
.done-screen h1 { font-size: 2.6rem; margin: 0; }
/* ---------- Children ---------- */
.avatar { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--sky); box-shadow: inset 0 0 0 4px #fff, 0 4px 0 rgba(46, 33, 24, .1); overflow: hidden; flex: none; }
.avatar .art { width: 82%; height: 82%; }
.avatar.sm { width: 40px; height: 40px; box-shadow: inset 0 0 0 2px #fff; }
.avatar.plus { font-size: 3rem; font-weight: 700; color: var(--teal-d); background: var(--cream); }
.who-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: 1.15rem; font-weight: 700; max-width: 100%; }
/* One flash to show where to switch child: it swells with a teal glow, then settles. */
.who-chip.hint { animation: chipHint 1.3s ease-in-out; }
@keyframes chipHint {
  0%, 100% { transform: none; box-shadow: var(--shadow); }
  35% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(20, 168, 157, .55), 0 0 24px 8px rgba(20, 168, 157, .45); }
  65% { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(20, 168, 157, .35), var(--shadow); }
}
/* ---------- The free part and the unlock ---------- */
.lock-badge, .pack-tile > .lock-badge, .big-btn > .lock-badge { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(46, 33, 24, .18); }
.lock-badge svg.i { width: 20px; height: 20px; }
.picks-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 14px; margin: 18px auto 0; padding: 12px 16px; max-width: 640px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.picks-bar .picks-en { color: var(--ink-soft); font-weight: 600; }
.locked-screen .big-lock { display: grid; place-items: center; width: 64px; height: 64px; margin-top: -18px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.locked-screen .big-lock svg.i { width: 34px; height: 34px; }
.locked-screen .muted { max-width: 420px; margin: 0; }
/* the family plan: three choices side by side, yearly marked Best Value */
.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.plan-opt { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 6px 10px; border-radius: 18px; background: var(--card); border: 3px solid #EADBC3; color: var(--ink); line-height: 1.1; transition: border-color .15s, transform .15s; }
.plan-opt b { font-size: 1rem; }
.plan-opt .plan-amt { font-size: 1.45rem; font-weight: 700; color: var(--teal-d); }
.plan-opt small { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.plan-opt.on { border-color: var(--orange); background: #FFF4E8; transform: translateY(-2px); }
.plan-opt.on .plan-amt { color: var(--orange-d); }
.plan-best { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 1px 9px 2px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.unlock-fine { text-align: center; font-size: .9rem; margin: 10px 0 0; }
.code-box { margin-top: 14px; text-align: center; }
.code-box summary { cursor: pointer; display: inline-block; margin-bottom: 8px; }
.unlock-body .sheet-title { padding: 0 56px; font-size: 1.45rem; line-height: 1.15; }
.unlock-list { margin: 12px auto 4px; padding: 0 0 0 20px; max-width: 360px; color: var(--ink); line-height: 1.45; text-align: left; }
.unlock-body [disabled], .unlock-body [aria-disabled="true"] { opacity: .5; pointer-events: none; }
.code-row { display: flex; gap: 8px; }
.code-input { flex: 1; min-width: 0; font: inherit; font-size: .95rem; font-weight: 600; padding: 10px 12px; border-radius: 14px; border: 3px solid var(--bg-2); background: var(--card); color: var(--ink); }
.code-msg { text-align: center; min-height: 1.4em; margin: 8px 0 0; }
.who-chip span:last-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-grid { --cols: 2; --gap: 16px; gap: var(--gap); max-width: 640px; margin: 12px auto 0; }
@media (min-width: 480px) { .who-grid { --cols: 3; } }
@media (min-width: 640px) { .who-grid { --cols: 4; } }
.who-tile { display: grid; justify-items: center; gap: 6px; padding: 18px 10px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); font-family: inherit; color: var(--ink); }
.who-tile.on { box-shadow: 0 0 0 4px var(--teal), var(--shadow); }
.who-tile .nm { font-size: 1.45rem; font-weight: 700; }
.who-tile .st { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-weight: 600; }
.who-tile .st .coin { width: 20px; height: 20px; }
.who-tile.add { background: transparent; box-shadow: inset 0 0 0 3px var(--bg-2); }
.sheet-title { margin: 4px 0 12px; font-size: 1.8rem; text-align: center; }
.name-field { display: grid; gap: 6px; font-weight: 700; color: var(--ink-soft); }
/* The family account card, first in Settings: Somali blue so it stands out. */
.account-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, #4F95E3 0%, #2F74CF 100%); box-shadow: 0 6px 0 #2459A6; }
.acc-ico { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.acc-ico svg { width: 34px; height: 34px; }
.acc-initial { background: #fff; color: #2F74CF; font-size: 1.6rem; font-weight: 700; }
.acc-text { flex: 1; min-width: 160px; }
.acc-text h3 { margin: 0; font-size: 1.25rem; color: #fff; overflow-wrap: anywhere; }
.acc-text p { margin: 2px 0 0; opacity: .92; font-size: .98rem; }
.acc-btn { flex: none; min-height: 48px; padding: 0 26px; border-radius: 999px; background: #fff; color: #2459A6; font-weight: 700; font-size: 1.05rem; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.acc-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.acc-btn.small { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.acc-btn.warn { color: #B3261E; }
.account-card.in { display: block; }
.acc-head { display: flex; align-items: center; gap: 14px; }
.acc-rows { margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, .25); }
.acc-rows .toggle-row { font-weight: 600; }
.acc-rows .toggle-row + .toggle-row { border-top: 1px solid rgba(255, 255, 255, .18); }
.acc-rows .switch { background: rgba(255, 255, 255, .3); }
.acc-rows .switch[aria-checked="true"] { background: #46B86C; }
.acc-rows .confirm-row { color: #fff; }
@media (max-width: 400px) { .account-card:not(.in) .acc-btn { width: 100%; } }

/* The family account sheet. */
.sheet-lead { text-align: center; margin: 0 0 14px; }
.sheet-msg { text-align: center; min-height: 1.4em; margin: 12px 0 0; font-weight: 700; color: var(--orange-d); }
.sheet-fine { text-align: center; font-size: .85rem; margin: 10px 0 0; }
.link-btn { color: var(--blue-d); font-weight: 700; text-decoration: underline; padding: 4px; }
.name-field small { font-weight: 500; }
.name-field input { font: inherit; font-size: 1.4rem; font-weight: 700; color: var(--ink); padding: 12px 16px; border-radius: 16px; border: 3px solid var(--bg-2); background: var(--card); }
.avatar-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; justify-items: center; }
.avatar-pick button { border-radius: 50%; padding: 0; background: none; }
.avatar-pick .avatar { width: 68px; height: 68px; }
.avatar-pick button.on .avatar { box-shadow: inset 0 0 0 3px #fff, 0 0 0 4px var(--teal); }
.child-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; flex-wrap: wrap; }
.child-row.on { background: #E3F4F2; }
.child-row b { font-size: 1.15rem; }
.child-row .cs { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); margin-right: auto; }
.child-row .cs .coin { width: 18px; height: 18px; }
.pill-btn.mini { min-height: 44px; font-size: 1rem; padding: 0 16px; }
.child-row .pill-btn.mini, .child-row .danger { min-height: 40px; padding: 0 12px; font-size: .95rem; }
/* Xaraf Raadi: big letter tiles. */
/* Higgaad Raadi: syllables, the vowel in its column's colour as on the Higgaad screen. */
.syl-choice { font-size: clamp(2.2rem, 11vw, 3.6rem); color: var(--ink); }
.syl-choice b { color: var(--vd); font-weight: 700; }
.letter-choice { font-family: inherit; font-size: clamp(3rem, 15vw, 4.4rem); font-weight: 700; display: grid; place-items: center; aspect-ratio: 1; }
/* Logo-style words: multicoloured letters with a white outline popping in one by one. */
/* Easy to read: a little air between the letters and a clear gap between the words, so the white outlines
   never run them together, and room between two lines (Mar kale / tijaabi!). */
.pop-title, .pop-word span { font-weight: 700; line-height: 1.2; letter-spacing: .03em; word-spacing: .3em; text-shadow: var(--outline-5), 0 7px 0 rgba(46, 33, 24, .15); }
.pop-title .nw, .pop-word .nw { white-space: nowrap; }
.pop-title i, .pop-word i { font-style: normal; display: inline-block; animation: letterPop .5s cubic-bezier(.3, 1.7, .6, 1) both; animation-delay: calc(var(--d, 0s) + var(--i) * .06s); }
.done-screen h1.pop-title { font-size: clamp(2.8rem, 13vw, 4rem); }
/* Low on the screen, below the cards, so it never covers what the child is choosing. */
.pop-word { position: fixed; left: 0; right: 0; bottom: calc(max(9vh, var(--band-h) + 14px) + var(--safe-b)); display: flex; justify-content: center; text-align: center; padding: 0 16px; pointer-events: none; z-index: 60; }
.pop-word span { font-size: clamp(3.2rem, 17vw, 5.5rem); animation: popWordOut 1.5s ease-in forwards; }
.pop-word.gentle span { font-size: clamp(2.2rem, 11vw, 3.6rem); }
@keyframes popWordOut { 0%, 72% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-36px) scale(.92); } }
.done-stars .coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.done-bonus { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 4px; }
/* Bonus stars for the round: a coin (finished), a heart (no mistakes), a gift (daily). */
.done-bonus .bonus { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 1.4rem; color: var(--ink); animation: pop .45s cubic-bezier(.3,1.6,.6,1) both; animation-delay: calc(.9s + var(--k) * .25s); }
.done-bonus .bonus svg { width: 32px; height: 32px; }
.done-bonus .bonus .heart { fill: var(--pink); }
.done-bonus .bonus .i { color: var(--pink-d); }
.done-stars .coin { width: 44px; height: 44px; animation: pop .4s cubic-bezier(.3,1.6,.6,1) both; }
.done-stars .coin:nth-child(2) { animation-delay: .08s; }
.done-stars .coin:nth-child(3) { animation-delay: .16s; }
.done-stars .coin:nth-child(4) { animation-delay: .24s; }
.done-stars .coin:nth-child(5) { animation-delay: .32s; }
.done-stars .coin:nth-child(6) { animation-delay: .4s; }

/* ---------- Rewards ---------- */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  border-radius: var(--radius); padding: 18px; text-align: center; background: var(--card); box-shadow: var(--shadow);
}
.stat .n { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 3rem; font-weight: 700; line-height: 1.1; }
.stat .k { font-size: 1.05rem; color: var(--ink-soft); }
h2.section { display: flex; align-items: center; gap: 8px; }
.sticker-grid { --cols: 3; --gap: 14px; gap: 18px var(--gap); }
@media (min-width: 480px) { .sticker-grid { --cols: 4; } }
@media (min-width: 640px) { .sticker-grid { --cols: 5; } }
@media (min-width: 820px) { .sticker-grid { --cols: 6; } }
.sticker { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; }
.sticker .badge { width: 100%; aspect-ratio: 1; filter: drop-shadow(0 5px 0 rgba(46,33,24,.12)); transform: rotate(-4deg); }
.sticker:nth-child(even) .badge { transform: rotate(4deg); }
.sticker .emoji { font-size: 3rem; }
.sticker .name { font-size: 1rem; font-weight: 700; line-height: 1.1; }
.sticker .name small { display: block; font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
/* Not yet yours: the picture you are working towards, a little faded, with its price. The next one to
   save up for has a ring and a bar showing how close the stars are. */
.sticker.locked .badge { filter: saturate(.5); opacity: .55; transform: none; }
.sticker.locked .need { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(46, 33, 24, .14); }
.sticker.next .badge { filter: saturate(.8); opacity: .95; outline: 4px dashed var(--yellow); outline-offset: 3px; border-radius: 50%; }
.sticker .prog { display: block; width: 72%; height: 8px; border-radius: 99px; background: rgba(46, 33, 24, .16); overflow: hidden; }
.sticker .prog i { display: block; height: 100%; border-radius: 99px; background: var(--yellow); }
/* Enough stars to buy it: full colour, gently bobbing, with a glowing price. */
.sticker.can-buy .badge { outline: 4px solid var(--yellow); outline-offset: 3px; border-radius: 50%; }
.sticker.can-buy .need { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 3px #fff, 0 0 14px 4px rgba(247, 179, 43, .7); }
.sticker-bank { margin: 8px 0 0; text-align: center; font-weight: 700; color: var(--ink-soft); display: flex; gap: 6px; justify-content: center; align-items: center; }
/* The 3D sticker viewer. */
.s3d-stage { width: min(270px, 70vw); aspect-ratio: 1; margin: 6px auto 0; perspective: 900px; touch-action: none; cursor: grab; user-select: none; }
.s3d-stage.dragging { cursor: grabbing; }
.s3d { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }
.s3d-face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.s3d-face .badge { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 8px rgba(46, 33, 24, .25)); }
.s3d-face.back { transform: rotateY(180deg); }
.s3d-glare { position: absolute; inset: 4%; border-radius: 50%; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--gx, 35%) var(--gy, 30%), rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 48%); }
.s3d-hint { margin: 2px 0 0; text-align: center; color: var(--ink-soft); font-size: .95rem; }
button.sticker { font-family: inherit; color: var(--ink); background: none; padding: 0; }
button.sticker:active .badge { transform: scale(.94); }
.sticker.nope { animation: shake .45s; }
.sticker-big { width: min(260px, 70vw); margin: 8px auto 0; animation: pop .45s cubic-bezier(.3, 1.6, .6, 1); }
.sticker-big .badge { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 0 rgba(46,33,24,.12)); }
.sticker-title { margin: 12px 0 0; text-align: center; font-size: 2.4rem; }
.sticker-title i { font-style: normal; display: inline-block; }
.sticker-en { margin: 2px 0 6px; text-align: center; color: var(--ink-soft); font-size: 1.1rem; }
.sticker .need {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .9rem; font-weight: 700; background: var(--card); padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  color: var(--ink-soft); box-shadow: 0 2px 0 rgba(46,33,24,.1);
}

/* ---------- Parent ---------- */
.gate { display: grid; justify-items: center; gap: 14px; text-align: center; padding-top: 10px; }
.gate .q { font-size: 2.4rem; font-weight: 700; }
.gate .answer { min-width: 160px; min-height: 72px; padding: 6px 20px; font-size: 2.4rem; font-weight: 700; border-radius: 22px; background: var(--card); box-shadow: inset 0 3px 0 rgba(58,38,21,.08); }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.keypad button { height: 76px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); font-size: 1.8rem; font-weight: 700; display: grid; place-items: center; }
.keypad svg.i { width: 32px; height: 32px; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(58,38,21,.12); }
.gate.wrong .answer { animation: shake .45s; }

.parent { display: grid; gap: 16px; font-size: 1.05rem; }
.panel { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 10px; font-size: 1.25rem; }
.panel p.muted { color: var(--ink-soft); margin: 0; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; margin: 10px 0; }
.bar-name { display: flex; align-items: center; gap: 6px; }
.bar-name .art { width: 30px; height: 30px; flex: none; }
.bar { height: 14px; border-radius: 99px; background: rgba(58,38,21,.1); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--teal); }
.word-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(58,38,21,.08); }
.word-row:first-of-type { border-top: 0; }
.word-row .pic .emoji { font-size: 2rem; }
.word-row .pic .art { width: 42px; height: 42px; }
.word-row .pic .swatch { width: 34px; height: 34px; box-shadow: 0 0 0 2px rgba(58,38,21,.2); }
.word-row .w { flex: 1; }
.word-row .w b { font-size: 1.2rem; }
.word-row .w span { color: var(--ink-soft); margin-left: 6px; }
.word-row .cnt { color: var(--ink-soft); font-size: .95rem; white-space: nowrap; }
.mini-play { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-2); color: var(--blue-d); display: grid; place-items: center; flex: none; }
.mini-play svg.i { width: 24px; height: 24px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.switch { width: 72px; height: 42px; border-radius: 99px; background: rgba(58,38,21,.2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%; background: #fff; transition: transform .42s var(--ease-spring); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(30px); }
.danger { color: #B3261E; font-weight: 700; min-height: 48px; padding: 0 12px; border-radius: 14px; background: #FDE7E5; }
.confirm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.code-show { word-break: break-all; font-weight: 700; }
.review-banner { background: #FFF1C9; color: #6B4A00; border-radius: 18px; padding: 12px 16px; }

/* ---------- FX ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px;
  font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); white-space: nowrap;
  opacity: 0; transform: translate(-50%, 24px);
  transition: opacity .3s var(--ease-out), transform .42s cubic-bezier(.34, 1.4, .5, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .big { display: grid; width: 56px; height: 56px; margin: -8px 0 -8px -12px; }
.toast .big svg { width: 100%; height: 100%; }

/* ---------- Animations ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(48px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(36px) scale(.97); } }
@keyframes pressPop { 0% { transform: scale(1); } 30% { transform: scale(.8); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bump { 30% { transform: scale(1.25); } 60% { transform: scale(.95); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-28deg); } 75% { transform: rotate(18deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-22px); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes wiggle-pop { 0% { transform: scale(1); } 35% { transform: scale(1.08) rotate(-3deg); } 70% { transform: scale(1.03) rotate(2deg); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ---------- Scene: sky, sun, clouds, dunes ---------- */
.scene {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--sky-top);
}
/* The owner's painted desert and coast (images/scene), one picture for each shape of screen, by day and
   by night: computers and phones held sideways, tablets held sideways, tablets held upright and phones.
   Only the picture for the screen in use is downloaded. Sideways they fill the screen from the bottom up;
   upright they sit at the top (the shoreline cut high, for Geesi to stand on) over plain sand, with the
   woven band along the bottom. */
.scene .bg { position: absolute; inset: 0; background: url("images/scene/wide-day.webp") center bottom / cover no-repeat; }
.scene .night { background-image: url("images/scene/wide-night.webp"); }
.scene .band { display: none; }
@media (orientation: landscape) and (max-aspect-ratio: 3/2) {
  .scene .day { background-image: url("images/scene/tablet-day.webp"); }
  .scene .night { background-image: url("images/scene/tablet-night.webp"); }
}
@media (orientation: portrait) {
  .scene .day { background: url("images/scene/tall-day.webp") center top / 100% auto no-repeat, var(--sand-day); }
  .scene .night { background: url("images/scene/tall-night.webp") center top / 100% auto no-repeat, var(--sand-night); }
  .scene .band { display: block; position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1086 / 68; background: url("images/scene/tall-day-band.webp") center / 100% 100%; }
}
@media (orientation: portrait) and (max-aspect-ratio: 2/3) {
  .scene .day { background-image: url("images/scene/phone-day.webp"); }
  .scene .night { background-image: url("images/scene/phone-night.webp"); }
  .scene .band { aspect-ratio: 941 / 75; background-image: url("images/scene/phone-day-band.webp"); }
}
/* Everywhere but the home and the intro the lower part of the picture fades back behind a veil of
   sand, so the cards and the words on them read cleanly. */
.scene .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(251, 241, 226, 0) 28%, rgba(251, 241, 226, .8) 60%); transition: opacity .5s; }
body.home .scene .veil, body.intro-on .scene .veil { opacity: 0; }
.cloud { position: absolute; left: 0; width: 150px; opacity: .9; animation: drift linear infinite; }
.cloud.c1 { top: 9vh; width: 130px; animation-duration: 95s; animation-delay: -30s; }
.cloud.c2 { top: 24vh; width: 180px; opacity: .75; animation-duration: 130s; animation-delay: -90s; }
.cloud.c3 { top: 38vh; width: 110px; opacity: .6; animation-duration: 110s; animation-delay: -10s; }
/* upright, the sky is only the top of the screen */
@media (orientation: portrait) { .cloud.c2 { top: 3vh; width: 120px; } .cloud.c3 { top: 14vh; width: 90px; } }
.birds { position: absolute; top: 15vh; left: 56vw; width: 54px; animation: birds 6s ease-in-out infinite, homeAtNight var(--cycle) linear var(--cycle-at) infinite; }
@media (orientation: portrait) { .birds { top: 9vh; left: 60vw; width: 40px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translateX(-220px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes birds { 50% { transform: translate(14px, -8px); } }

/* ---------- Night ---------- */
/* Each cycle (--cycle, 2 minutes) is mostly day. At sunset the sky turns
   orange and the night picture (stars, the crescent moon, lit windows) fades in
   over the day one; the birds go home; at dawn a little orange again. Only
   opacity and transform move, so it is cheap even on old tablets. Without
   motion it stays day. */
:root { --cycle: 120s; --cycle-at: -30s; }
.dusk, .night { position: absolute; inset: 0; opacity: 0; }
.dusk { background: linear-gradient(180deg, rgba(255, 150, 90, 0) 0%, rgba(255, 140, 90, .3) 45%, rgba(240, 110, 80, .4) 75%, rgba(240, 110, 80, .25) 100%);
  animation: dusk var(--cycle) linear var(--cycle-at) infinite; }
.night { animation: nightFall var(--cycle) linear var(--cycle-at) infinite; }
@keyframes nightFall { 0%, 72% { opacity: 0; } 82%, 92% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes dusk { 0%, 64% { opacity: 0; } 74% { opacity: 1; } 82%, 92% { opacity: 0; } 97% { opacity: .7; } 100% { opacity: 0; } }
@keyframes homeAtNight { 0%, 72% { opacity: 1; } 79%, 94% { opacity: 0; } 99%, 100% { opacity: 1; } }
/* Words and dots straight on the sky stay easy to see at night. */
.topbar-title small, .dots i { transition: color 4s, background-color 4s; }
html.is-night .topbar-title small { color: #ECE2CF; }
html.is-night .dots i:not(.done):not(.now), html.is-night .word-nav .dots i:not(.on) { background-color: rgba(255, 255, 255, .4); }
html.is-night .listen-word { text-shadow: var(--outline-3); }

/* ---------- Intro ---------- */
body.intro-on .topbar, body.intro-on .view { visibility: hidden; }
.intro { position: fixed; inset: 0; z-index: 80; overflow: hidden; cursor: pointer; transition: opacity .45s, transform .45s; }
.intro.leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.intro-title { position: absolute; left: 0; right: 0; top: calc(9vh + var(--safe-t)); display: grid; justify-items: center; gap: 4px; }
.intro-mark { font-size: min(5.6rem, 17vw); filter: drop-shadow(0 7px 0 rgba(46, 33, 24, .16)); }
.intro-mark b, .intro-mark .wm-pill { opacity: 0; }
.intro.landed .intro-mark b, .intro.landed .intro-mark .wm-pill { animation: letterPop .55s cubic-bezier(.3, 1.7, .6, 1) both; animation-delay: calc(var(--i) * .09s); }
.runner-track { --rw: min(400px, 88vw); position: absolute; left: 50%; bottom: max(calc(16vh + var(--safe-b)), calc(var(--band-h) + 124px + var(--safe-b))); width: var(--rw); margin-left: calc(var(--rw) / -2); }
.runner-move { transform: translateX(calc(-50vw - var(--rw))); will-change: transform; }
/* his run: the picture of every frame slides behind a window one frame big (js/scene.js) */
.run-cell { position: relative; width: 100%; overflow: hidden; }
.run-sheet { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
/* the live Geesi he ends as, placed by js/scene.js just where he stands in the last frame */
.intro-geesi { position: absolute; opacity: 0; pointer-events: none; }
.intro.landed .runner-move { visibility: hidden; }
.intro.landed .intro-geesi { opacity: 1; }
.intro.skip .wordmark text { animation-duration: .01s; animation-delay: 0s; transition-duration: .01s; transition-delay: 0s; }
.intro-start {
  position: absolute; left: 50%; bottom: calc(var(--band-h) + 24px + var(--safe-b)); transform: translate(-50%, 20px);
  min-height: 76px; padding: 0 34px 0 12px; gap: 16px; font-size: 1.75rem; opacity: 0; pointer-events: none; white-space: nowrap;
  box-shadow: 0 6px 0 var(--orange-d), 0 14px 24px rgba(150, 60, 20, .28);
  transition: opacity .35s, transform .35s cubic-bezier(.3, 1.6, .6, 1);
}
/* the play mark: a white disc as tall as the letters' cap height and a half, the triangle in the button's orange */
.intro-start .is-play { display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: 50%; background: #fff; color: var(--orange); box-shadow: 0 3px 0 rgba(150, 60, 20, .22); }
.intro-start .is-play svg.i { width: 26px; height: 26px; translate: 2px 0; }
/* both languages the same size and weight; only the slash between them is quieter */
.intro-start .is-lbl { display: inline-flex; align-items: baseline; gap: .32em; letter-spacing: .01em; text-shadow: 0 2px 0 rgba(120, 45, 15, .22); }
.intro-start .slash { opacity: .6; font-weight: 500; }
.intro.ready .intro-start:active { box-shadow: 0 2px 0 var(--orange-d), 0 6px 12px rgba(150, 60, 20, .22); }
.intro.ready .intro-start { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; animation: pulseCentered 1.6s ease-in-out .6s infinite; }
.intro.ready .intro-start:active { transform: translate(-50%, 4px); animation: none; }
@keyframes pulseCentered { 0%, 100% { transform: translate(-50%, 0) scale(1); } 50% { transform: translate(-50%, 0) scale(1.07); } }
@keyframes letterPop { 0% { opacity: 0; transform: translateY(30px) scale(.4); } 100% { opacity: 1; transform: none; } }

/* ---------- Depth ----------
   Tiles press down when tapped, and that is all they do. */
.big-btn:active, .pack-tile:active { transform: translateY(6px); }

/* Geesi jumps for joy like a real cub: crouches, springs up stretched, hangs
   for a moment, lands squashed and settles. His name tag swings after him. */
@keyframes geesiJump {
  0% { transform: none; }
  16% { transform: scale(1.12, .84); }
  38% { transform: translateY(-42px) scale(.9, 1.12); }
  56% { transform: translateY(-50px) scale(1.02, .98) rotate(-3deg); }
  76% { transform: translateY(0) scale(1.14, .84); }
  88% { transform: scale(.96, 1.05); }
  100% { transform: none; }
}
@keyframes tagSwing { 0%, 30% { transform: none; } 45% { transform: rotate(14deg); } 62% { transform: rotate(-10deg); } 78% { transform: rotate(5deg); } 100% { transform: none; } }
@keyframes geesiBreathe { 50% { transform: scale(1.018, .985); } }
.mascot-stage::after { transition: transform .3s; }
.mascot-stage:has(.mascot.cheer)::after { animation: shadowJump .95s cubic-bezier(.33, .7, .45, 1); }
@keyframes shadowJump { 16% { transform: scale(1.1); } 38%, 56% { transform: scale(.6); opacity: .5; } 76% { transform: scale(1.12); } 100% { transform: none; } }

/* ---------- Presses ----------
   motion-anything's button-press: anything tappable goes down almost at once
   and springs back with a little overshoot when let go. */
.big-btn, .pack-tile, .pill-btn, .next-word, .icon-btn { transition: transform .16s var(--ease-spring), box-shadow .16s var(--ease-out); }
.letter-tile, .word-card, .star-pill, .hig-letter { transition: transform .16s var(--ease-spring); }
.hig-syl { transition: transform .16s var(--ease-spring), box-shadow .16s var(--ease-out); }
.choice { transition: transform .16s var(--ease-spring), opacity .3s; }
:is(.big-btn, .pack-tile, .pill-btn, .next-word, .letter-tile, .word-card, .icon-btn, .choice, .hig-syl, .hig-letter):active { transition-duration: 80ms; transition-timing-function: var(--ease-out); }

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

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .home-grid { gap: 22px; }
  .big-btn { min-height: 200px; }
  .big-btn .ico { width: 112px; height: 112px; }
  .mascot { width: 220px; height: 220px; }
  .mascot-stage .g-host { width: 172px; }
  .letter-grid { --cols: 6; }
}
@media (min-width: 960px) {
  .letter-grid { --cols: 8; }
  .choices { max-width: 720px; margin-inline: auto; }
  .match-board { max-width: 720px; margin-inline: auto; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .home-grid { grid-template-columns: repeat(4, 1fr); }
  .big-btn { min-height: 130px; padding-bottom: 20px; }
  .big-btn .ico { width: 64px; height: 64px; margin-bottom: 2px; }
  .mascot { width: 140px; height: 140px; }
  .mascot-stage .g-host { width: 110px; }
  .choices { max-width: 560px; margin: 14px auto 0; }
  .game-head { grid-auto-flow: column; align-items: center; justify-content: center; gap: 18px; }
  .speaker-btn { width: 92px; height: 92px; }
}
@media (max-width: 699px) { .home-grid .big-btn:not(.wide) { min-height: 214px; } .home-grid .big-btn.wide { min-height: 150px; } }
@media (max-width: 360px) {
  .big-btn { min-height: 150px; }
  .big-btn .ico { width: 76px; height: 76px; }
  .big-btn .lbl { font-size: 1.25rem; }
  .bar-row { grid-template-columns: 84px 1fr auto; }
}

.credit { margin: 18px 0 0; text-align: center; font-size: .8rem; color: var(--ink-soft); }

/* ---------- States overview map ---------- */
.map-panel { margin: 0 auto 18px; max-width: 420px; padding: 10px 8px 4px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.states-map { display: block; width: 100%; height: auto; overflow: visible; }
.states-map .state { cursor: pointer; transition: opacity .25s; outline: none; }
.states-map .state .fill { transition: filter .2s; }
.states-map .state:focus-visible .fill { filter: brightness(1.08); }
@media (hover: hover) { .states-map .state:hover .fill { filter: brightness(1.08); } }
.states-map.picked .state:not(.on) { opacity: .35; }
.states-map .labels { pointer-events: none; }
.states-map .labels text {
  font-family: var(--font); font-weight: 700; font-size: 13px; text-anchor: middle; fill: #fff;
  stroke: rgba(46, 33, 24, .55); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke;
}
.states-map .zoom-label {
  font-family: var(--font); font-weight: 700; font-size: 13px; text-anchor: middle; fill: var(--ink);
  stroke: #fff; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke;
}
/* The capital under Banaadir's name, in Somali blue. */
.states-map .zoom-sub {
  font-family: var(--font); font-weight: 700; font-size: 11px; text-anchor: middle; fill: var(--blue-d);
  stroke: #fff; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke;
}

/* ---------- Feed the Camel ---------- */
.home-grid .big-btn.wide { grid-column: 1 / -1; }
.home-grid > :last-child:nth-child(odd):not(.wide) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
/* Sheeko (Stories) is gold and Ciyaaro (Games) purple: plain tiles like the rest. */
.big-btn.sheeko-tile { color: #fff; --d: #B96A0C; background: linear-gradient(180deg, #F2A93A, #E58F1B); }
.big-btn.games-tile { color: #fff; --d: #4A2DB5; background: linear-gradient(180deg, #7D60F3, #6A4CEB); }
.bkface .mouth-open, .bkface .mouth-o, .bkface .mouth-sad, .bkface .brows-sad { opacity: 0; }
.big-btn .ico, .big-btn .lbl, .big-btn .sub { z-index: 2; }
.deck { position: relative; flex: none; display: block; width: 78px; height: 100px; margin: 0 12px 0 8px; }
.deck .dk { position: absolute; inset: 0; display: block; border-radius: 12px; background: #FFF8EC; box-shadow: 0 3px 0 rgba(46, 33, 24, .2), inset 0 0 0 3px #fff; }
.deck .d3 { transform: rotate(-12deg) translate(-9px, 3px); background: #F6E7CE; }
.deck .d2 { transform: rotate(9deg) translate(8px, 1px); }
.deck .top { display: grid; place-items: center; transform: rotate(-2deg); overflow: hidden;
  background: linear-gradient(rgba(0, 0, 0, .17), rgba(0, 0, 0, .17)), var(--c); box-shadow: 0 5px 0 rgba(46, 33, 24, .24), inset 0 0 0 4px #fff, inset 0 0 0 6.5px rgba(255, 255, 255, .35); }
.deck .top::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 14px; border-radius: 0 0 6px 6px; background: var(--band) repeat-x left bottom; opacity: .9; }
.deck .dk-in { position: relative; z-index: 1; width: 68%; aspect-ratio: 1; margin-top: -9%; display: grid; place-items: center; border-radius: 50%; background: var(--cream);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85), 0 2px 0 rgba(0, 0, 0, .14); }
.deck .dk-in .art { width: 88%; height: 88%; }
.pack-tile.mix-tile .deck { width: 94px; height: 120px; }
.big-btn.nope { animation: shake .45s; }
.who-note { text-align: center; margin: 22px 0 0; }
.feed { display: grid; justify-items: center; gap: 14px; padding-top: 4px; }
.foods { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.food {
  touch-action: none; aspect-ratio: 1; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; transition: transform .15s, opacity .25s;
}
.food .pic .art { width: clamp(70px, 22vw, 120px); height: clamp(70px, 22vw, 120px); }
.food:active { transform: scale(.94); }
.food.given { opacity: .25; transform: scale(.9); }
.food.wrong { opacity: .4; animation: shake .45s; }
/* The camel's patience: one heart breaks (pops, wobbles, turns grey) per wrong food. */
.patience { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.patience .heart { width: 26px; height: 26px; fill: var(--pink, #EC5B86); stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 2px 2px rgba(46, 33, 24, .2)); transition: fill .3s; }
.patience .heart.lost { fill: #D9CFC3; filter: none; }
.patience .heart.losing { animation: heartLose .6s ease-out; }
@keyframes heartLose { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-12deg); } 55% { transform: scale(.85) rotate(10deg); } 100% { transform: none; } }
.feed-ghost { position: fixed; z-index: 45; pointer-events: none; transform: translate(-50%, -50%); filter: drop-shadow(0 10px 12px rgba(46, 33, 24, .25)); }
.feed-ghost .pic .art { width: 100%; height: auto; aspect-ratio: 1; }

/* Fixed on the backdrop's front dune; placeCamel() sets its width and top. */
.camel-zone { position: fixed; left: 8vw; width: min(380px, 80vw); top: 40vh; z-index: 1; }
.camel-zone.arriving { animation: camelArrive 1.7s cubic-bezier(.25, .6, .35, 1) both; }
.camel-zone.arriving .feed-bubble { animation: pop .4s cubic-bezier(.3, 1.6, .6, 1) 1.6s both; }
@keyframes camelArrive { from { transform: translateX(-80vw); } to { transform: none; } }
.camel { display: block; width: 100%; height: auto; overflow: visible; }
/* placeCamel() puts it above the camel's mouth and sets --tail to the mouth's x. */
.feed-bubble {
  position: absolute; left: 60%; top: -20%; display: inline-flex; white-space: nowrap; align-items: center; gap: 10px;
  padding: 10px 16px 10px 20px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
  font-size: clamp(1.3rem, 5vw, 1.9rem); font-weight: 700; color: var(--ink); animation: pop .4s cubic-bezier(.3, 1.6, .6, 1);
}
.feed-bubble::after {
  content: ""; position: absolute; left: var(--tail, 22px); bottom: -24px;
  border-top: 26px solid var(--card); border-right: 14px solid transparent;
}
.feed-bubble svg { width: 30px; height: 30px; color: var(--purple); flex: none; }
.feed-bubble.playing svg { animation: pulse .9s ease-in-out infinite; }

/* The camel's parts (js/camel.js) move around their joints, in the camel's own units (its picture's pixels). */
.camel .c-neck, .camel .c-tail, .camel .c-bell, .camel .c-ear, .camel .leg, .camel .c-body { transform-box: view-box; }
.camel.walking .leg.la { animation: stride .42s ease-in-out infinite alternate; }
.camel.walking .leg.lb { animation: stride .42s ease-in-out infinite alternate-reverse; }
.camel.walking .c-body { animation: walkBob .42s ease-in-out infinite alternate; }
@keyframes stride { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes walkBob { from { transform: translateY(0); } to { transform: translateY(-12px); } }
.camel .c-neck { transform-origin: 711px 589px; animation: neckSway 3.2s ease-in-out infinite; }
.camel .c-tail { transform-origin: 152px 528px; animation: tailSwish 2.4s ease-in-out infinite; }
.camel .c-bell { transform-origin: 855px 465px; animation: bellSway 3.2s ease-in-out infinite; }
.camel .c-ear { transform-origin: 695px 155px; animation: earTwitch 4s ease-in-out infinite; }
/* the eyes and mouths drawn over its face: it blinks now and then */
.camel .e-shut { opacity: 0; animation: camelBlink 4.2s steps(1, end) infinite; }
@keyframes camelBlink { 0% { opacity: 0; } 95% { opacity: 1; } 98% { opacity: 0; } }
.camel .e-happy, .camel .e-squint, .camel .m-open, .camel .m-chew, .camel .m-yuck, .camel .c-burp { opacity: 0; }
.camel.chew .e-shut, .camel.yuck .e-shut, .camel.upset .e-shut, .camel.sulk .e-shut { animation: none; }
/* waiting for food: mouth wide, head up */
.camel.open .m-open { opacity: 1; }
.camel.open .c-neck { animation: none; transform: rotate(-4deg); transition: transform .2s; }
/* chewing: happy eyes, the jaw munches, a nod */
.camel.chew .e-happy, .camel.chew .m-chew { opacity: 1; }
.camel.chew .m-chew .jaw { transform-box: fill-box; transform-origin: 50% 0; animation: munch .22s ease-in-out 4 alternate; }
.camel.chew .c-neck { animation: camelNod .44s ease-in-out 2; }
/* the wrong food: a squeezed eye, tongue out, a shake of the head */
.camel.yuck .e-squint, .camel.yuck .m-yuck { opacity: 1; }
.camel.yuck .c-neck { animation: camelNo .5s ease-in-out; }
.camel.burp .c-burp { animation: burpPuff 1s ease-out forwards; }
/* out of patience: cross, shakes its head and huffs, then walks off with its nose up */
.camel.upset .e-squint, .camel.upset .m-yuck { opacity: 1; }
.camel.upset .c-neck { animation: camelNo .5s ease-in-out 2; }
.camel.upset .c-burp { animation: burpPuff 1s ease-out .3s forwards; }
.camel.sulk .c-neck { animation: none; transform: rotate(-6deg); transition: transform .3s; }
.camel.sulk .e-squint { opacity: 1; }
.camel-zone.leaving { animation: camelLeave 2.2s ease-in both; }
@keyframes camelLeave { to { transform: translateX(110vw); } }
@keyframes neckSway { 50% { transform: rotate(-2deg); } }
@keyframes tailSwish { 50% { transform: rotate(9deg); } }
@keyframes bellSway { 25% { transform: rotate(6deg); } 75% { transform: rotate(-6deg); } }
@keyframes earTwitch { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-9deg); } 96% { transform: rotate(5deg); } }
@keyframes munch { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
@keyframes camelNod { 50% { transform: rotate(-3deg); } }
@keyframes camelNo { 20% { transform: rotate(-5deg); } 40% { transform: rotate(4.5deg); } 60% { transform: rotate(-3.5deg); } 80% { transform: rotate(2deg); } }
@keyframes burpPuff { 0% { opacity: 0; transform: translate(-30px, 30px) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(30px, -60px) scale(1.2); } }
@media (orientation: landscape) and (max-height: 560px) {
  .foods { max-width: 360px; gap: 10px; }
  /* the foods on the right, so the camel has the room on the left (js/app.js placeCamel) */
  .feed .foods { justify-self: end; margin-right: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .food .pic .art { width: min(78px, 100%); height: auto; aspect-ratio: 1; }
}

/* Dhegayso: the word's spelling under the speaker */
.listen-word { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 700; color: var(--ink); line-height: 1.1; text-align: center; }

/* Wrong answer: the screen edge glows red, then fades */
.wrong-flash {
  position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 10px rgba(229, 57, 53, .85), inset 0 0 70px 24px rgba(229, 57, 53, .35);
}
.wrong-flash.on { animation: wrongFlash .8s ease-out; }
@keyframes wrongFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Word packs: flip to discover ---------- */
.found-bar { display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto 16px; padding: 8px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.found-count { display: inline-flex; align-items: center; gap: 6px; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.found-count .coin, .found-count svg { width: 26px; height: 26px; }
.found-track { flex: 1; height: 12px; border-radius: 99px; background: rgba(46, 33, 24, .1); overflow: hidden; }
.found-track i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--gold, #F7B32B); transition: width .4s ease; }

.word-card.flip { padding: 0; background: none; box-shadow: none; perspective: 900px; height: 200px; min-height: 0; }
.word-card.flip:active { transform: scale(.96); }
.word-card.flip.playing { outline: none; animation: wiggle-pop .5s; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.35, .5, 1); }
.word-card.flip.open .flip-inner { transform: rotateY(180deg); }
.flip .face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 8px; border-radius: var(--radius); box-shadow: var(--shadow);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip .face.front { background: var(--card); transform: rotateY(180deg); }
.word-card.flip.playing .face.front { box-shadow: 0 0 0 4px var(--yellow), var(--shadow); }
/* The back: the pack's colour, woven like a Somali mat, with the pack's picture */
.flip .face.back {
  background-color: var(--c);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .16) 0 9px, transparent 9px 18px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 9px, transparent 9px 18px);
  border: 4px solid rgba(255, 255, 255, .5);
}
.back-badge { width: 74px; height: 74px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.back-badge .art { width: 78%; height: 78%; }
.show-all-row { text-align: center; margin-top: 18px; }
.show-all { min-height: 48px; font-size: 1rem; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* ---------- Sheeko: story pictures (js/storyscenes.js) ----------
   The cast drawings carry every mouth and brow; a picture shows one mood. */
.story-art { display: block; width: 100%; height: 100%; }
.story-art .mouth-open, .story-art .mouth-o, .story-art .mouth-sad, .story-art .brows-sad { opacity: 0; }
.story-art .mood-open .mouth-smile, .story-art .mood-o .mouth-smile, .story-art .mood-sad .mouth-smile, .story-art .mood-sleep .mouth-smile { opacity: 0; }
.story-art .mood-open .mouth-open, .story-art .mood-o .mouth-o, .story-art .mood-sad .mouth-sad, .story-art .mood-sad .brows-sad { opacity: 1; }
.story-art .mood-sleep .blink { transform: translateY(102px) scaleY(.12) translateY(-102px); }
.story-art .st-in { transform-box: fill-box; transform-origin: 50% 100%; }
.story-art .st-bob .st-in { animation: stBob 3.2s ease-in-out infinite; }
.story-art .st-run .st-in { animation: stRun .42s ease-in-out infinite; }
.story-art .st-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: stFlame .5s ease-in-out infinite alternate; }
.story-art .st-cloud { animation: stDrift 18s ease-in-out infinite alternate; }
.story-art .st-cloud.c1 { animation-duration: 24s; } .story-art .st-cloud.c2 { animation-duration: 30s; }
.story-art .st-stars circle { animation: stPulse 2.6s ease-in-out infinite; animation-delay: calc(var(--k) * .35s); }
.story-art .st-rain path { animation: stRain .7s linear infinite; animation-delay: calc(var(--k) * -.1s); }
.story-art .st-waves { animation: stWave 2.4s ease-in-out infinite alternate; }
.story-art .st-sound path { animation: stPulse 1.4s ease-in-out infinite; }
.story-art .st-sound path:nth-child(2) { animation-delay: .2s; } .story-art .st-sound path:nth-child(3) { animation-delay: .4s; }


.story-art .st-dust { animation: stPuff 1.2s ease-out infinite; transform-box: fill-box; transform-origin: 100% 50%; }
@keyframes stPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes stBob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-2px) scaleY(1.012); } }
@keyframes stRun { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes stFlame { from { transform: scale(1, 1); } to { transform: scale(.92, 1.08); } }
@keyframes stDrift { from { transform: translateX(-12px); } to { transform: translateX(16px); } }
@keyframes stRain { from { transform: translate(0, -30px); } to { transform: translate(-10px, 40px); } }
@keyframes stWave { from { transform: translateX(-8px); } to { transform: translateX(8px); } }
@keyframes stPuff { from { opacity: .9; transform: scale(.8); } to { opacity: .2; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .story-art * { animation: none !important; } }

/* ---------- Sheeko: reading settings (js/stories.js) ---------- */
.mode-list { display: grid; gap: 10px; margin: 14px 0 18px; }
.mode-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px; border-radius: 18px; text-align: left;
  background: var(--cream); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 3px transparent; }
.mode-opt b { font-size: 1.2rem; } .mode-opt span { color: var(--ink-soft); }
.mode-opt.on { box-shadow: inset 0 0 0 3px var(--teal); background: #E6F6F3; }

/* ---------- Sheeko: the storybook (js/storybook.js) ----------
   A hardback: cloth boards a little bigger than the pages, the page edges
   showing at the sides, a shadowed gutter at the spine. --pw/--ph are one
   page's size, --m the boards' margin, --fs the words' size. Classes start
   with bk- so the app's own rules never reach them. */
.bk-stage { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.bk-stage { --cloth: #C8502A; }
.bk { --paper: #FFF8EA; position: relative; flex: none; visibility: hidden;
  width: calc(2 * (var(--pw) + var(--m))); height: calc(var(--ph) + 2 * var(--m)); perspective: 2600px; }
.bk.one { width: calc(var(--pw) + 2 * var(--m)); }
.bk-ribbon { position: absolute; z-index: 0; left: calc(var(--m) + var(--pw) * 1.78); bottom: -30px; width: 16px; height: 60px; background: linear-gradient(90deg, #A8242F, #D23A44 50%, #A8242F);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.bk.one .bk-ribbon { left: calc(var(--m) + var(--pw) * .78); }
.closed .bk-ribbon, .opening .bk-ribbon, .closing .bk-ribbon { left: calc(var(--m) + var(--pw) * 1.78); }
.bk-board { position: absolute; top: 0; bottom: 0; width: 50%;
  background: radial-gradient(120% 90% at 50% 40%, rgba(255, 210, 160, .16), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px), var(--cloth);
  box-shadow: 0 22px 44px -16px rgba(70, 35, 10, .55), 0 4px 12px rgba(70, 35, 10, .25), inset 0 0 0 2px rgba(0, 0, 0, .08); }
.bk-board-l { left: 0; border-radius: 12px 3px 3px 12px; }
.bk-board-r { right: 0; border-radius: 3px 12px 12px 3px; }
.bk.one .bk-board-l { width: 100%; border-radius: 4px 12px 12px 4px; }
.bk.one .bk-board-r, .bk.one .bk-r, .bk.one .bk-edges-r, .bk.one .bk-gutter { display: none; }
.bk-edges { position: absolute; top: calc(var(--m) - 3px); height: calc(var(--ph) + 7px); width: 7px;
  background: repeating-linear-gradient(90deg, #FFFBF1 0 1px, #E2D5BC 1px 2px); }
.bk-edges-l { left: calc(var(--m) - 6px); border-radius: 3px 0 0 3px; }
.bk-edges-r { right: calc(var(--m) - 6px); border-radius: 0 3px 3px 0; }
.bk.one .bk-edges-l { left: auto; right: calc(var(--m) - 6px); border-radius: 0 3px 3px 0; }
.bk-page { position: absolute; top: var(--m); width: var(--pw); height: var(--ph); background: var(--paper); overflow: hidden; touch-action: pan-y; }
.bk-l { left: var(--m); }
.bk-r { left: calc(var(--m) + var(--pw)); }
/* the paper curves into the spine and catches the light at its outer edge */
.bk-l::after, .bk-r::after, .bk-lf::after, .bk-lb::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bk-l::after, .bk-lb::after { background: linear-gradient(90deg, rgba(255, 255, 255, .1), transparent 8%, transparent 88%, rgba(90, 55, 20, .1) 96%, rgba(70, 40, 12, .28)); }
.bk-r::after, .bk-lf::after { background: linear-gradient(270deg, rgba(255, 255, 255, .1), transparent 8%, transparent 88%, rgba(90, 55, 20, .1) 96%, rgba(70, 40, 12, .28)); }
.bk.one .bk-l::after { background: linear-gradient(270deg, rgba(255, 255, 255, .1), transparent 10%, transparent 92%, rgba(70, 40, 12, .18)); }
.bk-gutter { position: absolute; top: var(--m); height: var(--ph); left: calc(var(--m) + var(--pw) - 24px); width: 48px; z-index: 6; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(60, 35, 12, .14) 40%, rgba(45, 25, 8, .32) 50%, rgba(60, 35, 12, .14) 60%, transparent); }
.bk-face-in { position: absolute; inset: 0; }
.bk-blank { background: var(--paper); }
.bk-pic { position: absolute; inset: 0; background: #F3E6CC center / cover no-repeat; }
.bk-live { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: center / 100% 100% no-repeat; }
.bk-pic.half .bk-live { width: 200%; }
.bk-pic.half.right .bk-live { left: -100%; }
.bk-sprite { position: absolute; background: center / 100% 100% no-repeat; transform-origin: 50% 88%; animation: var(--move) var(--d, 0s) infinite; }
.bk-sprite.breathe { --move: bkBreathe 3.6s ease-in-out; }
.bk-sprite.run { --move: bkRun .5s ease-in-out; }
.bk-sprite.puff { --move: bkPuff 1.4s ease-in-out; }
.bk-sprite.beat { --move: bkBeat 1.2s ease-in-out; }
.bk-sprite.flicker { --move: bkFlicker .45s ease-in-out alternate; transform-origin: 50% 90%; }
.bk-sprite.fall { --move: bkFall .6s linear; }
.bk-sprite.float { --move: bkFloat 2.6s ease-in-out; }
.bk-sprite.snore { --move: bkSnore 3s ease-in-out; }
@keyframes bkFlicker { from { transform: scale(1, 1); } to { transform: scale(.96, 1.06); } }
@keyframes bkFall { from { transform: translate(0, -2%); } to { transform: translate(-.6%, 2%); } }
@keyframes bkFloat { 0%, 100% { transform: none; opacity: 1; } 50% { transform: translateY(-6%); opacity: .7; } }
@keyframes bkSnore { 0%, 100% { transform: none; } 50% { transform: scale(1.015, 1.03); } }
.bk-sprite.cast { cursor: pointer; }
@keyframes bkBreathe { 0%, 100% { transform: none; } 50% { transform: translateY(-.4%) scale(1.004, 1.012); } }
@keyframes bkRun { 0%, 100% { transform: none; } 50% { transform: translateY(-3%); } }
@keyframes bkPuff { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: .75; transform: scale(1.05); } }
@keyframes bkBeat { 0%, 100% { transform: none; } 15% { transform: scale(1.1); } 30% { transform: none; } }
.bk-leaf .bk-sprite { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .bk-sprite { animation: none; } }
.bk-part { position: absolute; background: center / 100% 100% no-repeat; opacity: 0; }
.bk-part.on { opacity: 1; }

/* the words, printed in the sky of the picture */
.bk-text { position: absolute; z-index: 2; left: 8%; right: 8%; top: 5%; display: flex; flex-direction: column; gap: .2em; font-size: var(--fs); }
.bk-line { display: block; text-align: left; padding: .1em .3em; margin: 0 -.3em; border-radius: .45em; color: #2B1E14; line-height: 1.3;
  transition: background-color .25s, box-shadow .25s; -webkit-tap-highlight-color: transparent; }
.bk-line .so { font-weight: 600; }
.bk-line .en { display: block; font-size: .74em; font-weight: 500; color: #6A523D; }
.bk-line .so.small { display: block; font-size: .74em; font-weight: 500; color: #6A523D; }
/* a little speaker on the line that is read in the other language when it is tapped */
.bk-line .spk, .bk-ask .spk { display: inline-block; width: .85em; height: .85em; margin-right: .4em; vertical-align: -.1em; background: currentColor; opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.500 3a4.500 4.500 0 0 0-2.500-4v8a4.500 4.500 0 0 0 2.500-4zM14 3.200v2.100c2.900.9 5 3.600 5 6.700s-2.100 5.800-5 6.700v2.100c4-.9 7-4.500 7-8.800s-3-7.900-7-8.800z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.500 3a4.500 4.500 0 0 0-2.500-4v8a4.500 4.500 0 0 0 2.500-4zM14 3.200v2.100c2.900.9 5 3.600 5 6.700s-2.100 5.800-5 6.700v2.100c4-.9 7-4.500 7-8.800s-3-7.900-7-8.800z'/%3E%3C/svg%3E") center / contain no-repeat; }
.bk-line .en, .bk-line .so.small, .bk-ask small { cursor: pointer; }
.bk-line:has(.so.small) > .en { font-size: 1em; font-weight: 600; color: #2B1E14; }
/* what a character says: a speech bubble beside their face; narration is plain text */
.bk-line.said { display: flex; align-items: center; gap: .55em; padding: .15em 0; margin: .15em 0; background: none; }
.bk-line.said .so, .bk-line.said .en { color: #2B1E14; }
.bk-faces { flex: none; display: flex; align-items: center; }
.bk-face-b { display: block; width: 3.3em; height: 3.3em; border-radius: 50%; padding: .22em .15em 0; background: #FFF6E4; box-shadow: 0 0 0 .2em var(--tg, #C8956A), 0 0 0 .34em #fff, 0 2px 5px rgba(0, 0, 0, .25); overflow: hidden; transition: transform .2s var(--ease-spring); }
.bk-face-b svg { width: 100%; height: 100%; display: block; }
.bk-faces.n2 .bk-face-b, .bk-faces.n3 .bk-face-b { width: 2.5em; height: 2.5em; } .bk-faces.n2 .bk-face-b + .bk-face-b, .bk-faces.n3 .bk-face-b + .bk-face-b { margin-left: -.7em; }
.bk-face-b[data-who="geesi"] { --tg: #EE6A3F; } .bk-face-b[data-who="ayan"] { --tg: #8A63D2; } .bk-face-b[data-who="sagal"] { --tg: #46B86C; } .bk-face-b[data-who="omar"] { --tg: #1F78D1; } .bk-face-b[data-who="yusuf"] { --tg: #5A4537; }
.bk-face-b[data-who="diin"] { --tg: #E0603E; } .bk-face-b[data-who="mother"] { --tg: #2C9C8F; } .bk-face-b[data-who="girl"] { --tg: #8A63D2; } .bk-face-b[data-who="boy"] { --tg: #F2B14C; } .bk-face-b[data-who="dhegdheer"] { --tg: #7A56A0; }
.bk-bub { position: relative; flex: 0 1 auto; padding: .25em .7em; border-radius: 1.1em; background: #fff; box-shadow: 0 0 0 .13em var(--tg, #C8956A), 0 .18em 0 rgba(0, 0, 0, .12); transition: background-color .25s; }
.bk-bub::before { content: ""; position: absolute; left: -.5em; top: 50%; width: .9em; height: .9em; transform: translateY(-50%) rotate(45deg); background: #fff; box-shadow: -.13em .13em 0 0 var(--tg, #C8956A); border-radius: 0 0 0 .22em; transition: background-color .25s; }
.bk-line.said[data-who="geesi"] { --tg: #EE6A3F; } .bk-line.said[data-who="ayan"] { --tg: #8A63D2; } .bk-line.said[data-who="sagal"] { --tg: #46B86C; } .bk-line.said[data-who="omar"] { --tg: #1F78D1; } .bk-line.said[data-who="yusuf"] { --tg: #5A4537; }
.bk-line.said[data-who="diin"] { --tg: #E0603E; } .bk-line.said[data-who="children"] { --tg: #1C9A8F; } .bk-line.said[data-who="worker"] { --tg: #8A63D2; } .bk-line.said[data-who="dhegdheer"] { --tg: #7A56A0; }
.bk-line.now.said { background: none; box-shadow: none; }
.bk-line.now.said .bk-bub { background: #FFF1C7; } .bk-line.now.said .bk-bub::before { background: #FFF1C7; } .bk-line.now.said .bk-face-b { transform: scale(1.1); }
/* the one who is speaking is lit in the picture, and hops */
.bk-spot { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 224, 110, .9), rgba(255, 224, 110, 0)); opacity: 0; transition: opacity .25s; pointer-events: none; }
.bk-spot.on { opacity: 1; }
.bk-sprite.speaking { animation: bkSpeak .5s ease-in-out infinite; }
@keyframes bkSpeak { 0%, 100% { transform: none; } 50% { transform: translateY(-2.5%) scale(1.02); } }
.bk-sprite.swapped .bk-part { display: none; }
.bk-line .w { border-radius: .25em; transition: background-color .12s, color .12s; }
.bk-line .w.lit { background: #FFC93A; color: #2B1E14; box-shadow: 0 0 0 .08em #FFC93A; }
.on-dark .bk-line { color: #FFF6E4; text-shadow: 0 1px 2px rgba(10, 14, 40, .8), 0 0 10px rgba(10, 14, 40, .5); }
.on-dark .bk-line .en, .on-dark .bk-line .so.small { color: #E4D8C4; }
.on-dark .bk-line.said .so, .on-dark .bk-line.said .en { color: #2B1E14; text-shadow: none; }
.on-dark .bk-line.said .en, .on-dark .bk-line.said .so.small { color: #5A4A38; }
.on-dark .bk-line .w.lit { color: #2B1E14; text-shadow: none; }
.on-dark .bk-num { color: rgba(255, 246, 228, .6); }
.bk-line.now { background: rgba(255, 210, 90, .55); box-shadow: 0 0 0 .14em rgba(255, 210, 90, .55); }
.bk-line:active { background: rgba(255, 220, 130, .4); }
.bk-num { position: absolute; z-index: 2; bottom: 2.2%; left: 6%; font-size: 13px; font-weight: 600; color: rgba(60, 40, 22, .55); }
.bk-r .bk-num, .bk-lf .bk-num { left: auto; right: 6%; }

/* the corner arrows */
.bk-arrow { position: absolute; z-index: 30; bottom: calc(var(--m) + 12px); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 250, 238, .94); color: var(--orange-d); box-shadow: 0 3px 0 rgba(150, 70, 30, .3), 0 6px 14px rgba(60, 30, 10, .2); transition: transform .15s, opacity .3s; }
.bk-arrow svg { width: 30px; height: 30px; }
.bk-arrow:active { transform: translateY(3px); }
.bk-next { right: calc(var(--m) + 12px); }
.bk-prev { left: calc(var(--m) + 12px); }
.bk-prev svg { transform: scaleX(-1); }
.at-first .bk-prev, .at-last .bk-next, .closed .bk-arrow, .opening .bk-arrow { opacity: 0; pointer-events: none; }

/* the cover: closed over the right-hand pages, it swings open on the spine */
.bk-cover { position: absolute; z-index: 40; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; }
.bk.one .bk-cover { left: 0; width: 100%; }
.open .bk-cover { display: none; }
.bk-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.bk-cover-front { border-radius: 4px 12px 12px 4px; background: var(--cloth);
  box-shadow: 0 22px 44px -16px rgba(70, 35, 10, .55), 0 4px 12px rgba(70, 35, 10, .3), inset 0 0 0 2px rgba(0, 0, 0, .1); }
.bk-cover-front .bk-pic { opacity: 0; transition: opacity .5s; }
.bk-cover-front .bk-pic.in { opacity: 1; }
.bk-cover-front .bk-pic { inset: 0; border-radius: inherit; box-shadow: none; }
.bk-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 8%; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, .32), rgba(0, 0, 0, .08) 22%, rgba(255, 255, 255, .16) 30%, rgba(0, 0, 0, .1) 38%, transparent 70%); }
.bk-cover-series { margin: 0 0 .3em; font-size: calc(var(--ph) * .03); font-weight: 700; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 0 rgba(60, 25, 5, .6), 0 0 6px rgba(60, 25, 5, .45); }
.bk-cover-title { position: absolute; left: 11%; right: 5%; top: 5%; text-align: center; pointer-events: none; }
.bk-cover-title h1 { margin: 0; font-size: calc(var(--ph) * .085); line-height: 1.04; font-weight: 700; letter-spacing: .01em; color: var(--cloth, #C8502A);
  text-shadow: 0 .06em 0 #fff, .06em 0 0 #fff, 0 -.06em 0 #fff, -.06em 0 0 #fff, .045em .045em 0 #fff, -.045em .045em 0 #fff, .045em -.045em 0 #fff, -.045em -.045em 0 #fff, 0 .11em .08em rgba(60, 25, 5, .35); }
.bk-cover-en { margin: .35em 0 0; font-size: calc(var(--ph) * .042); font-weight: 700; color: #fff; letter-spacing: .02em;
  text-shadow: 0 .07em 0 #8E3418, .06em 0 0 #8E3418, -.06em 0 0 #8E3418, 0 -.06em 0 #8E3418, 0 .12em .08em rgba(60, 25, 5, .4); }
.bk-w { display: inline-block; white-space: nowrap; }
.bk-w i { font-style: normal; }
.bk-cover-back { transform: rotateY(180deg); border-radius: 12px 3px 3px 12px; background: var(--cloth); }
.bk-page-in { position: absolute; top: var(--m); bottom: var(--m); left: var(--m); right: 0; background: var(--paper); overflow: hidden; }
.bk.one .bk-page-in { left: 0; right: var(--m); }
.closed .bk-board-l, .closed .bk-l, .closed .bk-edges-l, .closed .bk-gutter, .opening .bk-board-l, .opening .bk-l, .opening .bk-edges-l, .opening .bk-gutter { visibility: hidden; }

/* a page turning */
.bk-leaf { position: absolute; z-index: 20; top: var(--m); left: calc(var(--m) + var(--pw)); width: var(--pw); height: var(--ph); transform-origin: 0 50%; transform-style: preserve-3d; }
.bk-leaf.single { left: var(--m); }
.bk-lf, .bk-lb { background: var(--paper); }
.bk-lb { transform: rotateY(180deg); }
.bk-leaf i { display: none; }

/* paper pages: the contents and the title pages */
.bk-paper { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 9% 9% 7%; text-align: center; color: #2B1E14;
  background: radial-gradient(90% 70% at 50% 45%, rgba(255, 255, 255, .5), transparent 70%), var(--paper); }
.bk-paper h2 { margin: 0; font-size: calc(var(--ph) * .062); color: var(--orange-d); }
.bk-sub { margin: .2em 0 0; color: #6A523D; font-size: calc(var(--ph) * .03); }
.bk-fx { position: absolute; z-index: 5; pointer-events: none; display: block; }
.bk-fx svg { width: 100%; height: 100%; display: block; }
.bk-fx.ring { border-radius: 50%; border: 5px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 2px rgba(255, 170, 40, .6); }
.bk-titlepage { justify-content: center; gap: 2%; }
.bk-series { margin: 0; font-size: calc(var(--ph) * .032); font-weight: 600; color: var(--orange-d); letter-spacing: .04em; }
.bk-title { margin: 0; font-size: calc(var(--ph) * .12); line-height: 1.02; font-weight: 700; color: var(--cloth, #C8502A);
  text-shadow: 0 .05em 0 #fff, .05em 0 0 #fff, 0 -.05em 0 #fff, -.05em 0 0 #fff, 0 .09em .05em rgba(60, 25, 5, .22); }
.bk-flourish { width: 40%; height: 26px; margin-top: 4%; background:
  radial-gradient(circle, #EC5B86 5px, transparent 5.5px) 0 50% / 26px 26px repeat-x,
  radial-gradient(circle, #F7B32B 3px, transparent 3.5px) 13px 50% / 26px 26px repeat-x; }

.bk-vignette { margin-top: auto; background: center / 100% 100% no-repeat; }
.bk-titlepage .bk-vignette { margin-top: 4%; }
/* the questions at the end, on the last pages */
.bk-quiz-q { justify-content: center; gap: 3%; }
.bk-qn { margin: 0; font-weight: 700; color: rgba(60, 40, 22, .5); font-size: calc(var(--ph) * .03); }
.bk-ask { display: flex; flex-direction: column; gap: .2em; padding: .5em .8em; border-radius: 22px; background: rgba(247, 179, 43, .14); box-shadow: inset 0 0 0 2px rgba(200, 120, 40, .2); }
.bk-ask b { font-size: calc(var(--ph) * .07); line-height: 1.15; }
.bk-ask small { font-size: calc(var(--ph) * .03); color: #6A523D; }
.bk-quiz-a { justify-content: center; }
.bk-choices { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 4%; }
.bk-choices.words { flex-direction: column; align-items: stretch; gap: calc(var(--ph) * .04); }
.bk-choice { border-radius: 22px; background: #FFFDF6; box-shadow: 0 5px 0 rgba(120, 70, 30, .18), inset 0 0 0 2px rgba(200, 120, 40, .18); transition: transform .15s, background .2s; }
.bk-choice.pic { width: 30%; padding: 3% 2% 4%; display: flex; flex-direction: column; align-items: center; gap: .3em; }
.bk-choice-pic { width: 100%; aspect-ratio: 280 / 260; background: center / contain no-repeat; }
.bk-choice.pic b { font-size: calc(var(--ph) * .036); }
.bk-choice.word { padding: 4% 6%; display: flex; flex-direction: column; gap: .2em; }
.bk-choice.word b { font-size: calc(var(--ph) * .05); }
.bk-choice.word small { color: #6A523D; font-size: calc(var(--ph) * .028); }
.bk-choice.lit { transform: translateY(-4px) scale(1.03); background: #FFF1C7; }
.bk-choice.right { background: #DDF5E4; box-shadow: 0 5px 0 var(--green-d), inset 0 0 0 3px var(--green); }
.bk-choice.nope { animation: shake .45s; }
.bk-quiz-one { justify-content: center; gap: 4%; }
.bk-quiz-one .bk-ask b { font-size: calc(var(--ph) * .05); }
.bk-quiz-one .bk-choice.pic { width: 31%; }
.bk-quiz-one .bk-choice.pic b { font-size: calc(var(--ph) * .025); }
.bk-quiz-one .bk-choice.word b { font-size: calc(var(--ph) * .032); }
.bk.one .bk-cover-back { display: none; }
/* the book closing onto a little wooden shelf at the end */
.bk-shelf { position: absolute; left: 50%; bottom: 16%; width: min(70%, 520px); height: 22px; margin-left: min(-35%, -260px); border-radius: 6px; z-index: -1;
  background: linear-gradient(#C08A55, #9A6635); box-shadow: 0 10px 0 #7A4E26, 0 18px 24px rgba(60, 30, 10, .3); }
.closing .bk-board-l, .closing .bk-l, .closing .bk-edges-l, .closing .bk-gutter, .closing .bk-arrow, .bk-stage.closing .bk-bar { visibility: hidden; }
/* the buttons under the book */
.bk-bar { flex: none; display: flex; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(255, 252, 246, .9);
  box-shadow: 0 4px 0 rgba(46, 33, 24, .1); }
.closed ~ .bk-bar, .bk-stage.closed .bk-bar, .bk-stage.opening .bk-bar { opacity: 0; pointer-events: none; }
.bk-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--orange); box-shadow: 0 4px 0 var(--orange-d); font-weight: 700; font-size: 1.15rem; }
.bk-btn svg { width: 28px; height: 28px; }
.bk-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-d); }
.bk-play { width: 60px; height: 60px; background: var(--teal); box-shadow: 0 4px 0 var(--teal-d); }
.bk-mode { background: var(--cream); color: var(--ink); box-shadow: 0 4px 0 rgba(46, 33, 24, .15); }
.bk-lang { width: auto; height: 52px; padding: 0 18px 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-size: 1rem; white-space: nowrap; }
.bk-lang svg { width: 26px; height: 26px; color: var(--blue-d); }

/* the book in the app: it fills the screen under the top bar */
.bk-host { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 2px 0 calc(10px + var(--safe-b)); }
.bk-host.leaving { z-index: 50; pointer-events: none; }
.bk-host.leaving .bk-bar { display: none; }
/* Full Screen: just the pages, filling the screen */
.bk-stage.full { position: fixed; inset: 0; z-index: 200; background: #2A1E14; gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) env(safe-area-inset-right) max(10px, env(safe-area-inset-bottom)) env(safe-area-inset-left); }
.bk-stage.full .bk-board, .bk-stage.full .bk-edges { display: none; }
/* (under the pages, in its own room, never over them: the book is sized to leave it space, js/storybook.js measure) */
.bk-stage.full .bk-bar { background: rgba(255, 252, 246, .75); }
body.bk-full .topbar { visibility: hidden; }
.bk-stage.full .bk-bar, .bk-stage.full .bk-arrow { transition: opacity .4s; }
.bk-stage.full.idle .bk-bar, .bk-stage.full.idle .bk-arrow { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .bk-line, .bk-arrow { transition: none; } }

/* ---------- Sheeko: the bookcase (js/bookcase.js) ----------
   One card per series: its name, its books standing on a wooden shelf, a plain line for the stories
   to come. A book is a real cuboid (b3-*): front cover (one painting, edge to edge), back cover,
   spine, page block, top and bottom. Classes start with bc- and b3-. */
.bc { position: relative; width: 100%; max-width: 940px; margin: 0 auto; padding: 6px 4px 24px; --w: 140px; --h: 188px; --d: 34px; --sw: 140px; }
.bc-case { display: grid; gap: 18px; }
/* a book's card: the book, what it is, and Read Story */
.bc-shelf { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 28px; padding: 18px 28px 18px 22px; border-radius: 34px; background: #FAEBD3; }
.bc-shelf[data-shelf="geesi"] { --pill: #E5636B; --pill-d: #C0444D; }
.bc-shelf[data-shelf="folk"] { --pill: #1E9C93; --pill-d: #137870; }
.bc-info { min-width: 0; padding-right: 26px; border-right: 2px solid rgba(110, 72, 30, .14); }
.bc-series { display: inline-flex; align-items: center; gap: .45em; max-width: 100%; padding: .32em .95em .36em .8em; border-radius: 999px; background: var(--pill, var(--cloth)); color: #fff; font-weight: 700; font-size: clamp(.9rem, 2.2vw, 1.15rem); box-shadow: 0 3px 0 var(--pill-d, rgba(0, 0, 0, .2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-series svg, .bc-go svg { width: 1.25em; height: 1.25em; flex: none; }
.bc-info h2 { margin: 12px 0 0; font-size: clamp(1.6rem, 4.4vw, 2.5rem); line-height: 1.05; color: var(--ink); }
.bc-en { margin: 4px 0 0; font-size: clamp(1rem, 2.4vw, 1.4rem); font-weight: 700; color: #8A6A48; }
.bc-blurb { margin: 10px 0 0; font-size: clamp(.92rem, 1.9vw, 1.1rem); font-weight: 500; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.bc-go { display: inline-flex; align-items: center; gap: .5em; padding: .55em .9em .6em 1em; border-radius: 999px; background: linear-gradient(#FFD75E, #F7B92E); color: #3A2410; font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.3rem); white-space: nowrap; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 5px 0 #D0901F, 0 8px 14px rgba(46, 33, 24, .14); transition: transform .15s var(--ease-out), box-shadow .15s; }
.bc-go > svg:last-child { width: .9em; height: .9em; }
@media (hover: hover) { .bc-go:hover { transform: translateY(-2px); } }   /* (a mouse only: on a touch screen a tapped thing kept its hover look) */
/* a book outside the free part: the button wears a lock and the family plan opens it */
.bc-go.locked { background: linear-gradient(#F3E6CF, #E7D3B1); color: #6B5236; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 5px 0 #C9AE84, 0 8px 14px rgba(46, 33, 24, .1); }
.bc-go:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 1px 0 #D0901F; }
.bc-slot { position: relative; flex: none; width: var(--sw); height: var(--h); cursor: pointer; perspective: 1000px; transition: transform .2s var(--ease-out); }
.bc-slot:focus-visible { transform: translateY(-6px); }
@media (hover: hover) { .bc-slot:hover { transform: translateY(-6px); } }
.bc-slot:active { transform: translateY(-2px); }
.bc-tilt { position: absolute; left: 50%; bottom: 0; width: var(--w); height: var(--h); margin-left: calc(var(--w) / -2); transform: rotateY(-22deg); transform-style: preserve-3d; transition: transform .25s var(--ease-out); }
.bc-slot:focus-visible .bc-tilt { transform: rotateY(-12deg); }
@media (hover: hover) { .bc-slot:hover .bc-tilt { transform: rotateY(-12deg); } }
.bc-slot.lifted .bc-tilt { visibility: hidden; }
/* its shadow on the card */
.bc-slot::before { content: ""; position: absolute; left: 12%; right: -14%; top: 6%; bottom: 2px; border-radius: 10px; background: rgba(70, 40, 12, .2); filter: blur(11px); z-index: -1; }
.bc-slot::after { content: ""; position: absolute; left: 4%; right: -4%; bottom: -4px; height: 12px; border-radius: 50%; background: radial-gradient(rgba(60, 30, 10, .4), transparent 70%); z-index: -1; }
.bc-soon { margin: 4px 0 0; text-align: center; color: var(--ink-soft); text-shadow: var(--outline-3); }
.bc-soon b { display: block; font-size: 1.05rem; font-weight: 600; }
.bc-soon small { display: block; margin-top: 2px; font-size: .88rem; font-weight: 500; opacity: .85; }
/* narrow screens: Read Story under what the book is */
@media (max-width: 640px) {
  .bc-shelf { grid-template-columns: auto minmax(0, 1fr); padding: 16px 16px 16px 14px; gap: 12px 16px; border-radius: 26px; }
  .bc-info { padding-right: 0; border-right: 0; }
  .bc-go { grid-column: 2; justify-self: start; }
  .bc-slot { grid-row: span 2; }
  .bc-series { font-size: .74rem; padding: .32em .75em .36em .6em; gap: .35em; }
}

/* the book itself */
.b3 { position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; }
.b3-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.b3-f { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.b3-front, .b3-back { inset: 0; background: var(--cloth); overflow: hidden; }
.b3-front { transform: translateZ(calc(var(--d) / 2)); border-radius: 3px 9px 9px 3px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14); }
.b3-back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); border-radius: 9px 3px 3px 9px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
  background: radial-gradient(120% 90% at 50% 35%, rgba(255, 210, 160, .16), transparent 60%), repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px), var(--cloth); }
.b3-pic { position: absolute; inset: 0; background: var(--cloth) center / cover no-repeat; }
.b3-pic.in { background-color: #F3E6CC; }
.b3-title { position: absolute; left: 12%; right: 6%; top: 5%; text-align: center; pointer-events: none; }
.b3-title h1 { margin: 0; font-size: calc(var(--ph) * .1); line-height: 1.02; font-weight: 700; color: var(--cloth);
  text-shadow: 0 .06em 0 #fff, .06em 0 0 #fff, 0 -.06em 0 #fff, -.06em 0 0 #fff, .045em .045em 0 #fff, -.045em .045em 0 #fff, .045em -.045em 0 #fff, -.045em -.045em 0 #fff, 0 .11em .08em rgba(60, 25, 5, .35); }
.b3-title h1 .nw { display: inline-block; white-space: nowrap; }
.b3-series { margin: 0 0 .25em; font-size: calc(var(--ph) * .034); font-weight: 700; letter-spacing: .03em; color: #fff; text-shadow: 0 1px 0 rgba(60, 25, 5, .6), 0 0 6px rgba(60, 25, 5, .45); }
.b3-title .bk-cover-en { font-size: calc(var(--ph) * .045); }
/* the book's hinge: a groove down the front cover, and the board's edge */
.b3-hinge { position: absolute; left: 0; top: 0; bottom: 0; width: 9%; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, .32), rgba(0, 0, 0, .08) 22%, rgba(255, 255, 255, .16) 30%, rgba(0, 0, 0, .1) 38%, transparent 70%); }
.b3-hinge.r { left: auto; right: 0; transform: scaleX(-1); }
.b3-spine { top: 0; height: 100%; left: calc((var(--w) - var(--d)) / 2); width: var(--d); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .1) 30%, transparent 55%, rgba(0, 0, 0, .2)), var(--cloth); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6% 0 7%; overflow: hidden; }
.b3-spine::before, .b3-spine::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: #F7C25A; opacity: .85; } .b3-spine::before { top: 3.5%; } .b3-spine::after { bottom: 3.5%; }
.b3-face { flex: none; display: block; width: 82%; border-radius: 50%; background: #FFF6E4; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(0, 0, 0, .25); overflow: hidden; }
.b3-face svg { display: block; width: 100%; height: auto; }
.b3-sp { flex: 1; min-height: 0; display: flex; align-items: center; writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); white-space: nowrap; font-weight: 700; font-size: calc(var(--d) * .36); color: #fff; text-shadow: 0 1px 0 rgba(60, 25, 5, .55); overflow: hidden; margin: 4% 0; }
.b3-star { flex: none; display: block; width: 46%; aspect-ratio: 1; background: #F7C25A; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.b3-pages { top: 2.4%; height: 95.2%; left: calc((var(--w) - var(--d) + 10px) / 2); width: calc(var(--d) - 10px); transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 4px));
  background: repeating-linear-gradient(90deg, #FFFBF1 0 1px, #E4D7BE 1px 2px); box-shadow: inset 0 0 6px rgba(120, 80, 30, .3); }
.b3-top, .b3-bottom { left: 3%; width: 94%; height: calc(var(--d) - 8px); top: calc((var(--h) - var(--d) + 8px) / 2); background: repeating-linear-gradient(0deg, #FFFBF1 0 1px, #E4D7BE 1px 2px); }
.b3-top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 3px)); } .b3-bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 3px)); }
/* a soft sheen that follows the spin */
.b3-front::after, .b3-back::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; background: radial-gradient(60% 50% at var(--shine, 40%) 30%, rgba(255, 255, 255, .55), transparent 70%); }

/* the book held in front of you */
.bc-stage { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 70px 12px calc(14px + var(--safe-b)); touch-action: none; }
.bc-stage[hidden] { display: none; }
.bc-dim { position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 40%, rgba(255, 240, 210, .5), rgba(60, 35, 20, .78)); }
.bc-spot { position: relative; z-index: 1; flex: none; perspective: 900px; cursor: grab; display: grid; place-items: center; padding: 14px 26px 22px; touch-action: none; }
.bc-stage.dragging .bc-spot { cursor: grabbing; }
.bc-float { transform-style: preserve-3d; }
.bc-stage.ready .bc-float { animation: bcBob 3.8s ease-in-out infinite; }
.bc-stage.dragging .bc-float, .bc-stage.back .bc-float { animation-play-state: paused; }
.bc-shadow { position: absolute; left: 20%; right: 20%; bottom: 0; height: 22px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .55), transparent 70%); }
@keyframes bcBob { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-9px) rotate(.6deg); } }
.bc-hint { position: relative; z-index: 1; margin: 0; color: #FFF6E4; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); text-align: center; min-height: 1.4em; }
.bc-bar { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; }
.bc-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--cream); box-shadow: 0 4px 0 rgba(46, 33, 24, .2); }
.bc-btn svg { width: 28px; height: 28px; transform: scaleX(-1); }
.bc-read { font-size: 1.3rem; }
.bc-btn svg { width: 28px; height: 28px; } .bc-put svg { transform: scaleX(-1); }
.bc-stage.back .bc-flip { background: var(--teal); color: #fff; box-shadow: 0 4px 0 var(--teal-d); }
/* the tray of stickers, when the back is showing */
.bc-tray { position: relative; z-index: 1; width: min(560px, 96vw); display: grid; gap: 8px; justify-items: center; }
.bc-tray[hidden] { display: none; }
.bc-stickers { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 8px 12px; border-radius: 18px; background: rgba(255, 250, 238, .94); box-shadow: 0 4px 0 rgba(46, 33, 24, .18); touch-action: pan-x; }
.bc-tsk { flex: none; width: 54px; height: 54px; border-radius: 50%; touch-action: none; transition: transform .15s var(--ease-spring); }
.bc-tsk:active { transform: scale(1.12); } .bc-tsk svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(46, 33, 24, .25)); pointer-events: none; }
.bc-none { margin: 4px 8px; color: var(--ink-soft); font-weight: 600; }
.bc-sel { display: flex; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 250, 238, .96); box-shadow: 0 3px 0 rgba(46, 33, 24, .18); }
.bc-sel[hidden] { display: none; }
.bc-sel button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #FFF1C7; color: var(--ink); } .bc-sel button svg { width: 22px; height: 22px; }
.bc-sel button[data-act="bin"] { background: #FDE2E2; color: var(--red-d); }
.bc-ghost-sk { position: absolute; left: 0; top: 0; width: 70px; height: 70px; z-index: 90; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .3)); } .bc-ghost-sk svg { width: 100%; height: 100%; }
/* a sticker stuck on the back cover */
.b3-stk { position: absolute; inset: 0; }
.b3-sk { position: absolute; display: block; touch-action: none; cursor: grab; filter: drop-shadow(0 2px 1.5px rgba(30, 15, 5, .35)); }
.b3-sk svg { display: block; width: 100%; height: auto; pointer-events: none; }
.b3-sk.sel::after { content: ""; position: absolute; inset: -5%; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, .95); animation: bcSel 1.6s linear infinite; pointer-events: none; }
.b3-sk.off { opacity: .45; }
@keyframes bcSel { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bc-stage.ready .bc-float { animation: none; } .bc-tilt, .bc-slot { transition: none; } }

/* ---------- Geesi, from his master character sheet (js/geesi.js) ----------
   The pictures are cut from the sheet; these make him blink now and then, move his mouth while he
   talks (.talk), and hop into the waving pose when he waves (.wave). The frames switch at once
   (steps), like an animated cartoon, never fading through each other. */
.mascot.geesi { height: auto; overflow: visible; }
.geesi .g-blink, .geesi .g-mouth, .geesi .g-wave { opacity: 0; }
.geesi .g-blink { animation: gBlink 4.7s steps(1, end) infinite; }
@keyframes gBlink { 0% { opacity: 0; } 94% { opacity: 1; } 97% { opacity: 0; } }
.geesi.talk .g-mouth { animation: gTalk .3s steps(1, end) infinite; }
@keyframes gTalk { 0% { opacity: 1; } 50% { opacity: 0; } }
.mascot.geesi.wave { animation: geesiJump .95s cubic-bezier(.33, .7, .45, 1); }
.geesi.wave .g-base, .geesi.wave .g-blink, .geesi.wave .g-mouth { visibility: hidden; }
.geesi.wave .g-wave { opacity: 1; }
.mascot.geesi.hop { animation: geesiJump .95s cubic-bezier(.33, .7, .45, 1); }
/* Geesi alive (js/geesirig.js): his picture bent gently on a canvas, and the soft shadow under his feet. */
.geesi-rig { position: relative; display: block; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.geesi-rig canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* a shadow under each paw (js/geesihd.js pawShadows), for each pose */
.geesi-rig .g-paws { position: absolute; inset: 0; pointer-events: none; }
.geesi-rig .g-paws span { position: absolute; inset: 0; }
.geesi-rig .g-paws b { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(105, 58, 18, .6), rgba(105, 58, 18, .27) 55%, rgba(105, 58, 18, 0)); }
.geesi-rig .g-shadow { position: absolute; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(90, 52, 16, .3), rgba(90, 52, 16, .12) 70%, rgba(90, 52, 16, 0)); }

/* ---------- Home ----------
   The top bar (who's playing, the logo, stars, settings), Geesi with his speech bubble, the "Sii Wad!"
   card and six tiles, over one still scenery: the desert and its camels, and the coast with a dhow and a
   white town (js/scene.js). Computers and tablets held sideways: Geesi on the left, 3 tiles across. Phones
   and tablets held upright: Geesi at the top, 2 across. Nothing here moves by itself but Geesi. */
:root {
  --t-coral: #FF8452; --t-coral-2: #EC5B2D; --t-coral-d: #C8441D;
  --t-green: #3FBC6B; --t-green-2: #22914A; --t-green-d: #1A7239;
  --t-red: #F45B62; --t-red-2: #D93944; --t-red-d: #B02A34;
  --t-gold: #F2A93A; --t-gold-2: #E58F1B; --t-gold-d: #B96A0C;   /* the bright gold of the first Sheeko tile */
  --t-purple: #946DF6; --t-purple-2: #6B46E0; --t-purple-d: #5133B6;
  --t-blue: #3E95F1; --t-blue-2: #1D6CD3; --t-blue-d: #1654A8;
  --bubble-ink: #6A4126;
  --go-1: #3C8DEA; --go-2: #1E62C6; --go-track: #9BC4F3;
  --play-1: #FFE173; --play-2: #F7B32B; --play-3: #E5960F; --play-ink: #5A3412;
  --tile-edge: 5px solid #fff;
  --tile-shadow: 0 6px 0 rgba(46, 33, 24, .12), 0 12px 22px rgba(46, 33, 24, .1);
}

/* The top bar on the home screen: the child on the left, the logo in the middle, stars and settings on the right. */
body.home .topbar { gap: 10px; padding-left: clamp(12px, 2.2vw, 32px); padding-right: clamp(12px, 2.2vw, 32px); }
body.home .topbar-title { display: contents; }
body.home .who-chip { order: 0; margin-right: auto; padding-right: 10px; min-height: 52px; }
.who-chip .chev { width: 20px; height: 20px; flex: none; color: var(--ink-soft); }
body.home .star-pill { order: 1; }
body.home .fs-btn { order: 2; }
body.home .settings-btn { order: 3; color: var(--ink); }
.home-logo { position: absolute; left: 50%; top: var(--safe-t); bottom: 0; translate: -50% 0; margin: 0; display: flex; align-items: center; font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.75rem); pointer-events: none; }
.home-logo .logo { font-size: 1em; }

/* The scenery is the backdrop's painted picture (js/scene.js), its woven band along the bottom. */
body.home .view { padding-bottom: calc(48px + var(--safe-b)); }
body.home { overflow-x: clip; }

.home-wrap { position: relative; display: grid; gap: 14px; justify-items: center; }
.home-wrap .mascot-stage { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; }
/* Geesi's size (--gw, his width; he is 1.35 times as tall). His feet are the bottom of .g-host. */
.home-wrap .g-wrap { position: relative; z-index: 1; width: var(--gw); }
.home-wrap .g-host { width: 100%; }
/* While he speaks, the yellow marks of the tiles shine beside his head (still: they only show and hide). */
.talk-rays { position: absolute; z-index: 2; width: 17%; opacity: 0; scale: .5; pointer-events: none; transition: opacity .15s, scale .25s var(--ease-spring); }
.talk-rays.r { right: -9%; top: 3%; }
.talk-rays.l { left: -7%; top: 3%; transform: scaleX(-1); }
.g-wrap.speaking .talk-rays { opacity: 1; scale: 1; }
.home-main { position: relative; z-index: 2; display: grid; gap: 14px; width: 100%; }
.home-main .streak-chip { justify-self: center; }

/* Geesi's speech bubble */
.home-wrap .bubble-slot { position: relative; z-index: 3; height: auto; max-width: 100%; }
/* well clear of his head: he hops about an eighth of his height when he waves */
.home-wrap .bubble, .home-wrap .bubble.talking { margin: 0; padding: .45em .9em .5em; border-radius: 1.2em; font-size: clamp(1.15rem, 2vw, 1.8rem); line-height: 1.15; text-align: center; color: var(--bubble-ink); max-width: none; box-shadow: 0 5px 0 rgba(46, 33, 24, .1); }

/* "Sii Wad!": the lesson to do next */
.go-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(10px, 2vw, 26px);
  width: 100%; padding: clamp(8px, 1.4vw, 16px) clamp(12px, 2.4vw, 30px); border: var(--tile-edge); border-radius: 30px;
  color: #fff; background: linear-gradient(180deg, var(--go-1), var(--go-2)); box-shadow: var(--tile-shadow);
  transition: transform .16s var(--ease-spring);
}
.go-card:active { transform: translateY(4px); transition-duration: 80ms; }
.go-pic { position: relative; display: block; width: clamp(64px, 10vw, 150px); aspect-ratio: 1.15; padding-right: clamp(10px, 1.8vw, 26px); border-right: 3px solid rgba(255, 255, 255, .3); box-sizing: content-box; }
.go-pic .art { width: 100%; height: 100%; }
.go-pic .rays { position: absolute; top: -10%; left: 30%; width: 22%; rotate: -40deg; }
.go-text { display: grid; gap: clamp(2px, .5vw, 6px); min-width: 0; }
.go-title { font-size: clamp(1.55rem, 3.4vw, 3.1rem); font-weight: 700; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .14); }
.go-next { font-size: clamp(.95rem, 1.6vw, 1.45rem); font-weight: 600; color: #DDEBFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-next b { color: #fff; font-weight: 700; }
.go-progress { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); margin-top: clamp(2px, .5vw, 6px); }
.go-bar { position: relative; flex: 1; max-width: 340px; height: clamp(16px, 1.9vw, 24px); border: 3px solid #fff; border-radius: 99px; background: var(--go-track); overflow: hidden; }
.go-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 100%); border-radius: 99px; background: linear-gradient(180deg, var(--play-1), var(--play-2)); }
.go-bar.steps::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 2px), rgba(255, 255, 255, .55) calc(100% / var(--n) - 2px) calc(100% / var(--n))); }
.go-count { font-size: clamp(1rem, 1.6vw, 1.45rem); font-weight: 700; }
.go-play { position: relative; display: grid; place-items: center; width: clamp(54px, 8vw, 116px); aspect-ratio: 1; border: 5px solid #fff; border-radius: 50%; color: var(--play-ink);
  background: radial-gradient(circle at 50% 32%, var(--play-1), var(--play-2) 58%, var(--play-3)); box-shadow: 0 5px 0 rgba(0, 0, 0, .16); }
.go-play svg.i { width: 44%; height: 44%; margin-left: 9%; }
.go-play .rays { position: absolute; top: -26%; right: -26%; width: 40%; }

/* The six tiles */
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); width: 100%; }
.home-tiles .home-tile {
  min-height: clamp(116px, calc((100svh - 410px) / 3), 230px); padding: 10px 8px 30px; gap: 0; justify-content: center;
  border: var(--tile-edge); border-radius: 28px; background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: var(--tile-shadow);
}
.home-tiles .home-tile:active { box-shadow: 0 1px 0 rgba(46, 33, 24, .12); }
.home-tiles .home-tile::after { height: 24px; opacity: 1; background: var(--band) repeat-x left bottom 1px / 14px 14px, var(--cd); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28); }
.h-ico { position: relative; z-index: 2; display: block; width: clamp(56px, 8.4vw, 124px); aspect-ratio: 1; margin-bottom: 2px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .1)); }
.h-ico .art { width: 100%; height: 100%; }
.h-ico .rays { position: absolute; top: -6%; right: -18%; width: 26%; }
.home-tiles .home-tile .lbl { font-size: clamp(1.3rem, 2.3vw, 2.05rem); line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, .17); }
.home-tiles .home-tile .sub { font-size: clamp(.85rem, 1.25vw, 1.15rem); line-height: 1.2; }
.t-coral  { --c1: var(--t-coral);  --c2: var(--t-coral-2);  --cd: var(--t-coral-d); }
.t-green  { --c1: var(--t-green);  --c2: var(--t-green-2);  --cd: var(--t-green-d); }
.t-red    { --c1: var(--t-red);    --c2: var(--t-red-2);    --cd: var(--t-red-d); }
.t-gold   { --c1: var(--t-gold);   --c2: var(--t-gold-2);   --cd: var(--t-gold-d); }
.t-purple { --c1: var(--t-purple); --c2: var(--t-purple-2); --cd: var(--t-purple-d); }
.t-blue   { --c1: var(--t-blue);   --c2: var(--t-blue-2);   --cd: var(--t-blue-d); }

/* Held upright (phones, tablets): Geesi at the top, standing on the beach of the backdrop's picture, his
   bubble above him and a little to the right. */
@media (orientation: portrait) {
  /* the logo takes the room between the child and the stars (centred over them, it could touch them) */
  .home-logo { position: static; translate: none; flex: 1 0 auto; justify-content: center; font-size: clamp(1.4rem, 6.8vw, 3.2rem); }
  .home-wrap .mascot-stage { --gw: clamp(108px, 30vw, 180px); }
  .home-main { max-width: 680px; justify-self: center; }
  .home-wrap .bubble-slot { margin-bottom: calc(var(--gw) * .3); translate: calc(var(--gw) * .3) 0; max-width: calc(100% - var(--gw) * .6); }
  .talk-rays { width: 21%; }
  .talk-rays.r { right: -15%; top: 0; }
  .talk-rays.l { left: -11%; top: 0; }
  .home-wrap .bubble, .home-wrap .bubble.talking { font-size: clamp(1.05rem, 3.4vw, 1.6rem); }
  .home-wrap .bubble::after { left: 24%; }
}
/* Tablets held upright: bigger pictures; the tiles share what height is left. */
@media (orientation: portrait) and (min-width: 600px) {
  .home-tiles .home-tile { min-height: clamp(140px, calc((100svh - 600px) / 3), 230px); }
  .h-ico { width: clamp(64px, 11vw, 120px); }
}
/* Phones: a smaller logo, stars and settings, so all four fit in one row; the full-screen button drops just below. */
@media (orientation: portrait) and (max-width: 599px) {
  body.home .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  body.home .who-chip { flex: 0 1 auto; min-width: 0; margin-right: 0; min-height: 46px; font-size: 1rem; gap: 6px; padding: 3px 6px 3px 3px; max-width: 36vw; }
  body.home .who-chip .avatar.sm { width: 36px; height: 36px; }
  .who-chip .chev { width: 16px; height: 16px; }

  body.home .star-pill { min-height: 46px; padding: 0 8px; font-size: 1.2rem; }
  body.home .star-icon .coin { width: 24px; height: 24px; }
  body.home .topbar .icon-btn { width: 46px; height: 46px; }
  body.home .topbar .icon-btn svg { width: 25px; height: 25px; }
  body.home .fs-btn { position: absolute; left: 12px; top: calc(100% + 2px); width: 42px !important; height: 42px !important; }
  .home-tiles .home-tile { min-height: clamp(112px, calc((100svh - 490px) / 3), 180px); }
  .go-pic { width: 54px; }
  .go-next { white-space: normal; font-size: .92rem; line-height: 1.15; }
}

/* The smallest phones: no arrow on the child's button, so the name has room. */
@media (orientation: portrait) and (max-width: 380px) { body.home .who-chip .chev { display: none; } body.home .who-chip { padding-right: 10px; } }

/* Computers and tablets held sideways: Geesi on the left, standing on the sand; the card and the tiles,
   3 across, beside him; the coast on the right. Everything on one screen. */
@media (orientation: landscape) and (min-height: 561px) {
  body.home .view { --view-max: 1720px; --view-pad: clamp(16px, 2.5vw, 40px); }
  /* --ground: the painted woven band along the bottom of the picture and a little sand above it, where
     Geesi stands (the picture covers the screen from the bottom up, so its band is 6.5% of its height) */
  body.home { --ground: calc(max(100svh, 56.25vw) * .085); }
  body.home .view { padding-bottom: var(--ground); }
  .home-wrap { grid-template-columns: 27% minmax(0, 1fr) 12%; column-gap: clamp(12px, 1.6vw, 28px); align-items: center; min-height: calc(100svh - 88px - var(--safe-t) - var(--ground)); }
  .home-wrap .mascot-stage { --gw: min(100%, 24vw, 44vh, 440px); grid-column: 1; grid-row: 1; align-self: end; }
  .home-wrap .bubble-slot { position: absolute; bottom: 115%; left: 0; right: 0; display: flex; justify-content: center; }
  .home-wrap .bubble::after { left: 62%; }
  .home-main { grid-column: 2; grid-row: 1; max-width: 1040px; justify-self: start; }
  .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-tiles .home-tile { min-height: clamp(150px, calc((100svh - 400px) / 2), 236px); }
}
@media (orientation: landscape) and (min-height: 561px) and (max-aspect-ratio: 3/2) {
  body.home { --ground: calc(max(100svh, 75vw) * .085); }
}
/* Sideways, everything also scales with the height of the screen, so on a short laptop window the card and
   the tiles still fit above the sand where Geesi stands; and there is room under the logo. */
@media (orientation: landscape) and (min-height: 561px) {
  .home-wrap { padding-top: clamp(10px, 4svh - 8px, 32px); }
  .home-main { gap: clamp(10px, min(1.4vw, 2svh), 18px); }
  .home-tiles { gap: clamp(10px, min(1.4vw, 2svh), 18px); }
  .go-card { padding-top: clamp(8px, min(1.4vw, 1.8svh), 16px); padding-bottom: clamp(8px, min(1.4vw, 1.8svh), 16px); }
  .go-pic { width: clamp(60px, min(10vw, 14svh), 150px); }
  .go-title { font-size: clamp(1.5rem, min(3.4vw, 5.4svh), 3.1rem); }
  .go-next, .go-count { font-size: clamp(.95rem, min(1.6vw, 2.5svh), 1.45rem); }
  .go-bar { height: clamp(16px, min(1.9vw, 2.8svh), 24px); }
  .go-play { width: clamp(54px, min(8vw, 12svh), 116px); }
  .home-tiles .home-tile { min-height: clamp(120px, calc((100svh - 420px) / 2), 236px); padding: 8px 8px 28px; }
  .h-ico { width: clamp(48px, min(8.4vw, 10.5svh), 124px); }
  .home-tiles .home-tile .lbl { font-size: clamp(1.2rem, min(2.3vw, 3.6svh), 2.05rem); }
  .home-tiles .home-tile .sub { font-size: clamp(.8rem, min(1.25vw, 2svh), 1.15rem); }
}
/* Phones held sideways: Geesi small on the left, the card and the tiles (3 across) beside him. */
@media (orientation: landscape) and (max-height: 560px) {
  /* Geesi at the top of his column, so he stands on the sand just below the shoreline */
  .home-wrap { grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 16px; }
  .home-wrap .mascot-stage { --gw: clamp(96px, 16vw, 150px); grid-column: 1; grid-row: 1; }
  .home-wrap .bubble-slot { margin-bottom: calc(var(--gw) * .3); }
  .home-wrap .bubble, .home-wrap .bubble.talking { font-size: 1.05rem; max-width: 24vw; }
  .home-main { grid-column: 2; grid-row: 1; gap: 10px; }
  .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .home-tiles .home-tile { min-height: 104px; padding: 4px 6px 22px; }
  .home-tiles .home-tile::after { height: 18px; }
  .h-ico { width: 46px; }
  body.home .topbar { padding-top: calc(6px + var(--safe-t)); padding-bottom: 6px; }
  .home-tiles .home-tile .lbl { font-size: 1.2rem; }
  .home-tiles .home-tile .sub { font-size: .8rem; }
  .go-card { padding: 4px 12px; border-radius: 24px; border-width: 4px; }
  .go-pic { width: 50px; }
  .go-title { font-size: 1.3rem; }
  .go-next, .go-count { font-size: .9rem; }
  .go-bar { height: 14px; border-width: 2px; }
  .go-play { width: 46px; border-width: 4px; }
  body.home .topbar .icon-btn { width: 50px; height: 50px; }
  body.home .star-pill { min-height: 50px; }
  .home-logo { font-size: 2.5rem; }
}

/* ---------- One look across the app ----------
   Every screen looks like the home screen. What a child taps in colour (tiles, packs, buttons, the big
   speaker, the syllable letters) has a thick white edge, a soft light-to-dark sheen, the soft shadow and,
   on tiles, the woven band; the cream cards (letters, words, answers, children, stickers' counts, panels,
   sheets, the bookcase's shelves) have the same white edge and shadow. Still: nothing here moves by itself. */
:root {
  --card-edge: 4px solid #fff;
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .08));
  --press-shadow: 0 1px 0 rgba(46, 33, 24, .12);
}
/* coloured tiles */
.big-btn { border: var(--tile-edge); box-shadow: var(--tile-shadow); padding-bottom: 30px; }
.big-btn:not(.home-tile) { background-image: var(--sheen); }
.big-btn::after { height: 22px; opacity: 1; background: var(--band) repeat-x left bottom 1px / 14px 14px, rgba(0, 0, 0, .14); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28); }
.big-btn:active { box-shadow: var(--press-shadow); }
.big-btn .lbl { text-shadow: 0 3px 0 rgba(0, 0, 0, .17); }
/* buttons */
.pill-btn { border: 4px solid #fff; background-image: var(--sheen); box-shadow: 0 5px 0 rgba(46, 33, 24, .13), 0 9px 18px rgba(46, 33, 24, .1); }
.pill-btn:active { transform: translateY(3px); box-shadow: var(--press-shadow); }
.pill-btn.ghost { background-color: var(--card); }
.speaker-btn { border: 5px solid #fff; background-image: var(--sheen); box-shadow: var(--tile-shadow); }
.speaker-btn:active { box-shadow: var(--press-shadow); }
.hig-letter, .hig-vowel { border: 3px solid #fff; background-image: var(--sheen); box-shadow: 0 4px 0 rgba(46, 33, 24, .12), 0 8px 14px rgba(46, 33, 24, .08); }
.bk-btn { border: 3px solid #fff; background-image: var(--sheen); box-shadow: 0 4px 0 rgba(46, 33, 24, .14); }
.bk-btn:active { box-shadow: var(--press-shadow); }
.account-card { border: var(--tile-edge); box-shadow: var(--tile-shadow); }
.acc-btn { border: 3px solid #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
/* cream cards */
.letter-tile, .word-card:not(.flip), .flip .face, .choice, .hig-syl, .who-tile, .stat, .picks-bar, .panel, .m-item, .found-bar,
.next-word, .sheet .example, .done-bonus .bonus, .mode-opt, .bc-shelf, .feed-bubble { border: var(--card-edge); box-shadow: var(--tile-shadow); }
.letter-tile, .choice, .who-tile, .stat, .panel, .bc-shelf { border-radius: var(--radius); }
.who-tile.on { box-shadow: 0 0 0 4px var(--teal), var(--tile-shadow); }
.word-card.flip.playing .face.front { box-shadow: 0 0 0 4px var(--yellow), var(--tile-shadow); }
.hig-syl.playing { box-shadow: 0 0 0 4px var(--vc), var(--tile-shadow); }
.mode-opt.on { box-shadow: 0 0 0 3px var(--teal), var(--tile-shadow); }
/* pop-up sheets: the cream card with the white edge, like the cards on the screen behind */
.sheet { border: 5px solid #fff; }
.toast { border: 4px solid #fff; box-shadow: var(--tile-shadow); }
/* answers share their row evenly, whatever is written on them (a long syllable like "Khe" never pushes the row wider) */
.choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.syl-choice { font-size: clamp(2rem, 10vw, 3.6rem); }
/* the Games screen's tiles: big pictures, like the home screen's */
.home-grid .big-btn .h-ico { width: clamp(76px, 11vw, 128px); }

/* ---------- In the games, the letters and the cards ---------- */
/* Geesi, as on the home screen (js/geesihd.js): beside the speaker in the games, big at the end of a round.
   A right answer: he hops for joy; a wrong one: he tilts his head, encouraging; out of hearts: he droops. */
.g-mini { flex: none; width: 150px; }
.g-mini.sm { width: 92px; }
.done-screen .g-mini { width: clamp(130px, 34vw, 190px); }
.g-mini.think { animation: geesiThink .9s ease-in-out; transform-origin: 50% 100%; }
.g-mini.sad { animation: geesiSad 1.3s ease-in-out both; transform-origin: 50% 100%; }
@keyframes geesiThink { 30% { transform: rotate(-6deg); } 70% { transform: rotate(4deg); } }
@keyframes geesiSad { 25%, 85% { transform: translateY(5px) scale(1.02, .96) rotate(-3deg); } }
/* the games play on the full painted desert, like the home screen (no veil of sand) */
body[data-screen="play"] .scene .veil { opacity: 0; }
.listen-word { text-shadow: var(--outline-3); }

/* a pack's cards, face down: a tile in the pack's colour, its picture with the yellow marks, the woven band */
.flip .face.back { background: var(--band) repeat-x left bottom / 14px 14px, linear-gradient(to top, rgba(0, 0, 0, .14) 16px, transparent 16px), var(--sheen), var(--c); }
.back-badge { position: relative; width: 62%; height: auto; aspect-ratio: 1; background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .12)); }
.back-badge .art { width: 100%; height: 100%; }
.back-badge .rays { position: absolute; top: -6%; right: -16%; width: 26%; }
/* messages: Geesi's speech bubble (cream, warm brown words) */
.toast { background: var(--card); color: var(--bubble-ink); }
/* the syllable table and the top bar always fit the screen's width: columns share it evenly, the title
   shrinks (js/app.js fitTitle) rather than pushing the stars off the edge */
.hig-row { grid-template-columns: minmax(0, 1.2fr) repeat(5, minmax(0, 1fr)); }
.topbar-title { min-width: 0; }
/* the big numbers (stars, days in a row) scale down on small phones, so their boxes always fit side by side */
.stat-row > * { min-width: 0; }
.stat { padding: 16px 10px; }
.stat .n { font-size: clamp(2.1rem, 9vw, 3rem); }
/* Geesi a little bigger in the games and at the end of a round */
.g-mini.sm { width: clamp(118px, 11vw, 170px); }
.done-screen .g-mini { width: clamp(130px, min(38vw, 20vh), 220px); }   /* (with the height too: the buttons stay clear of the messages) */
/* the round and the hearts: one cream pill at the top of a game */
.game-status { display: flex; align-items: center; justify-content: center; gap: 12px; width: fit-content; max-width: 100%; margin: 4px auto 8px; padding: 6px 14px; border: var(--card-edge); border-radius: 999px; background: var(--card); box-shadow: var(--tile-shadow); }
.game-status .patience { margin: 0; }
.game-status .round { display: flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 2px solid rgba(46, 33, 24, .1); }
.game-status .go-bar { width: clamp(70px, 18vw, 130px); flex: none; height: 18px; border-color: #fff; background: #E8DDCB; box-shadow: inset 0 0 0 1px rgba(46, 33, 24, .08); }
.game-status .round b { font-size: 1.05rem; font-weight: 700; color: var(--bubble-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .game-status { gap: 8px; padding: 5px 10px; } .game-status .patience .heart { width: 22px; height: 22px; } .game-status .round { padding-right: 8px; } }
/* messages stand above the woven band along the bottom of the screen, never over it */
:root { --band-h: calc(max(100svh, 56.25vw) * .066); }
@media (orientation: landscape) and (max-aspect-ratio: 3/2) { :root { --band-h: calc(max(100svh, 75vw) * .063); } }
@media (orientation: portrait) { :root { --band-h: 6.3vw; } }
@media (orientation: portrait) and (max-aspect-ratio: 2/3) { :root { --band-h: 8vw; } }
.toast { bottom: calc(var(--band-h) + 14px + var(--safe-b)); }
/* Dhegayso: Geesi says the word in his speech bubble (tap it to hear it again), the pictures straight below */
.say-row { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.say-bubble { position: relative; display: inline-flex; align-items: center; gap: 12px; margin-bottom: 38%; padding: 10px 18px 10px 22px; border: var(--card-edge); border-radius: 24px; background: var(--card); box-shadow: var(--tile-shadow); }
.say-row .g-mini { order: -1; }
.say-bubble::after { content: ""; position: absolute; left: -16px; bottom: 16px; border: 10px solid transparent; border-right: 14px solid #fff; border-left: 0; }
.say-bubble .listen-word { text-shadow: none; font-size: clamp(1.8rem, 7.5vw, 2.6rem); }
.say-bubble svg.i { width: 34px; height: 34px; color: var(--purple); flex: none; }
.say-bubble.playing svg.i { animation: pulse .9s ease-in-out infinite; }
.say-bubble:active { transform: translateY(3px); }
.game-head + .choices { margin-top: 10px; }
/* a win: the yellow marks beside Geesi's paws while he claps (still: they only show and hide) */
.g-mini { position: relative; }
.g-mini .talk-rays { top: 40%; }
.g-mini.clapping .talk-rays { opacity: 1; scale: 1; }
/* short screens: the end of a round a little tighter, so its buttons stay clear of the messages */
@media (max-height: 700px) {
  .done-screen { gap: 8px; padding-top: 0; }
  .done-screen .g-mini { width: 112px; }
  .done-screen h1.pop-title { font-size: clamp(2.3rem, 10vw, 3.2rem); }
  .done-stars .coin { width: 34px; height: 34px; }
  .done-bonus { margin: 4px 0 0; }
}
/* Feed the Camel: the speech bubble beside the camel's face, its tail pointing left at the snout */
.feed-bubble.side::after { left: -15px; top: calc(50% - 9px); bottom: auto; border: 9px solid transparent; border-right: 15px solid var(--card); border-left: 0; }
/* a pack's word cards: square (as wide as their column; never too small for the picture and its name) */
.card-grid > .word-card.flip { height: auto; aspect-ratio: 1; min-height: 170px; }
/* the Feed the Camel tile: the game's own camel (js/camel.js), still */
.h-ico .camel { display: block; width: 100%; height: 100%; overflow: visible; }
.h-ico .camel, .h-ico .camel * { animation: none !important; }
/* Geesi's bubble on the home screen shows only while he talks (js/app.js restBubble); its space is kept */
.home-wrap .bubble.quiet { visibility: hidden; animation: none; }
/* Geesi introducing himself: his words in blue, and "Baro Somali" as the logo itself */
.home-wrap .bubble.intro-says { color: var(--blue); }
.bubble .bubble-logo { font-size: 1.3em; white-space: nowrap; vertical-align: -.04em; filter: drop-shadow(0 2px 0 rgba(46, 33, 24, .12)); }
/* Geesi stands in the sand (home screen): the sand drifted a little over the front of his paws, in the colour
   of the backdrop's sand there (by day, and by night as the night picture fades in); only in his resting pose
   with his paws down (js/app.js sets its opacity from js/geesihd.js onGround). Paws at 18%, 54% and 78%
   across his box (the resting picture). The shadow under each paw is js/geesihd.js's own, for every pose. */
:root { --paw-sand: rgb(255, 201, 121); --paw-sand-night: rgb(213, 143, 73); }
@media (orientation: landscape) and (max-aspect-ratio: 3/2) { :root { --paw-sand: rgb(253, 186, 95); --paw-sand-night: rgb(206, 131, 60); } }
@media (orientation: portrait) { :root { --paw-sand: rgb(254, 204, 121); --paw-sand-night: rgb(233, 168, 85); } }
@media (orientation: portrait) and (max-aspect-ratio: 2/3) { :root { --paw-sand: rgb(253, 198, 113); --paw-sand-night: rgb(223, 160, 79); } }
.home-wrap .g-host { position: relative; z-index: 1; }
.g-sand { position: absolute; z-index: 2; left: 0; right: 0; top: 95.8%; height: 5.6%; pointer-events: none; }
.g-sand b { position: absolute; inset: 0; --s: var(--paw-sand);
  background: radial-gradient(ellipse 13% 50% at 18.3% 100%, var(--s) 60%, transparent 100%), radial-gradient(ellipse 14% 50% at 53.7% 100%, var(--s) 60%, transparent 100%),
    radial-gradient(ellipse 13% 50% at 78% 100%, var(--s) 60%, transparent 100%),
    radial-gradient(ellipse 13% 70% at 18.3% 100%, rgba(150, 90, 30, .3) 60%, transparent 100%), radial-gradient(ellipse 14% 70% at 53.7% 100%, rgba(150, 90, 30, .3) 60%, transparent 100%),
    radial-gradient(ellipse 13% 70% at 78% 100%, rgba(150, 90, 30, .3) 60%, transparent 100%); }
.g-sand b.n { --s: var(--paw-sand-night); opacity: 0; animation: nightFall var(--cycle) linear var(--cycle-at) infinite; }

/* ---------- Geesi Orod, the runner game (its own styles are in runner.css, loaded with the game) ---------- */
/* Its tile leads Ciyaaro, the whole row wide: Geesi galloping on the left, the name beside him. */
.home-grid .big-btn.run-tile { grid-column: 1 / -1; flex-direction: row; gap: 14px; min-height: 150px; padding: 14px 22px 22px; background: linear-gradient(180deg, #F48A4F, #E8673A); --d: #B8481F; }
.run-tile .run-ico { width: clamp(150px, 38%, 260px); aspect-ratio: 900 / 581; margin: 0; }
.run-tile .run-ico img { width: 100%; height: 100%; object-fit: contain; display: block; animation: runTileGallop 1.1s ease-in-out infinite; }
.run-tile .run-ico .rays { top: -4%; right: -10%; width: 16%; }
.run-tile .run-txt { position: relative; z-index: 2; display: grid; text-align: left; }
.run-tile .lbl { font-size: clamp(1.7rem, 5.6vw, 2.3rem); }
@keyframes runTileGallop { 50% { transform: translate(3%, -5%) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .run-tile .run-ico img { animation: none; } }
/* while the runner plays: no top bar, no backdrop, no page scroll (the game fills the screen) */
body.runner-on { overflow: hidden; overscroll-behavior: none; }
body.runner-on .topbar, body.runner-on .scene { display: none; }
body.runner-on .view { padding: 0; max-width: none; animation: none; }

/* ---------- Akhri (Read): the reading path (js/app.js "Akhri", tools/reading) ---------- */
:root { --t-teal: #22B8AC; --t-teal-2: #0E968B; --t-teal-d: #0A746C; }
.t-teal { --c1: var(--t-teal); --c2: var(--t-teal-2); --cd: var(--t-teal-d); }
/* Home: Akhri sits after Higgaad as a wide tile (letters, syllables, reading on the way), so seven tiles
   still fill the grid: 2 across with Akhri on its own row, or 4 across held sideways with Akhri two wide. */
.home-tiles > .home-tile.wide { grid-column: span 2; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; justify-content: center; align-content: center; column-gap: clamp(12px, 1.8vw, 24px); }
.home-tiles > .home-tile.wide .h-ico { grid-column: 1; grid-row: 1 / span 2; align-self: center; margin-bottom: 0; }
.home-tiles > .home-tile.wide .lbl, .home-tiles > .home-tile.wide .sub { grid-column: 2; }
.home-tiles > .home-tile.wide .lbl { align-self: end; justify-self: start; }
.home-tiles > .home-tile.wide .sub { align-self: start; justify-self: start; }
@media (orientation: portrait) {
  .home-tiles:has(> .wide) > .home-tile:not(.wide) { min-height: clamp(100px, calc((100svh - 470px) / 3), 200px); }
  .home-tiles:has(> .wide) > .home-tile.wide { min-height: clamp(72px, calc((100svh - 470px) / 5), 120px); padding-top: 4px; padding-bottom: 26px; }
  .home-tiles > .home-tile.wide .h-ico { width: clamp(44px, 8vw, 88px); }
}
@media (orientation: landscape) {
  .home-tiles:has(> .wide) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-tiles:has(> .wide) .home-tile .lbl { font-size: clamp(1.1rem, min(1.9vw, 3.4svh), 1.8rem); }
  .home-tiles:has(> .wide) .home-tile .sub { font-size: clamp(.75rem, min(1.05vw, 1.9svh), 1rem); }
}

/* Higgaad: the Gaaban | Dheer (short | long) switch, and the longer syllables a little smaller. */
.hig-switch { display: flex; justify-content: center; gap: 0; margin: 0 auto 16px; width: max-content; padding: 5px; border-radius: 999px; background: var(--card); box-shadow: var(--tile-shadow); border: var(--card-edge, 3px solid #fff); }
.hig-len { min-width: 110px; padding: 8px 20px; border-radius: 999px; font: inherit; font-size: 1.2rem; font-weight: 700; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.hig-len small { font-size: .72rem; font-weight: 600; }
.hig-len.on { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-d); }
.hig.long .hig-syl { font-size: clamp(1.05rem, 4.4vw, 1.5rem); }
.hig.long .hig-vowel { font-size: 1.1rem; }
.syl-choice.long { font-size: clamp(1.8rem, 9vw, 3rem); }

/* A word in its beats: ga·bar, each vowel in its Higgaad colour. */
.ak-beat { display: inline-block; }
.ak-beat i { font-style: normal; display: inline-block; }
.ak-v { color: var(--vd); }
.ak-dot { color: #C9B393; font-weight: 400; margin: 0 .06em; }

/* The path */
.ak-path { display: grid; gap: 14px; width: 100%; max-width: 620px; margin: 6px auto 0; }
.ak-stop { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num name pic" "num ex pic" "num bar pic"; column-gap: 16px; row-gap: 2px; align-items: center;
  padding: 12px 18px 12px 14px; border-radius: 26px; background: var(--card); border: var(--card-edge, 3px solid #fff); box-shadow: var(--tile-shadow);
  margin-left: calc(var(--k) % 2 * 9%); margin-right: calc((1 - var(--k) % 2) * 9%); color: var(--ink); }
.ak-num { grid-area: num; position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--t-teal), var(--t-teal-2)); color: #fff; font-size: 1.9rem; font-weight: 700; box-shadow: 0 4px 0 var(--t-teal-d); border: 3px solid #fff; }
.ak-num svg.i { width: 34px; height: 34px; }
.ak-num .rays { position: absolute; top: -8px; right: -14px; width: 18px; }
.ak-stop.done .ak-num { background: linear-gradient(180deg, var(--t-green), var(--t-green-2)); box-shadow: 0 4px 0 var(--t-green-d); }
.ak-stop.ahead { opacity: .62; }
.ak-stop-name { grid-area: name; font-size: 1.05rem; font-weight: 700; color: var(--teal-d); line-height: 1.15; }
.ak-stop-name small { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.ak-ex { grid-area: ex; font-size: clamp(1.6rem, 6vw, 2.1rem); font-weight: 700; line-height: 1.1; }
.ak-stop-pic { grid-area: pic; }
.ak-stop-pic .pic .art { width: clamp(64px, 16vw, 92px); height: clamp(64px, 16vw, 92px); }
.ak-stop .go-progress { grid-area: bar; margin-top: 4px; }
.ak-stop .go-count { font-weight: 700; color: var(--ink-soft); }
.ak-stop > .lock-badge { top: 10px; right: 10px; }

/* Reading a word, a sentence */
.ak-read { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 640px; margin: 0 auto; }
.ak-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ak-dots i { width: 12px; height: 12px; border-radius: 50%; background: #E7DCCB; }
.ak-dots i.read { background: var(--teal); }
.ak-dots i.on { outline: 3px solid var(--orange); outline-offset: 2px; }
.ak-card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 26px 16px 22px; border-radius: 30px; background: var(--card); border: var(--card-edge, 3px solid #fff); box-shadow: var(--tile-shadow); color: var(--ink); }
.ak-card .ak-word { font-size: clamp(3.2rem, 17vw, 5.4rem); font-weight: 700; line-height: 1.05; }
.ak-reward { display: grid; place-items: center; min-height: 170px; opacity: 0; transform: scale(.6); transition: opacity .3s var(--ease-out), transform .45s var(--ease-spring); }
.ak-card.shown .ak-reward { opacity: 1; transform: none; }
.ak-en { color: var(--ink-soft); font-size: 1.1rem; margin: 0; text-align: center; }
/* a word with no picture: the card only as big as the word (and its English) */
.ak-card.no-pic { width: auto; min-width: min(100%, 280px); max-width: 100%; padding: 24px 40px 20px; }
.ak-nav { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 32px); }
.ak-nav .next-word[disabled] { opacity: .35; }
.ak-page { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; padding: 20px 16px; border-radius: 30px; background: var(--card); border: var(--card-edge, 3px solid #fff); box-shadow: var(--tile-shadow); }
.ak-line { margin: 0; text-align: center; font-size: clamp(1.7rem, 7vw, 2.6rem); font-weight: 700; line-height: 1.5; color: var(--ink); }
.ak-w { font: inherit; color: inherit; padding: 0 .12em; border-radius: .25em; transition: background .12s, transform .12s; }
.ak-w.lit { background: #FFC93A; color: #2B1E14; box-shadow: 0 0 0 .06em #FFC93A; }
.ak-w.you { background: var(--sky); box-shadow: 0 0 0 .06em var(--sky); transform: translateY(-2px); }
.ak-gate { min-height: 120px; }
@media (prefers-reduced-motion: reduce) { .ak-reward { transition: none; } .ak-w.you { transform: none; } }

/* Geesi's walkthroughs (js/app.js coach): his bubble at the bottom, his paw tapping what he means, and the
   "?" button that shows it again. */
.coach { position: fixed; inset: 0; z-index: 60; background: rgba(46, 33, 24, .18); animation: coachIn .2s var(--ease-out); cursor: pointer; }
.coach.closing { opacity: 0; transition: opacity .2s; }
@keyframes coachIn { from { opacity: 0; } }
.coach-bubble { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(92vw, 560px); box-sizing: border-box;
  padding: 16px 22px 14px; border-radius: 26px; background: var(--card); border: var(--card-edge, 4px solid #fff); box-shadow: var(--tile-shadow, 0 6px 0 rgba(46, 33, 24, .12)); text-align: center; }
.coach-bubble .so { margin: 0; font-size: clamp(1.25rem, 4.6vw, 1.6rem); font-weight: 700; color: var(--ink); line-height: 1.25; }
.coach-bubble .en { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; }
.coach-bubble .en:empty { display: none; }
.coach-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.coach-dots i { width: 9px; height: 9px; border-radius: 50%; background: #E7DCCB; }
.coach-dots i.on { background: var(--orange); }
.coach-paw { position: fixed; width: 76px; height: 76px; margin: -10px 0 0 -38px; opacity: 0; pointer-events: none; transition: left .35s var(--ease-out), top .35s var(--ease-out), opacity .2s; filter: drop-shadow(0 4px 4px rgba(46, 33, 24, .25)); }
.coach-paw.on { opacity: 1; animation: pawTap 1s ease-in-out infinite; }
.coach-paw .art { width: 100%; height: 100%; }
@keyframes pawTap { 0%, 100% { transform: translateY(10px); } 45% { transform: translateY(0) scale(.92); } 60% { transform: translateY(0) scale(.92); } }
.coach-btn { position: fixed; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + var(--safe-b)); z-index: 20; width: 48px; height: 48px; border-radius: 50%;
  background: var(--card); border: 4px solid #fff; box-shadow: var(--tile-shadow, 0 4px 0 rgba(46, 33, 24, .14)); font: inherit; font-size: 1.5rem; font-weight: 700; color: var(--teal-d); }
.coach-btn:active { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) { .coach-paw.on { animation: none; } .coach-paw { transition: opacity .2s; } }

/* Akhri sentences, read with a finger: a dash under each word (dark: all its sounds are known; orange:
   something not taught yet), pale words ahead, dark words read, and Geesi's paw to slide along. */
.ak-trail { position: relative; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; padding-bottom: 30px; }
.ak-sent .ak-line { line-height: 1.25; }
.ak-sent .ak-w { position: relative; display: inline-block; margin: .25em 0 .85em; padding-bottom: .3em; color: #C4B49C; transition: color .18s, background .12s; }
.ak-sent .ak-w::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: .08em; height: .2em; border-radius: 99px; background: #9BB4DD; opacity: .45; transition: opacity .18s, background .18s; }
.ak-sent .ak-w.new::after { background: #F4A486; }
.ak-sent .ak-w.read { color: var(--ink); }
.ak-sent .ak-w.read::after { background: var(--blue-d); opacity: 1; }
.ak-sent .ak-w.read.new::after { background: var(--orange); }
.ak-sent .ak-w.here::after { opacity: 1; background: #FFB3A7; }
.ak-sent .ak-w.later { opacity: .55; }
.ak-sent .ak-w.lit { color: #2B1E14; }
.ak-paw { position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin-left: -28px; cursor: grab; touch-action: none;
  transition: transform .14s var(--ease-out); filter: drop-shadow(0 3px 3px rgba(46, 33, 24, .28)); z-index: 2; }
.ak-paw .art { width: 100%; height: 100%; }
.ak-paw.held { cursor: grabbing; transition: none; scale: 1.12; }
.ak-paw.hop { animation: pawHop .6s var(--ease-spring) 2; }
@keyframes pawHop { 50% { translate: 0 -14px; } }
.ak-paw:focus-visible { outline: 3px solid var(--teal); border-radius: 50%; }
.next-word.ready { animation: pulse .9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ak-paw { transition: none; } .ak-paw.hop { animation: none; } }
.ak-lv { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: .4em; border-radius: 50%; background: #fff; color: var(--blue-d); font-weight: 700; font-size: .9em; vertical-align: .1em; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
/* Akhri's pictures: a scene in a rounded frame, kept to a share of the screen's height */
.ak-scene-wrap { width: min(100%, 560px, calc(36svh * 1.583)); aspect-ratio: 760 / 480; border-radius: 22px; overflow: hidden; background: var(--sky); box-shadow: inset 0 0 0 3px #fff, 0 3px 0 rgba(46, 33, 24, .1); }
.ak-scene { display: block; width: 100%; height: 100%; }

/* Akhri's two doors (js/app.js akhriView): the app's tiles, wide like Geesi Orod in Ciyaaro, the picture beside
   the name. Geesi La Akhri, the flagship, first and taller; Erayo under it. */
.home-grid .big-btn.ak-door { grid-column: 1 / -1; flex-direction: row; gap: clamp(12px, 3vw, 26px); min-height: 140px; padding: 14px 22px 24px; }
.home-grid .big-btn.ak-door.geesi { min-height: clamp(180px, 30svh, 240px); }
.ak-door .h-ico { margin: 0; flex: none; width: clamp(84px, 20vw, 130px); }
.ak-door.geesi .h-ico { width: clamp(118px, 28vw, 190px); }
.ak-door-txt { position: relative; z-index: 2; display: grid; text-align: left; }
.ak-door .lbl { font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.1; }
.ak-door.geesi .lbl { font-size: clamp(1.9rem, 6.4vw, 2.6rem); }
.big-btn.ak-door.ahead { opacity: .62; }

/* "Waa xiran yahay" (locked): not a happy moment, so not the rainbow letters that pop in for "Sax!". One warm,
   quiet colour, a thinner outline, and room between the letters and the words so it reads easily. */
.done-screen h1.locked-title { margin: 4px 0 2px; font-size: clamp(2.1rem, 9vw, 3rem); font-weight: 700; line-height: 1.15; color: #8A6A4E;
  letter-spacing: .05em; word-spacing: .28em; text-shadow: var(--outline-3), 0 4px 0 rgba(46, 33, 24, .12); animation: lockedIn .35s var(--ease-out) both; }
@keyframes lockedIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .done-screen h1.locked-title { animation: none; } }

/* English hidden (html.no-en, js/app.js route): the space the English line had goes to the name, so tiles don't
   look half-empty. Names a little bigger and centred in their tile; the wide Akhri tile's name in the middle of
   its row; the Erayo steps' names bigger. */
.no-en .big-btn .lbl { font-size: clamp(1.6rem, 4.2vw, 1.95rem); }
.no-en .big-btn { gap: 8px; }
.no-en .home-tiles .home-tile .lbl { font-size: clamp(1.45rem, 2.6vw, 2.25rem); }
.no-en .home-tiles > .home-tile.wide .lbl { grid-row: 1 / span 2; align-self: center; }
.no-en .ak-door .lbl { font-size: clamp(1.8rem, 5.6vw, 2.4rem); }
.no-en .ak-door.geesi .lbl { font-size: clamp(2.1rem, 7vw, 2.9rem); }
.no-en .ak-stop-name { font-size: 1.2rem; }
/* a little book in Geesi La Akhri not opened yet (its word step isn't read) */
.ak-parts .pack-tile.ahead { opacity: .62; }

/* ---------- The games and the reading fit the screen ----------
   The games (Dhegayso, Isku Aadi, Higgaad Raadi), Akhri's word cards, its check and its sentences, the end of a
   round and the Ciyaaro menu show everything at once, with nothing to scroll: phones upright and sideways,
   tablets and computers. The page is the top bar plus one screen-high area (the body a column 100svh high);
   the answers, the cards and the pictures take their size from the room that is left to them (container units,
   cqw and cqh), Geesi and the speaker from the screen's height (svh). Phones held sideways get a smaller top
   bar and put things side by side. Browsers without container units keep the layout above. */
:root { --g-fit: clamp(64px, 14svh, 150px); --spk-fit: clamp(60px, 11svh, 116px); }
/* Nothing sits on the woven band along the bottom of the backdrop (--band-h, its height): the room ends just
   above it (or above the phone's home bar, if that is taller). */
:root { --clear-band: calc(max(var(--band-h), var(--safe-b)) + 10px); }
.bk-host { bottom: max(var(--band-h), var(--safe-b)); padding-bottom: 6px; }
.bc { padding-bottom: var(--clear-band); }
body[data-screen="stories"] .view { padding-bottom: 0; }   /* (the bookcase's own padding keeps it clear of the band) */
.coach-bubble { bottom: calc(var(--clear-band) + 4px); }
/* Nothing on top of anything else.
   The "?" (Geesi's walkthrough again) sits in the top bar beside the back button, never over the screen, and
   the title makes room for it (js/app.js fitTitle keeps the title between the buttons). */
.coach-btn { top: calc(var(--safe-t) + 18px); bottom: auto; left: calc(16px + var(--tap) + 10px); }
body:has(#topbar > .coach-btn) .topbar-title { margin-left: 56px; }
@media (orientation: landscape) and (max-height: 560px) {   /* (with the smaller top bar there, below) */
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .coach-btn { top: calc(var(--safe-t) + 9px); left: 76px; width: 44px; height: 44px; font-size: 1.3rem; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]):has(#topbar > .coach-btn) .topbar-title { margin-left: 50px; }
}
.topbar-title.no-rays .ht-rays { display: none; }
.topbar-title.two-lines .tt { white-space: normal; line-height: 1; padding-bottom: .06em; }
/* (the big title's column is the title's own width: a long English ribbon mustn't widen it, or the words are
   measured against the wrong room) */
.topbar-title.hero { grid-template-columns: minmax(0, 1fr); }
/* Phones: the top bar's buttons a little smaller (still easy to tap), so the title has room between them. */
@media (max-width: 430px) {
  body:not(.home) .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  body:not(.home) .topbar .icon-btn { width: 54px; height: 54px; }
  body:not(.home) .topbar .icon-btn svg { width: 28px; height: 28px; }
  body:not(.home) .star-pill { min-height: 54px; min-width: 54px; padding: 0 12px; gap: 4px; font-size: 1.3rem; }
  body:not(.home) .star-icon .coin { width: 26px; height: 26px; }
  .coach-btn { top: calc(var(--safe-t) + 16px); left: 74px; width: 42px; height: 42px; font-size: 1.3rem; }
  body:has(#topbar > .coach-btn) .topbar-title { margin-left: 50px; }
}
/* The storybook's page arrows sit in the bar under the book, at its two ends, not on the pages; on a phone the
   language button shows just its globe, so the bar still fits. */
.bk-bar .bk-arrow { position: relative; left: auto; right: auto; bottom: auto; width: 52px; height: 52px; flex: none; }
.bk-bar .bk-arrow svg { width: 28px; height: 28px; }
@media (max-width: 520px) {
  .bk-bar { gap: 10px; }
  .bk-lang { width: 52px; padding: 0; justify-content: center; }
  .bk-lang .bk-lang-t { display: none; }
}
@supports (width: 1cqh) {
  body:has(> .view > :is(.game-head, .game-status, .ak-read, .done-screen, .games-grid)) { display: flex; flex-direction: column; height: 100svh; }
  body:has(> .view > :is(.game-head, .game-status, .ak-read, .done-screen, .games-grid)) > .view {
    flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: var(--clear-band); }

  /* Geesi and the speaker over the answers (Dhegayso, Higgaad Raadi, Akhri's check) */
  .view > .game-head { flex: none; gap: clamp(4px, 1.2svh, 10px); margin-top: 0; }
  .view > .game-head .game-status { margin: 2px auto 0; }
  .view > :is(.game-head, .game-row) .g-mini.sm { width: var(--g-fit); }
  .view > .game-head .speaker-btn { width: var(--spk-fit); height: var(--spk-fit); }
  .view > .game-head .speaker-btn svg { width: 52%; height: 52%; }
  /* his speech bubble beside his head (not raised by the row's width, which made the row taller than him) */
  .view > .game-head .say-row { align-items: flex-start; }
  .view > .game-head .say-bubble { margin: clamp(0px, 1.6svh, 16px) 0 0; }
  .view > .game-head .say-bubble .listen-word { font-size: clamp(1.6rem, min(7.5vw, 5svh), 2.6rem); }
  /* the three answers: squares as big as the room under Geesi allows */
  .view > .choices { --cg: clamp(10px, 1.8svh, 14px); flex: 1 1 0; min-height: 0; width: 100%; max-width: none; margin: clamp(8px, 2svh, 18px) 0 0;
    container-type: size; grid-template-columns: repeat(3, auto); justify-content: center; align-content: start; gap: var(--cg);
    --cs: min(calc((100cqw - 2 * var(--cg)) / 3), 100cqh, 240px); }
  .view > .choices > .choice { width: var(--cs); height: var(--cs); min-height: 0; aspect-ratio: auto; }
  .view > .choices > .choice .pic :is(.art, img) { width: calc(var(--cs) * .64); height: calc(var(--cs) * .64); }
  .view > .choices > .choice .pic .emoji { font-size: calc(var(--cs) * .5); }
  .view > .choices > .choice .pic .swatch { width: calc(var(--cs) * .52); height: calc(var(--cs) * .52); }
  .view > .choices > .syl-choice { font-size: min(3.6rem, calc(var(--cs) * .36)); }
  .view > .choices > .syl-choice.long { font-size: min(3rem, calc(var(--cs) * .3)); }

  /* Isku Aadi: Geesi a little smaller, and the five rows of words and pictures share the height left */
  .view > .game-status { flex: none; }
  .view > .game-row { flex: none; }
  .view > .game-row .g-mini.sm { width: calc(var(--g-fit) * .8); }
  .view > .match-board { --mg: clamp(8px, 1.6svh, 14px); flex: 1 1 0; min-height: 0; width: 100%; max-width: 720px; margin: clamp(6px, 1.6svh, 16px) auto 0;
    container-type: size; align-content: start; gap: var(--mg) 18px; --mh: clamp(40px, calc((100cqh - 4 * var(--mg)) / 5), 96px); --iw: calc((100cqw - 18px) / 2); }
  .view > .match-board .match-col { gap: var(--mg); }
  .view > .match-board .m-item { height: var(--mh); min-height: 0; padding: 4px 8px; }
  .view > .match-board .m-item .pic :is(.art, img) { width: calc(var(--mh) * .76); height: calc(var(--mh) * .76); }
  .view > .match-board .m-item .pic .emoji { font-size: calc(var(--mh) * .56); }
  .view > .match-board .m-item .pic .swatch { width: calc(var(--mh) * .66); height: calc(var(--mh) * .66); }
  /* a long word (Qaansoroobaad) smaller, so it stays inside its card (--n: its longest word's letters) */
  .view > .match-board .m-item .so { font-size: clamp(.85rem, calc((var(--iw) - 64px) / var(--n, 6) / .62), 1.45rem); white-space: nowrap; }

  /* Akhri: the word card or the sentence page takes the room between the dots and Geesi */
  .view > .ak-read { flex: 1 1 auto; min-height: 0; gap: clamp(8px, 1.8svh, 16px); }
  .view > .ak-read > :is(.ak-dots, .ak-nav) { flex: none; }
  .view > .ak-read .ak-nav .game-row { gap: clamp(6px, 2vw, 18px); }
  .view > .ak-read .ak-nav .g-mini.sm { width: min(calc(var(--g-fit) * .85), 24vw); }
  .view > .ak-read .ak-nav .speaker-btn { width: min(var(--spk-fit), 22vw); height: min(var(--spk-fit), 22vw); }
  .view > .ak-read .ak-nav .speaker-btn svg { width: 52%; height: 52%; }
  .view > .ak-read .next-word { width: clamp(44px, 7svh, 56px); height: clamp(44px, 7svh, 56px); }
  .view > .ak-read > .ak-card { flex: 0 1 auto; min-height: 0; padding: clamp(10px, 2.4svh, 26px) 16px clamp(8px, 2svh, 22px); gap: clamp(2px, 1svh, 10px); }
  .view > .ak-read > .ak-card > :is(.ak-word, .ak-en) { flex: none; }
  .view > .ak-read > .ak-card .ak-word { font-size: clamp(2.4rem, min(17vw, 10svh), 5.4rem); }
  .view > .ak-read > .ak-card > .ak-reward { flex: 0 1 clamp(70px, 28svh, 210px); min-height: 0; align-self: stretch; container-type: size; }
  .view > .ak-read > .ak-card > .ak-reward .pic.lg :is(.art, img) { width: min(190px, 100cqh, 100cqw); height: min(190px, 100cqh, 100cqw); }
  .view > .ak-read > .ak-card > .ak-reward .pic.lg .emoji { font-size: min(7rem, 72cqh); }
  .view > .ak-read > .ak-card > .ak-reward .pic.lg .swatch { width: min(140px, 80cqh); height: min(140px, 80cqh); }
  /* a sentence: the picture gets what the words leave (never wider than the page) */
  .view > .ak-sent > .ak-page { flex: 1 1 auto; min-height: 0; container-type: inline-size; justify-content: center; padding: clamp(10px, 2svh, 20px) 16px; gap: clamp(6px, 1.4svh, 12px); }
  .view > .ak-sent .ak-scene-wrap { flex: 1 1 0; min-height: 64px; width: auto; height: auto; max-width: 100%; max-height: min(calc(100cqw / 1.583), 354px); }
  .view > .ak-sent .ak-page > .pic { flex: 0 1 auto; min-height: 0; }
  .view > .ak-sent .ak-page > .pic.lg :is(.art, img) { width: clamp(70px, 22svh, 170px); height: clamp(70px, 22svh, 170px); }
  .view > .ak-sent .ak-page > :is(.ak-trail, .ak-en) { flex: none; }
  .view > .ak-sent .ak-trail { padding-bottom: clamp(20px, 3.4svh, 30px); }
  .view > .ak-sent .ak-line { font-size: clamp(1.4rem, min(6.6vw, 4.8svh), 2.6rem); }
  .view > .ak-sent .ak-w { margin: .2em 0 .7em; }
  .view > .ak-sent .ak-paw { width: clamp(42px, 7svh, 56px); height: clamp(42px, 7svh, 56px); margin-left: calc(clamp(42px, 7svh, 56px) / -2); }

  /* the end of a round, the try-again and the locked screens: in the middle of the room */
  .view > .done-screen { flex: 1 1 auto; align-content: center; padding-top: 0; }

  /* the Ciyaaro menu: the tiles share the height left over by the Family plan bar */
  .view > .home-grid.games-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: 1fr 1fr minmax(0, .72fr); }
  .view > .home-grid.games-grid > .big-btn { min-height: 0; container-type: size; padding-top: 6px; }
  .view > .home-grid.games-grid > .big-btn .h-ico { width: min(clamp(76px, 11vw, 128px), 54cqh); }
  .view > .home-grid.games-grid > .run-tile .run-ico { width: min(clamp(150px, 38%, 260px), calc(76cqh * 1.55)); }
  .view > .games-grid + .picks-bar { flex: none; margin-top: clamp(8px, 2svh, 18px); }

  /* Tablets held sideways and computers: a sentence's picture on the left, the words beside it */
  @media (orientation: landscape) {
    .view > .ak-sent { max-width: 1040px; }
    .view > .ak-sent > .ak-page { container-type: size; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr;
      align-items: center; justify-items: center; column-gap: clamp(14px, 3vw, 32px); row-gap: 6px; }
    .view > .ak-sent .ak-page > :is(.ak-scene-wrap, .pic) { grid-column: 1; grid-row: 1 / -1; }
    .view > .ak-sent .ak-scene-wrap { flex: none; min-height: 0; max-height: none; width: min(44cqw, 100cqh * 1.583, 560px); }
    .view > .ak-sent .ak-page > .ak-trail { grid-column: 2; grid-row: 2; }
    .view > .ak-sent .ak-page > .ak-en { grid-column: 2; grid-row: 3; }
  }

  /* Phones held sideways */
  @media (orientation: landscape) and (max-height: 560px) {
    .view > .game-head { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 16px; }
    .view > .game-head .game-status { margin: 0; }
    .view > .choices { margin-top: 8px; }
    /* Isku Aadi: Geesi on the left; the words in a row over the pictures */
    body:has(> .view > .match-board) > .view { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 12px; }
    body:has(> .view > .match-board) > .view > .game-status { grid-column: 1 / -1; margin: 0 auto 6px; }
    .view > .game-row { grid-column: 1; grid-row: 2; flex-direction: column; justify-content: flex-end; gap: 4px; }
    .view > .game-row .g-mini.sm { width: var(--g-fit); }
    .view > .game-row .hint { margin: 0; gap: 4px; }
    .view > .game-row .hint svg.i { width: 22px; height: 22px; }
    .view > .match-board { grid-column: 2; grid-row: 2; margin: 0; max-width: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr));
      gap: var(--mg); --iw: calc((100cqw - 4 * var(--mg)) / 5); }
    .view > .match-board .match-col { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); align-content: stretch; }
    .view > .match-board .m-item { height: auto; flex-direction: column; gap: 2px; padding: 4px; }
    .view > .match-board .m-item .pic :is(.art, img) { --p: min(calc((100cqh - var(--mg)) / 2 - 20px), calc(var(--iw) - 22px)); width: var(--p); height: var(--p); }
    .view > .match-board .m-item .so { font-size: clamp(.8rem, calc((var(--iw) - 18px) / var(--n, 6) / .62), 1.35rem); }
    /* Akhri: the arrows, Geesi and the speaker in a column on the right, so the card has the whole height */
    .view > .ak-read { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); gap: 8px 12px; max-width: none; }
    .view > .ak-read > .ak-dots { grid-column: 1 / -1; }
    .view > .ak-read > :is(.ak-card, .ak-page) { grid-column: 1; grid-row: 2; justify-self: stretch; align-self: stretch; }
    .view > .ak-read > .ak-card.no-pic { justify-self: center; align-self: center; }
    .view > .ak-read > .ak-nav { grid-column: 2; grid-row: 2; display: grid; grid-template-areas: "row row" "prev next"; justify-items: center; align-content: center; gap: 8px; }
    .view > .ak-read > .ak-nav > .prev { grid-area: prev; }
    .view > .ak-read > .ak-nav > .next-word:not(.prev) { grid-area: next; }
    .view > .ak-read > .ak-nav > .game-row { grid-area: row; flex-direction: column; gap: 4px; }
    .view > .ak-read .ak-nav .g-mini.sm { width: var(--g-fit); }
    /* a word: the word on the left, its picture on the right, as big as the card is high */
    .view > .ak-read > .ak-card:not(.no-pic) { container-type: size; display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto auto 1fr;
      justify-content: center; align-items: center; column-gap: clamp(20px, 5vw, 48px); row-gap: 4px; }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-word { grid-column: 1; grid-row: 2; }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-en { grid-column: 1; grid-row: 3; }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-reward { grid-column: 2; grid-row: 1 / -1; container-type: normal; align-self: center; }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-reward .pic.lg :is(.art, img) { width: min(190px, 100cqh - 8px, 40cqw); height: min(190px, 100cqh - 8px, 40cqw); }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-reward .pic.lg .emoji { font-size: min(7rem, 70cqh); }
    .view > .ak-read > .ak-card:not(.no-pic) > .ak-reward .pic.lg .swatch { width: min(140px, 76cqh); height: min(140px, 76cqh); }
    .view > .ak-sent .ak-scene-wrap { width: min(40cqw, 100cqh * 1.583, 560px); }
    .view > .ak-sent .ak-w { margin: .15em 0 .62em; }
    .view > .ak-sent .ak-en { font-size: .95rem; }
    /* the end of a round: Geesi on the left, the stars and the buttons beside him */
    .view > .done-screen { grid-template-columns: auto auto; justify-content: center; column-gap: clamp(16px, 4vw, 40px); row-gap: 0; }
    .view > .done-screen > .g-mini { grid-column: 1; grid-row: 1 / span 9; align-self: center; width: clamp(96px, 34svh, 170px); }
    .view > .done-screen > :not(.g-mini) { grid-column: 2; margin-block: 4px; }
    /* Ciyaaro: four tiles in a row, Geesi Orod under them */
    .view > .home-grid.games-grid { grid-template-rows: 1fr minmax(0, .8fr); gap: 10px; }
    .view > .home-grid.games-grid > .big-btn { padding-bottom: 22px; }
    .view > .home-grid.games-grid > .big-btn::after { height: 18px; }
    .view > .home-grid.games-grid > .big-btn .lbl { font-size: 1.25rem; }
    .view > .home-grid.games-grid > .big-btn .sub { font-size: .8rem; }
  }
}
/* The bookcase: every book's card in view at once, above the woven band (js/bookcase.js fitShelf: smaller books
   first, then .tight leaves out the blurb, then .tighter the series name, with a smaller title). The blurb is
   two lines at most; held sideways, a phone shows the books side by side, each over its name and Read Story. */
.bc-blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc.tight .bc-blurb { display: none; }
.bc.tight .bc-case { gap: 12px; }
.bc.tight .bc-shelf { padding-top: 12px; padding-bottom: 12px; }
.bc.tighter .bc-series { display: none; }
.bc.tighter .bc-info h2 { margin-top: 0; font-size: clamp(1.25rem, 3.6vw, 2rem); }
.bc.tighter .bc-en { font-size: clamp(.9rem, 2vw, 1.2rem); }
.bc.tighter .bc-shelf { row-gap: 8px; }
@media (orientation: landscape) and (max-height: 560px) {
  .bc-case { display: flex; flex-wrap: wrap; gap: 12px; }
  .bc-case > .bc-shelf { flex: 1 1 0; min-width: 0; }
  .bc-case > .bc-soon { flex: 1 0 100%; margin-top: 0; }
  .bc-soon b, .bc-soon small { display: inline; margin: 0; }
  .bc-soon small::before { content: " · "; }
  .bc-shelf { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; text-align: center; padding: 8px 8px 10px; gap: 4px; border-radius: 26px; }
  .bc-info { padding-right: 0; border-right: 0; }
  .bc-slot { grid-row: auto; }
  .bc-go { grid-column: auto; justify-self: center; }
  .bc-series, .bc-blurb { display: none; }
  .bc-info h2, .bc.tighter .bc-info h2 { margin-top: 0; font-size: 1.15rem; }
  .bc-en, .bc.tighter .bc-en { margin-top: 2px; font-size: .8rem; }
  /* the book in hand on the left, as tall as the screen allows; the hint, the stickers and the buttons beside it */
  .bc-stage { display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto auto auto 1fr; justify-content: center; align-items: center;
    column-gap: 28px; row-gap: 10px; padding: calc(64px + var(--safe-t)) 12px calc(10px + var(--safe-b)); }
  .bc-stage > .bc-spot { grid-column: 1; grid-row: 1 / -1; }
  .bc-stage > .bc-hint { grid-column: 2; grid-row: 2; max-width: 300px; }
  .bc-stage > .bc-tray { grid-column: 2; grid-row: 3; width: min(320px, 46vw); }
  .bc-stage > .bc-bar { grid-column: 2; grid-row: 4; justify-self: center; }
}
/* Phones held sideways: a smaller top bar on the games, the reading and the stories, as on the home screen */
@media (orientation: landscape) and (max-height: 560px) {
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .topbar { padding-top: calc(6px + var(--safe-t)); padding-bottom: 6px; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .topbar .icon-btn { width: 50px; height: 50px; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .star-pill { min-height: 50px; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .topbar-title { font-size: 1.6rem; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .topbar-title.hero { font-size: 2.1rem; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .ht-ribbon { font-size: .8rem; }
  body:is([data-screen="play"], [data-screen="games"], [data-screen="akhri"], [data-screen="stories"], [data-screen="story"]) .topbar-title small { font-size: .75rem; margin-top: 0; }
}

/* ---------- Akhri's menus fit the screen ----------
   Akhri's two doors (js/app.js akhriView), the Erayo path of five word steps (akhriErayoView) and Geesi La
   Akhri's sentence sets and little books (akhriParts) show everything at once above the woven band, with nothing
   to scroll, as the games do (above). The doors share the height the Family plan bar leaves; the steps and the
   books are rows as tall as the room allows, never taller than their usual size, and what is inside them takes
   its size from that height (--sh, or container units). Phones held sideways put the doors side by side, the
   five steps in a row, and the books four in a row, each its deck over its name. */
@supports (width: 1cqh) {
  body:has(> .view > :is(.ak-doors, .ak-path, .ak-parts)) { display: flex; flex-direction: column; height: 100svh; }
  body:has(> .view > :is(.ak-doors, .ak-path, .ak-parts)) > .view {
    flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: var(--clear-band); }
  .view > :is(.ak-doors, .ak-path, .ak-parts) + .picks-bar { flex: none; margin-top: clamp(8px, 2svh, 18px); }

  /* the doors: Geesi La Akhri a little taller than Erayo; their pictures and names as big as each door allows */
  .view > .home-grid.ak-doors { flex: 1 1 auto; min-height: 0; max-height: 480px; grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(10px, 2svh, 16px); }
  .view > .home-grid.ak-doors > .big-btn.ak-door { min-height: 0; container-type: size; padding-top: 8px; padding-bottom: 24px; }
  .view > .ak-doors .ak-door .h-ico { width: min(clamp(84px, 20vw, 130px), 66cqh, 34cqw); }
  .view > .ak-doors .ak-door.geesi .h-ico { width: min(clamp(118px, 28vw, 190px), 78cqh, 38cqw); }
  .view > .ak-doors .ak-door .lbl { font-size: min(clamp(1.6rem, 5vw, 2.1rem), 24cqh, 11cqw); }
  .view > .ak-doors .ak-door.geesi .lbl { font-size: min(clamp(1.9rem, 6.4vw, 2.6rem), 22cqh, 11.5cqw); }
  .view > .ak-doors .ak-door .sub { font-size: min(.95rem, 12cqh, 6cqw); }
  .view > .ak-doors .ak-door:has(> .lock-badge) > .ak-door-txt { padding-right: 22px; }   /* (clear of the lock) */
  .no-en .view > .ak-doors .ak-door .lbl { font-size: min(clamp(1.8rem, 5.6vw, 2.4rem), 28cqh, 12cqw); }
  .no-en .view > .ak-doors .ak-door.geesi .lbl { font-size: min(clamp(2.1rem, 7vw, 2.9rem), 26cqh, 13cqw); }

  /* Erayo: five rows (--sh high, at most their usual 128px), the zig-zag kept */
  .view > .ak-path { --pg: clamp(8px, 1.5svh, 14px); flex: 1 1 auto; min-height: 0; max-height: calc(5 * 128px + 4 * var(--pg)); margin-top: 0; container-type: size;
    align-content: start; gap: var(--pg); --sh: min(128px, calc((100cqh - 4 * var(--pg)) / 5)); }
  .view > .ak-path > .ak-stop { height: var(--sh); min-height: 0; padding-block: calc(var(--sh) * .06); row-gap: 0; align-content: center; }
  .view > .ak-path .ak-num { width: min(64px, var(--sh) * .6, 15vw); height: min(64px, var(--sh) * .6, 15vw); font-size: min(1.9rem, var(--sh) * .28); }
  .view > .ak-path .ak-num svg.i { width: 54%; height: 54%; }
  .view > .ak-path .ak-stop-name { font-size: min(1.05rem, var(--sh) * .165, 4.4cqw); line-height: 1.12; }
  .view > .ak-path .ak-stop-name small { font-size: min(.8rem, var(--sh) * .13); }
  .view > .ak-path .ak-ex { font-size: min(clamp(1.6rem, 6vw, 2.1rem), var(--sh) * .3); line-height: 1.08; }
  .view > .ak-path .ak-stop-pic .pic :is(.art, img) { width: min(clamp(52px, 16vw, 92px), var(--sh) * .76); height: min(clamp(52px, 16vw, 92px), var(--sh) * .76); }
  .view > .ak-path .ak-stop .go-progress { margin-top: min(4px, var(--sh) * .03); }
  .view > .ak-path .ak-stop .go-bar { height: min(clamp(16px, 1.9vw, 24px), var(--sh) * .15); border-width: min(3px, var(--sh) * .03); }
  .view > .ak-path .ak-stop .go-count { font-size: min(1rem, var(--sh) * .16); }
  .no-en .view > .ak-path .ak-stop-name { font-size: min(1.2rem, var(--sh) * .2, 5cqw); }
  .view > .ak-path .ak-stop > .lock-badge { top: min(10px, var(--sh) * .07); right: min(10px, var(--sh) * .07); width: min(34px, var(--sh) * .34); height: min(34px, var(--sh) * .34); }
  .view > .ak-path .ak-stop > .lock-badge svg.i { width: 58%; height: 58%; }

  /* Geesi La Akhri: rows as tall as the room allows (at most the usual 132px); the last row's tiles in the middle.
     Each tile sizes its little deck of cards and its name from its own height. */
  .view > .pack-list.ak-parts { --pg: clamp(8px, 1.5svh, 16px); flex: 1 1 auto; min-height: 0; display: grid; gap: var(--pg);
    grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 132px); align-content: start; }
  .view > .ak-parts > .pack-tile { --wb: clamp(11px, 2svh, 16px); min-height: 0; container-type: size; gap: clamp(10px, 3vw, 18px);
    padding: clamp(4px, 1.4svh, 16px) clamp(12px, 3vw, 20px) calc(var(--wb) + clamp(3px, 1svh, 8px)) 14px; }
  .view > .ak-parts > .pack-tile::after { height: var(--wb); }
  .view > .ak-parts .deck { --dh: min(100px, 100cqh); width: calc(var(--dh) * .78); height: var(--dh); margin: 0 calc(var(--dh) * .1) 0 12px; }
  .view > .ak-parts .deck .top::after { height: calc(var(--dh) * .14); }
  .view > .ak-parts .pack-tile .t { font-size: min(1.6rem, 46cqh, 6.6cqw); line-height: 1.15; }
  .view > .ak-parts > .pack-tile:has(> .lock-badge) > span:last-child { padding-right: 24px; }
  .view > .ak-parts .pack-tile .e { font-size: min(1rem, 27cqh); }
  .view > .ak-parts > .pack-tile > .lock-badge { top: min(10px, 8cqh); }
  @media (min-width: 580px) {
    .view > .pack-list.ak-parts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .view > .ak-parts > * { grid-column: span 2; }
    .view > .ak-parts .pack-tile .t { font-size: min(1.6rem, 28cqh); }   /* (a long name has room for two lines) */
    .view > .ak-parts > :nth-child(2n+1):last-child { grid-column: 2 / span 2; }
  }
  @media (min-width: 880px) {
    .view > .pack-list.ak-parts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .view > .ak-parts > :nth-child(2n+1):last-child { grid-column: span 2; }
    .view > .ak-parts > :nth-child(3n+1):last-child { grid-column: 3 / span 2; }
    .view > .ak-parts > :nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
  }

  /* Phones held sideways */
  @media (orientation: landscape) and (max-height: 560px) {
    /* the doors side by side */
    .view > .home-grid.ak-doors { max-width: 760px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .view > .home-grid.ak-doors > .big-btn.ak-door { grid-column: auto; padding-inline: 16px; }
    .no-en .view > .ak-doors .ak-door.geesi .lbl { font-size: min(clamp(2.1rem, 7vw, 2.9rem), 26cqh, 12cqw); }
    /* the five steps in a row, each its number and picture over its name, its word and how much is read */
    .view > .ak-path { max-width: none; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); align-content: stretch; gap: 10px; }
    .view > .ak-path > .ak-stop { height: auto; margin: 0; container-type: size; padding: 8px 10px 10px; border-radius: 22px;
      grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto auto; grid-template-areas: "num pic" "name name" "ex ex" "bar bar";
      align-content: space-evenly; column-gap: 6px; row-gap: 2px; }
    .view > .ak-path .ak-num { width: min(48px, 24cqh, 40cqw); height: min(48px, 24cqh, 40cqw); font-size: min(1.5rem, 11cqh, 18cqw); border-width: 2px; box-shadow: 0 3px 0 var(--t-teal-d); }
    .view > .ak-path .ak-stop.done .ak-num { box-shadow: 0 3px 0 var(--t-green-d); }
    .view > .ak-path .ak-num .rays { top: -6px; right: -10px; width: 14px; }
    .view > .ak-path .ak-stop-pic { justify-self: end; }
    .view > .ak-path .ak-stop-pic .pic :is(.art, img) { width: min(72px, 30cqh, 50cqw); height: min(72px, 30cqh, 50cqw); }
    .view > .ak-path .ak-stop-name, .no-en .view > .ak-path .ak-stop-name { font-size: min(.95rem, 7.4cqh, 12.5cqw); }
    .view > .ak-path .ak-stop-name small { font-size: min(.75rem, 5.8cqh, 10cqw); }
    .view > .ak-path .ak-ex { font-size: min(1.7rem, 12cqh, 20cqw); }
    .view > .ak-path .ak-stop .go-progress { margin-top: 0; gap: 4px; }
    .view > .ak-path .ak-stop .go-bar { height: min(14px, 7cqh); border-width: 2px; }
    .view > .ak-path .ak-stop .go-count { font-size: min(.85rem, 7cqh, 11cqw); }
    .view > .ak-path .ak-stop > .lock-badge { top: 6px; right: 6px; width: 28px; height: 28px; }
    /* the books: four in a row, each its little deck over its name (the last row in the middle) */
    .view > .pack-list.ak-parts { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .view > .ak-parts > :is(:nth-child(2n+1):last-child, :nth-child(3n+1):last-child, :nth-child(3n+1):nth-last-child(2)) { grid-column: span 2; }
    .view > .ak-parts > :nth-child(4n+1):last-child { grid-column: 4 / span 2; }
    .view > .ak-parts > :nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
    .view > .ak-parts > :nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
    .view > .ak-parts > .pack-tile { flex-direction: column; justify-content: center; text-align: center; gap: 2px; padding: 6px 8px calc(var(--wb) + 4px); }
    .view > .ak-parts .deck { --dh: min(100px, 46cqh); margin: 0 0 4px; }
    .view > .ak-parts .pack-tile .t { font-size: min(1.2rem, 15cqh, 12cqw); line-height: 1.1; }
    .view > .ak-parts .pack-tile .e { font-size: min(.85rem, 10cqh); }
    .view > .ak-parts > .pack-tile:has(> .lock-badge) > span:last-child { padding-right: 0; }
    .view > .ak-parts > .pack-tile > .lock-badge { top: 6px; right: 6px; width: 26px; height: 26px; }
    .view > .ak-parts > .pack-tile > .lock-badge svg.i { width: 15px; height: 15px; }
  }
}

/* ---------- English Help (Settings > Language; js/app.js lang()) ---------- */
/* Settings: the three language levels */
.lang-row { padding: 8px 0; }
.lang-row > span { display: block; margin-bottom: 8px; }
.lang-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.lang-opt { border: 3px solid #E7DCCB; border-radius: 16px; background: #fff; padding: 10px 12px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; min-height: 56px; }
.lang-opt b { display: block; font-size: 1.05rem; }
.lang-opt small { color: var(--ink-soft); font-size: .88rem; }
.lang-opt.on { border-color: var(--teal); background: #E2F5F2; }
/* Geesi's bubble: the English line, the Somali small under it */
.bubble .bubble-so { display: block; margin-top: 4px; font-size: .62em; font-weight: 600; color: var(--ink-soft); line-height: 1.2; }
/* praise stays Somali: its English small under it */
.pop-word { flex-direction: column; align-items: center; }
.pop-word .pop-en { margin-top: 4px; font-size: clamp(1.1rem, 4.5vw, 1.5rem); font-weight: 700; color: var(--ink); text-shadow: var(--outline-3); animation: popWordOut 1.5s ease-in forwards; }
.done-screen .pop-en { margin: -6px 0 6px; font-size: 1.25rem; font-weight: 700; color: var(--ink-soft); }
