/* ============================================================================
   ASHTAR KATKOOT 2.0 — ANIMAL RESCUE ADVENTURE
   Forest Trail / Rescue Clearing presentation, rescue tracker, adventure
   composition, Katkoot companion, rescue moment, single Help control
   ----------------------------------------------------------------------------
   Scoping: every rule is gated on BOTH the .kg1-animal-v2 root class (added by
   the V2 controller) and the .animal-c1 / .c1-* chapter namespace. When the
   chapter is not running none of this can match, so no other grade, world or
   the retained Animal V2 prototype is affected.

   ---------------------------------------------------------------------------
   BACKGROUNDS - approved portrait artwork
   game/assets/animal-rescue/animal-rescue-forest-trail.jpg   (941 x 1672)
   game/assets/animal-rescue/animal-rescue-clearing.jpg       (941 x 1672)

   Both are portrait and were drawn for the phone, so `cover` shows the FULL
   height and trims only the outer ~9% per side on 390x844. On a squarer phone
   (360x640) the fit is almost exact. Nothing is stretched: only background-size
   is used, never a transform.

   The previous landscape zone backgrounds are deliberately no longer referenced
   by Chapter 1. The files themselves are untouched and still serve the map.

   ---------------------------------------------------------------------------
   THE ONE RULE THIS FILE EXISTS TO ENFORCE
   The forest must stay visible. There is deliberately NO large opaque panel
   behind the gameplay. Instead:
     - the top and bottom edges get a narrow dark scrim for contrast
     - text sits on small glass pills, not on sheets
     - the animal is lit by a soft radial glow and stands IN the scene
     - answers are individual floating cards with real shadows
   Readability is protected locally, at the smallest surface that can do it.
   ========================================================================== */

/* ---------- scene backdrop ------------------------------------------- */
#app.kg1-animal-v2 .c1-scene{
  position:absolute;
  inset:0;
  z-index:0;
  background-repeat:no-repeat;
  /* Portrait source into a portrait viewport: full height kept, minimal side
     trim. 50% keeps the waterfall / trail centred. 40% keeps the canopy from
     eating the top on wider-than-tall viewports. */
  background-size:cover;
  background-position:50% 40%;
  overflow:hidden;
}
#app.kg1-animal-v2 .animal-c1[data-scene="trail"] .c1-scene{
  background-image:url('assets/animal-rescue/animal-rescue-forest-trail.jpg');
}
#app.kg1-animal-v2 .animal-c1[data-scene="clearing"] .c1-scene{
  background-image:url('assets/animal-rescue/animal-rescue-clearing.jpg');
}

/* Narrow contrast scrims at the top and bottom edges ONLY. The middle of the
   artwork - the waterfall, the pool, the trail - is never dimmed, so the
   environment stays bright and detailed where the child looks at the animal. */
#app.kg1-animal-v2 .c1-scene::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(9,30,13,.46) 0,rgba(9,30,13,.16) 11%,rgba(9,30,13,0) 20%),
    linear-gradient(0deg,rgba(9,30,13,.48) 0,rgba(9,30,13,.18) 13%,rgba(9,30,13,0) 24%);
}

/* ---------- shell ---------------------------------------------------- */
#app.kg1-animal-v2 .animal-c1{
  position:fixed;
  inset:0;
  z-index:23;
  display:flex;
  flex-direction:column;
  background:transparent;
  /* Clear the shared top controls, respect the notch, and keep the tracker and
     the bottom actions off the physical edges. */
  padding:calc(64px + env(safe-area-inset-top))
          max(10px, env(safe-area-inset-left))
          calc(10px + env(safe-area-inset-bottom))
          max(10px, env(safe-area-inset-right));
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
}
#app.kg1-animal-v2 .animal-c1.hidden{display:none!important}

/* The legacy V2 prototype screen is suppressed while a chapter runs. */
#app.kg1-animal-v2 .animal-c1.is-active ~ .animal-v2-screen{display:none!important}

/* Keep the shared safe controls above the scene. */
#app.kg1-animal-v2 #exitStage,
#app.kg1-animal-v2 #sound{z-index:26!important}

/* Legacy stage furniture belongs to the plane mechanic. */
#app.kg1-animal-v2 #targetPreview,
#app.kg1-animal-v2 #fire,
#app.kg1-animal-v2 #helpStage{display:none!important}

/* Every gameplay row sits above the backdrop; the overlay stays on top. */
/* The chapter's shared chrome rule. The transient layers (scene backdrop,
   rescue banner, flight layer, story picture, completion overlay) and the action
   row are all EXCLUDED, because each of those owns its own stacking and this
   rule carries a very high specificity - it must not silently win over them. */
#app.kg1-animal-v2 #animalC1 > :not(.c1-scene):not(.c1-rescue):not(.c1-overlay):not(.c1-flylayer):not(.c1-storylayer):not(.c1-foot){
  position:relative;
  z-index:1;
}

/* ---------- shared glass surfaces ------------------------------------- */
/* One compact glass treatment, used at the smallest size that needs contrast. */
#app.kg1-animal-v2 .c1-glass{
  background:rgba(255,255,255,.52);
  -webkit-backdrop-filter:blur(6px) saturate(1.1);
  backdrop-filter:blur(6px) saturate(1.1);
  border:1.5px solid rgba(255,255,255,.66);
  box-shadow:0 3px 12px rgba(10,38,16,.2);
}

/* ---------- header: chapter + rescued counter ------------------------ */
#app.kg1-animal-v2 .c1-topright{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:6px;
}

/* ---------- the Animal Album button -------------------------------------
   The single, scoped entry point to the collection. It sits in the chapter's
   own header, next to the rescued counter, and shows the same rescued count
   the Album itself shows - so "my collection" is always one number, never two
   competing ones. */
#app.kg1-animal-v2 .c1-albumbtn{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
  min-height:34px;
  padding:3px 9px 3px 7px;
  border-radius:999px;
  border:2px solid rgba(255,222,140,.9);
  background:linear-gradient(180deg,rgba(255,244,206,.96),rgba(255,226,150,.94));
  box-shadow:0 2px 7px rgba(10,38,16,.28);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
#app.kg1-animal-v2 .c1-albumbtn:active{transform:scale(.95)}
/* A small album glyph drawn in CSS - two stacked pages. Deliberately NOT an
   animal picture: this is a navigation affordance, and borrowing a rescued
   animal's artwork for it would blur the collection itself. */
#app.kg1-animal-v2 .c1-albumicon{
  position:relative;
  width:15px;
  height:17px;
  flex:0 0 auto;
  border-radius:3px 4px 4px 3px;
  background:linear-gradient(90deg,#8a5a12 0 3px,#fff8e2 3px 100%);
  box-shadow:inset 0 0 0 1.5px rgba(138,90,18,.5);
}
#app.kg1-animal-v2 .c1-albumicon::after{
  content:"";
  position:absolute;
  left:5px;
  top:3px;
  width:8px;
  height:1.5px;
  border-radius:1px;
  background:rgba(138,90,18,.4);
  box-shadow:0 3px 0 rgba(138,90,18,.4),0 6px 0 rgba(138,90,18,.4);
}
#app.kg1-animal-v2 .c1-albumcount{
  font-size:clamp(10px,3vw,12px);
  font-weight:1000;
  line-height:1;
  color:#7a4d0c;
  direction:ltr;
  unicode-bidi:isolate;
}

#app.kg1-animal-v2 .c1-top{  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 2px 5px;
}
#app.kg1-animal-v2 .c1-chapter{
  min-width:0;
  color:#fff;
  font-weight:1000;
  font-size:clamp(12px,3.7vw,15px);
  line-height:1.1;
  text-shadow:0 2px 5px rgba(6,26,10,.8),0 0 12px rgba(6,26,10,.45);
}
/* The ACTIVITY story line - a line of text in the header. This is the
   pre-existing, approved `.c1-story` and it is NOT the story picture layer. */
#app.kg1-animal-v2 .c1-story{
  display:block;
  color:#ffe9a8;
  font-size:.85em;
  font-weight:900;
  line-height:1.2;
  margin-top:1px;
  text-shadow:0 2px 5px rgba(6,26,10,.85);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Counts RESCUED only. This is what stops four DISCOVERED animals from
   looking like a finished mission. */
#app.kg1-animal-v2 .c1-savepill{
  flex:0 0 auto;
  display:flex;
  align-items:baseline;
  gap:1px;
  padding:3px 11px 4px;
  border-radius:999px;
  background:rgba(46,138,70,.9);
  border:2px solid rgba(190,240,200,.85);
  color:#fff;
  font-weight:1000;
  font-size:clamp(11px,3.3vw,14px);
  line-height:1;
  text-shadow:0 1px 2px rgba(6,32,12,.7);
  box-shadow:0 3px 10px rgba(8,40,16,.34);
}
#app.kg1-animal-v2 .c1-saved{font-size:1.22em}
#app.kg1-animal-v2 .c1-saveof{opacity:.8}

/* ---------- rescue tracker ------------------------------------------- */
#app.kg1-animal-v2 .c1-tracker{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  padding:6px 7px;
  margin-bottom:4px;
  border-radius:18px;
  /* Animals always read left-to-right in teaching order, whatever the
     document direction is. */
  direction:ltr;
  background:rgba(255,255,255,.46);
  -webkit-backdrop-filter:blur(6px) saturate(1.08);
  backdrop-filter:blur(6px) saturate(1.08);
  border:1.5px solid rgba(255,255,255,.6);
  box-shadow:0 3px 12px rgba(10,38,16,.2);
}
#app.kg1-animal-v2 .c1-chip{
  position:relative;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1px;
  padding:3px 2px 2px;
  border-radius:13px;
  border:2px solid transparent;
  background:rgba(255,255,255,.34);
  transition:border-color .25s ease,background .25s ease,box-shadow .25s ease;
}
/* One identical box for every animal, so visual weight never depends on the
   source image's intrinsic proportions. The box is wider than tall so a tall
   animal such as the giraffe still reads clearly, and the artwork is contained
   inside it so nothing is ever cropped. */
#app.kg1-animal-v2 .c1-chipart{
  width:100%;
  max-width:46px;
  aspect-ratio:1/1;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
#app.kg1-animal-v2 .c1-chipart img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  transition:filter .3s ease,opacity .3s ease;
}
#app.kg1-animal-v2 .c1-chipword{
  font-size:clamp(7.5px,2.4vw,9.5px);
  font-weight:1000;
  letter-spacing:.03em;
  line-height:1;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* --- state 1: UNKNOWN. A cold, flat silhouette. Dashed = "not yet real". */
#app.kg1-animal-v2 .c1-chip.is-unknown{
  background:rgba(24,42,26,.24);
  border:2px dashed rgba(255,255,255,.5);
}
#app.kg1-animal-v2 .c1-chip.is-unknown .c1-chipart img{
  filter:grayscale(1) brightness(.42) contrast(1.15);
  opacity:.72;
}
#app.kg1-animal-v2 .c1-chip.is-unknown .c1-chipword{color:rgba(255,255,255,.72)}

/* --- state 2: DISCOVERED. Seen, but clearly NOT saved. Deliberately
   desaturated and dimmed with a dashed amber edge, so it can never be
   mistaken for a rescue at a glance. */
#app.kg1-animal-v2 .c1-chip.is-found{
  background:rgba(255,246,214,.72);
  border:2px dashed #d8a326;
}
#app.kg1-animal-v2 .c1-chip.is-found .c1-chipart img{
  filter:saturate(.45) brightness(.94);
  opacity:.88;
}
#app.kg1-animal-v2 .c1-chip.is-found .c1-chipword{color:#7a5a10}
/* a small hollow marker: "seen", not "saved" */
#app.kg1-animal-v2 .c1-chipmark{
  position:absolute;
  top:2px;
  inset-inline-end:2px;
  width:12px;
  height:12px;
  border-radius:50%;
  transition:opacity .25s ease,transform .25s ease,background .25s ease,border-color .25s ease;
}
#app.kg1-animal-v2 .c1-chipmark::after{
  content:"";
  position:absolute;
  left:3.5px;
  top:2.5px;
  width:3px;
  height:6px;
  border:solid #fff;
  border-width:0 2.2px 2.2px 0;
  transform:rotate(42deg);
}
#app.kg1-animal-v2 .c1-chip.is-found .c1-chipmark{
  opacity:1;
  transform:scale(1);
  background:rgba(216,163,38,.95);
  box-shadow:0 0 0 1.5px rgba(255,255,255,.85);
}
/* --- state 3: RESCUED. Full colour, solid ring, filled tick, glow. Earned.
   This is the only state that means "this animal is MINE", and it is driven by
   the rescue ledger - never by having heard the animal, and never by finishing
   an activity. */
