/* Vertical world: layers, characters, hazards' helpers, title, hints, hit flash, and the map overlay.
   Works on top of base.css (#stage, #hero, #light, #shadow, .grade, .vig, .grain). Same palette as the rest of the game. */
.wstage{position:relative;overflow:hidden}
.wlayers{position:absolute;inset:0;overflow:hidden}
.wl{position:absolute;left:0;top:0;will-change:transform;max-width:none}
.wl-back{opacity:1}
.wfx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.wflash{position:absolute;inset:0;pointer-events:none;opacity:0;background:radial-gradient(ellipse at 50% 55%, rgba(255,233,199,.55), rgba(242,166,90,.35) 60%, rgba(242,166,90,.1));mix-blend-mode:screen}
.wfade{position:absolute;inset:0;pointer-events:none;background:#03080A;opacity:0;transition:opacity .25s ease}
.wfade.on{opacity:1}
.wfog{animation:wfogdrift 90s ease-in-out infinite alternate}
@keyframes wfogdrift{from{transform:translateX(-90px)}to{transform:translateX(90px)}}

/* title (2 s) and key hints (once) */
.wtitle,.whint{position:absolute;left:50%;transform:translateX(-50%);text-align:center;pointer-events:none;opacity:0;transition:opacity .5s ease;color:var(--bone);text-shadow:0 2px 12px rgba(0,0,0,.9)}
.wtitle{top:11%;font-family:var(--serif);font-size:clamp(28px,4.4vh,46px);font-style:italic;font-weight:500;letter-spacing:.02em}
.whint{bottom:9%;font-family:var(--mono);font-size:clamp(13px,1.9vh,17px);color:#FFE9C7;padding:7px 16px;border:1px solid var(--line);border-radius:999px;background:rgba(8,20,22,.78)}
.wtitle.on,.whint.on{opacity:1}

/* places and collectibles */
.place .marker{animation:wbob 1.8s ease-in-out infinite;opacity:.65}
.place.near .marker{opacity:1;animation-duration:.7s;filter:drop-shadow(0 0 6px rgba(242,166,90,.9))}
.exitup .marker{animation:wbob 2s ease-in-out infinite}
.collect .bob{animation:wbob 2.2s ease-in-out infinite}
@keyframes wbob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.bulb{animation:tw 3.2s ease-in-out infinite}

/* residents and spectators: small idle loops built from the groups body, head, arm-l, arm-r, legs, prop */
.ch [class*="ch-"]{transform-box:fill-box}
.ch .ch-body{transform-origin:50% 100%;animation:chBreathe calc(4.2s * var(--dd,1)) ease-in-out var(--d,0s) infinite}
.ch .ch-head{transform-origin:50% 100%;animation:chHead calc(5.6s * var(--dd,1)) ease-in-out var(--d,0s) infinite}
.ch .ch-arm-l{transform-origin:50% 8%;animation:chArm calc(6.4s * var(--dd,1)) ease-in-out var(--d,0s) infinite}
.ch .ch-arm-r{transform-origin:50% 8%;animation:chArm calc(7.1s * var(--dd,1)) ease-in-out calc(var(--d,0s) - 1.3s) infinite reverse}
.ch .ch-prop{transform-origin:50% 0%;animation:chSway calc(5s * var(--dd,1)) ease-in-out var(--d,0s) infinite}
.ch.t-smlouva .ch-arm-r{transform-origin:50% 8%;animation:chHaggle 1.7s ease-in-out var(--d,0s) infinite}
.ch.t-rozhlizi .ch-head{animation:chLook 6s ease-in-out var(--d,0s) infinite}
.ch.cheer .ch-arm-l{animation:chCheerL .46s ease-in-out infinite alternate}
.ch.cheer .ch-arm-r{animation:chCheerR .46s ease-in-out .08s infinite alternate}
.ch.cheer .ch-body{animation:chJump .46s ease-in-out infinite alternate}
.ch.cheer .ch-head{animation:chJump .46s ease-in-out .05s infinite alternate}
.ch.flinch .ch-body{animation:chFlinch .5s ease-out 1}
.ch.flinch .ch-head{animation:chFlinchHead .5s ease-out 1}
.ch.flinch .ch-arm-l,.ch.flinch .ch-arm-r{animation:chGuard .5s ease-out forwards}
@keyframes chBreathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.012,1.02)}}
@keyframes chHead{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2.5deg) translateY(-1px)}}
@keyframes chArm{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(4deg)}}
@keyframes chSway{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(3deg)}}
@keyframes chHaggle{0%,100%{transform:rotate(0)}30%{transform:rotate(-34deg)}60%{transform:rotate(-12deg)}}
@keyframes chLook{0%,35%,100%{transform:rotate(0)}45%,65%{transform:rotate(-9deg) translateX(-1px)}75%,90%{transform:rotate(8deg)}}
@keyframes chCheerL{from{transform:translateY(-6px) rotate(-150deg)}to{transform:translateY(-16px) rotate(-178deg)}}
@keyframes chCheerR{from{transform:translateY(-6px) rotate(150deg)}to{transform:translateY(-16px) rotate(178deg)}}
@keyframes chJump{from{transform:translateY(0)}to{transform:translateY(-9px)}}
@keyframes chFlinch{0%{transform:translateY(0) scale(1,1)}25%{transform:translateY(5px) scale(1.05,.9)}100%{transform:translateY(0) scale(1,1)}}
@keyframes chFlinchHead{0%{transform:translateY(0)}25%{transform:translateY(6px) rotate(-8deg)}100%{transform:translateY(0)}}
@keyframes chGuard{0%{transform:rotate(0)}25%{transform:rotate(-70deg)}100%{transform:rotate(-30deg)}}
.ch.ch-spec.flinch .ch-arm-r{animation-name:chGuardR}
@keyframes chGuardR{0%{transform:rotate(0)}25%{transform:rotate(70deg)}100%{transform:rotate(30deg)}}
@media (prefers-reduced-motion: reduce){
  .ch .ch-body,.ch .ch-head,.ch .ch-arm-l,.ch .ch-arm-r,.ch .ch-prop,.wfog,.place .marker,.exitup .marker,.collect .bob,.bulb{animation:none}
  .ch.cheer .ch-arm-l{animation:none;transform:translateY(-10px) rotate(-165deg)}
  .ch.cheer .ch-arm-r{animation:none;transform:translateY(-10px) rotate(165deg)}
  .ch.flinch .ch-body,.ch.flinch .ch-head,.ch.flinch .ch-arm-l,.ch.flinch .ch-arm-r{animation:none}
  .wtitle,.whint,.wfade{transition:none}
}

