/* ==========================================================================
   ANIMAL RESCUE ADVENTURE MAP - presentation
   --------------------------------------------------------------------------
   The brief for this screen is that it must not look like a developer menu.
   It is the thing a KG1 child sees when they choose the Animal world, so it
   has to read as a JOURNEY: a winding dirt road running down through a bright
   jungle, with five places to stop at.

   Three ideas do all the work:

     1. The ROAD is the structure, not a decoration. It is one continuous
        S-curved path drawn as an SVG so the road and the stops cannot drift
        apart at any viewport, and the stops sit ON it.

     2. The stops are DESTINATIONS, not stage buttons. They read as places -
        a numbered marker, a place name in Arabic and English, and the four
        animals waiting there. There is deliberately no "STAGE" word anywhere.

     3. LOCKED DOES NOT MEAN BROKEN. Chapters 2-5 use the same board, the same
        typography and the same animal portraits, just dimmed, with a lock
        badge. A child should read "I will go there later", not "this button
        is disabled".

   Scoped entirely under .arcmap so no other world, grade or legacy stage map
   can be affected by anything in this file.
   ========================================================================== */

#app .arcmap{
  position:relative;
  display:block;
  width:100%;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;          /* the journey scrolls down, never sideways */
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  touch-action:pan-y;
  /* THE BACKDROP IS CHAPTER 1'S OWN ARTWORK, reused rather than replaced.
     `animal-rescue-forest-trail.jpg` is 941x1672 - a tall portrait scene of a
     dirt path running into a green reserve past a bridge and waterfalls. A
     vertical journey needs a vertical picture, and this is the exact world the
     child has just finished playing in, so the map and the chapter are visibly
     the same place. The washed-out sky is what a landscape backdrop left at the
     top of a tall scroll area; this picture fills the height with canopy,
     water and path instead. */
  background-color:#1d4b2a;
  background-image:
    linear-gradient(180deg,rgba(12,46,22,.34) 0%,rgba(10,40,18,.40) 45%,rgba(8,32,15,.52) 100%),
    url('assets/animal-rescue/animal-rescue-forest-trail.jpg');
  background-size:auto,cover;
  background-position:center top;
  background-repeat:no-repeat,no-repeat;
  background-attachment:local,local;
}

/* Edge foliage, from the map's own existing prop sheet. Kept at the sides and
   corners, low enough in contrast to stay scenery: the road and the stops are
   the structure, and the leaves are what make the edges feel like a reserve
   rather than a page margin. */
#app .arcmap::before,
#app .arcmap::after{
  content:"";
  position:absolute;
  top:0;
  width:clamp(74px,23vw,116px);
  height:clamp(150px,26vh,240px);
  background:url('assets/map/branch-liana.png') no-repeat center top;
  background-size:auto 100%;
  opacity:.55;
  pointer-events:none;
  z-index:0;
}
#app .arcmap::before{left:0;transform:scaleX(-1);transform-origin:left top}
#app .arcmap::after{right:0}

#app .arcmap-root{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  min-height:100%;
  padding:calc(10px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom));
}

/* ---------- the utility bar: Album + the real tally ------------------- */
#app .arcmap-bar{
  position:sticky;
  top:0;
  z-index:6;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  max-width:420px;
  padding:5px 6px 5px 10px;
  border-radius:999px;
  background:rgba(255,253,242,.90);
  -webkit-backdrop-filter:blur(8px) saturate(1.12);
  backdrop-filter:blur(8px) saturate(1.12);
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 3px 0 rgba(185,138,36,.45),0 8px 18px rgba(10,38,16,.32);
}
#app .arcmap-album{
  display:flex;
  align-items:center;
  gap:5px;
  min-height:40px;
  padding:4px 12px 4px 9px;
  border:2px solid rgba(255,255,255,.9);
  border-radius:999px;
  background:linear-gradient(180deg,#fff6d8,#ffe9a8);
  color:#4a3210;
  font-size:clamp(12px,3.4vw,14px);
  font-weight:1000;
  line-height:1;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
#app .arcmap-album:active{transform:translateY(2px)}
#app .arcmap-album-ico{font-size:1.05em;line-height:1}
#app .arcmap-tally{
  display:flex;
  align-items:baseline;
  gap:5px;
  color:#2f4a1c;
  font-size:clamp(10px,2.9vw,12px);
  font-weight:1000;
  line-height:1.1;
  white-space:nowrap;
}
#app .arcmap-tally b{
  font-size:clamp(14px,4.1vw,17px);
  letter-spacing:.02em;
}

