/* Supplied chapter decoration; all layout, copy and image framing stays intact. */
#chapters .chapter-copy .chapter-atmosphere{left:-24px;bottom:-24px;width:calc(100% + 24px);height:auto;max-height:58%;object-fit:contain;object-position:left bottom;opacity:.2;filter:none}
#chapters .city-scene>img{filter:brightness(.54)}
#universe .universe-map-post:not(.is-card-owner) .universe-map-card{visibility:hidden;opacity:0;transition:none}
/* Ambient details sit in the same world, below the content cards. */
#universe .universe-residents,#universe .universe-walker,#universe .universe-pixel-coin{position:absolute;left:0;top:0;width:0;height:0;transform-origin:0 0;z-index:1}
#universe .universe-residents{padding:0;border:0;overflow:visible;cursor:pointer}
#universe .universe-residents>img{position:absolute;bottom:0;width:30px;height:auto;max-width:none;pointer-events:none;image-rendering:pixelated}
#universe .universe-residents>img:first-child{right:1px}#universe .universe-residents>img:nth-child(2){left:1px}
#universe .resident-dialogue{position:absolute;bottom:67px;left:0;transform:translateX(-50%);padding:1px 8px;background:#e8dfefed;color:#3d3548;border-radius:9px;font:12px/1.4 'DM Sans',sans-serif;white-space:nowrap;box-shadow:0 3px 9px #0002}
#universe .resident-dialogue::after{content:'';position:absolute;top:100%;left:45%;border:4px solid transparent;border-top-color:#e8dfefed}
#universe .resident-lines{display:none;font-size:9px;line-height:1.55;text-align:left;padding:5px 1px}
#universe .resident-lines>span{display:block}#universe .resident-lines b{font-weight:500;color:#79638b;margin-right:4px}
#universe .is-chatting .resident-ellipsis{display:none}#universe .is-chatting .resident-lines{display:block}
#universe .universe-residents:focus-visible{outline:none}#universe .universe-residents:focus-visible .resident-dialogue{outline:2px solid #bc9dea;outline-offset:3px}
#universe .universe-walker,#universe .universe-pixel-coin{pointer-events:none}
#universe .universe-walker>img{position:absolute;bottom:0;left:-17px;width:34px;max-width:none;height:auto;image-rendering:pixelated}
#universe .universe-pixel-coin>svg{position:absolute;bottom:17px;left:-14px;width:28px!important;height:28px!important}
#universe .resident-reward{position:absolute;left:-20px;bottom:70px;display:flex;align-items:center;gap:2px;font:10px 'DM Sans',sans-serif;color:#edd395;opacity:0;white-space:nowrap}
#universe .resident-reward-coin{width:15px;height:15px;display:block}
#universe .is-rewarded .resident-reward{animation:resident-reward 1.3s ease-out both}
#universe .is-dragging .universe-residents{pointer-events:none}
@keyframes resident-reward{0%{opacity:0;translate:0 0}20%{opacity:1}75%{opacity:1}100%{opacity:0;translate:0 -14px}}
/* Calm breathing has scale only: no vertical bounce. */
@keyframes creature-live{0%,100%{transform:scale(.975)}50%{transform:scale(1.065)}}
.site-creature #motif-message{scale:.94;transition:opacity .25s,scale .25s}
.site-creature.is-speaking #motif-message{scale:1}
@media(max-width:700px){#chapters .chapter-copy .chapter-atmosphere{left:-8px;bottom:-8px;width:90%;max-height:65%;opacity:.2}}
@media(prefers-reduced-motion:reduce){#universe .resident-reward{animation:none!important}.site-creature #motif-message{transition:none}}

/* One readable view per canonical item; spare wrapped copies stay secondary. */
#universe .universe-map-post.is-distant .universe-map-marker{visibility:hidden}
#universe .universe-map-post:not(.is-primary-copy) .universe-map-marker{opacity:.22}
#universe .universe-map-post.is-card-owner .universe-map-card{transform:scale(var(--card-readability,1));transform-origin:center bottom}
#universe .universe-footer>span.universe-drag{font:13px 'DM Sans',sans-serif;color:#a4aea7}
#universe .universe-residents{width:70px;height:80px;margin-left:-35px;margin-top:-80px;transform-origin:35px 80px}
#universe .universe-residents>img:first-child{left:4px;right:auto}
#universe .universe-residents>img:nth-child(2){left:36px}
#universe .resident-dialogue{left:50%}

#universe.universe-map,#universe.universe-map .universe-space{overflow:clip}

#universe .universe-map-plane{z-index:1}
#universe .universe-residents,#universe .universe-walker,#universe .universe-pixel-coin{z-index:0}
#universe .universe-map-plane{pointer-events:none}
#universe .universe-map-post{pointer-events:auto}

/* Dialogue alone lives above markers; character art and world position are unchanged. */
#universe .universe-dialogue-layer{position:absolute;left:0;top:0;width:0;height:0;transform-origin:0 0;z-index:10;pointer-events:none}
#universe .universe-dialogue-layer .resident-dialogue{left:0}
#universe .resident-lines{transition:opacity .15s ease}
#universe .resident-lines.is-fading{opacity:0}
@media(prefers-reduced-motion:reduce){#universe .resident-lines{transition:none}}

/* Whole entities, rather than cards alone, have a single visible world instance. */
#universe .universe-map-post:not(.is-card-owner){visibility:hidden!important;pointer-events:none}
#universe .universe-map-post.is-open .universe-map-card{pointer-events:auto}
#universe .universe-marker-face>img{width:100%;height:100%;object-fit:cover;border-radius:inherit;pointer-events:none}
#universe .universe-residents,#universe .universe-walker{z-index:5}
/* The supplied expression canvases share one fixed, unchanged anchor. */
.site-creature .creature-breathe>img{display:block;width:100%;height:auto}
#universe .universe-marker-face:has(>img){width:44px;height:44px;border-radius:50%;overflow:hidden}

/* Approved chapter text layout only; the current visuals and interactions stay in place. */
#chapters .chapter-copy h2{margin:24px 0}
#chapters .task-copy h2{margin:14px 0;font-size:clamp(38px,3.55vw,58px)}
#chapters .task-copy .chapter-support{line-height:1.5}
#chapters .chapter-three .chapter-body{grid-template-columns:52% 48%}
#chapters .belonging-copy{padding-right:24px}
#chapters .belonging-copy h2{font-size:clamp(28px,2.5vw,38px);max-width:none}
#chapters .belonging-copy h2>span{display:block}
#chapters .belonging-copy h2 em{font:inherit;white-space:nowrap}
#chapters .join-support{max-width:500px;font-size:14px;line-height:1.42}
#chapters .chapter-narrative{width:min(500px,100%);gap:0}
#chapters .chapter-narrative li{display:grid;grid-template-columns:minmax(96px,25%) 1fr;align-items:baseline;gap:24px;padding:13px 0;border-top:1px solid #ffffff18}
#chapters .chapter-narrative li:last-child{border-bottom:1px solid #ffffff18}
#chapters .chapter-narrative span{line-height:1.3}
@media(min-width:701px){
  #chapters .chapter-copy{height:100%}
  #chapters .chapter-narrative li{padding:15px 0}
  #chapters .chapter-narrative strong{font-size:10px;letter-spacing:1.5px}
  #chapters .chapter-narrative span{font-size:14.5px;line-height:1.35;color:#c4c8c6}
  #chapters .chapter-copy>.chapter-narrative{margin-top:auto;margin-bottom:var(--chapter-row-lift,clamp(60px,8vh,78px))}
  #chapters .chapter-one{--chapter-row-lift:clamp(96px,12vh,118px)}
  #chapters .chapter-two{--chapter-row-lift:clamp(64px,8vh,82px)}
  #chapters .chapter-three{--chapter-row-lift:clamp(18px,2.5vh,28px)}
  #chapters .chapter-copy>.chapter-support{font-size:clamp(15px,1.2vw,17px);line-height:1.5;color:#c9cdcb}
  /* Preserve the motif's original rendered width as Chapter 03's text column widens. */
  #chapters .chapter-three .chapter-atmosphere{width:82.6923077%}
  /* Keep the existing hint at its original lower-left anchor, independent of rows. */
  #chapters .chapter-copy>.city-scan-hint{position:absolute;bottom:25px;margin-top:0}
}
@media(min-width:701px) and (max-width:1100px){
  #chapters .chapter-three{--chapter-row-lift:0px}
  #chapters .chapter-three .chapter-atmosphere{width:88.4615385%}
}
@media(max-height:800px) and (min-width:701px){
  #chapters .task-copy h2{font-size:37px}
  #chapters .belonging-copy h2{font-size:30px}
}
@media(max-width:700px){
  #chapters .chapter-three .chapter-body{grid-template-columns:1fr}
  #chapters .belonging-copy{padding-right:8px}
  #chapters .belonging-copy h2{font-size:29px!important}
  #chapters .task-copy h2{font-size:31px!important;margin:8px 0}
  #chapters .task-copy .chapter-support{line-height:1.35}
  #chapters .join-support{font-size:11px;line-height:1.35}
  #chapters .chapter-narrative{display:grid;margin-top:14px;margin-bottom:0;gap:8px 10px}
  #chapters .chapter-narrative li{display:block;grid-template-columns:1fr;padding:7px 0}
  #chapters .chapter-narrative span{font-size:10px;line-height:1.3}
  #chapters .join-narrative span{font-size:9px;line-height:1.25}
}
@media(max-height:710px) and (max-width:700px){
  #chapters .task-copy h2{font-size:27px!important}
  #chapters .belonging-copy h2{font-size:26px!important}
}

/* Current pass: supplied foreground, attached speech tails, and heading copy. */
.hero-approved .layer-left{scale:.9;transform-origin:left bottom}
.site-creature #motif-message::after{left:-7px;top:50%;bottom:auto;width:18px;height:12px;transform:translateY(-50%);clip-path:polygon(100% 0,100% 100%,0 75%)}
.site-creature[data-bubble-side="left"] #motif-message::after{left:auto;right:-7px}
#universe .resident-dialogue::after{top:calc(100% - 1px);left:50%;width:40px;height:9px;border:0;background:#e8dfefed;transform:translateX(-50%);clip-path:polygon(35% 0,55% 0,10% 100%)}
#universe .resident-dialogue[data-speaker="right"]::after{clip-path:polygon(45% 0,65% 0,90% 100%)}
#universe .universe-heading{background:none;right:7%;width:auto;max-width:none}
#universe .universe-heading h2{width:auto;max-width:none;white-space:normal}
#universe .universe-heading p{width:auto;max-width:none;white-space:normal;font-weight:400}

/* New supplied resident groups, with independent hover bubbles above the map. */
#universe .universe-extra-scene{position:absolute;left:0;top:0;width:104px;height:84px;margin-left:-52px;margin-top:-84px;transform-origin:52px 84px;z-index:5;padding:0;border:0;background:none;overflow:visible;cursor:pointer}
#universe .universe-extra-scene>img{position:absolute;width:32px;height:auto;max-width:none;transform:translateX(-50%);image-rendering:pixelated;pointer-events:none}
#universe .universe-extra-scene:focus-visible{outline:1px solid #bca8dc;outline-offset:4px;border-radius:8px}
#universe .universe-extra-dialogue{position:absolute;left:0;top:0;width:0;height:0;transform-origin:0 0;z-index:10;pointer-events:none}
#universe .universe-extra-dialogue .resident-dialogue{left:0;bottom:84px;pointer-events:auto;min-width:90px}
#universe .universe-extra-dialogue .resident-dialogue::after{left:calc(50% + var(--speaker-x,0px));top:calc(100% - 1px);width:10px;height:9px;clip-path:polygon(0 0,100% 0,50% 100%)}
#universe .universe-extra-dialogue .resident-dialogue[hidden],#universe .universe-extra-scene[hidden],#universe .universe-extra-dialogue[hidden]{display:none}
#universe .is-dragging .universe-extra-scene{pointer-events:none}