#app.kg1-animal-v2 .c1-chip.is-rescued{
  background:rgba(233,252,238,.95);
  border:2px solid #34a853;
  box-shadow:0 0 0 2px rgba(52,168,83,.24),0 3px 10px rgba(16,70,30,.26);
}
#app.kg1-animal-v2 .c1-chip.is-rescued .c1-chipart img{
  filter:none;
  opacity:1;
  /* A soft, slow shine so a rescued animal reads as alive at a glance. Purely
     decorative: it is a filter, it cannot affect layout or any tap target. */
  animation:c1RescuedShine 3.4s ease-in-out infinite;
}
@keyframes c1RescuedShine{
  0%,100%{filter:drop-shadow(0 0 2px rgba(70,200,110,.35)) brightness(1)}
  50%    {filter:drop-shadow(0 0 7px rgba(90,225,130,.85)) brightness(1.06)}
}
#app.kg1-animal-v2 .c1-chip.is-rescued .c1-chipword{color:#15682f}
#app.kg1-animal-v2 .c1-chip.is-rescued .c1-chipmark{
  opacity:1;
  transform:scale(1);
  background:#34a853;
  box-shadow:0 0 0 1.5px #fff;
}

/* ---------- body: the adventure column -------------------------------- */
#app.kg1-animal-v2 .c1-body{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  padding:2px 0;
}

/* ---------- compact instruction pill ---------------------------------- */
/* Small and local. NOT a sheet across the screen. */
#app.kg1-animal-v2 .c1-prompt{
  flex:0 0 auto;
  align-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:34px;
  max-width:100%;
  padding:3px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.62);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  border:1.5px solid rgba(255,255,255,.7);
  box-shadow:0 3px 10px rgba(10,38,16,.2);
}
#app.kg1-animal-v2 .c1-prompt-text{
  color:#123a22;
  font-weight:1000;
  font-size:clamp(13px,3.9vw,17px);
  line-height:1.2;
  text-align:center;
}
/* ---------- the speaker control: ONE clean glass component --------------
   The brief was explicit: the instruction must be ONE glass container, with
   no visible circular speaker frame sitting inside another frame.

   So the speaker is now a BARE ICON. It has no border, no background, no
   shadow and no circle of its own - the pill around it is the only frame. What
   it keeps is a comfortable child-sized TAP TARGET, achieved with an invisible
   ::before that extends the hit area well past the glyph, so the icon can stay
   small and the target can stay large.

   The glyph is a CSS speaker drawn from two shapes, so it is never an emoji
   that renders differently on every device, and it inherits the pill's colour. */
#app.kg1-animal-v2 .c1-speak{
  position:relative;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  box-shadow:none;
  color:#1c5c34;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
/* The invisible extension of the tap target. 44px of real touch area around a
   30px icon, with nothing drawn. */
#app.kg1-animal-v2 .c1-speak::before{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:46px;
  height:46px;
  transform:translate(-50%,-50%);
  border-radius:50%;
}
/* The speaker glyph: a trapezoid cone plus two sound arcs, drawn in CSS. */
#app.kg1-animal-v2 .c1-speak i{
  display:block;
  width:17px;
  height:15px;
  position:relative;
}
#app.kg1-animal-v2 .c1-speak i::before{
  content:"";
  position:absolute;
  left:0;
  top:3px;
  width:0;
  height:0;
  border-style:solid;
  border-width:4.5px 6px 4.5px 0;
  border-color:transparent currentColor transparent transparent;
}
#app.kg1-animal-v2 .c1-speak i::after{
  content:"";
  position:absolute;
  left:7px;
  top:0;
  width:7px;
  height:15px;
  border:2.2px solid currentColor;
  border-left:0;
  border-top-color:transparent;
  border-bottom-color:transparent;
  border-radius:0 9px 9px 0;
}
#app.kg1-animal-v2 .c1-speak:active{transform:scale(.9);opacity:.75}
/* Keep the icon optically centred beside RTL text without shifting the pill. */
#app.kg1-animal-v2 .c1-prompt .c1-speak{margin-inline-end:1px}

/* ---------- written target: one small solid pill --------------------- */
#app.kg1-animal-v2 .c1-target{
  flex:0 0 auto;
  align-self:center;
  transition:opacity .18s ease;
}
#app.kg1-animal-v2 .c1-target.is-hidden{visibility:hidden}
#app.kg1-animal-v2 .c1-targetword{
  display:inline-block;
  font-size:clamp(24px,7.6vw,36px);
  line-height:1.05;
  font-weight:1000;
  letter-spacing:.05em;
  color:#0f3a20;
  background:linear-gradient(180deg,#fffdf0,#fff0b8);
  border:2.5px solid #e0a91b;
  border-radius:14px;
  padding:3px 15px 5px;
  box-shadow:0 4px 12px rgba(12,44,18,.28);
  word-break:keep-all;
}

/* ---------- the animal, standing IN the forest ----------------------- */
/* No worksheet box. A soft radial light lifts the animal off the artwork and
   guarantees separation from the background without hiding the scene. */
#app.kg1-animal-v2 .c1-card{
  flex:0 0 auto;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:visible;
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
}
#app.kg1-animal-v2 .c1-card::before{
  content:"";
  position:absolute;
  inset:-14% -10%;
  z-index:-1;
  background:radial-gradient(closest-side,
    rgba(255,253,242,.94) 0%,
    rgba(255,251,232,.72) 46%,
    rgba(255,250,228,.3) 68%,
    rgba(255,250,228,0) 80%);
}
#app.kg1-animal-v2 .c1-card img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  filter:drop-shadow(0 8px 14px rgba(14,42,18,.4));
}
/* Stable square image stage. Every album picture is authored 640x640, so one
   square box scales all four animals by exactly the same amount: the giraffe is
   no longer constrained by the others, and there is no layout jump between
   animals. `contain` guarantees the artwork is never cropped or stretched. */
#app.kg1-animal-v2 .c1-card-xl{width:min(62vw,224px);aspect-ratio:1/1;max-height:36vh}
#app.kg1-animal-v2 .c1-card-md{width:min(44vw,158px);aspect-ratio:1/1;max-height:25vh}
/* The small stimulus card used by Missing Letter and Guided Build Word, where
   the name and the controls need the vertical room more than the picture does.
   The image still fills it with object-fit:contain - never cropped, never
   transform-scaled. */
#app.kg1-animal-v2 .c1-card-sm{width:min(40vw,144px);aspect-ratio:1/1;max-height:21vh}

#app.kg1-animal-v2 .c1-bigword{
  flex:0 0 auto;
  font-size:clamp(28px,9vw,42px);
  line-height:1.05;
  font-weight:1000;
  letter-spacing:.05em;
  color:#fff;
  text-shadow:0 2px 0 rgba(10,40,14,.7),0 4px 14px rgba(6,26,10,.75);
  word-break:keep-all;
}

/* ---------- answers: floating cards in the world --------------------- */
#app.kg1-animal-v2 .c1-options{
  flex:0 1 auto;
  min-height:0;
  display:grid;
  /* The real gap between answer cards. Each card carries a 5px solid bottom
     edge plus a soft drop shadow, both of which bleed BELOW the element box, so
     a gap smaller than that reads on a real phone as cards touching or
     overlapping. This gap is sized to clear them. */
  gap:14px;
  width:100%;
  /* min-content, NOT minmax(0,auto): the rows must never be squeezed below the
     card's own height, which is what made the shadows collide. */
  grid-auto-rows:min-content;
  /* If a full answer set is genuinely taller than a short phone, it scrolls
     cleanly rather than overlapping or hiding the last answer. */
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  /* Pushes the choices down onto the trail. This is what turns the layout
     from "card in the middle" into a composition with a top, a middle and a
     bottom, and it is what removes the dead region. */
  margin-top:auto;
  padding-top:8px;
}
/* THREE EQUAL PICTURE CARDS ON ONE ROW.
   Chapter 1 image answers are always three of the same four album pictures, so a
   single row is both clearer and far safer vertically than two rows.

   Why this changed: this grid was the last one still on two columns. Measured at
   360x550 - what a 360x640 phone actually has left once browser chrome is
   showing - three image cards wrapped to 2 rows, the option box clipped the
   second row (clippedInBox true) and the answer area had to scroll internally.
   That was the reported real-phone fault, and the word row had already been
   fixed for exactly the same reason.

   One row removes the problem rather than shrinking the cards: the pictures stay
   large enough to recognise and the whole set is visible at once.

   Verified: 3 x 100x100 tap targets with 88x88 contain-fitted pictures at
   360 wide; no transform scaling is used. */
#app.kg1-animal-v2 .c1-options-pics{
  grid-template-columns:repeat(3,minmax(0,1fr));
  max-width:330px;
  margin-left:auto;
  margin-right:auto;
  max-height:100%;
  align-content:start;
  gap:10px;
  padding-bottom:2px;
  /* THREE IMAGES SIT TOO LOW.
     .c1-options normally carries `margin-top:auto`, which pins the answers to
     the very bottom of the column. That composition is right for picture-word,
     where the animal is the hero and the trail carries the answers - but a
     listen-picture question has no animal card, so the whole 245px of auto
     margin became a dead gap ABOVE the images while they were jammed against
     the bottom edge (measured: 254px gap, 4px below).

     For image answers the group is centred instead, so the prompt, the word and
     the three pictures read as one composition in the middle of the screen. */
  margin-top:10px;
}
/* THREE EQUAL WORD CARDS ON ONE ROW.

   Chapter 1 word answers are always three short English words
   (LION / MONKEY / GIRAFFE / TIGER), so a single row is both clearer and far
   safer vertically than a column.

   Why this changed: with one column the set measured 3 x 48px plus gaps. At
   360x550 - which is what a 360x640 phone actually has left once browser chrome
   is showing - the third choice fell below the fold, the option box clipped it,
   and the answer area had to scroll internally. That is the reported real-phone
   fault. One row removes the whole problem instead of shrinking the cards.

   Verified: GIRAFFE (the longest word) fits on a single line with 22px to spare
   at 360 wide and 23px at 390 wide. Tap targets stay 107x58 at 360 and 113x58
   at 390, far above a comfortable minimum. No transform scaling is used. */
#app.kg1-animal-v2 .c1-options-words{
  grid-template-columns:repeat(3,minmax(0,1fr));
  max-width:360px;
  margin-left:auto;
  margin-right:auto;
  /* `start`, not `end`. The set is already pushed to the bottom of the stage by
     margin-top:auto on .c1-options, so this makes no difference when the answers
     fit. When they are taller than a short phone it keeps the overflow below the
     top edge, where the child can actually scroll to it. */
  align-content:start;
  gap:10px;
  padding-bottom:2px;
}
#app.kg1-animal-v2 .c1-options-words .c1-wordbtn{
  min-height:58px;
  padding:8px 5px;
}
#app.kg1-animal-v2 .c1-options-words .c1-wordbtn b{
  /* Big enough for a child to read, small enough that the longest word still
     fits on one line at the narrowest supported width. */
  font-size:clamp(15px,4.1vw,16px);
  letter-spacing:-0.01em;
  white-space:nowrap;
}

/* ---------- DISCOVERY: all four animals at once ---------------------- */
/* 2x2 on portrait. Four animals in one row would make each card roughly a
   quarter of 360px wide, which is far too small to recognise a giraffe from a
   tiger - so the grid wraps to two rows of two instead. */