/* ---------- the trail ------------------------------------------------- */
#app .arcmap-trail{
  position:relative;
  width:100%;
  max-width:420px;
  display:flex;
  flex-direction:column;
  /* Five stops with generous breathing room. The map is the one screen in the
     game where scrolling is the intended interaction, so it is given real
     length instead of being squeezed to fit. */
  gap:clamp(16px,4.4vh,30px);
  padding:14px 0 18px;
}

/* The road. Drawn once as an SVG path so it always matches the stop rhythm. */
#app .arcmap-road{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
  overflow:visible;
}
#app .arcmap-road-edge{
  fill:none;
  stroke:#9a6a2e;          /* packed earth edge */
  stroke-width:15;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 2px 4px rgba(10,38,16,.45));
}
/* A lighter, narrower core on top reads as a worn path. */
#app .arcmap-road-core{
  fill:none;
  stroke:#d9ab68;
  stroke-width:8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* ---------- where the journey begins ---------------------------------- *
   A signpost standing on the road, above the first stop. It is what turns
   "five stacked cards" into "a route with a beginning": the child can see the
   road starting here and running down past four more places. */
#app .arcmap-start{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  margin-bottom:2px;
  text-align:center;
}
#app .arcmap-signpost{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0;
  padding:5px 16px 6px;
  border:2.5px solid rgba(255,255,255,.9);
  border-radius:14px;
  background:linear-gradient(180deg,#a9743c,#8a5a2b);
  box-shadow:0 4px 0 #5f3c19,0 8px 14px rgba(12,40,18,.34);
  color:#fff8e8;
  text-shadow:0 1px 2px rgba(0,0,0,.42);
}
#app .arcmap-signpost b{
  font-size:clamp(12px,3.4vw,14px);
  font-weight:1000;
  line-height:1.25;
}
#app .arcmap-signpost i{
  font-style:normal;
  font-size:clamp(8px,2.3vw,9.5px);
  font-weight:1000;
  letter-spacing:.10em;
  line-height:1.3;
  opacity:.92;
}
#app .arcmap-start-hint{
  padding:1px 9px;
  border-radius:999px;
  background:rgba(12,44,22,.40);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
  color:#eaffd8;
  font-size:clamp(9px,2.6vw,11px);
  font-weight:1000;
  line-height:1.6;
  text-shadow:0 1px 2px rgba(0,0,0,.4);
}

/* ---------- one stop -------------------------------------------------- */
#app .arcmap-stop{
  position:relative;
  z-index:1;
  display:flex;
  justify-content:center;
  /* Alternate the stops either side of the road so the journey reads as a
     path being travelled rather than a list being scrolled. */
  padding-left:0;
  padding-right:0;
}
#app .arcmap-stop[data-chapter="1"],
#app .arcmap-stop[data-chapter="3"],
#app .arcmap-stop[data-chapter="5"]{justify-content:flex-end;padding-right:clamp(6px,3vw,22px)}
#app .arcmap-stop[data-chapter="2"],
#app .arcmap-stop[data-chapter="4"]{justify-content:flex-start;padding-left:clamp(6px,3vw,22px)}

