*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;background:#d4f1e0;color:#263238;font-family:system-ui,sans-serif}main{width:100%;max-width:1120px;margin:auto;padding:4px}.hidden,[hidden]{display:none!important}.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible,.zone:focus-visible{outline:4px solid #1759b9;outline-offset:2px}
#welcome{position:relative;width:100%;aspect-ratio:1489/1056;background:url('./assets/approved-storybook.png') center/contain no-repeat}
#welcome #explore,#welcome #pip-replay{position:absolute;display:block;background:transparent;border:3px solid transparent;border-radius:28px;padding:0;box-shadow:none}
#welcome #explore{left:34%;top:68%;width:32%;height:11%}#welcome #pip-replay{left:39%;top:82%;width:22%;height:13%}
#welcome #explore:active,#welcome #pip-replay:active{background:#ffffff26}
.map-stage{position:relative;width:100%}.map-stage>img{display:block;width:100%;height:auto}.touchmap{position:absolute;inset:0;width:100%;height:100%}.zone{fill:transparent;stroke:transparent;cursor:pointer;pointer-events:all}.zone:focus-visible{stroke:#1759b9;stroke-width:5;stroke-opacity:1}
.map-back{position:absolute;top:3.0%;left:2.0%;width:14%;height:7%;border:0;background:transparent;border-radius:20px;box-shadow:none}
#game{text-align:center;margin:40px auto;padding:clamp(24px,6vw,64px);max-width:750px;border-radius:32px;background:#fff9e8;box-shadow:0 12px 30px #426d6130}#game h2{font-size:clamp(2rem,5vw,3.5rem)}#game p{font-size:clamp(1.2rem,2.8vw,1.6rem)}#next{background:#ffcf55;border:0;border-radius:22px;min-height:64px;padding:15px 25px;font-size:1.2rem;font-weight:700}
#pip-intro{position:fixed;z-index:30;inset:0;height:100dvh;overflow-y:auto;padding:12px;background:#15374af2;color:white;display:flex;flex-direction:column;align-items:center;justify-content:safe center;gap:12px}#pip-intro h2{margin:0;font-size:clamp(1.5rem,4vw,2.3rem)}#pip-intro-video{width:min(100%,900px,calc((100dvh - 155px)*16/9));max-height:min(58dvh,520px);aspect-ratio:16/9;background:#15242e;border-radius:16px}.pip-actions{display:flex;gap:12px;justify-content:center}.pip-actions button{min-height:50px;padding:12px 22px;font-size:1rem;border:0;border-radius:16px;background:#ffdf79}@media(max-height:480px){#pip-intro{gap:6px}#pip-intro-video{max-height:48dvh;width:min(100%,calc(48dvh*16/9))}}

/* Full-viewport cinematic Pip greeting: no native player UI. */
#pip-intro{position:fixed;inset:0;z-index:30;width:100vw;height:100dvh;max-height:none;margin:0;padding:0;background:#000;display:block;overflow:hidden}
#pip-intro-video{display:block;width:100%;height:100%;max-height:none;max-width:none;aspect-ratio:auto;object-fit:contain;border-radius:0;background:#000}
#pip-intro .pip-actions{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));right:max(16px,env(safe-area-inset-right));display:flex;gap:12px}
#pip-intro .pip-actions button{min-height:44px;padding:10px 18px;background:#fff8e5e8;color:#263238;font-size:1rem;border-radius:22px;box-shadow:0 3px 12px #0005}
#pip-intro .pip-actions button[hidden]{display:none}

#welcome{cursor:pointer}

/* Dinosaur Valley: prototype activity lives alongside existing page; no original styling changed. */
#dino-valley,#dino-slides{position:fixed;inset:0;z-index:20;background:linear-gradient(140deg,#66dffa,#bcf27b 70%,#ffdb83);overflow:auto;padding:0;margin:0;max-width:none;text-align:center}
.dino-landscape{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:8px}
.valley-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;width:min(96vw,1100px);background:#fffbd9dd;border-radius:22px;padding:8px 12px;font-size:clamp(15px,2.5vw,25px);box-shadow:0 4px 15px #184f2850}
.valley-bar button,.slide-top button{font-size:clamp(12px,2vw,18px);font-weight:750;border:0;border-radius:18px;background:#ffdc61;min-height:42px;padding:7px 13px;color:#5b3909}
#choose-triceratops{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:0;max-width:min(96vw,1100px);border:0;background:transparent;padding:0}
#choose-triceratops img{height:100%;max-width:100%;object-fit:contain;border-radius:24px;box-shadow:0 8px 28px #2d583750}
.valley-prompt{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:clamp(16px,3vw,25px);font-weight:900;color:#653600;background:#ffe065;padding:10px 20px;border-radius:99px;box-shadow:0 4px 16px #46390070;animation:soft-bounce 2.3s ease-in-out infinite}
.valley-note{margin:0;font-size:clamp(12px,1.5vw,16px);font-weight:700;color:#26502c}
#dino-slides{z-index:25;background:radial-gradient(circle at 50% 20%,#b0efff,#369fb7);display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));overflow:hidden}
.slide-top{flex-shrink:0;width:min(100%,1100px);display:flex;justify-content:space-between;align-items:center;gap:10px;color:#163b35;font-weight:850;font-size:clamp(15px,2.4vw,23px)}
.slide-stage{min-height:0;flex:1;display:flex;align-items:center;justify-content:center;width:100%}
.slide-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;border-radius:17px;box-shadow:0 5px 22px #124f5360}
.slide-controls{flex-shrink:0;width:min(100%,1100px);min-height:74px;display:flex;gap:9px;align-items:center;justify-content:space-between;background:#fff7d8ee;border-radius:20px;padding:8px}
.slide-controls>button{flex-shrink:0;border:0;background:#ffbf29;border-radius:19px;width:clamp(58px,10vw,90px);height:clamp(55px,9vh,78px);font-size:clamp(22px,4vw,37px);font-weight:900;color:#754010;box-shadow:0 3px 0 #bf8a12}
.slide-controls>button:disabled{opacity:.36}.slide-controls>button.ready{animation:soft-bounce 1.8s infinite;box-shadow:0 0 19px 7px #fff18f}
.pip-caption{font-size:clamp(13px,2.2vw,22px);font-weight:650;line-height:1.25;max-width:850px}.pip-caption strong{white-space:nowrap;color:#b45e05}
.sound-note{flex-shrink:0;font-size:11px;color:#144f58;background:#ffffffb3;border-radius:10px;padding:2px 8px}
@keyframes soft-bounce{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.065)}}
.valley-prompt{animation-name:valley-bounce}@keyframes valley-bounce{0%,100%{transform:translateX(-50%) scale(1)}50%{transform:translateX(-50%) scale(1.05)}}
@media(prefers-reduced-motion:reduce){.slide-controls>button.ready,.valley-prompt{animation:none}}
@media(max-height:520px){.slide-top button{min-height:34px;padding:4px 10px}.slide-controls{min-height:54px}.slide-controls>button{height:48px}.sound-note{display:none}.valley-note{display:none}}

/* Overlay Pip ON the approved slide artwork, leaving artwork untouched. */
.slide-picture{position:relative;display:block;height:100%;max-width:100%;aspect-ratio:1086 / 1448;min-height:0;}
.slide-picture #slide-image{display:block;width:100%;height:100%;object-fit:contain;}
#animated-pip,#still-pip{position:absolute;z-index:2;bottom:0.5%;left:1%;width:39%;height:auto;object-fit:contain;filter:drop-shadow(0px 5px 4px rgba(0,0,0,.23));pointer-events:none;box-shadow:none!important;border-radius:0!important;}
.slide-controls>button:disabled{cursor:default;}
.slide-controls>button.ready{animation:soft-bounce 1.8s ease-in-out infinite;}
@media(prefers-reduced-motion:reduce){.slide-controls>button.ready{animation:none}}

/* Dinosaur Valley: full multi-dinosaur illustrated selection scene. */
#dino-valley{overflow:auto;background:linear-gradient(#72d9f9,#b9f5a9);}
.dino-valley-layout{min-height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:12px}
.dino-valley-layout>.valley-bar{flex:0 0 auto;width:min(98%,1350px)}
.valley-scene{position:relative;width:min(100%,1350px);aspect-ratio:1536/530;flex:0 0 auto;box-shadow:0 10px 28px #21583960;border:5px solid #ffe4a3;border-radius:22px;overflow:hidden;background:#7ecb79}
.valley-scene>img{width:100%;height:100%;display:block;object-fit:fill;pointer-events:none;user-select:none}
.valley-hotspots{position:absolute;inset:0;width:100%;height:100%}
.dino-hotspot{fill:transparent;stroke:transparent;pointer-events:all;cursor:pointer;}
.dino-hotspot:focus-visible{stroke:#ffca39;stroke-width:11;stroke-opacity:.95;}
.dino-hotspot:active{stroke:#ffe35a;stroke-width:9;stroke-opacity:.75;fill:#fff6a51f}
.valley-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;width:min(98%,1350px);padding:12px 18px;border-radius:24px;background:#fff9ddef;box-shadow:0 4px 12px #184f2840;color:#285b36;font-size:clamp(14px,2.3vw,23px);font-weight:750;text-align:left}
.valley-ready{display:block;white-space:nowrap;background:#ffd75b;padding:8px 12px;border-radius:999px;color:#67410b;font-size:clamp(11px,1.8vw,18px)}
@media(max-width:650px){.valley-footer{flex-direction:column;text-align:center}.valley-ready{font-size:12px}.valley-scene{border-width:3px}}
@media(max-height:600px) and (min-width:760px){.dino-valley-layout{gap:6px;padding-top:4px;padding-bottom:4px}.valley-bar{padding:5px 10px}.valley-footer{padding:5px 12px}.valley-scene{width:min(100%,calc((100dvh - 130px)*1536/530));}}

/* Valley level 1: full-height panorama with native horizontal scrolling.
   Image and SVG overlay share the same fixed coordinate box; hitboxes remain aligned. */
#dino-valley{overflow:hidden;padding:0;background:#4ec7ef}
.valley-scroll{width:100vw;height:100dvh;display:flex;align-items:center;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x}
.valley-scroll::-webkit-scrollbar{display:none}
#dino-valley .valley-scene{width:max(100vw,min(120vw,210dvh));height:auto;max-width:none;aspect-ratio:1536 / 530;flex:0 0 auto;position:relative;margin:auto;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:#62cbe9}
#dino-valley .valley-scene>img{width:100%;height:100%;object-fit:fill;border-radius:0}
#dino-valley .valley-hotspots{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#dino-valley .dino-hotspot{pointer-events:all;fill:transparent;stroke:transparent;cursor:pointer}
#dino-valley .dino-hotspot:focus-visible{stroke:#ffe176;stroke-width:9;stroke-opacity:0.85}
.valley-corner-back,.valley-level-badge{position:fixed;z-index:24;top:max(16px,env(safe-area-inset-top));display:grid;place-items:center;width:clamp(50px,7vw,68px);height:clamp(50px,7vw,68px);border-radius:50%;background:#ffe16b;color:#613900;box-shadow:0 4px 14px #293e4566;border:3px solid #fff9d5;font-size:clamp(25px,3vw,33px);font-weight:900}
.valley-corner-back{left:max(16px,env(safe-area-inset-left));cursor:pointer}
.valley-level-badge{right:max(16px,env(safe-area-inset-right));pointer-events:none}

/* Approved 1448 × 1086 Valley artwork. Entire image is ALWAYS visible; no cover/crop. */
#dino-valley{position:fixed;inset:0;overflow:hidden;display:grid;place-items:center;background:#65ccec;}
#dino-valley .valley-stage{position:relative;width:min(100vw,calc(100dvh * 1448 / 1086));height:auto;aspect-ratio:1448/1086;max-width:100vw;max-height:100dvh;margin:auto;box-shadow:none;border:0;border-radius:0;overflow:hidden;}
#dino-valley .valley-stage>img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;display:block;pointer-events:none;user-select:none;}
#dino-valley .valley-stage>.valley-hotspots{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}
#dino-valley .valley-stage .dino-hotspot{fill:transparent;stroke:transparent;pointer-events:all;cursor:pointer;}
#dino-valley .valley-stage .dino-hotspot:focus-visible{stroke:#ffdc4a;stroke-width:9;}
.valley-feedback{position:fixed;bottom:max(18px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:#fff9dcee;border-radius:18px;padding:0;max-width:80vw;opacity:0;pointer-events:none;color:#4b3515;font-size:clamp(17px,2.5vw,25px);font-weight:800;box-shadow:0 5px 18px #27381844;transition:opacity .25s;}
.valley-feedback.visible{padding:14px 18px;opacity:1;}

/* Dinosaur Valley stays visually label-free; keep accessible announcements offscreen. */
#dino-valley .valley-feedback,#dino-valley .valley-feedback.visible{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;opacity:0!important;pointer-events:none!important;}

/* Clean slideshow controls: arrows only, no text labels or narrator captions. */
.slide-controls{justify-content:space-between;min-height:64px;background:transparent;box-shadow:none;padding:4px 8px}

/* Slide navigation maps to the arrows ALREADY DRAWN in the approved slide PNGs.
   The buttons are transparent touch zones, scaled with the 1086x1448 artwork. */
.slide-picture .art-arrow {
  position:absolute;z-index:5;display:block;border:0;padding:0;margin:0;
  appearance:none;-webkit-appearance:none;background:transparent;box-shadow:none;
  cursor:pointer;touch-action:manipulation;border-radius:50%;
  -webkit-tap-highlight-color:transparent;
}
.slide-picture .art-next {right:3.6%;bottom:2.6%;width:22%;height:17%;}
.slide-picture .art-prev {left:3.1%;top:7.2%;width:17%;height:13%;}
.slide-picture .art-arrow:disabled {cursor:default;pointer-events:none;}
.slide-picture .art-arrow[hidden]{display:none!important;}
.slide-picture .art-arrow.ready::after {
    content: '';
    display: block;
    position: absolute;
    width: 65%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(255, 241, 115, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 14px 6px rgba(255, 227, 56, 0.65);
    animation: art-arrow-glow 1.8s ease-in-out infinite;
    pointer-events: none;
}

/* Triceratops */
.slide-picture[data-dino="triceratops"] .art-arrow.ready::after {
    top: 42%;
    left: 57%;
}

/* Stegosaurus */
.slide-picture[data-dino="stegosaurus"] .art-arrow.ready::after {
    top: 55%;
    left: 38%;
}


/* Draw the arrows inside the buttons */
.slide-picture[data-dino="pterodactyl"] .art-prev::before,
.slide-picture[data-dino="pterodactyl"] .art-next::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #754012;
    font-size: clamp(22px, 5vw, 48px);
    font-weight: bold;
    line-height: 1;
}

/* Global Back button — all dinosaurs */
.slide-picture .art-prev {
    left: 7%;
    top: -1%;
    width: 17%;
    height: 13%;
}

.slide-picture .art-arrow:focus-visible {outline:4px solid #ffffff;outline-offset:-3px;}
@keyframes art-arrow-glow {
    0%, 100% {
        opacity: .3;
        box-shadow: 0 0 10px 4px rgba(255, 227, 56, .45);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 18px 8px rgba(255, 227, 56, .8);
    }
}
@media(prefers-reduced-motion:reduce){.slide-picture .art-arrow.ready::after{animation:none;opacity:.85}}

/* Pterodactyl — Back button */
.slide-picture[data-dino="pterodactyl"] .art-prev {
    top: 4%;
}

/* Pterodactyl — Next arrow glow */
.slide-picture[data-dino="pterodactyl"] .art-next.ready::after {
    top: 25%;
    left: 53%;
}


/* Layered portrait activity (opt-in). Reference artboard: EXACTLY 1200 x 1600 (3:4).
   Legacy dinosaur slides are completely unaffected unless .is-layered is present. */
.slide-picture.is-layered { aspect-ratio:896 / 1200; isolation:isolate; overflow:hidden; border-radius:17px; background:#83d9ed; }
.slide-picture.is-layered #slide-image { width:100%;height:100%;object-fit:contain; border-radius:0;box-shadow:none; }
.slide-picture .layered-slide-banner,.slide-picture .layered-slide-count {display:none;}
.slide-picture.is-layered .layered-slide-banner {
  display:flex;align-items:center;justify-content:center;position:absolute;
  z-index:3;top:2.2%;left:21%;width:58%;height:9.2%;
  background:url('./assets/ui/slide-banner.svg') center/100% 100% no-repeat;
  padding:0 6%;text-align:center;pointer-events:none;
}
.slide-picture.is-layered #slide-banner-title {
  font-weight:900;font-size:clamp(12px,2.25vw,30px);line-height:1.04;
  letter-spacing:-.025em;color:#643b16;text-shadow:0 1px 1px #fff4d5;
}
.slide-picture.is-layered .layered-slide-count {
  display:grid;place-items:center;position:absolute;z-index:3;top:12%;right:3%;
  min-width:11%;height:3.5%;border-radius:999px;background:#fff4ccde;
  color:#69431d;font-size:clamp(9px,1.3vw,17px);font-weight:850;pointer-events:none;
}
/* Clickable controls are the visible shared illustrated assets. */
.slide-picture.is-layered .art-prev,.slide-picture.is-layered .art-next {
  position:absolute;z-index:5;background-position:center;background-repeat:no-repeat;
  background-size:contain;border-radius:50%;height:auto;aspect-ratio:1/1;
  -webkit-tap-highlight-color:transparent;
}
.slide-picture.is-layered .art-prev {top:2.2%;left:3%;width:16%;background-image:url('./assets/ui/back-arrow.svg');}
.slide-picture.is-layered .art-next {bottom:3%;right:3%;width:20%;background-image:url('./assets/ui/next-arrow.svg');}
.slide-picture.is-layered .art-prev::before,.slide-picture.is-layered .art-next::before {content:none;}
.slide-picture.is-layered .art-next.ready::after {
  top:50%;left:50%;width:76%;box-sizing:border-box;border-width:4px;
}
/* Layered art always uses shared controls: no dinosaur-specific hotspot tuning. */
@media(max-width:700px){.slide-picture.is-layered #slide-banner-title{font-size:clamp(12px,3.6vw,24px);}}

/* Layered title banner correction — v2 */
/* Layered slide title: long labels must remain inside the illustrated sign. */
.slide-picture.is-layered {
  container-type: inline-size;
}
.slide-picture.is-layered .layered-slide-banner {
  top: 2.2%;
  left: 20%;
  width: 76%;
  height: 9.2%;
  padding: 0 5%;
  box-sizing: border-box;
  overflow: hidden;
}
.slide-picture.is-layered #slide-banner-title {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(11px, 4.15cqw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: #6b3510;
  text-shadow: 0 1px 0 #fff1b6, 0 2px 1px #e9ac50;
}
/* Override the previous mobile rule without affecting legacy dinosaur slides. */
@media(max-width:700px) {
  .slide-picture.is-layered #slide-banner-title {
    font-size: clamp(11px, 4.15cqw, 42px);
  }
}

/* Owner-supplied banner PNG overlay — v1 */
/* Custom Little Explorers wooden label supplied by the project owner. */
.slide-picture.is-layered .layered-slide-banner {
  top: 2.2%;
  left: 20%;
  width: 76%;
  height: 10.25%;
  padding: 0 7%;
  box-sizing: border-box;
  background: url('./assets/ui/slide-banner.png') center / contain no-repeat;
  overflow: hidden;
}
.slide-picture.is-layered #slide-banner-title {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(11px, 4.15cqw, 42px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
  color: #603717;
  text-shadow: 0 1px 0 #ffe2a1;
}
@media(max-width:700px) {
  .slide-picture.is-layered #slide-banner-title {
    font-size: clamp(11px, 4.15cqw, 42px);
  }
}

/* Layered slides — prominent wooden banner titles */
.slide-picture.is-layered {
    container-type: inline-size;
}

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@700&display=swap');

.slide-picture.is-layered #slide-banner-title {
    /* 1. Playful Web Font (See Google Font option below) */
    font-family: "Fredoka", "Arial Rounded MT Bold", "Arial Black", sans-serif;
    font-size: 36px; /* Slightly larger to mimic the thick header scale */
    font-weight: 700; /* Fredoka's max weight is 700 but behaves very chunky */
    line-height: 1;
    letter-spacing: -0.01em; /* Reduced squeeze; let the letters breathe slightly */
    white-space: nowrap;

    color: #ffffff;

    /* 2. Thicker Text Stroke */
    -webkit-text-stroke: 3px #623713; /* Increased from 1.5px to match the heavy outer borders */
    paint-order: stroke fill; /* CRITICAL: Prevents the thick stroke from eating inside the white letters */

    /* 3. Enhanced 3D Offset & Soft Drop Shadow */
    text-shadow:
        0px 4px 0px #623713, /* Solid 3D under-block */
        0px 6px 8px rgba(35, 18, 5, 0.55); /* Deeper, softer ambient shadow below the banner */
}