#app.kg1-animal-v2 .c1-dtip{
  flex:0 0 auto;
  align-self:center;
  max-width:100%;
  padding:4px 12px 5px;
  border-radius:999px;
  background:rgba(255,255,255,.66);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  border:1.5px solid rgba(255,255,255,.72);
  box-shadow:0 3px 10px rgba(10,38,16,.2);
  color:#123a22;
  font-weight:1000;
  font-size:clamp(13px,3.7vw,16px);
  line-height:1.25;
  text-align:center;
}
#app.kg1-animal-v2 .c1-dgrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  width:100%;
  max-width:340px;
  margin:auto;
  min-height:0;
  flex:0 1 auto;
  /* Teaching order reads left to right, whatever the document direction is. */
  direction:ltr;
}
#app.kg1-animal-v2 .c1-dcard{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-width:0;
  padding:7px 5px 6px;
  border:2.5px solid rgba(255,255,255,.9);
  border-radius:18px;
  /* translucent, so the forest stays visible between and behind the cards */
  background:rgba(255,253,245,.6);
  -webkit-backdrop-filter:blur(7px) saturate(1.08);
  backdrop-filter:blur(7px) saturate(1.08);
  box-shadow:0 4px 0 #b98a24,0 8px 16px rgba(12,40,18,.26);
  cursor:pointer;
  transition:transform .08s ease,box-shadow .08s ease,background .12s ease;
}
#app.kg1-animal-v2 .c1-dcard:active{transform:translateY(3px);box-shadow:0 1px 0 #b98a24,0 4px 10px rgba(12,40,18,.3)}
#app.kg1-animal-v2 .c1-dthumb{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  aspect-ratio:1/1;
  max-height:19vh;
}
#app.kg1-animal-v2 .c1-dthumb img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
#app.kg1-animal-v2 .c1-dname{
  font-size:clamp(14px,4.1vw,18px);
  font-weight:1000;
  line-height:1.05;
  color:#123a22;
  direction:ltr;
  unicode-bidi:isolate;
  word-break:keep-all;
}
/* The heard indicator. A tick in the corner - the card itself stays fully
   usable, so the child can tap it again to hear the name replayed. */
#app.kg1-animal-v2 .c1-dtick{
  position:absolute;
  top:3px;
  left:4px;
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  font-size:13px;
  font-weight:1000;
  line-height:1;
  color:#fff;
  background:rgba(20,60,32,.28);
  box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.4);
  opacity:0;
  transform:scale(.7);
  transition:opacity .16s ease,transform .16s ease,background .16s ease;
}
#app.kg1-animal-v2 .c1-dcard.is-heard .c1-dtick{
  opacity:1;
  transform:scale(1);
  background:#2f9e52;
  box-shadow:0 2px 6px rgba(12,60,26,.4);
}
#app.kg1-animal-v2 .c1-dcard.is-heard{background:rgba(233,255,238,.68)}
/* The "not yet" note in the actions row. Deliberately not a button: there is
   nothing to press until every animal has been heard. */
#app.kg1-animal-v2 .c1-dnote{
  font-size:13px;
  font-weight:900;
  color:#eafff0;
  text-shadow:0 2px 0 rgba(8,34,14,.8),0 3px 10px rgba(6,26,10,.8);
  padding:0 4px;
}

/* ---------- THE GLASS WORD BOARD (Missing Letter) --------------------- */
/* One glass slot per character, so the partial word is readable against the
   forest instead of floating on top of it, and the missing position is obvious.

   The board is a real element with its own direction rather than a bare text
   string: the document is dir="rtl", and a plain string can inherit that and
   read the wrong way round. Slots are appended in reading order, so
   "_ION" and "MO_KEY" and "GIRAFF_" all read left to right.

   Deliberately translucent: the forest stays visible around and behind it. */
#app.kg1-animal-v2 .c1-wordboard{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:7px 9px;
  border-radius:18px;
  background:rgba(255,255,255,.58);
  -webkit-backdrop-filter:blur(8px) saturate(1.1);
  backdrop-filter:blur(8px) saturate(1.1);
  border:2px solid rgba(255,255,255,.82);
  box-shadow:0 5px 16px rgba(10,38,16,.28),inset 0 1px 0 rgba(255,255,255,.75);
  direction:ltr;
  unicode-bidi:isolate;
}
#app.kg1-animal-v2 .c1-wslot{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:1.32em;
  height:1.62em;
  padding:0 .12em;
  font-size:clamp(19px,6vw,27px);
  font-weight:1000;
  line-height:1;
  color:#123a22;
  background:rgba(255,255,255,.72);
  border:2px solid rgba(255,255,255,.9);
  border-radius:11px;
  box-shadow:0 3px 8px rgba(10,38,16,.22);
  transition:background .12s ease,border-color .12s ease,color .12s ease;
}
/* The one missing position. A dashed, warmer slot so the eye lands on it. */
#app.kg1-animal-v2 .c1-wslot.is-blank{
  color:#8a5a10;
  background:rgba(255,241,196,.9);
  border:2.5px dashed #d99a12;
  box-shadow:0 3px 10px rgba(120,74,6,.28),inset 0 0 10px rgba(255,224,140,.6);
}
/* A tapped letter lands here immediately. Green for correct, soft red for a
   wrong letter the child will be offered again. */
#app.kg1-animal-v2 .c1-wslot.is-filled-ok{
  color:#0f4d24;
  background:rgba(206,255,220,.94);
  border-color:#4fbe72;
}
#app.kg1-animal-v2 .c1-wslot.is-filled-bad{
  color:#7a231b;
  background:rgba(255,225,219,.94);
  border-color:#e08a7c;
}
#app.kg1-animal-v2 .c1-wslot.is-revealed{
  color:#6b4708;
  background:rgba(255,240,190,.96);
  border-color:#e0b13a;
}

/* THREE LETTER CARDS ON ONE ROW - the same universal 3-choice rule as the word
   and picture rows. A single letter is short, so three sit comfortably side by
   side and the set is never taller than the word row it replaces. */
#app.kg1-animal-v2 .c1-options-letters{
  grid-template-columns:repeat(3,minmax(0,1fr));
  max-width:300px;
  margin-left:auto;
  margin-right:auto;
  max-height:100%;
  align-content:start;
  gap:10px;
  padding-bottom:2px;
}
#app.kg1-animal-v2 .c1-options-letters .c1-letterbtn{
  min-height:58px;
  padding:6px 4px;
}
#app.kg1-animal-v2 .c1-options-letters .c1-letterbtn b{
  font-size:clamp(24px,7.4vw,34px);
  font-weight:1000;
  line-height:1;
  color:#123a22;
}

/* ---------- Guided Build Word ---------------------------------------- */
/* GLASS LETTER SLOTS.
   Each position is its own translucent card so the letter reads clearly against
   the forest, and the forest still shows through around and between them.

   THE LTR FIX - this is the whole bug the real-phone report described.
   The document is <html dir="rtl">. A flex row inherits that direction, so
   slot 0 rendered at the RIGHT and the child saw the word assemble
   right-to-left: tapping L, I, O, N produced "_ _ _ L" instead of "L I O N".
   Setting dir="ltr" on the individual slot spans cannot help, because the
   flex MAIN-AXIS direction is decided by the CONTAINER. `direction:ltr` below,
   on .c1-slots itself, is the fix. unicode-bidi:isolate stops anything inside
   from re-introducing an inherited run direction. */
#app.kg1-animal-v2 .c1-stage-build{gap:8px}
#app.kg1-animal-v2 .c1-slots{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:6px;
  min-height:0;
  flex:0 0 auto;
  /* THE FIX: English words assemble left to right, whatever the page says. */
  direction:ltr;
  unicode-bidi:isolate;
}
#app.kg1-animal-v2 .c1-slot{
  display:flex;
  align-items:center;
  justify-content:center;
  /* Sized in em against the slot font so the row scales as one unit. */
  width:1.5em;
  height:1.85em;
  font-size:clamp(20px,6.2vw,28px);
  font-weight:1000;
  line-height:1;
  color:#123a22;
  /* glass, not a bare underline over the forest */
  background:rgba(255,255,255,.62);
  -webkit-backdrop-filter:blur(7px) saturate(1.1);
  backdrop-filter:blur(7px) saturate(1.1);
  border:2px solid rgba(255,255,255,.8);
  border-bottom:4px solid rgba(255,255,255,.9);
  border-radius:12px;
  box-shadow:0 4px 12px rgba(10,38,16,.26),inset 0 1px 0 rgba(255,255,255,.7);
  transition:color .12s ease,border-color .12s ease,background .12s ease;
}
/* Filled: the letter has landed. */
#app.kg1-animal-v2 .c1-slot.is-filled{
  color:#0f4d24;
  background:rgba(206,255,220,.9);
  border-color:rgba(255,255,255,.95);
  border-bottom-color:#4fbe72;
}
/* Next: the only slot that is asking for a letter, so the progressive scaffold
   is visible rather than merely implied. */
#app.kg1-animal-v2 .c1-slot.is-next{
  color:#6b4708;
  background:rgba(255,240,190,.82);
  border:2.5px dashed #d99a12;
  border-bottom:4px solid #d99a12;
}

/* The readable name, revealed only by a hint. Hidden by default: showing it
   immediately would turn the activity into pure copying. */
#app.kg1-animal-v2 .c1-buildref{
  font-size:clamp(14px,4.2vw,18px);
  font-weight:900;
  letter-spacing:.14em;
  color:#ffe9a8;
  text-shadow:0 2px 0 rgba(10,40,14,.7);
  word-break:keep-all;
  min-height:1.2em;
  flex:0 0 auto;
}
#app.kg1-animal-v2 .c1-buildref.is-hidden{visibility:hidden}

/* The tile pool wraps. Seven letters cannot fit in one row at 360 wide without
   becoming unusably small, so GIRAFFE and MONKEY wrap to two rows of large,
   easily tapped tiles - which is correct here, because this pool is a
   construction kit rather than a set of competing answers. */
#app.kg1-animal-v2 .c1-tilepool{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-content:flex-end;
  gap:8px;
  width:100%;
  min-height:0;
  /* Keep the pool on screen rather than pushing the stage into a scroll. */
  flex:0 1 auto;
  margin-top:auto;
  padding-top:6px;
}
#app.kg1-animal-v2 .c1-lettertile{
  min-width:44px;
  min-height:52px;
  padding:4px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2.5px solid rgba(255,255,255,.92);
  border-radius:14px;
  background:rgba(255,253,245,.95);
  box-shadow:0 5px 0 #b98a24,0 9px 18px rgba(12,40,18,.28);
  cursor:pointer;
  transition:transform .08s ease,box-shadow .08s ease,opacity .12s ease,border-color .12s ease;
}
#app.kg1-animal-v2 .c1-lettertile b{
  font-size:clamp(20px,5.8vw,26px);
  font-weight:1000;
  line-height:1;
  color:#123a22;
}
#app.kg1-animal-v2 .c1-lettertile:active{transform:translateY(3px);box-shadow:0 2px 0 #b98a24}
#app.kg1-animal-v2 .c1-lettertile.is-used{opacity:.22;pointer-events:none}
/* A wrong pick is refused for that letter only. The word and the current slot
   are left untouched - there is no full reset. */
#app.kg1-animal-v2 .c1-lettertile.is-wrong{
  border-color:#ff8a7a;
  background:rgba(255,236,232,.95);
  box-shadow:0 5px 0 #a5342d;
}
#app.kg1-animal-v2 .c1-tile{
  min-width:0;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5px 8px;
  border:2.5px solid rgba(255,255,255,.92);
  border-radius:18px;
  /* A real object in the world: light card, warm solid edge, floating shadow. */
  background:rgba(255,253,245,.95);
  box-shadow:0 5px 0 #b98a24,0 9px 18px rgba(12,40,18,.3);
  cursor:pointer;
  transition:transform .08s ease,box-shadow .08s ease,border-color .12s ease,background .12s ease;
}
#app.kg1-animal-v2 .c1-tile:active{transform:translateY(3px);box-shadow:0 2px 0 #b98a24,0 5px 12px rgba(12,40,18,.3)}
#app.kg1-animal-v2 .c1-thumb{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  max-width:104px;
  aspect-ratio:1/1;
}
#app.kg1-animal-v2 .c1-thumb img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