#app .arcmap-node{
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-areas:
    "num  ar"
    "num  en"
    "row  row"
    "prog badge";
  align-items:center;
  gap:2px 8px;
  width:min(74%,288px);
  min-height:104px;
  padding:9px 11px 8px;
  text-align:start;
  border:2.5px solid rgba(255,255,255,.92);
  border-radius:20px;
  /* The same cream board the chapter's own glass surfaces use, so a chapter
     stop and a Chapter 1 surface are visibly the same world. */
  background:linear-gradient(180deg,rgba(255,251,238,.95),rgba(252,243,218,.92));
  box-shadow:0 5px 0 #b98a24,0 10px 20px rgba(12,40,18,.30);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:transform .1s ease,box-shadow .1s ease;
}
#app .arcmap-node:active{transform:translateY(3px);box-shadow:0 2px 0 #b98a24,0 6px 12px rgba(12,40,18,.30)}

/* the chapter number: a marker, not a stage bubble */
#app .arcmap-num{
  grid-area:num;
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:50%;
  background:linear-gradient(180deg,#3f8f52,#2a6b3c);
  color:#fff;
  font-size:clamp(17px,5vw,21px);
  font-weight:1000;
  line-height:1;
  text-shadow:0 1px 0 rgba(0,0,0,.28);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 2px 4px rgba(10,38,16,.35);
}
#app .arcmap-ar{
  grid-area:ar;
  color:#3a2410;
  font-size:clamp(14px,4.2vw,17px);
  font-weight:1000;
  line-height:1.2;
}
#app .arcmap-en{
  grid-area:en;
  color:#5b6b3a;
  font-size:clamp(9px,2.6vw,11px);
  font-weight:1000;
  letter-spacing:.06em;
  line-height:1.1;
}

/* the four animals waiting at this stop */
#app .arcmap-animals{
  grid-area:row;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:4px;
  margin-top:4px;
  padding:3px 5px;
  border-radius:12px;
  background:rgba(255,255,255,.5);
}
#app .arcmap-animal{
  display:block;
  width:clamp(34px,10.4vw,44px);
  aspect-ratio:1/1;
  border-radius:9px;
  background:rgba(255,255,255,.55);
  overflow:hidden;
}
/* The quiet shape used when the catalogue has no artwork for an animal yet -
   the same neutral treatment the Album itself uses, never a substitute. */
#app .arcmap-animal i{
  display:block;
  width:52%;
  height:52%;
  margin:24% auto 0;
  border-radius:50% 50% 42% 42%;
  background:rgba(120,132,104,.42);
}
#app .arcmap-animal img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 2px 3px rgba(74,48,16,.3));
}

#app .arcmap-prog{
  grid-area:prog;
  color:#7a5320;
  font-size:clamp(10px,2.9vw,12px);
  font-weight:1000;
  line-height:1.1;
}

/* ---------- state: done, and coming-later ---------------------------- */
#app .arcmap-badge{
  grid-area:badge;
  display:flex;
  align-items:center;
  justify-self:end;
  gap:3px;
  padding:2px 7px;
  border-radius:999px;
  font-size:clamp(9px,2.6vw,11px);
  font-weight:1000;
  line-height:1.4;
  white-space:nowrap;
}
#app .arcmap-badge i{font-style:normal;font-size:1.05em;line-height:1}
#app .arcmap-badge.is-done{background:rgba(214,244,222,.95);color:#1d6b3c;box-shadow:inset 0 0 0 1.5px rgba(93,217,127,.75)}
#app .arcmap-badge.is-locked{background:rgba(255,255,255,.62);color:#6b5a3a;box-shadow:inset 0 0 0 1.5px rgba(160,140,105,.45)}