/* ---------------------------------------------------------------- the map */
.map-overlay{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 50% 45%,rgba(6,18,22,.9),rgba(2,6,8,.96));opacity:0;transition:opacity .18s ease-out}
.map-overlay[hidden]{display:none}
.map-overlay.on{opacity:1;transition-duration:.3s}
.map-card{height:min(95%,940px);aspect-ratio:1280/770;max-width:98%;transform:scale(.96);transition:transform .18s cubic-bezier(.16,1,.3,1);filter:drop-shadow(0 18px 50px rgba(0,0,0,.65))}
.map-overlay.on .map-card{transform:none;transition-duration:.4s}
.map-svg{display:block;width:100%;height:100%}
.mp-name{font-family:var(--serif);font-style:italic;font-weight:600;font-size:27px;letter-spacing:.01em;fill:var(--bone);paint-order:stroke;stroke:#04100F;stroke-width:5px;stroke-linejoin:round}
.mp-name.dim{fill:#CFC8B4;opacity:.78;font-weight:500}
.mp-node.camp.clickable{cursor:pointer}
.mp-node.camp.clickable:hover .mp-lit{filter:brightness(1.25) drop-shadow(0 0 10px rgba(242,166,90,.6))}
.mp-route{filter:drop-shadow(0 0 4px rgba(242,166,90,.85));animation:mproute 1.4s linear infinite}
.mp-beacon .halo,.mp-hero .halo{transform-box:fill-box;transform-origin:center}
.mp-beacon .halo{animation:mpbeacon 2.6s ease-in-out infinite}
.mp-beacon .ring{transform-box:fill-box;transform-origin:center;animation:mpring 2.6s ease-out infinite}
.mp-beacon .ring.r2{animation-delay:1.3s}
.mp-hero .halo{animation:mphero 3.2s ease-in-out infinite}
.mp-rim{animation:mprim 3.2s ease-in-out infinite}
.mp-spread{animation:mpspread 1.5s cubic-bezier(.16,1,.3,1) .5s both}
.mp-wash{transform-box:fill-box;transform-origin:center;animation:mpwash 1.5s ease-out .5s both}
.mp-node.fresh .mp-chalk{animation:mpchalk 1.6s ease-out .5s both}
.mp-node.fresh .mp-chalk.in{animation:mpchalkin 1.4s ease-out .5s both}
.map-lens .mp-spread,.map-lens .mp-wash{animation-delay:.25s}
@keyframes mproute{to{stroke-dashoffset:-9.1}}
@keyframes mpbeacon{0%,100%{transform:scale(.8);opacity:.6}50%{transform:scale(1.15);opacity:1}}
@keyframes mpring{0%{transform:scale(.5);opacity:.9}100%{transform:scale(2.1);opacity:0}}
@keyframes mphero{0%,100%{transform:scale(.92);opacity:.75}50%{transform:scale(1.06);opacity:1}}
@keyframes mprim{0%,100%{opacity:.35}50%{opacity:.8}}
@keyframes mpspread{from{r:0px}to{r:400px}}
@keyframes mpwash{0%{opacity:0;transform:scale(.3)}35%{opacity:.8}100%{opacity:0;transform:scale(2.2)}}
@keyframes mpchalk{0%{opacity:1}100%{opacity:0}}
@keyframes mpchalkin{0%{opacity:0}100%{opacity:1}}

/* the lens: the chamber that was just revealed, round, top right (clear of the room title in the middle) */
.map-lens{position:absolute;top:22px;right:22px;z-index:25;width:min(196px,20vw);aspect-ratio:1;border-radius:50%;overflow:hidden;background:#04100F;box-shadow:0 0 0 2px #2B4A4B,0 0 0 5px rgba(4,16,15,.9),0 0 0 6px rgba(233,228,212,.28),0 0 34px rgba(242,166,90,.3),0 12px 40px rgba(0,0,0,.65);opacity:0;pointer-events:none}
.map-lens[hidden]{display:none}
.map-lens svg{display:block;width:100%;height:100%}
.map-lens.show{animation:mplens 2.6s cubic-bezier(.16,1,.3,1) forwards}
@keyframes mplens{0%{opacity:0;transform:scale(.7)}14%{opacity:1;transform:none}82%{opacity:1;transform:none}100%{opacity:0;transform:scale(.94)}}
@media (max-width:1000px){.map-lens{width:min(130px,22vw)}}
@media (prefers-reduced-motion: reduce){
  .mp-route,.mp-beacon .halo,.mp-beacon .ring,.mp-hero .halo,.mp-rim,.mp-wash{animation:none}
  .mp-beacon .ring{opacity:.5}
  .mp-spread{animation:none;r:400px}
  .mp-node.fresh .mp-chalk,.mp-node.fresh .mp-chalk.in{animation:none}
  .mp-node.fresh .mp-chalk:not(.in){opacity:0}
  .map-overlay,.map-card{transition:none}
  .map-lens.show{animation:mplensr 2.6s linear forwards}
  @keyframes mplensr{0%{opacity:0}8%,86%{opacity:1}100%{opacity:0}}
}