#app.kg1-animal-v2 .c1-wordbtn{
  min-width:0;
  min-height:52px;
  padding:8px 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2.5px solid rgba(255,255,255,.92);
  border-radius:16px;
  background:rgba(255,253,245,.95);
  box-shadow:0 5px 0 #b98a24,0 9px 18px rgba(12,40,18,.28);
  cursor:pointer;
  transition:transform .08s ease,box-shadow .08s ease,border-color .12s ease,background .12s ease;
}
#app.kg1-animal-v2 .c1-wordbtn:active{transform:translateY(3px);box-shadow:0 2px 0 #b98a24}
#app.kg1-animal-v2 .c1-wordbtn b{
  font-size:clamp(18px,5.2vw,25px);
  font-weight:1000;
  color:#123a22;
  line-height:1.05;
  word-break:keep-all;
}

/* feedback on the floating cards */
#app.kg1-animal-v2 .c1-tile.is-correct,
#app.kg1-animal-v2 .c1-wordbtn.is-correct,
#app.kg1-animal-v2 .c1-letterbtn.is-correct{
  border-color:#5fd97f;
  background:rgba(230,255,236,.97);
  box-shadow:0 5px 0 #2b7c3e,0 0 0 3px rgba(95,217,127,.4);
  animation:c1Pop .3s ease-out;
}
#app.kg1-animal-v2 .c1-tile.is-wrong,
#app.kg1-animal-v2 .c1-wordbtn.is-wrong,
#app.kg1-animal-v2 .c1-letterbtn.is-wrong{
  border-color:#ff8a7a;
  background:rgba(255,236,232,.95);
  box-shadow:0 5px 0 #a5342d;
}
#app.kg1-animal-v2 .c1-tile.is-gone{opacity:.2}
@keyframes c1Pop{0%{transform:scale(.97)}60%{transform:scale(1.03)}100%{transform:scale(1)}}

/* ---------- match board ---------------------------------------------- */
/* Compact cards, equal weight, whole card tappable, forest visible between
   them. No white sheet anywhere. */
/* A listen-picture question has no animal card, so the stage has a prompt and a
   word and then the answers. Centring that group - instead of letting the
   answers be pushed to the floor by an auto margin - is what lifts the row of
   three images into the usable middle of the screen. */
#app.kg1-animal-v2 .c1-stage-listen-picture{justify-content:center}
#app.kg1-animal-v2 .c1-stage-listen-picture .c1-options{margin-top:12px}
#app.kg1-animal-v2 .c1-stage-match{gap:7px}
#app.kg1-animal-v2 .c1-match{
  flex:0 1 auto;
  min-height:0;
  width:100%;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  /* min-content rows so a card is never squeezed below its own height, which is
     what made the 4px solid edge and the drop shadow of neighbouring cards
     collide. */
  grid-auto-rows:minmax(50px,auto);
  /* Clears each card's 4px solid bottom edge and its drop shadow. Still
     9px, which clears the 4px edge plus the shadow's soft falloff. */
  gap:9px;
  margin-top:auto;
  padding-top:2px;
  max-height:100%;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
#app.kg1-animal-v2 .c1-mcard{
  min-width:0;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4px;
  border:2.5px solid rgba(255,255,255,.9);
  border-radius:15px;
  background:rgba(255,253,244,.93);
  box-shadow:0 4px 0 #b98a24,0 7px 15px rgba(12,40,18,.26);
  cursor:pointer;
  transition:transform .12s ease,opacity .3s ease,box-shadow .12s ease,border-color .12s ease;
}
#app.kg1-animal-v2 .c1-mcard-word{
  background:rgba(238,247,255,.94);
  border-color:#a9d8f5;
  box-shadow:0 4px 0 #4f9dc4,0 7px 15px rgba(12,40,18,.24);
}
#app.kg1-animal-v2 .c1-mcard .c1-thumb{max-width:min(16vw,54px)}
#app.kg1-animal-v2 .c1-mcard b{
  font-size:clamp(15px,4.3vw,21px);
  font-weight:1000;
  color:#123a22;
  line-height:1.05;
  word-break:keep-all;
}
#app.kg1-animal-v2 .c1-mcard.is-selected{
  border-color:#8ef0c4;
  box-shadow:0 0 0 3px rgba(142,240,196,.75),0 4px 0 #2f8f5f,0 8px 18px rgba(12,40,18,.3);
  transform:translateY(-2px);
}
#app.kg1-animal-v2 .c1-mcard.is-wrong{
  border-color:#ff8a7a;
  box-shadow:0 0 0 3px rgba(255,138,122,.8),0 4px 0 #a5342d;
}
/* A matched pair settles: it lifts, glows green, then gets out of the way. */
#app.kg1-animal-v2 .c1-mcard.is-matched{
  pointer-events:none;
  border-color:#5fd97f;
  background:rgba(230,255,236,.9);
  box-shadow:0 0 0 3px rgba(95,217,127,.55);
  animation:c1Settle .5s ease forwards;
}
@keyframes c1Settle{
  0%{transform:scale(1)}
  45%{transform:scale(1.09)}
  100%{transform:scale(1);opacity:0}
}

/* ---------- travel ribbon: the continuous-trail beat ----------------- */
/* Shown between activities instead of a Next button. It keeps the last
   answered question on screen, so the screen is never blank, while naming the
   next step of the journey. Tapping it skips the wait. */
#app.kg1-animal-v2 .c1-ribbon{
  position:absolute;
  left:50%;
  bottom:6px;
  transform:translateX(-50%);
  z-index:4;
  display:flex;
  align-items:center;
  gap:6px;
  max-width:88%;
  padding:5px 14px 6px;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  border:1.5px solid rgba(255,255,255,.8);
  box-shadow:0 4px 14px rgba(10,38,16,.3);
  color:#123a22;
  font-weight:1000;
  font-size:clamp(11px,3.4vw,14px);
  font-family:inherit;
  cursor:pointer;
  animation:c1RibbonIn .26s ease-out;
}
#app.kg1-animal-v2 .c1-ribbonleaf{
  width:9px;
  height:9px;
  flex:0 0 auto;
  border-radius:50% 0 50% 0;
  background:#5ec27a;
  transform:rotate(45deg);
  animation:c1Leaf 1.1s ease-in-out infinite;
}
@keyframes c1RibbonIn{
  from{opacity:0;transform:translate(-50%,8px)}
  to{opacity:1;transform:translate(-50%,0)}
}
@keyframes c1Leaf{
  0%,100%{transform:rotate(45deg) scale(1)}
  50%{transform:rotate(45deg) scale(1.35)}
}
/* The answered question stays put, just slightly receded. */
#app.kg1-animal-v2 .c1-stage.is-travelling{opacity:.92}

/* ---------- foot: Help + actions, one row ---------------------------- */
#app.kg1-animal-v2 .c1-foot{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:54px;
  padding-top:8px;
  /* Above the story picture layer. The action row is the child's only way out
     of a story beat, so it must never be hidden behind one. The Help control
     lives here too, which is exactly why the whole row moves up together. */
  z-index:10;
}
#app.kg1-animal-v2 .c1-foot .c1-actions{
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  display:flex;
  gap:8px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
}

/* The ONE help control. Lives in the footer row as a sibling of the actions,
   so it is structurally incapable of covering the art or the answers. */
#app.kg1-animal-v2 .c1-help{
  flex:0 0 auto;
  min-height:48px;
  min-width:98px;
  padding:0 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:15px;
  border:2.5px solid #2f7a4a;
  background:rgba(255,255,255,.92);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  color:#123a22;
  font-weight:1000;
  font-size:clamp(12px,3.5vw,15px);
  cursor:pointer;
  box-shadow:0 4px 0 #2f7a4a,0 6px 14px rgba(10,38,16,.28);
  transition:transform .08s ease,box-shadow .08s ease,opacity .2s ease;
}
#app.kg1-animal-v2 .c1-help:active{transform:translateY(3px);box-shadow:0 1px 0 #2f7a4a}
#app.kg1-animal-v2 .c1-help[disabled]{opacity:.55;cursor:default;box-shadow:none;transform:none}
#app.kg1-animal-v2 .c1-help.is-off{display:none}

#app.kg1-animal-v2 .c1-btn{
  min-height:48px;
  padding:0 18px;
  border-radius:15px;
  cursor:pointer;
  font-weight:1000;
  font-size:clamp(13px,3.8vw,16px);
  border:2.5px solid #2f7a4a;
  background:rgba(255,255,255,.94);
  color:#123a22;
  box-shadow:0 4px 0 #2f7a4a,0 6px 14px rgba(10,38,16,.24);
}
#app.kg1-animal-v2 .c1-btn:active{transform:translateY(2px);box-shadow:0 2px 0 #2f7a4a}
#app.kg1-animal-v2 .c1-btn-primary{
  background:linear-gradient(180deg,#ffe694,#ffc93c);
  border-color:#a5761a;
  color:#4a3208;
  box-shadow:0 4px 0 #a5761a,0 6px 14px rgba(60,40,4,.3);
}
#app.kg1-animal-v2 .c1-btn-ghost{
  background:rgba(255,255,255,.86);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  color:#123a22;
  border-color:#4f9dc4;
  box-shadow:0 4px 0 #4f9dc4;
}

/* ---------- story surfaces: intro, story beat, Katkoot ---------------- */
/* Katkoot sits IN FLOW beside the words. He is never absolutely positioned
   over gameplay, so he cannot overlap anything - by construction. */
#app.kg1-animal-v2 .c1-storycard{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  padding:4px 0;
  overflow:hidden;
}
#app.kg1-animal-v2 .c1-storyrow{
  position:relative;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:4px;
  width:100%;
  min-height:0;
}
/* Localized contrast protection. A soft, wide falloff behind the character and
   the words only - enough to make white text readable over the bright pool and
   waterfall, while leaving the rest of the artwork untouched. This is
   deliberately NOT a panel: it has no edge, no border and no fill. */
#app.kg1-animal-v2 .c1-storyrow::before{
  content:"";
  position:absolute;
  inset:-10% -8% -16%;
  z-index:-1;
  pointer-events:none;
  background:radial-gradient(62% 60% at 50% 54%,
    rgba(6,26,11,.58) 0%,
    rgba(6,26,11,.34) 52%,
    rgba(6,26,11,.1) 74%,
    rgba(6,26,11,0) 86%);
}
#app.kg1-animal-v2 .c1-storykat{
  flex:0 0 auto;
  width:clamp(112px,34vw,158px);
  max-height:34vh;
  object-fit:contain;
  object-position:bottom center;
  filter:drop-shadow(0 8px 12px rgba(6,26,10,.55));
  animation:c1KatIn .34s cubic-bezier(.2,1.3,.5,1);
}
@keyframes c1KatIn{
  from{opacity:0;transform:translateY(14px) scale(.94)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

/* ---------- KATKOOT ENTRANCE (VISUAL ONLY) ------------------------------
   The one thing that changed about the Chapter 1 opening: Katkoot now
   ARRIVES instead of simply fading up in place.

   He comes in from below and to the side, overshoots slightly, settles with a
   small bounce, gives one idle bob as if waving, and comes to rest at exactly
   transform:none - the same position and the same size he has always had.

   This is a class-based keyframe on an IN-FLOW element, so it cannot leave a
   residual transform behind, cannot shift layout, and cannot cover the story
   text or the Next button. It is paused by prefers-reduced-motion below.

   It adds NO audio of any kind. The approved opening narration
   (`c1_intro` -> c1_intro_01.mp3 + c1_intro_02.mp3) is requested at exactly
   the same point in the same function, and these two simply run side by side. */
#app.kg1-animal-v2 .c1-kat-enter{
  animation:c1KatEnter 1.5s cubic-bezier(.22,1.28,.36,1) both;
}
@keyframes c1KatEnter{
  0%   {opacity:0;transform:translate3d(-26px,34px,0) scale(.86) rotate(-4deg)}
  34%  {opacity:1;transform:translate3d(4px,-9px,0)  scale(1.06) rotate(1.5deg)}
  52%  {opacity:1;transform:translate3d(-3px,3px,0)  scale(.985) rotate(-.6deg)}
  68%  {opacity:1;transform:translate3d(1px,-2px,0)  scale(1.012) rotate(.3deg)}
  82%  {opacity:1;transform:translate3d(0,0,0) scale(1) rotate(0)}
  90%  {opacity:1;transform:translate3d(0,-5px,0) scale(1)}
  100% {opacity:1;transform:translate3d(0,0,0) scale(1)}
}
#app.kg1-animal-v2 .c1-storywords{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:5px;
  text-align:center;
  padding-bottom:4px;
}
#app.kg1-animal-v2 .c1-storytitle{
  font-size:clamp(18px,5.2vw,24px);
  font-weight:1000;
  color:#fff;
  line-height:1.15;
  text-shadow:0 2px 0 rgba(6,26,10,.85),0 0 10px rgba(6,26,10,.9),0 4px 18px rgba(6,26,10,.7);
}
#app.kg1-animal-v2 .c1-storytext{
  font-size:clamp(12px,3.5vw,15px);
  font-weight:800;
  color:#f4ffe9;
  line-height:1.35;
  max-width:22ch;
  margin:0 auto;
  text-shadow:0 2px 5px rgba(6,26,10,.95),0 0 12px rgba(6,26,10,.85);
}