/* Chapter 1, in progress: a warm ring so the eye finds the stop to go to. */
#app .arcmap-node.is-new,
#app .arcmap-node.is-progress{
  border-color:#8ef0c4;
  box-shadow:0 5px 0 #2f8f5f,0 0 0 3px rgba(142,240,196,.55),0 10px 20px rgba(12,40,18,.30);
}
#app .arcmap-node.is-new::after,
#app .arcmap-node.is-progress::after{
  content:attr(data-hint);
  position:absolute;
  top:-9px;
  inset-inline-end:8px;
  padding:2px 8px;
  border-radius:999px;
  background:#ffe9a8;
  color:#5a3d12;
  font-size:clamp(9px,2.6vw,11px);
  font-weight:1000;
  line-height:1.5;
  box-shadow:0 2px 5px rgba(10,38,16,.3);
}
#app .arcmap-node.is-new::after{content:"هنا نبدأ"}

/* Chapter 1 completed: unmistakably done, without shouting. */
#app .arcmap-node.is-completed{
  border-color:#5fd97f;
  background:linear-gradient(180deg,rgba(236,252,240,.96),rgba(222,246,228,.93));
  box-shadow:0 5px 0 #2b7c3e,0 0 0 3px rgba(95,217,127,.45),0 10px 20px rgba(12,40,18,.28);
}
#app .arcmap-node.is-completed .arcmap-animal{background:rgba(255,255,255,.78)}

/* Chapters 2-5: VISIBLE and DESIRABLE, not disabled grey boxes. The board,
   the type and the animals all stay; only the light drops and a lock badge
   says why. */
#app .arcmap-stop-locked .arcmap-node{
  border-color:rgba(255,255,255,.78);
  background:linear-gradient(180deg,rgba(242,242,232,.90),rgba(228,230,212,.87));
  box-shadow:0 4px 0 rgba(140,120,80,.45),0 8px 16px rgba(12,40,18,.30);
  cursor:pointer;   /* still tappable: it answers "coming later" */
}
#app .arcmap-stop-locked .arcmap-num{
  background:linear-gradient(180deg,#8d9a76,#5f6d4e);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.30),0 2px 4px rgba(10,38,16,.3);
}
#app .arcmap-stop-locked .arcmap-ar{color:#4a4a36}
#app .arcmap-stop-locked .arcmap-en{color:#6d6d55}
#app .arcmap-stop-locked .arcmap-animal img{
  /* Silhouette treatment, not a hidden image: the child can see what is over
     there, which is the entire point of showing the chapter at all. */
  filter:grayscale(1) brightness(.62) contrast(.95) drop-shadow(0 2px 3px rgba(20,30,18,.35));
  opacity:.85;
}
#app .arcmap-stop-locked .arcmap-animal{background:rgba(210,214,198,.55)}
#app .arcmap-stop-locked .arcmap-node:active{transform:translateY(2px)}

/* ---------- the footer line ------------------------------------------- */
#app .arcmap-foot{
  display:flex;
  align-items:center;
  gap:6px;
  padding:4px 12px;
  border-radius:999px;
  background:rgba(12,44,22,.42);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
  color:#f2ffe6;
  font-size:clamp(10px,2.9vw,12px);
  font-weight:1000;
  line-height:1.4;
  text-shadow:0 1px 2px rgba(0,0,0,.4);
}
#app .arcmap-foot-label{color:#d9f2c4;opacity:.9}
#app .arcmap-foot b{color:#fff}

/* ---------- small / short phones -------------------------------------- */
@media (max-width:380px){
  #app .arcmap-node{width:min(78%,272px);min-height:98px;padding:8px 9px 7px}
  #app .arcmap-num{width:34px;height:34px}
  #app .arcmap-animal{width:clamp(30px,9.6vw,38px)}
  #app .arcmap-album{min-height:38px;padding:3px 10px 3px 8px}
}
@media (max-height:700px){
  #app .arcmap-root{gap:8px}
  #app .arcmap-trail{gap:clamp(12px,3.2vh,22px);padding:10px 0 14px}
  #app .arcmap-node{min-height:94px}
  #app .arcmap-animal{width:clamp(30px,9.2vw,40px)}
}
@media (prefers-reduced-motion:reduce){
  #app .arcmap-node{transition:none}
}
