/* ==========================================================================
   ASHTAR KATKOOT — ADVENTURE CARDS MAP
   --------------------------------------------------------------------------
   The KG1 -> Animals map: nine adventure cards in a vertical column for a
   390 x 844 portrait phone.

   EVERYTHING BELOW IS PRESENTATION. No state is declared here. A card's
   palette, badge and stars are driven by .abk-card[data-status] and by the
   markup animal-book.js builds from AshtarProgress, so this file can be
   restyled without touching progression, unlocking or stars.

   The jungle, the sunlight and the foliage are gradients. No screenshot is
   used as a background, and no artwork is flattened into a single image: each
   of the nine cards is a real DOM element with its own live animal picture.
   ========================================================================== */

/* ---------------------------------------------------------------- *
   THE JUNGLE SCREEN
   Warm sunlight from above, canopy at the edges, foliage below.
   ---------------------------------------------------------------- */
#app .abk-screen.cm-cards-map .abk-host,
#app .abk-screen.cm-cards-map .abk-root {
  position: fixed;
  inset: 0;
  background:
    /* sun shafts */
    radial-gradient(58% 26% at 50% -4%, rgba(255, 238, 168, 0.85) 0%, rgba(255, 226, 140, 0.25) 45%, transparent 72%),
    /* canopy */
    radial-gradient(120% 42% at 50% 0%, #63c25a 0%, #3f9440 40%, #2d7333 100%),
    /* warm depth */
    radial-gradient(130% 70% at 50% 40%, #3f9440 0%, #2a6b31 55%, #1c4a26 100%);
  overflow: hidden;
}

#app .abk-screen.cm-cards-map .abk-root { display: flex; flex-direction: column; }

#app .abk-screen.cm-cards-map .abk-host {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* The shared #mapScreen header still claims this screen in text ("stage 1 of
   30"), a progression the cards do not use. game.js marks it .abk-headergone
   expecting removal; this is that rule. The mute control is not inside that
   header, so it survives. */
#app .abk-screen.cm-cards-map .abk-headergone { display: none !important; }

/* Foliage tucked along the bottom edge, behind the column. */
#app .abk-screen.cm-cards-map .abk-host::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(26px 16px at 4% 100%, #3f9440 60%, transparent 62%),
    radial-gradient(20px 13px at 20% 100%, #57b04f 60%, transparent 62%),
    radial-gradient(24px 15px at 46% 100%, #357f38 60%, transparent 62%),
    radial-gradient(22px 14px at 72% 100%, #4fae4f 60%, transparent 62%),
    radial-gradient(24px 15px at 96% 100%, #357f38 60%, transparent 62%),
    linear-gradient(0deg, rgba(32, 90, 38, 0.9), rgba(32, 90, 38, 0));
}

/* ---------------------------------------------------------------- *
   THE SIGN — compact, so the column starts high on the screen
   ---------------------------------------------------------------- */
#app .abk-screen.cm-cards-map .abk-hud {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row-reverse;   /* back (left) - sign - album (right) */
  align-items: center;
  gap: 8px;
  /* The game's own #sound control is absolutely positioned in the top-left
     corner; this inset keeps the back button clear of it. */
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 4px 58px;
}

#app .abk-screen.cm-cards-map .abk-sign {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 12px 7px;
  border-radius: 16px;
  border: 2px solid #6b3a17;
  background: linear-gradient(180deg, #c07d3f 0%, #a1652f 52%, #8a4f22 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 226, 176, 0.45),
    inset 0 -3px 0 rgba(0, 0, 0, 0.30),
    0 4px 10px rgba(0, 0, 0, 0.38);
}

#app .abk-screen.cm-cards-map .abk-sign-title {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  color: #ffd97a;
  text-align: center;
  text-shadow: 0 2px 0 #6b3a17, 0 0 12px rgba(255, 196, 70, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#app .abk-screen.cm-cards-map .abk-sign-bar {
  display: flex;
  flex-direction: row-reverse;   /* star - track - count, left to right */
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

#app .abk-screen.cm-cards-map .abk-sign-star {
  font-size: 14px;
  color: #ffd54a;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
}

#app .abk-screen.cm-cards-map .abk-sign-track {
  flex: 1 1 auto;
  min-width: 0;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4a2a12, #2f1a0b);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* The fill width is written by animal-book.js from the same adventureProgress()
   that decides each card's state, so the header cannot disagree with the
   column beneath it. */
#app .abk-screen.cm-cards-map .abk-sign-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #a6f07a 0%, #4cc24a 55%, #2f9e3a 100%);
  box-shadow: 0 0 8px rgba(120, 230, 120, 0.6);
}

#app .abk-screen.cm-cards-map .abk-sign-count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: #ffeccb;
  direction: ltr;
  unicode-bidi: isolate;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

#app .abk-screen.cm-cards-map .abk-hud-back,
#app .abk-screen.cm-cards-map .abk-hud-album {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s ease;
}