/* ---------- rescue moment -------------------------------------------- */
/* Compact and centred. Not a modal: no dimmed full-screen layer, no button,
   and it never touches the foot, so Help and the answers stay exactly where
   they were. A tap skips it. */
#app.kg1-animal-v2 .c1-rescue{
  position:absolute;
  inset:0;
  z-index:7;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
  padding:0 18px;
}
#app.kg1-animal-v2 .c1-rescue.is-on{opacity:1}
#app.kg1-animal-v2 .c1-rescuebox{
  display:flex;
  align-items:center;
  gap:8px;
  max-width:100%;
  padding:9px 14px 9px 8px;
  border-radius:20px;
  background:rgba(240,255,243,.95);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  border:2.5px solid #34a853;
  box-shadow:0 8px 26px rgba(10,50,20,.42),0 0 0 4px rgba(255,255,255,.35);
  animation:c1RescueIn .3s cubic-bezier(.2,1.4,.5,1);
}
@keyframes c1RescueIn{
  from{opacity:0;transform:scale(.84) translateY(10px)}
  to{opacity:1;transform:scale(1) translateY(0)}
}
#app.kg1-animal-v2 .c1-rescuebox img{
  width:clamp(56px,17vw,80px);
  aspect-ratio:1/1;
  object-fit:contain;
  filter:drop-shadow(0 0 8px rgba(90,220,130,.9));
  flex:0 0 auto;
}
#app.kg1-animal-v2 .c1-rescuekat{
  width:clamp(40px,12vw,58px);
  aspect-ratio:1/1;
  object-fit:contain;
  object-position:bottom center;
  flex:0 0 auto;
  filter:drop-shadow(0 3px 6px rgba(10,36,14,.4));
}

/* ---------- THE FLIGHT ---------------------------------------------------
   A dedicated, empty, non-interactive layer that exists only for the temporary
   clone of the rescued animal while it travels to its own tracker slot.

   It is positioned inside the chapter, so viewport rectangles are converted
   into this layer's own coordinate space once, in JS, from live layout. There
   is no hard-coded x/y/width/height anywhere in the flight.

   The clone is transform-only (translate + scale) and is removed the instant
   it lands, so no gameplay node is ever transformed and nothing is left behind
   if the chapter is torn down mid-flight. */
#app.kg1-animal-v2 .c1-flylayer{
  position:absolute;
  inset:0;
  z-index:8;
  pointer-events:none;
  overflow:visible;
}
#app.kg1-animal-v2 .c1-fly{
  position:absolute;
  display:block;
  object-fit:contain;
  pointer-events:none;
  filter:drop-shadow(0 0 12px rgba(120,235,150,.95)) drop-shadow(0 4px 10px rgba(6,30,12,.5));
  will-change:transform,opacity;
}
/* While the animal is in the air the banner keeps its full presence, so the
   child can see both "the animal I just rescued" and "where it is going". */
#app.kg1-animal-v2 .c1-rescue.is-flytime .c1-rescuebox{animation:none}

/* ---------- THE LANDING --------------------------------------------------
   A short pop on the exact slot the animal arrived at. Added to the freshly
   rendered chip AFTER the tracker has been rebuilt, so the full-colour state
   and the pop always belong to the same element. */
#app.kg1-animal-v2 .c1-chip.is-arriving{
  animation:c1Arrive .32s cubic-bezier(.25,1.5,.45,1);
  z-index:2;
}
@keyframes c1Arrive{
  0%  {transform:scale(1)}
  38% {transform:scale(1.22)}
  70% {transform:scale(.96)}
  100%{transform:scale(1)}
}
#app.kg1-animal-v2 .c1-rescuetext{
  font-size:clamp(14px,4.2vw,18px);
  font-weight:1000;
  color:#0f5c26;
  line-height:1.2;
  white-space:nowrap;
}
#app.kg1-animal-v2 .c1-rescuetext span{
  display:block;
  font-size:.72em;
  font-weight:900;
  color:#2f7a4a;
}
/* A short, cheap burst. Eight elements, all removed when the moment ends. */
#app.kg1-animal-v2 .c1-spark{
  position:absolute;
  width:9px;
  height:9px;
  border-radius:2px;
  background:#ffe066;
  box-shadow:0 0 8px rgba(255,214,102,.95);
  animation:c1Spark .78s ease-out forwards;
}
@keyframes c1Spark{
  0%{opacity:1;transform:translate(0,0) rotate(0) scale(1)}
  100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(220deg) scale(.3)}
}

/* ---------- chapter completion: the Rescue Clearing ------------------ */
/* The clearing artwork plus a celebration card. This is the one place a large
   surface is correct, because it is a reward, not a worksheet. */
#app.kg1-animal-v2 .c1-overlay.c1-clearing{
  background:linear-gradient(180deg,rgba(12,40,18,.34),rgba(8,30,12,.56));
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
}
#app.kg1-animal-v2 .c1-clearing .animal-v2-card{
  max-width:344px;
  gap:7px;
  padding:13px 13px 15px;
  animation:animalV2CardIn .3s ease-out;
}
#app.kg1-animal-v2 .c1-clearing .animal-v2-stars{font-size:clamp(23px,7vw,30px)}
#app.kg1-animal-v2 .c1-clearing .animal-v2-card-label{
  font-size:clamp(21px,6.4vw,28px);
  color:#15682f;
}
#app.kg1-animal-v2 .c1-clearing .animal-v2-card-caption{
  font-size:clamp(12px,3.4vw,15px);
  color:#2f7a4a;
}
#app.kg1-animal-v2 .c1-clearing .animal-v2-card-actions{margin-top:4px}

#app.kg1-animal-v2 .c1-clearingkat{
  width:clamp(84px,26vw,116px);
  aspect-ratio:1/1;
  object-fit:contain;
  object-position:bottom center;
  filter:drop-shadow(0 6px 10px rgba(10,36,14,.4));
}
#app.kg1-animal-v2 .c1-rescuedrow{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  width:100%;
  padding:7px 5px;
  border-radius:16px;
  background:rgba(240,252,242,.95);
  border:2px solid #bfe6c8;
  direction:ltr;
}
#app.kg1-animal-v2 .c1-rescuedrow .c1-chip{
  background:transparent;
  border-color:transparent;
  padding:1px 0;
  box-shadow:none;
}
#app.kg1-animal-v2 .c1-rescuedrow .c1-chipart{max-width:42px}
#app.kg1-animal-v2 .c1-tally{
  font-size:clamp(15px,4.4vw,19px);
  font-weight:1000;
  color:#15682f;
  line-height:1.2;
}
#app.kg1-animal-v2 .c1-nextup{
  font-size:clamp(11px,3.2vw,13.5px);
  font-weight:800;
  color:#5c7365;
  line-height:1.3;
  margin:0;
}
/* Purely presentational. Writes nothing, so it cannot touch aircraft
   progression. Left exactly as it was - not expanded. */
#app.kg1-animal-v2 .c1-tease{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:4px 11px;
  border-radius:999px;
  background:#eef4ff;
  border:2px dashed #9fb6e8;
  font-size:clamp(10px,3vw,12.5px);
  font-weight:1000;
  color:#3c5590;
}
#app.kg1-animal-v2 .c1-tease i{
  width:14px;height:14px;border-radius:4px;background:#ffd76a;display:inline-block;flex:0 0 auto;
}

/* ---------- reduced motion ------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  #app.kg1-animal-v2 .c1-spark{display:none}
  #app.kg1-animal-v2 .c1-rescuebox,
  #app.kg1-animal-v2 .c1-storykat,
  #app.kg1-animal-v2 .c1-tile.is-correct,
  #app.kg1-animal-v2 .c1-wordbtn.is-correct,
  #app.kg1-animal-v2 .c1-letterbtn.is-correct,
  #app.kg1-animal-v2 .c1-mcard.is-matched{animation:none}
}

/* ---------- short viewports (e.g. 360x640) --------------------------- */
@media (max-height:700px){
  /* Still a little smaller than the tall-phone values, because the vertical
     budget is genuinely tighter, but no longer the shrunken sizes that made the
     animals hard to recognise. The answer areas scroll if they must, so a
     slightly larger animal can never push an answer off screen. */
  #app.kg1-animal-v2 .c1-card-xl{width:min(48vw,168px);max-height:26vh}
  #app.kg1-animal-v2 .c1-card-md{width:min(36vw,130px);max-height:19vh}
  #app.kg1-animal-v2 .c1-chipart{max-width:38px}
  #app.kg1-animal-v2 .c1-thumb{max-width:88px}
  #app.kg1-animal-v2 .c1-mcard .c1-thumb{max-width:min(14vw,46px)}
  #app.kg1-animal-v2 .c1-tracker{padding:4px 6px;gap:4px}
  #app.kg1-animal-v2 .c1-help{min-height:44px;min-width:90px}
  #app.kg1-animal-v2 .c1-btn{min-height:44px}
  #app.kg1-animal-v2 .c1-storykat{width:clamp(80px,26vw,108px);max-height:24vh}
  #app.kg1-animal-v2 .c1-mcard{min-height:46px}
  /* On a 640px-tall screen a full set of large word cards is a few pixels
     taller than the space left over. These two values keep the whole set
     visible on first render: the gap stays well clear of the card's 5px solid
     edge and its drop shadow, and 48px is still a comfortable child tap
     target. Where the set genuinely cannot fit, the area still scrolls cleanly
     rather than overlapping. */
  /* The word answers are three cards on ONE row now, so their height is no
     longer competing for vertical space. Keep the tap targets comfortable and
     the gap tight, and drop the old single-column squeeze entirely. */
  #app.kg1-animal-v2 .c1-options-words{gap:8px}
  #app.kg1-animal-v2 .c1-options-words .c1-wordbtn{min-height:54px}
  /* Same universal 3-choice rule for pictures and letters: one row, tight gap,
     tap targets still comfortably above a child's minimum. */
  #app.kg1-animal-v2 .c1-options-pics{gap:8px}
  #app.kg1-animal-v2 .c1-options-pics .c1-tile{min-height:88px}
  #app.kg1-animal-v2 .c1-options-letters{gap:8px}
  #app.kg1-animal-v2 .c1-options-letters .c1-letterbtn{min-height:54px}
  /* Missing Letter and Build Word each carry a stimulus card, the name and a
     set of controls, so both cards step down a little on a short screen. */
  #app.kg1-animal-v2 .c1-card-sm{width:min(34vw,122px);aspect-ratio:1/1;max-height:17vh}
  #app.kg1-animal-v2 .c1-stage-build,
  #app.kg1-animal-v2 .c1-stage-missing-letter{gap:6px}
  /* The glass word board and the glass letter slots both step down together so
     the two reading activities look like the same family of surfaces. */
  #app.kg1-animal-v2 .c1-wordboard{gap:4px;padding:5px 7px;border-radius:15px}
  #app.kg1-animal-v2 .c1-wslot{font-size:clamp(17px,5.4vw,23px);height:1.55em;border-radius:9px}
  #app.kg1-animal-v2 .c1-slot{
    font-size:clamp(18px,5.4vw,23px);
    width:1.4em;
    height:1.7em;
    border-bottom-width:3px;
  }
  /* 44px is kept even here: the longest word Chapter 1 can build is GIRAFFE, and
     7 x 44px plus 6 gaps is 344px, which still fits inside 360. Verified at
     360x640 - all seven tiles stay on one row with a comfortable target. */
  #app.kg1-animal-v2 .c1-lettertile{min-width:44px;min-height:46px;padding:3px 5px}
  #app.kg1-animal-v2 .c1-lettertile b{font-size:clamp(18px,5.2vw,23px)}
  #app.kg1-animal-v2 .c1-tilepool{gap:6px}
  /* Discovery shows four animals at once, so on a short screen the cards step
     down together. The pictures stay large enough to tell a giraffe from a
     tiger, which is the whole point of teaching them side by side. */
  #app.kg1-animal-v2 .c1-dgrid{gap:7px;max-width:330px}
  #app.kg1-animal-v2 .c1-dcard{padding:5px 4px 5px;border-radius:15px}
  #app.kg1-animal-v2 .c1-dthumb{max-height:15.5vh}
  #app.kg1-animal-v2 .c1-dname{font-size:clamp(13px,3.8vw,16px)}
  #app.kg1-animal-v2 .c1-dtick{width:20px;height:20px;font-size:12px}
  #app.kg1-animal-v2 .c1-dtip{font-size:clamp(12px,3.4vw,15px);padding:3px 10px 4px}
  /* The 3-image row is centred rather than pinned to the floor, so the space
     freed above it is shared instead of becoming one large dead gap. */
  #app.kg1-animal-v2 .c1-stage-listen-picture .c1-options{margin-top:8px}
}

