/* What this is: reserved articulated-character space and readable activity poses for families. */
.character-stage{display:block;position:relative;isolation:isolate;max-width:100%;}
.character-stage>img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:contain;}
.character-stage[data-rig-ready=true]>img{visibility:hidden;animation:none!important;}
.character-stage>.rig-svg{display:block;width:100%;height:100%;overflow:visible;}
.character-caption{display:block;position:relative;font-family:inherit;font-weight:500;font-size:.75rem;line-height:inherit;color:var(--muted);text-align:center;margin:3px auto;max-width:28ch;}
.observatory-dome .character-stage{position:absolute;width:330px;height:280px;bottom:4px;left:7px;z-index:2;}
.observatory-dome .character-caption{display:none;}
.room-art .character-stage{position:absolute;width:100%;height:100%;left:0;top:0;z-index:1;}
.room-art .character-caption{display:none;}
.companion-image .character-stage{width:100%;height:100%;}
.companion-image{height:205px;margin-bottom:33px;}
.habitat .character-stage{height:170px;margin-bottom:35px;}
.completion-sky .character-stage{position:absolute;width:280px;height:230px;left:calc(50% - 140px);top:5px;}
.completion-sky .character-caption{position:relative;inset:auto;font-size:.75rem;color:var(--muted);}
.completion-sky.celebrate:has(.rig-svg){animation:none;}
.story-cast .character-stage{width:100%;max-width:245px;height:140px;margin:auto auto 22px;}
#storyActor .character-stage{width:112px;height:100px;margin:auto;}
#storyActor .character-caption{display:none;}
.character-caption [lang]{display:block;}
.character-caption [lang=th]{letter-spacing:normal;word-spacing:normal;}
#storiesDialog .story-scene .character-caption{color:#f0f7ff;background:#111a31;border-radius:6px;padding:4px 8px;}
@media(max-width:1000px){.habitat .character-stage{height:180px;}}
@media(max-width:720px){.companion-image{height:220px;max-width:260px;margin:10px auto 40px;}.story-cast .character-stage{height:125px;}#storyActor .character-stage{width:88px;height:80px;}}
@media(max-width:420px){.observatory{position:relative!important;right:auto!important;top:auto!important;transform:none!important;opacity:1!important;width:100%!important;height:270px!important;margin:10px auto!important;}.observatory-dome .character-stage{width:100%;left:0;height:250px;}.arrival-copy{padding-right:0!important;}.observatory-dome{width:100%;}.room-art .character-stage{width:100%;height:100%;left:0;top:0;}.habitat .character-stage{height:170px;}.companion-image{height:205px;}.story-cast .character-stage{height:130px;}#storyActor .character-stage{width:80px;height:75px;}}
@media(forced-colors:active){.character-caption,#storiesDialog .story-scene .character-caption{color:CanvasText;background:Canvas;}.rig-svg{forced-color-adjust:none;}.character-stage{border:1px solid CanvasText;}}
@media print{.character-stage .rig-svg{display:none!important;}.character-stage>img{visibility:visible!important;}.character-caption{display:none;}}

/* Captions participate in layout and inherit every shared reading size/font. */
.character-caption{line-height:var(--studio-leading,1.55);}
.companion-image{height:auto;margin-bottom:16px;}
.companion-image .character-stage{height:auto;}
.companion-image .rig-svg{height:205px;}
.character-stage[data-character-media=true]>.rig-svg{display:none;}
.character-media{display:block;height:205px;position:relative;}
.character-media>img,.character-media>video{display:block;width:100%;height:100%;object-fit:contain;border-radius:12px;}
.character-media>[hidden]{display:none;}
@media print{.character-media{display:none!important;}}
.habitat .character-stage{height:auto;margin-bottom:16px;}
.habitat .rig-svg{height:170px;}
.story-cast .character-stage{height:auto;margin-bottom:16px;}
.story-cast .rig-svg{height:140px;}
@media(max-width:720px){.companion-image .rig-svg{height:220px;}.story-cast .rig-svg{height:125px;}}
@media(max-width:720px){.character-media{height:220px;}}

/* Accepted ambient media stays in each surface's reserved character space. */
.habitat .character-media{height:170px;}
.completion-sky .character-stage>.character-media{position:relative;inset:auto;width:100%;height:230px;}
@media(max-width:1000px){.habitat .character-media{height:180px;}}
@media(max-width:420px){.habitat .character-media{height:170px;}}

/* Moon Seeds uses finite role media in reserved space beside app-owned quantities. */
#storiesDialog .story-action-stage:has(.luma-moon-seeds){grid-template-columns:115px minmax(0,1fr);}
#storyActor .character-stage:has(.luma-moon-seeds){width:115px;height:115px;}
#storiesDialog .luma-moon-seeds{height:175px;}
#storiesDialog #storyActor .luma-moon-seeds{height:115px;}
#storiesDialog .luma-moon-seeds>img,#storiesDialog .luma-moon-seeds>video{width:100%;max-width:none;height:100%;margin:0;filter:none;}
#storiesDialog .luma-moon-seeds[hidden]{display:none;}
@media print{#storiesDialog .luma-moon-seeds{display:none!important;}}

/* Emberwing home and room media occupy their existing reserved stage. */
.observatory-dome .emberwing-tending,.room-art :is(.emberwing-tending,.puffclaw-tray-attention){width:100%;height:100%;}
.observatory-dome .emberwing-tending>img,.observatory-dome .emberwing-tending>video,.room-art :is(.emberwing-tending,.puffclaw-tray-attention)>img,.room-art :is(.emberwing-tending,.puffclaw-tray-attention)>video{position:static;inset:auto;width:100%;height:100%;max-width:none;margin:0;object-fit:contain;}

/* Completion reserves both the native image and its reading-size caption. */
.completion-sky:has(:is(.emberwing-tending,.puffclaw-tray-attention,.driftwhisker-cloud-rest,.tessel-mosaic-attention)){height:auto;}
.completion-sky:has(:is(.emberwing-tending,.puffclaw-tray-attention,.driftwhisker-cloud-rest,.tessel-mosaic-attention))>.character-stage{position:relative;inset:auto;width:280px;height:auto;margin:auto;}
.completion-sky :is(.emberwing-tending,.puffclaw-tray-attention,.driftwhisker-cloud-rest,.tessel-mosaic-attention)>img,.completion-sky :is(.emberwing-tending,.puffclaw-tray-attention,.driftwhisker-cloud-rest,.tessel-mosaic-attention)>video{position:static;inset:auto;width:100%;height:100%;}
.completion-sky:has(:is(.emberwing-tending,.puffclaw-tray-attention,.driftwhisker-cloud-rest,.tessel-mosaic-attention)) .character-caption>span{position:static;inset:auto;color:inherit;font-size:inherit;}

/* Lanterns supporting cast keeps native media beside the app-owned delivery. */
#storiesDialog .emberwing-lanterns{height:175px;}
#storiesDialog .emberwing-lanterns>img,#storiesDialog .emberwing-lanterns>video{width:100%;max-width:none;height:100%;margin:0;filter:none;}
#storiesDialog .emberwing-lanterns[hidden]{display:none;}
@media(max-width:600px){#storiesDialog .emberwing-lanterns{height:115px;}}

/* Puffclaw Lanterns keeps the authored cargo outside its finite media. */
#storyActor .character-stage:has(.puffclaw-lanterns){width:115px;height:115px;}
#storiesDialog #storyActor .puffclaw-lanterns{height:115px;}
#storiesDialog #storyCast .puffclaw-lanterns{height:175px;}
#storiesDialog .puffclaw-lanterns>img,#storiesDialog .puffclaw-lanterns>video{width:100%;max-width:none;height:100%;margin:0;filter:none;}
#storiesDialog .puffclaw-lanterns[hidden]{display:none;}
@media(max-width:600px){#storiesDialog #storyCast .puffclaw-lanterns{height:115px;}}

#storiesDialog .story-action-stage:has(.puffclaw-lanterns){grid-template-columns:115px minmax(0,1fr);}