#app .abk-screen.cm-cards-map .abk-hud-back {
  background: linear-gradient(180deg, #ffd977 0%, #f79422 60%, #d97a0d 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.35);
}

#app .abk-screen.cm-cards-map .abk-hud-album {
  background: linear-gradient(180deg, #ffe08a 0%, #f0a92c 60%, #cf7f0c 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.35);
}

#app .abk-screen.cm-cards-map .abk-hud-glyph {
  font-size: 19px;
  line-height: 1;
  color: #fffdf7;
  text-shadow: 0 2px 0 rgba(120, 60, 0, 0.55);
}

#app .abk-screen.cm-cards-map .abk-hud-back:active,
#app .abk-screen.cm-cards-map .abk-hud-album:active { transform: translateY(2px); }

#app .abk-screen.cm-cards-map .abk-hud-back:focus-visible,
#app .abk-screen.cm-cards-map .abk-hud-album:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- *
   THE SCROLLING COLUMN
   ---------------------------------------------------------------- */
#app .abk-screen.cm-cards-map .abk-stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

#app .abk-screen.cm-cards-map .abk-stage:focus { outline: none; }
#app .abk-screen.cm-cards-map .abk-stage:focus-visible {
  outline: 3px solid rgba(255, 240, 170, 0.9);
  outline-offset: -3px;
}

/* ---------------------------------------------------------------- *
   A CARD — a polished tile, not a web panel.
   ~352 x 134 on a 390 screen, 24px corners, a thick coloured rim over a
   lighter inner face, with a hard "lip" under the frame so it reads as an
   object sitting above the jungle.
   `row-reverse` puts the artwork on the LEFT and the words on the RIGHT,
   which is the composition of the reference and the natural read for an
   Arabic child: the animal first, then the name.
   ---------------------------------------------------------------- */
#app .abk-screen.cm-cards-map .abk-card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 352px;
  min-height: 134px;
  padding: 7px;
  border-radius: 24px;
  border: 4px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s ease;
}

#app .abk-screen.cm-cards-map .abk-card:active { transform: translateY(2px); }
#app .abk-screen.cm-cards-map .abk-card:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 3px;
}

/* ---- the artwork: 36% of the card, and the focal point ---- */
#app .abk-screen.cm-cards-map .abk-card-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 126px;
  height: 116px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.30);
  /* A jungle scene behind the animal, from artwork the game already ships.
     Alternated so a long column does not repeat. */
  background-color: #3f9440;
  background-image: url("assets/zones/bg-animals-1.jpg");
  background-size: cover;
  background-position: center;
}

#app .abk-screen.cm-cards-map .abk-stage > .abk-card:nth-child(even) .abk-card-thumb {
  background-image: url("assets/zones/bg-animals-2.jpg");
}

/* State tint: over the scene, under the animal, so the picture is never
   washed out - only warmed, dimmed or muted. */
#app .abk-screen.cm-cards-map .abk-card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, rgba(255, 244, 190, 0.18), rgba(255, 205, 90, 0.34));
}

/* contain-fit: the whole animal, never cropped, never stretched. */
#app .abk-screen.cm-cards-map .abk-card-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#app .abk-screen.cm-cards-map .abk-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 2px 0;
}

/* No row may be squeezed: the whole point of the card is that the name is
   readable. */
#app .abk-screen.cm-cards-map .abk-card-body > * { flex: 0 0 auto; }

#app .abk-screen.cm-cards-map .abk-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* The adventure number, in a small decorative plaque. */
#app .abk-screen.cm-cards-map .abk-card-num {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 2px 4px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.30);
}

/* Kept for assistive technology: the colour and the badge already say the
   same thing to a sighted child. */
#app .abk-screen.cm-cards-map .abk-card-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The title is allowed to WRAP. It used to be `white-space: nowrap` with
   `text-overflow: ellipsis`, which cut real Arabic names short - "الإنقاذ في
   الغابة" arrived as "إنقاذ في الغا...". Two lines are enough for every title
   in the book, and the card is a flex row, so a taller text column can never
   reach across the artwork, the stars or the badge beside it. */
#app .abk-screen.cm-cards-map .abk-card-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.28;
  color: #3b2412;
  text-align: start;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  word-break: normal;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

#app .abk-screen.cm-cards-map .abk-card-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  margin-top: 1px;
}