/* ============================================================================
   ANIMAL ALBUM
   ----------------------------------------------------------------------------
   The child-facing collection for the Animal Rescue world: twenty approved
   animals, four per chapter, grouped the way the journey is grouped.

   Two rules shape every style here.

   1. A LOCKED ANIMAL IS A SILHOUETTE, NOT A PADLOCK. The card shows the real
      artwork in flat grey, so the child can see WHAT they are going to rescue
      and wants to. The name stays visible too - this is a collection to
      complete, not a list of secrets. A padlock would say "denied"; a faded
      lion says "not yet", which is the actual truth.

   2. THE ALBUM IS A SIBLING OF THE CHAPTER, NOT A CHILD OF IT. It is a
      full-screen surface of its own with its own scroll area, so twenty cards
      can never squeeze the gameplay column or push a tap target off screen.
   ========================================================================== */
#app .album-screen{
  position:fixed;
  inset:0;
  /* 32, not 26. The Album is an app-level modal and has to sit above every
   chapter surface: the Chapter 1 reward overlay is z-index 31, so at 26 the
   album opened BEHIND the completion card and the button appeared to do
   nothing. It deliberately stays below the intro splash (120) and the
   target preview (190), which are app chrome, not gameplay. */
  z-index:32;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(120% 60% at 50% 0%,rgba(46,120,72,.55),rgba(10,38,18,.92) 62%),
    linear-gradient(180deg,#123f22,#0a2612);
  color:#fff;
  padding:calc(58px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-left))
          calc(10px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right));
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
}
#app .album-screen.hidden{display:none!important}

#app .album-top{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 2px 8px;
}
#app .album-back{
  flex:0 0 auto;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.55);
  background:rgba(255,255,255,.14);
  color:#fff;
  font:inherit;
  font-weight:1000;
  font-size:clamp(12px,3.4vw,14px);
  cursor:pointer;
  touch-action:manipulation;
}
#app .album-back:active{background:rgba(255,255,255,.26)}
#app .album-title{
  flex:1 1 auto;
  min-width:0;
  text-align:center;
  font-weight:1000;
  font-size:clamp(15px,4.6vw,20px);
  text-shadow:0 2px 6px rgba(0,0,0,.5);
}
#app .album-pill{
  flex:0 0 auto;
  display:flex;
  align-items:baseline;
  gap:1px;
  padding:4px 12px 5px;
  border-radius:999px;
  background:linear-gradient(180deg,#ffd76a,#f5b73c);
  border:2px solid rgba(255,255,255,.7);
  color:#5c3a05;
  font-weight:1000;
  font-size:clamp(11px,3.3vw,14px);
  line-height:1;
  direction:ltr;
}

#app .album-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:2px 2px 8px;
}
#app .album-body{display:flex;flex-direction:column;gap:10px}

#app .album-chapterhead{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  padding:2px 4px 4px;
  margin-top:2px;
  border-bottom:1.5px solid rgba(255,255,255,.2);
}
#app .album-chapterhead b{font-weight:1000;font-size:clamp(12px,3.5vw,15px)}
#app .album-chaptercount{
  font-weight:1000;
  font-size:clamp(11px,3.2vw,13px);
  color:#ffe08a;
  direction:ltr;
}

/* Four across, so each chapter reads as one clean row of four - the same
   shape the Rescue Tracker uses, so the two are instantly recognisable as
   the same collection. Always LTR: the first animal is on the left. */
#app .album-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  direction:ltr;
}

#app .album-card{
  position:relative;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:4px 3px 5px;
  border-radius:14px;
  border:2px solid transparent;
  background:rgba(255,255,255,.1);
  font:inherit;
  cursor:pointer;
  touch-action:manipulation;
}
#app .album-art{
  width:100%;
  max-width:52px;
  aspect-ratio:1/1;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
#app .album-art img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  transition:filter .3s ease,opacity .3s ease;
}
/* The neutral placeholder for an animal with no album artwork yet. A quiet
   rounded shape - never a padlock, and never a substitute picture. */
#app .album-art i{
  display:block;
  width:64%;
  height:64%;
  border-radius:46% 46% 40% 40%;
  background:rgba(255,255,255,.14);
  border:2px dashed rgba(255,255,255,.24);
}
#app .album-name{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:clamp(8px,2.5vw,10px);
  font-weight:1000;
  letter-spacing:.02em;
  line-height:1.1;
  color:rgba(255,255,255,.68);
}

/* --- LOCKED: waiting to be rescued. Clearly NOT earned. ---------------- */
#app .album-card.is-locked{
  background:rgba(0,0,0,.22);
  border:2px dashed rgba(255,255,255,.22);
}
#app .album-card.is-locked .album-art img{
  filter:grayscale(1) brightness(.5) contrast(1.1);
  opacity:.62;
}
#app .album-card.is-locked:active{background:rgba(0,0,0,.3)}

/* --- UNLOCKED: rescued and mine. Full colour, ring, tick. --------------- */
#app .album-card.is-unlocked{
  background:linear-gradient(180deg,rgba(233,252,238,.95),rgba(206,244,216,.92));
  border:2px solid #34a853;
  box-shadow:0 3px 10px rgba(0,0,0,.3);
}
#app .album-card.is-unlocked .album-art img{filter:none;opacity:1}
#app .album-card.is-unlocked .album-name{color:#15682f}
#app .album-card.is-unlocked .album-mark{
  position:absolute;
  top:2px;
  inset-inline-end:2px;
  width:15px;
  height:15px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#34a853;
  color:#fff;
  font-size:10px;
  font-weight:1000;
  line-height:1;
  box-shadow:0 0 0 1.5px #fff;
}

/* ---------- detail ------------------------------------------------------ */
#app .album-detail{
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(4,20,9,.72);
  -webkit-backdrop-filter:blur(3px);
  backdrop-filter:blur(3px);
}
#app .album-detail.hidden{display:none!important}
#app .album-panel{
  position:relative;
  width:min(78vw,300px);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  padding:16px 16px 18px;
  border-radius:26px;
  background:linear-gradient(180deg,#f6fff8,#e2f6e8);
  border:3px solid #34a853;
  box-shadow:0 12px 34px rgba(0,0,0,.5);
  animation:c1AlbumIn .26s cubic-bezier(.2,1.35,.5,1);
}
#app .album-detail.is-locked .album-panel{
  background:linear-gradient(180deg,#e9eef0,#d3dde1);
  border-color:rgba(120,140,150,.75);
}
@keyframes c1AlbumIn{
  from{opacity:0;transform:translateY(16px) scale(.92)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
#app .album-detailart{
  width:min(46vw,168px);
  aspect-ratio:1/1;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
#app .album-detailart img{width:100%;height:100%;object-fit:contain}
#app .album-detail.is-locked .album-detailart img{
  filter:grayscale(1) brightness(.55) contrast(1.1);
  opacity:.7;
}
#app .album-detail.is-locked .album-detailart i{
  display:block;
  width:62%;
  height:62%;
  border-radius:46% 46% 40% 40%;
  background:rgba(90,110,120,.24);
  border:2px dashed rgba(90,110,120,.4);
}
#app .album-detailname{
  font-size:clamp(19px,6vw,26px);
  font-weight:1000;
  color:#15682f;
  direction:ltr;
}
#app .album-detail.is-locked .album-detailname{color:#5c6b72}
#app .album-detailmeta{font-size:clamp(10px,3vw,12px);opacity:.75;color:#2c5a3c}
#app .album-detail.is-locked .album-detailmeta{color:#54636a}
#app .album-listen{margin-top:2px;min-height:46px;font-size:clamp(14px,4vw,17px)}
#app .album-detailclose{
  position:absolute;
  top:8px;
  inset-inline-end:8px;
  width:36px;
  height:36px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.2);
  background:rgba(255,255,255,.75);
  color:#2c4a38;
  font-size:20px;
  font-weight:1000;
  line-height:1;
  cursor:pointer;
}

/* ---------- reduced motion ----------------------------------------------
   The Katkoot entrance and the arrival pop are decorative, so they simply stop.
   The FLIGHT is handled in JS (it is skipped entirely), which means a child
   with reduced motion still gets the rescue, the full-colour slot and the
   Album unlock - only the movement is removed. */
@media (prefers-reduced-motion:reduce){
  #app.kg1-animal-v2 .c1-kat-enter,
  #app.kg1-animal-v2 .c1-chip.is-arriving,
  #app.kg1-animal-v2 .c1-chip.is-rescued .c1-chipart img,
  #app .album-panel{animation:none}
}

/* ---------- short viewports (e.g. 360x640) ------------------------------ */
@media (max-height:700px){
  #app .album-art{max-width:42px}
  #app .album-card{padding:3px 2px 4px;border-radius:12px}
  #app .album-grid{gap:5px}
  #app .album-body{gap:8px}
  #app .album-detailart{width:min(40vw,140px)}
}

/* ============================================================================
   CHAPTER 1 STORY LAYER
   ----------------------------------------------------------------------------
   One full-bleed surface holding one picture, inside the chapter. It is a
   crossfade plus a page/glow transition - no canvas, no per-frame JavaScript,
   no general scene graph. A much larger Adventure Map will reuse these ideas at
   a different scale; nothing here is built for that yet.

   IT COVERS THE CHAPTER CHROME WHILE IT IS SHOWING, and only while it is
   showing. The tracker, the album badge and the activity UI are all still there
   underneath and come straight back when the story beat ends.
   ========================================================================== */
#app.kg1-animal-v2 .c1-storylayer{
  position:absolute;
  inset:0;
  z-index:9;
  overflow:hidden;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  background:#0a2612;
  transition:opacity .3s ease,visibility .3s;
}
#app.kg1-animal-v2 .c1-storylayer.is-on{
  opacity:1;
  visibility:visible;
}
#app.kg1-animal-v2 .c1-storyimg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:50% 50%;
  transform:scale(1.03);
  transition:transform .6s ease,opacity .3s ease;
  filter:saturate(1.02) contrast(1.02);
}
/* The IN half: a gentle settle. `is-in` is added one frame after the new
   picture is decoded, so there is always a real starting value. */
#app.kg1-animal-v2 .c1-storylayer.is-in .c1-storyimg{
  transform:scale(1);
  opacity:1;
}
#app.kg1-animal-v2 .c1-storylayer:not(.is-in) .c1-storyimg{
  opacity:.55;
  transform:scale(1.05);
}
/* A warm glow that rises while a picture is in, so a story beat feels lit
   rather than merely displayed. Purely decorative. */
#app.kg1-animal-v2 .c1-storylayer::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(70% 45% at 50% 42%,rgba(255,232,168,.22),rgba(255,200,90,0) 70%);
  opacity:0;
  transition:opacity .5s ease;
}
#app.kg1-animal-v2 .c1-storylayer.is-in::after{opacity:1}

/* ---------- the action row must stay ABOVE the story picture -----------
   The chapter's shared chrome rule gives every direct child z-index:1, and its
   long `:not()` chain makes its specificity (2 ids, 7 classes) far too high for
   an ordinary rule to beat. So the action row is EXCLUDED from that rule
   instead, and given its own stacking here. Story layer is 9, foot is 10.

   Without this the child sees a beautiful story picture and NO visible way to
   continue it, which would make every story beat look like a dead end. */
