/* ============================================================================
   ASHTAR KATKOOT 2.0 — Animal Rescue Adventure, Chapter 1
   Base layer only.
   ----------------------------------------------------------------------------
   Every rule is gated on the .kg1-animal-v2 root class (added by the V2
   controller) and additionally namespaced under .animal-c1 / .c1-* classes.
   When the chapter is not running these rules cannot match anything, so no
   other world, grade or the legacy Animal V2 prototype is affected.

   This file intentionally holds almost no visual opinion. The adventure
   presentation - the Forest Trail / Rescue Clearing scenes, the glass
   surfaces, the rescue tracker states, the answer cards, Help, the rescue
   moment and the completion clearing - all live in animal-rescue.css, which
   loads after this file. Keeping the two apart is what makes the presentation
   replaceable without touching the chapter's behaviour.

   What remains here is the structural skeleton and the two rules that must
   never be broken: the stage hugs its content, and the foot row owns both the
   help control and the actions so they cannot overlap.

   Reuses the existing V2 completion card classes
   (.animal-v2-complete / .animal-v2-card / .animal-v2-art ...) so the chapter
   reward moment is still the proven V2 card. Those are NOT redefined here.

   Target viewport: 390 x 844 portrait, no gameplay scrolling.
   ========================================================================== */

/* ---------- chapter shell ------------------------------------------- */
#app.kg1-animal-v2 .animal-c1{
  display:flex;
  flex-direction:column;
}
#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}

/* ---------- the stage ------------------------------------------------ */
/* flex:0 1 auto is load-bearing: the stage hugs its content (so the forest
   shows above and below it) but can still shrink, which is what stops a tall
   question from ever turning into a scroll. */
#app.kg1-animal-v2 .c1-stage{
  flex:0 1 auto;
  min-height:0;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
/* Discovery has no answer set, so its animal becomes the hero and centres in
   the middle band instead of being pushed to the bottom. */
#app.kg1-animal-v2 .c1-stage-discovery{
  flex:1 1 auto;
  justify-content:center;
  gap:10px;
}
/* Quiz stages fill the column so .c1-options can be pushed down onto the
   trail with margin-top:auto. */
#app.kg1-animal-v2 .c1-stage-listen-picture,
#app.kg1-animal-v2 .c1-stage-picture-word,
#app.kg1-animal-v2 .c1-stage-match{
  flex:1 1 auto;
  justify-content:flex-start;
}

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

/* ---------- option sets --------------------------------------------- */
#app.kg1-animal-v2 .c1-options{width:100%}
#app.kg1-animal-v2 .c1-options-pics{max-height:100%}
#app.kg1-animal-v2 .c1-options-words{align-content:end}

/* ---------- action bar ---------------------------------------------- */
#app.kg1-animal-v2 .c1-actions{
  display:flex;
  gap:8px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
}

/* ---------- chapter reward overlay ---------------------------------- */
/* Reuses the proven V2 card markup/classes. No speech is wired here. */
#app.kg1-animal-v2 .c1-overlay{
  position:fixed;
  inset:0;
  z-index:31;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background:rgba(4,18,38,.6);
  -webkit-backdrop-filter:blur(3px);
  backdrop-filter:blur(3px);
}
#app.kg1-animal-v2 .c1-overlay.hidden{display:none!important}
#app.kg1-animal-v2 .c1-overlay .animal-v2-card-actions{grid-template-columns:1fr}