#app .abk-screen.cm-cards-map .abk-star {
  font-size: 25px;
  line-height: 1;
  color: #c6ced8;
  text-shadow: 0 1px 0 rgba(120, 95, 55, 0.30);
}

#app .abk-screen.cm-cards-map .abk-star.is-on {
  color: #ffc93c;
  /* The bevel: a dark lip under the gold, plus its own glow. */
  text-shadow: 0 2px 0 #dd8f0a, 0 4px 8px rgba(255, 175, 30, 0.45);
}

/* ---- the round badge: what tapping this card will do ---- */
#app .abk-screen.cm-cards-map .abk-play,
#app .abk-screen.cm-cards-map .abk-done,
#app .abk-screen.cm-cards-map .abk-lock {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  line-height: 1;
  color: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

/* the gloss on every badge */
#app .abk-screen.cm-cards-map .abk-play::before,
#app .abk-screen.cm-cards-map .abk-done::before,
#app .abk-screen.cm-cards-map .abk-lock::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 5px;
  height: 40%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  pointer-events: none;
}

#app .abk-screen.cm-cards-map .abk-play,
#app .abk-screen.cm-cards-map .abk-done,
#app .abk-screen.cm-cards-map .abk-lock > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- *
   THE THREE STATES
   Only palette, rim and saturation differ. Nothing is ever hidden, and a
   locked card is still unmistakably a card.
   ---------------------------------------------------------------- */

/* COMPLETED — lush green and turquoise with golden star accents. */
#app .abk-screen.cm-cards-map .abk-card[data-status="completed"] {
  border-color: #35a94a;
  background: linear-gradient(180deg, #f2fff4 0%, #d8f7dc 52%, #b9ecc1 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    0 6px 0 #1f7a30,
    0 12px 22px rgba(0, 0, 0, 0.34);
}

#app .abk-screen.cm-cards-map .abk-card[data-status="completed"] .abk-card-thumb::before {
  background: linear-gradient(160deg, rgba(178, 240, 160, 0.22), rgba(78, 190, 96, 0.42));
}
#app .abk-screen.cm-cards-map .abk-card[data-status="completed"] .abk-card-num {
  background: linear-gradient(180deg, #5ccb63, #2f9a3c);
}
#app .abk-screen.cm-cards-map .abk-done {
  background: linear-gradient(180deg, #86e07f 0%, #3cb854 58%, #23903c 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.24), 0 5px 10px rgba(0, 0, 0, 0.32);
}

/* AVAILABLE — warm gold, the loudest card on the screen, with a big green
   Play button so the action is obvious to a child who cannot yet read. */
#app .abk-screen.cm-cards-map .abk-card[data-status="available"] {
  border-color: #ffc42e;
  background: linear-gradient(180deg, #fffbe8 0%, #ffeeb4 50%, #ffdd7d 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.98),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6),
    0 7px 0 #d2890a,
    0 14px 26px rgba(0, 0, 0, 0.36);
}

#app .abk-screen.cm-cards-map .abk-card[data-status="available"] .abk-card-thumb::before {
  background: linear-gradient(160deg, rgba(255, 244, 180, 0.18), rgba(246, 182, 60, 0.34));
}
#app .abk-screen.cm-cards-map .abk-card[data-status="available"] .abk-card-num {
  background: linear-gradient(180deg, #f7a53c, #dd7c10);
}
#app .abk-screen.cm-cards-map .abk-play {
  background: linear-gradient(180deg, #8ae86f 0%, #46b64c 55%, #2c8c38 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 5px 10px rgba(0, 0, 0, 0.32);
}

/* LOCKED — cool lavender and blue. Still colourful and inviting, and the
   animal is only gently muted so a child can still see what is waiting. */
#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] {
  border-color: #8496c8;
  background: linear-gradient(180deg, #f6f8fe 0%, #e3e9f8 52%, #cdd7ee 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 6px 0 #5f6f9c,
    0 12px 22px rgba(0, 0, 0, 0.30);
}

#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] .abk-card-thumb {
  border-color: rgba(255, 255, 255, 0.85);
}
#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] .abk-card-thumb::before {
  background: linear-gradient(160deg, rgba(206, 218, 240, 0.42), rgba(128, 146, 186, 0.58));
}
#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] .abk-card-thumb img {
  filter: saturate(0.72) brightness(0.97);
}
#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] .abk-card-num {
  background: linear-gradient(180deg, #a8b6d8, #7183ad);
}
#app .abk-screen.cm-cards-map .abk-card[data-status="locked"] .abk-card-title {
  color: #46587c;
}
#app .abk-screen.cm-cards-map .abk-lock {
  background: linear-gradient(180deg, #d3ddf0 0%, #97a8cd 58%, #7688b0 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 5px 10px rgba(0, 0, 0, 0.28);
  font-size: 24px;
}