#app.kg1-animal-v2 #animalC1 > .c1-foot{
  position:relative;
  z-index:10;
}

/* ---------- the page turn, for the book beats --------------------------
   The outgoing picture lifts and fades as if a page were turning over it. This
   is the transition that makes the opening feel like a book being opened, and
   it is a transform on the single <img>, so it can never disturb layout. */
#app.kg1-animal-v2 .c1-storylayer.is-page.is-in .c1-storyimg{
  animation:c1StoryPage .62s cubic-bezier(.22,.72,.28,1) both;
}
#app.kg1-animal-v2 .c1-storylayer.is-page:not(.is-in) .c1-storyimg{
  animation:c1StoryPageOut .3s ease both;
}
@keyframes c1StoryPage{
  0%  {opacity:0;transform:perspective(900px) rotateY(-26deg) scale(1.06)}
  55% {opacity:1}
  100%{opacity:1;transform:perspective(900px) rotateY(0) scale(1)}
}
@keyframes c1StoryPageOut{
  0%  {opacity:1;transform:perspective(900px) rotateY(0) scale(1)}
  100%{opacity:0;transform:perspective(900px) rotateY(18deg) scale(.97)}
}

/* ---------- the rescue mission cue (Discovery -> learning) --------------
   Not a picture: a small in-flow card, so the tracker above it stays visible.
   At this beat the child should be looking at 0/4 waiting, not at a
   full-screen slide. */
#app.kg1-animal-v2 .c1-missioncue{
  flex:0 0 auto;
  align-self:center;
  max-width:min(88%,420px);
  padding:14px 18px 15px;
  border-radius:22px;
  text-align:center;
  background:rgba(255,255,255,.72);
  -webkit-backdrop-filter:blur(7px) saturate(1.08);
  backdrop-filter:blur(7px) saturate(1.08);
  border:2px solid rgba(255,255,255,.8);
  box-shadow:0 6px 20px rgba(8,40,18,.32);
  animation:c1MissionIn .34s cubic-bezier(.2,1.3,.5,1);
}
@keyframes c1MissionIn{
  from{opacity:0;transform:translateY(12px) scale(.96)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
#app.kg1-animal-v2 .c1-missiontitle{
  display:block;
  font-weight:1000;
  font-size:clamp(17px,5.2vw,23px);
  color:#12502a;
  line-height:1.15;
}
#app.kg1-animal-v2 .c1-missiontext{
  margin:5px 0 0;
  font-weight:1000;
  font-size:clamp(13px,3.8vw,17px);
  line-height:1.3;
  color:#1c5c34;
}

/* ---------- reduced motion ---------------------------------------------
   The story layer still SHOWS every picture - the story is the content, not
   decoration, so it is never skipped. Only the movement is removed: no page
   turn, no settle, no glow pulse. A child with reduced motion gets the same
   story, told without motion. */
@media (prefers-reduced-motion:reduce){
  #app.kg1-animal-v2 .c1-storyimg,
  #app.kg1-animal-v2 .c1-storylayer,
  #app.kg1-animal-v2 .c1-storylayer::after,
  #app.kg1-animal-v2 .c1-missioncue{transition:none;animation:none}
  #app.kg1-animal-v2 .c1-storylayer.is-in .c1-storyimg,
  #app.kg1-animal-v2 .c1-storylayer:not(.is-in) .c1-storyimg{transform:none;opacity:1}
}

/* ============================================================================
   CHAPTER 1 STORY CINEMATIC PASS
   ----------------------------------------------------------------------------
   THE PROBLEM THIS SOLVES. The artwork is static and, once the narration was
   finally given the time it needed, each scene became a long still picture. A
   child looks at a still image for twelve seconds and then stops looking.

   THE APPROACH. The supplied artwork is NOT regenerated, NOT re-cropped and NOT
   replaced. All the life here is CSS motion on the same single <img> the story
   layer already owns, plus two decorative pseudo-elements. No canvas, no video,
   no sprite sheet, no per-frame JavaScript, no new asset - so it costs almost
   nothing on a phone.

   ONE PROPERTY, ONE JOB. The slow push owns `transform`. The page turn is
   therefore expressed on `clip-path` and `filter` instead, which are different
   properties and compose cleanly. Two animations fighting over one property is
   how a cinematic pass quietly turns into a flicker, so they are kept strictly
   apart by design.

   MOTION IS SLOW ON PURPOSE. A Ken Burns that is too fast is unreadable. One
   that moves a few percent over ten-plus seconds is felt rather than noticed,
   and the child can still study every part of the drawing.

   REDUCED MOTION IS RESPECTED BUT NOT SILENCED. The scene still crossfades, the
   picture still appears, and the rescue still lands in full colour - a child who
   asked for less motion still has to be able to follow the story. Only the
   continuous drift and the drifting motes stop.
   ========================================================================= */

/* ---------- the slow push, per scene, so no two scenes drift alike -------- */
@keyframes c1CinePush{
  0%  {transform:scale(1.005)}
  100%{transform:scale(1.085) translate3d(0,-.8%,0)}
}
@keyframes c1CinePushL{
  0%  {transform:scale(1.01) translate3d(.6%,0,0)}
  100%{transform:scale(1.075) translate3d(-.9%,-.6%,0)}
}
@keyframes c1CinePushR{
  0%  {transform:scale(1.01) translate3d(-.6%,0,0)}
  100%{transform:scale(1.075) translate3d(.9%,-.6%,0)}
}
@keyframes c1CinePushUp{
  0%  {transform:scale(1.02) translate3d(0,.8%,0)}
  100%{transform:scale(1.09) translate3d(0,-.9%,0)}
}

/* Scene 1 - the closed book. A very slow push toward the middle of the spread,
   where the cover symbol and Katkoot are, so the child is drawn in rather than
   shown a static wide shot. 13s matches the measured book-intro recording. */
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-intro"] .c1-storyimg{
  animation:c1CinePushUp 13s cubic-bezier(.3,.05,.3,1) both;
}
/* Scene 2 - the open book. Barely any drift, so the spread stays readable while
   a 17.5 second sentence plays over it. */
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-open"] .c1-storyimg{
  animation:c1CinePush 18s cubic-bezier(.3,.05,.3,1) both;
}
/* Scene 3 - the net. A slow left-to-right drift, the direction the eye reads the
   four animals in. */
#app.kg1-animal-v2 .c1-storylayer[data-scene="trapped-0of4"] .c1-storyimg{
  animation:c1CinePushL 15s cubic-bezier(.3,.05,.3,1) both;
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="rescued-1of4"] .c1-storyimg{
  animation:c1CinePushL 10s cubic-bezier(.3,.05,.3,1) both;
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="rescued-2of4"] .c1-storyimg{
  animation:c1CinePush 10s cubic-bezier(.3,.05,.3,1) both;
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="rescued-3of4"] .c1-storyimg{
  animation:c1CinePushR 10s cubic-bezier(.3,.05,.3,1) both;
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="rescued-4of4"] .c1-storyimg{
  animation:c1CinePushUp 11s cubic-bezier(.3,.05,.3,1) both;
}
/* The finished book: the only scene that also keeps brightening, because this
   one is the reward. */
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-complete"] .c1-storyimg{
  animation:c1CinePush 12s cubic-bezier(.3,.05,.3,1) both;
}

/* ---------- the page turn, on clip-path and filter, never on transform ----- *
   A page sweeping across the frame, plus a brief warm flash where the light
   catches the turned page. Because it never touches `transform`, the slow push
   above runs underneath it uninterrupted. */
@keyframes c1CinePageIn{
  0%  {clip-path:inset(0 100% 0 0);filter:brightness(1.34) saturate(.7)}
  60% {filter:brightness(1.1) saturate(.95)}
  100%{clip-path:inset(0 0 0 0);  filter:brightness(1)   saturate(1)}
}
@keyframes c1CinePageOut{
  0%  {clip-path:inset(0 0 0 0);  filter:brightness(1)}
  100%{clip-path:inset(0 0 0 100%);filter:brightness(.72) saturate(.8)}
}
#app.kg1-animal-v2 .c1-storylayer.is-page.is-in .c1-storyimg{
  animation:c1CinePageIn .68s cubic-bezier(.3,.1,.2,1) both;
}
#app.kg1-animal-v2 .c1-storylayer.is-page:not(.is-in) .c1-storyimg{
  animation:c1CinePageOut .34s ease-in both;
}

/* ---------- the warm light ------------------------------------------------ *
   `::after` was already a soft warm wash that rises on `is-in`; it is kept, and
   the book scenes get a slower breathing version. Light coming up on an old
   book is the most story-like thing available here and it costs three lines. */
@keyframes c1CineBreath{0%,100%{opacity:.5}50%{opacity:1}}
#app.kg1-animal-v2 .c1-storylayer::after{
  background-image:
    radial-gradient(122% 92% at 50% 45%,rgba(0,0,0,0) 56%,rgba(6,20,10,.32) 100%),
    radial-gradient(70% 45% at 50% 42%,rgba(255,232,168,.20),rgba(255,200,90,0) 70%);
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-intro"]::after,
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-open"]::after,
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-complete"]::after{
  animation:c1CineBreath 6.5s ease-in-out infinite;
  background-image:
    radial-gradient(122% 92% at 50% 45%,rgba(0,0,0,0) 58%,rgba(6,20,10,.26) 100%),
    radial-gradient(58% 40% at 50% 46%,rgba(255,226,150,.34),rgba(255,196,86,0) 72%);
}

/* ---------- the light motes ---------------------------------------------- *
   `::before` is a handful of soft dots on ONE element, animated with
   background-position and opacity. Far cheaper than a dozen DOM nodes, and the
   difference between "a picture" and "a place". Deliberately absent from the
   dense scenes, where they would only fight the drawing. */
@keyframes c1CineMotes{
  0%  {background-position:0 0;      opacity:.18}
  50% {opacity:.44}
  100%{background-position:38px -54px;opacity:.18}
}
#app.kg1-animal-v2 .c1-storylayer::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  opacity:0;
  transition:opacity .8s ease;
  background-image:
    radial-gradient(2.5px 2.5px at 18% 26%,rgba(255,236,186,.95),rgba(255,236,186,0) 100%),
    radial-gradient(2px 2px at 72% 18%,rgba(255,244,214,.85),rgba(255,244,214,0) 100%),
    radial-gradient(3px 3px at 41% 63%,rgba(255,228,168,.7),rgba(255,228,168,0) 100%),
    radial-gradient(2px 2px at 86% 71%,rgba(255,240,200,.8),rgba(255,240,200,0) 100%),
    radial-gradient(1.8px 1.8px at 29% 84%,rgba(255,232,180,.65),rgba(255,232,180,0) 100%),
    radial-gradient(2.2px 2.2px at 60% 42%,rgba(255,246,220,.7),rgba(255,246,220,0) 100%);
  background-repeat:repeat;
}
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-intro"].is-in::before,
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-open"].is-in::before,
#app.kg1-animal-v2 .c1-storylayer[data-scene="rescued-4of4"].is-in::before,
#app.kg1-animal-v2 .c1-storylayer[data-scene="book-complete"].is-in::before{
  opacity:1;
  animation:c1CineMotes 11s ease-in-out infinite alternate;
}

/* ---------- reduced motion: honoured, but never silent ------------------- */
@media (prefers-reduced-motion: reduce){
  /* The drift stops. The picture still arrives, and still crossfades. */
  #app.kg1-animal-v2 .c1-storylayer[data-scene] .c1-storyimg{
    animation:none !important;
    transform:scale(1.005) !important;
  }
  #app.kg1-animal-v2 .c1-storylayer.is-page.is-in .c1-storyimg{
    animation:c1CineFade .3s ease both !important;
  }
  #app.kg1-animal-v2 .c1-storylayer.is-page:not(.is-in) .c1-storyimg{
    animation:none !important;
  }
  #app.kg1-animal-v2 .c1-storylayer[data-scene]::before{
    animation:none !important;
    opacity:0 !important;
  }
  #app.kg1-animal-v2 .c1-storylayer[data-scene]::after{
    animation:none !important;
  }
  /* The flying rescue token does not travel. It still appears, still lands and
     still turns its destination to full colour, so the rescue remains legible -
     a child must never lose the meaning of the animation just because they
     asked for less of it. */
  #app.kg1-animal-v2 .c1-fly{animation:none !important}
  #app.kg1-animal-v2 .c1-slot.is-arriving{animation:none !important}
}
@keyframes c1CineFade{from{opacity:0}to{opacity:1}}