/* ---------------------------------------------------------------- *
   REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #app .abk-screen.cm-cards-map .abk-card,
  #app .abk-screen.cm-cards-map .abk-hud-back,
  #app .abk-screen.cm-cards-map .abk-hud-album { transition: none; }
  #app .abk-screen.cm-cards-map .abk-card:active { transform: none; }
}

/* ==================================================================== *
   THE 100 ANIMAL CHALLENGE STAGES
   --------------------------------------------------------------------
   Same tile language as the adventure cards - thick rim, layered bevel, real
   shadow - at a smaller scale so a hundred of them stay readable and cheap.
   Nothing here decides state: `.abk-chal[data-status]` is written by
   animal-book.js from the curriculum and the existing stage records.
   ==================================================================== */

/* The header keeps a hole on the album side, so the back button has room. */
#app .abk-screen.cm-cards-map .abk-hud-space { flex: 0 0 44px; }

/* ---- lesson divider: the curriculum's own grouping, never re-ordered ---- */
#app .abk-screen.cm-cards-map .abk-chal-lessonhead {
  align-self: stretch;
  max-width: 352px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 2px solid #6b3a17;
  background: linear-gradient(180deg, #b9793d 0%, #9a5f2a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 226, 176, 0.4), 0 3px 8px rgba(0, 0, 0, 0.32);
}

#app .abk-screen.cm-cards-map .abk-chal-lessonno {
  font-size: 11px;
  font-weight: 900;
  color: #ffe6a8;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

#app .abk-screen.cm-cards-map .abk-chal-lessontitle {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: #fff6e2;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .abk-screen.cm-cards-map .abk-chal-skills {
  font-size: 9px;
  font-weight: 800;
  color: #ffd97a;
  opacity: 0.85;
  direction: ltr;
  white-space: nowrap;
}

/* ---- one stage ---- */
#app .abk-screen.cm-cards-map .abk-chal {
  flex: 0 0 auto;
  align-self: stretch;
  max-width: 352px;
  min-height: 60px;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 18px;
  border: 3px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s ease;
}

#app .abk-screen.cm-cards-map .abk-chal:active { transform: translateY(2px); }
#app .abk-screen.cm-cards-map .abk-chal:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 3px;
}

/* The number is the hero: it is what a child counts by. */
#app .abk-screen.cm-cards-map .abk-chal-num {
  flex: 0 0 auto;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  direction: ltr;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.25);
}

#app .abk-screen.cm-cards-map .abk-chal-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#app .abk-screen.cm-cards-map .abk-chal-lesson {
  font-size: 12px;
  font-weight: 800;
  color: #4a3018;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .abk-screen.cm-cards-map .abk-chal-stars {
  display: flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  min-height: 15px;
}

#app .abk-screen.cm-cards-map .abk-chal-stars .abk-star { font-size: 15px; }

#app .abk-screen.cm-cards-map .abk-chal-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 3px 6px rgba(0, 0, 0, 0.28);
}

/* ---- states ---- */
#app .abk-screen.cm-cards-map .abk-chal[data-status="completed"] {
  border-color: #35a94a;
  background: linear-gradient(180deg, #f2fff4 0%, #d8f7dc 55%, #bdecc4 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 4px 0 #1f7a30, 0 8px 16px rgba(0, 0, 0, 0.28);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="completed"] .abk-chal-num {
  background: linear-gradient(180deg, #5ccb63, #2f9a3c);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="completed"] .abk-chal-badge {
  background: linear-gradient(180deg, #86e07f, #2b9c40);
}

#app .abk-screen.cm-cards-map .abk-chal[data-status="current"] {
  border-color: #ffc42e;
  background: linear-gradient(180deg, #fffbe8 0%, #ffeeb4 52%, #ffdd7d 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.95), 0 5px 0 #d2890a, 0 10px 20px rgba(0, 0, 0, 0.32);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="current"] .abk-chal-num {
  background: linear-gradient(180deg, #f7a53c, #dd7c10);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="current"] .abk-chal-badge {
  background: linear-gradient(180deg, #8ae86f, #2c8c38);
}

#app .abk-screen.cm-cards-map .abk-chal[data-status="locked"] {
  border-color: #8496c8;
  background: linear-gradient(180deg, #f4f7fd 0%, #e2e8f7 52%, #ccd6ed 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.85), 0 4px 0 #5f6f9c, 0 8px 16px rgba(0, 0, 0, 0.26);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="locked"] .abk-chal-num {
  background: linear-gradient(180deg, #a8b6d8, #7183ad);
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="locked"] .abk-chal-lesson {
  color: #56658a;
}
#app .abk-screen.cm-cards-map .abk-chal[data-status="locked"] .abk-chal-badge {
  background: linear-gradient(180deg, #d3ddf0, #7688b0);
}

/* ---- the challenges entry card, in the adventure card's own language ---- */
#app .abk-screen.cm-cards-map .abk-entry .abk-entry-thumb {
  background:
    radial-gradient(60% 60% at 50% 40%, #ffe58a 0%, #f0a92c 55%, #c97f0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
#app .abk-screen.cm-cards-map .abk-entry-mark {
  font-size: 30px;
  font-weight: 900;
  color: #6b3a17;
  direction: ltr;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}
#app .abk-screen.cm-cards-map .abk-card-progress {
  font-size: 12px;
  font-weight: 900;
  color: #6b4a22;
  direction: ltr;
  unicode-bidi: isolate;
}

@media (prefers-reduced-motion: reduce) {
  #app .abk-screen.cm-cards-map .abk-chal { transition: none; }
  #app .abk-screen.cm-cards-map .abk-chal:active { transform: none; }
}
/* ------------------------------------------------------------------ *
 * THE ANIMAL FRIENDS ENTRY CARD
 *
 * Additive only: the nine story cards and the challenges entry card are not
 * touched. The three faces are the existing approved animal images.
 * ------------------------------------------------------------------ */
.abk-card.abk-friends {
  background: linear-gradient(160deg, #ffe6a3 0%, #ffc069 45%, #f79b53 100%);
  border-color: #b8703a;
}
.abk-friends-faces {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 6px;
}
.abk-friends-faces img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, #fffdf5, #ffeec9);
  border: 2px solid #fff;
  box-shadow: 0 2px 5px #0003;
}
.abk-card.abk-friends .abk-card-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #7a3c12;
  opacity: .9;
}
/* ==========================================================================
 * THE FOUR FRIEND GROUP CARDS
 *
 * Everything about the card itself - 352 x 134 minimum, the 24px corners, the
 * coloured rim, the hard lip, the typography - is the EXISTING adventure-card
 * design. These rules only fill the artwork slot, because a group shows three
 * (or two) small portraits where a story shows one big animal.
 * ========================================================================== */
/* ==========================================================================
 * THE FOUR FRIEND GROUP CARDS
 *
 * The card itself is untouched: same 24px corners, same rim, same lip, same
 * shadow, same typography as the nine adventure cards. Only the INSIDE is laid
 * out differently, and it is laid out with a real grid rather than by nudging
 * margins - that is what stops the frames, the text and the portraits from
 * ever overlapping.
 *
 *   column 1   the group's own animal portraits, in a dedicated image area
 *   column 2   the group name, then one animal name per line, centred
 *
 * The names live in a three-row grid. Two names simply leave the third row
 * empty, so a two-animal card and a three-animal card are the same height and
 * both look deliberate.
 * ========================================================================== */
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-thumb {
  padding: 6px;
  overflow: hidden;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-faces {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-faces img {
  width: 100%;
  max-width: 44px;
  height: 100%;
  max-height: 92px;
  object-fit: contain;
  object-position: center;
  display: block;
}
/* Two animals: two wider columns, so the image area reads as full rather than
   as a half-empty box. The card's own dimensions never change. */
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-faces.is-pair {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-faces.is-pair img {
  max-width: 62px;
}

/* THE NAME LIST. Three equal rows, each name centred in its own row. */
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-names {
  display: grid;
  grid-template-rows: repeat(3, auto);
  align-content: center;
  justify-items: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  margin: 2px 0;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-name {
  display: block;
  max-width: 100%;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: .02em;
  color: #3b2412;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-card-num {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
/* THE GROUP HEADING.
 *
 * Its own full-width line above the animal names. It is not squeezed into the
 * small head row beside the status badge any more, so it can never be clipped,
 * ellipsised or cut off: the row grows to fit the text and the names shift
 * down with it. */
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0 0 2px;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.3;
  color: #2f1c0c;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-group-head .abk-card-status {
  flex: 0 0 auto;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-card-meta {
  justify-content: flex-start;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-card-meta .abk-card-stars {
  margin: 0 0 0 8px;
  gap: 1px;
}
#app .abk-screen.cm-cards-map .abk-card.abk-group .abk-card-meta .abk-star {
  font-size: 20px;
}