/* ============================================================================
   THE ARABIC MEANING LABEL - bilingual Discovery
   ----------------------------------------------------------------------------
   English is the primary word and stays visually first. The Arabic underneath is
   the word the English one MEANS, so it must be readable enough to learn from
   and quiet enough not to compete with the word being taught.
   *
   It is slightly smaller and lower-contrast than the English, but never small and
   never faint: this is the whole point of the screen, and a child who cannot read
   it has learned nothing. Direction is forced RTL so a mixed-language line can
   never put punctuation in the wrong place.
   ========================================================================== */
#app.kg1-animal-v2 .c1-dar{
  display:block;
  direction:rtl;
  text-align:center;
  margin-top:3px;
  font-size:.86em;
  line-height:1.35;
  color:#f3e2c2;
  opacity:.95;
  text-shadow:0 1px 2px rgba(0,0,0,.55);
  font-weight:600;
  pointer-events:none;
}
/* On a card that has been tapped, the meaning is confirmed, not merely shown. */
#app.kg1-animal-v2 .c1-dcard.is-heard .c1-dar{
  color:#fff6df;
  opacity:1;
}
/* Small phones: keep the meaning readable rather than letting the two words
   fight for the same line. The English shrinks first because it is still the
   larger, bolder line. */
@media (max-width:380px){
  #app.kg1-animal-v2 .c1-dar{font-size:.82em;margin-top:2px}
}

/* ============================================================================
   THE STORY CROSS-FADE - two pictures, overlapping
   ----------------------------------------------------------------------------
   The story layer holds TWO identical pictures. During a transition the previous
   one stays fully opaque and the next one is revealed on top of it.

   This replaces a faked cross-fade on a single <img>, which dimmed the current
   picture to 55% and then swapped its `src`. On a real phone that produced a brown,
   dim flash: the dim half was visible, and at the instant `src` changed the new
   picture frequently had not painted yet, so the layer's dark background showed
   through. Two pictures cannot produce that - there is never a frame in which
   neither one is showing, and the outgoing one is never dimmed.

   Purely visual. It gates nothing: narration progression is owned by the settle
   path, so no story line is started, cut or delayed by this.
   ========================================================================== */
#app.kg1-animal-v2 .c1-storyimg2{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:50% 50%;
  /* Always fully painted, but invisible until the fade reveals it. */
  opacity:0;
  transition:opacity .52s ease;
  pointer-events:none;
}
#app.kg1-animal-v2 .c1-storylayer.is-xfade .c1-storyimg2{
  opacity:1;
}

/* The outgoing picture must stay at full strength for the whole transition. The
   old rules dimmed it to .55 whenever `is-in` was absent, which is the exact
   brown frame this replaces - so the dim is removed and only the opacity of the
   INCOMING picture moves. */
#app.kg1-animal-v2 .c1-storylayer .c1-storyimg{
  opacity:1;
}

/* While a cross-fade is in progress the incoming picture is on top, so it must not
   also be running the outgoing half of a page-turn. */
#app.kg1-animal-v2 .c1-storylayer.is-xfade .c1-storyimg2{
  animation:none;
}

/* Reduced motion: the story still changes and the child still sees the new picture,
   it simply appears instead of fading. `is-xfade` is honoured for one frame by JS
   and then the primary image is promoted, so the ending state is identical. */
@media (prefers-reduced-motion: reduce){
  #app.kg1-animal-v2 .c1-storyimg2{transition:none}
}

/* ============================================================================
   CHAPTER 1 MATCH - the word text
   ----------------------------------------------------------------------------
   The word card sits on a light, translucent glass panel, and the text inherited a
   colour intended for the dark activity background. White on pale glass is the worst
   of both: very low contrast, and it looks like a rendering fault rather than a
   design.

   A deep warm brown, in the same family as the lion / tiger / monkey artwork, keeps
   the board feeling part of the Animal Rescue forest instead of borrowing a colour
   from somewhere else. Deliberately NOT a pale orange, which would fight the artwork
   and reduce the contrast it was meant to fix.

   Scoped to `.c1-mword`, which exists only inside Chapter 1 Match. Action Match and
   Colors Match have their own markup and are completely untouched by this.
   ========================================================================== */
#app.kg1-animal-v2 .c1-mword{
  color:#3a2410;
  text-shadow:0 1px 0 rgba(255,255,255,.55);
  font-weight:700;
  letter-spacing:.02em;
}
/* While a card is selected or matched the text stays dark; only the card's own
   treatment changes, so the word never loses its contrast. */
#app.kg1-animal-v2 .c1-mcard.is-selected .c1-mword,
#app.kg1-animal-v2 .c1-mcard.is-matched .c1-mword{
  color:#2a1a0a;
}
#app.kg1-animal-v2 .c1-mcard.is-wrong .c1-mword{
  color:#7a2d12;
}


/* ==========================================================================
   THE FINAL BILINGUAL RECALL
   --------------------------------------------------------------------------
   THE PHYSICAL-PHONE DEFECT. On the real Android phone the four animals at the
   end of Chapter 1 "visually disappeared into the forest". The forest backdrop
   is a detailed, high-contrast painted scene - leaves, branches, a waterfall,
   sky - and small semi-transparent animals sitting directly on it had no
   surface of their own. The child could not tell where one animal ended and
   the background began, which is fatal for an activity whose entire job is
   "tap the animal you remember".

   THE FIX IS ONE PANEL, NOT FOUR CARDS. The mistake would have been to give
   each animal its own opaque white rectangle: four bright boxes in a row would
   fight the warm forest, read as a worksheet, and break the chapter's visual
   direction. Instead the four animals sit ON a single warm parchment-glass
   panel - one composition, rounded, softly bordered, with the forest still
   reading through it at the edges and between the animals. The panel is what
   gives the animals a surface to belong to; the translucency is what keeps it
   inside the adventure rather than on top of it.

   SIZING. Deliberately NOT transform: scale(). The panel and its contents are
   laid out with real grid tracks, real aspect-ratios and real clamp() font
   sizes, so a tap target's real size is its layout size - which is what makes
   the hit area honest at both 390x844 and 360x640.
   ========================================================================== */
#app.kg1-animal-v2 .c1-stage-recall{
  justify-content:flex-start;
  padding-top:6px;
}

/* ---- the panel: one warm, translucent surface for all four animals ----- */
#app.kg1-animal-v2 .c1-recall{
  flex:0 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
  width:100%;
  max-width:392px;
  margin:0 auto;
  padding:12px 12px 11px;
  border-radius:26px;
  /* Warm parchment, not white. High enough opacity that a giraffe is legible
     against it, low enough that the forest still shows through. */
  background:
    linear-gradient(180deg,
      rgba(255,249,231,.90) 0%,
      rgba(253,243,216,.86) 52%,
      rgba(250,236,203,.83) 100%);
  -webkit-backdrop-filter:blur(9px) saturate(1.14);
  backdrop-filter:blur(9px) saturate(1.14);
  border:2px solid rgba(255,255,255,.78);
  /* Two shadows: a tight warm inner lift and a soft drop onto the forest. */
  box-shadow:
    0 2px 0 rgba(255,255,255,.5) inset,
    0 6px 0 rgba(185,138,36,.30),
    0 16px 30px rgba(12,40,18,.34);
}

/* ---- the Arabic heading, in its own element and direction ------------- */
#app.kg1-animal-v2 .c1-recall-title{
  flex:0 0 auto;
  font-size:clamp(17px,5.1vw,22px);
  font-weight:1000;
  line-height:1.25;
  text-align:center;
  color:#3a2410;
  text-shadow:0 1px 0 rgba(255,255,255,.7);
}

/* ---- 2x2: the safest arrangement at both supported widths -------------- */
#app.kg1-animal-v2 .c1-recall-grid{
  flex:0 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  width:100%;
  /* Teaching order reads left to right, whatever the document direction is. */
  direction:ltr;
}

/* ---- one animal on the shared panel ------------------------------------ *
   No card of its own: the panel is the surface. A card here would defeat the
   whole point of the fix. What each animal gets instead is a generous, honest
   tap area and a pressed/heard state. */
#app.kg1-animal-v2 .c1-rcard{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  min-width:0;
  /* A real, comfortable KG1 tap target. The hit area IS the layout box - no
     invisible extension, no transform. */
  min-height:104px;
  padding:6px 5px 7px;
  border:2px solid transparent;
  border-radius:18px;
  background:transparent;
  cursor:pointer;
  transition:background .14s ease,border-color .14s ease,box-shadow .14s ease;
}
#app.kg1-animal-v2 .c1-rcard:active{
  background:rgba(255,255,255,.46);
}
#app.kg1-animal-v2 .c1-rcard.is-heard{
  /* Heard, not correct. This is recall: there is no right answer, so the
     affordance is "I have heard this one", never a green tick. */
  border-color:rgba(255,255,255,.9);
  background:rgba(255,255,255,.40);
  box-shadow:0 2px 0 rgba(185,138,36,.22);
}

#app.kg1-animal-v2 .c1-rthumb{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  aspect-ratio:1/1;
  max-height:15vh;
}
#app.kg1-animal-v2 .c1-rthumb img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  /* A soft contact shadow instead of a hard outline, so the animal sits ON the
     parchment rather than being pasted onto it. */
  filter:drop-shadow(0 4px 6px rgba(74,48,16,.34));
}

/* English name: the primary label. */
#app.kg1-animal-v2 .c1-rname{
  font-size:clamp(14px,4.1vw,18px);
  font-weight:1000;
  letter-spacing:.02em;
  line-height:1.1;
  color:#2f4a1c;
  text-shadow:0 1px 0 rgba(255,255,255,.65);
}
/* Arabic meaning: the secondary label, in its own element, its own direction. */
#app.kg1-animal-v2 .c1-rar{
  font-size:clamp(12px,3.5vw,15px);
  font-weight:1000;
  line-height:1.15;
  color:#7a5320;
}

/* ---- the tap instruction, in Arabic ----------------------------------- */
#app.kg1-animal-v2 .c1-rtip{
  flex:0 0 auto;
  font-size:clamp(11px,3.2vw,13px);
  font-weight:1000;
  text-align:center;
  line-height:1.3;
  color:#6b4a1c;
}

/* ---- 360x640 and short phones: the panel shrinks, nothing is clipped ----- */
@media (max-height:700px){
  #app.kg1-animal-v2 .c1-stage-recall{padding-top:2px}
  #app.kg1-animal-v2 .c1-recall{gap:6px;padding:9px 10px 8px;border-radius:22px}
  #app.kg1-animal-v2 .c1-recall-grid{gap:6px}
  #app.kg1-animal-v2 .c1-rcard{min-height:88px;padding:4px 4px 5px;border-radius:15px}
  #app.kg1-animal-v2 .c1-rthumb{max-height:13vh}
  #app.kg1-animal-v2 .c1-recall-title{font-size:clamp(15px,4.5vw,19px)}
  #app.kg1-animal-v2 .c1-rname{font-size:clamp(13px,3.8vw,16px)}
  #app.kg1-animal-v2 .c1-rar{font-size:clamp(11px,3.2vw,13px)}
  #app.kg1-animal-v2 .c1-rtip{font-size:clamp(10px,2.9vw,12px)}
}
@media (max-width:380px){
  #app.kg1-animal-v2 .c1-recall{padding:8px 8px 7px}
  #app.kg1-animal-v2 .c1-rcard{min-height:82px;padding:4px 3px 5px}
  #app.kg1-animal-v2 .c1-rname{font-size:clamp(12px,3.5vw,15px)}
  #app.kg1-animal-v2 .c1-rar{font-size:clamp(10px,3vw,12px)}
}
@media (prefers-reduced-motion:reduce){
  #app.kg1-animal-v2 .c1-rcard{transition:none}
}
