/* Place illustrations and transparent standees share one stage. */
.novel-mode .narrative-shell{position:relative;display:block;max-width:1440px;height:100dvh;overflow:hidden;isolation:isolate;background:#17121b;--scene-header:128px}
.novel-scenery{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.novel-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.novel-cast{position:absolute;inset:var(--scene-header,128px) 0 0;--portrait-unit:calc((100dvh - var(--scene-header,128px) + 16px) / var(--body-heads));pointer-events:none}
/* One shared anatomical head unit, rather than a shared PNG width. Source
   bottoms extend beyond the stage: incomplete legs never float over the room. */
.novel-standee{position:absolute;display:block;top:calc(var(--portrait-offset,0px) + var(--portrait-unit) * var(--source-top));left:calc(var(--standee-centre) - var(--portrait-unit) * var(--source-centre));width:calc(var(--portrait-unit) * var(--source-width));height:auto;max-width:none;filter:drop-shadow(0 5px 12px #16101838);animation:none}
.novel-standee.is-partner{--standee-centre:28%}.novel-standee.is-self{--standee-centre:72%}
.novel-standee.is-listening{filter:brightness(.84) drop-shadow(0 5px 12px #16101838)}
.novel-cast.solo .novel-standee{--standee-centre:50%}
.novel-art-target{position:absolute;inset:0;z-index:1;border:0;border-radius:0;background:transparent;cursor:zoom-in}
.novel-art-target:focus-visible{outline:2px solid var(--gold);outline-offset:-4px}
.novel-mode .narrative-header{position:relative;z-index:3;padding:calc(12px + env(safe-area-inset-top)) 24px 24px;border:0;background:linear-gradient(#17121bf0,#17121bc7 65%,#17121b00);align-items:flex-start;gap:12px}
.novel-mode .narrative-header>div:first-child{flex:1;min-width:0}
.novel-mode .narrative-header h1{font-size:1.15rem;line-height:1.5}
.novel-mode .narrative-header-actions{gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:104px}
.novel-mode .narrative-position{width:100%;text-align:right}
.novel-mode .narrative-location{font-size:.875rem;color:#ecdee5;line-height:1.5;margin:5px 0 0}
.novel-mode .event-phase{font-size:.8125rem;line-height:1.5;margin-bottom:3px}
.novel-mode .narrative-scroll{position:relative;z-index:2;background:#19121dcf}
.novel-reading .narrative-scroll{position:absolute;left:max(16px,calc((100% - 900px)/2));right:max(16px,calc((100% - 900px)/2));bottom:0;overflow:visible;max-height:none;padding-bottom:calc(12px + env(safe-area-inset-bottom));background:transparent;pointer-events:none}
.novel-reading .rpg-text-window{pointer-events:auto;margin:0;padding:14px 18px;background:#1a1420ed;border:1px solid #d2bdcb85;border-radius:12px;box-shadow:0 8px 35px #0005;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.novel-reading .rpg-text-window{max-height:min(48dvh,max(72px,calc((100dvh - var(--scene-header,128px)) * .66 - var(--scene-controls,80px) - 20px)));overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.novel-reading .rpg-text-window p{font-size:1rem;line-height:1.65;margin:6px 0 0}
.novel-reading .rpg-name{font-size:.9375rem;line-height:1.5;margin:0;gap:10px}
.novel-reading .narrative-footer{display:block;padding:8px 0 0;pointer-events:auto}
.novel-choosing .narrative-scroll{position:absolute;bottom:0;left:0;right:0;max-height:65dvh;overflow:auto;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid #b99da366;box-shadow:0 -20px 45px #19121d80}
.novel-choosing .narrative-choice-intro{padding-top:12px;font-size:.875rem}
.novel-choosing .narrative-footer{padding-top:10px}
.novel-summary .narrative-shell{display:flex;flex-direction:column}
.novel-summary .narrative-scroll{flex:1;overflow:auto;min-height:0}
.novel-mode.event-opening-mode .narrative-shell{display:flex;flex-direction:column}
.novel-mode.event-opening-mode .narrative-scroll{flex:1;background:linear-gradient(#19121da8,#19121de8)}
.novel-mode.cinema-art-only .narrative-shell{display:block;padding:0}
.novel-mode.cinema-art-only .novel-cast{--scene-header:env(safe-area-inset-top,0px)}
.novel-mode.cinema-art-only .cinema-art-return{position:absolute;z-index:4;bottom:0;left:50%;transform:translateX(-50%);margin:0 0 calc(12px + env(safe-area-inset-bottom));white-space:nowrap}
.novel-daily{position:relative;width:100%;aspect-ratio:3/2;overflow:hidden;isolation:isolate}
.novel-daily .novel-cast{inset:0}
/* These source portraits end at the thighs. Fill past the lower frame edge, never float a cutout above the room floor. */
.novel-daily .novel-cast.solo .novel-standee{top:4%;left:50%;right:auto;width:auto;max-width:none;height:155%;transform:translateX(-50%);object-fit:contain;object-position:center top}
@keyframes standee-arrival{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:800px){
 .novel-mode .novel-cast{--portrait-unit:min(calc((100dvh - var(--scene-header,128px) + 16px) / var(--body-heads)),calc((100vw - 16px) / var(--cast-span)));--portrait-offset:max(0px,calc(100dvh - var(--scene-header,128px) + 16px - var(--portrait-unit) * var(--body-heads)))}
 .novel-reading:not(.cinema-art-only) .novel-cast,.novel-choosing .novel-cast{--portrait-offset:0px}
 .novel-choosing .narrative-scroll{max-height:56dvh;background:#19121df5}
 .novel-mode .narrative-header{padding:calc(8px + env(safe-area-inset-top)) 12px 20px;gap:8px}
 .novel-mode .narrative-header h1{font-size:1rem}
 .novel-mode .narrative-header-actions .icon-button{width:44px;height:44px;min-width:44px;min-height:44px}
 .novel-mode .narrative-header-actions{max-width:92px}
 .novel-mode .narrative-header span{font-size:.8125rem;line-height:1.5}
 .novel-mode .novel-standee{--standee-centre:50%}
 .novel-mode .novel-standee.is-listening{display:none}
 .novel-reading .narrative-scroll{left:12px;right:12px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}
 .novel-reading:not(.cinema-art-only) .narrative-scroll{left:0;right:0;height:44dvh;min-height:0;box-sizing:border-box;display:flex;flex-direction:column;gap:0;padding:12px 12px calc(10px + env(safe-area-inset-bottom));background:#19121df5;border-radius:14px 14px 0 0}
 .novel-reading:not(.cinema-art-only) .rpg-text-window{flex:1;min-height:0;box-sizing:border-box}
 .novel-reading:not(.cinema-art-only) .narrative-footer{flex-shrink:0}
 .novel-reading .rpg-text-window{padding:12px 14px}
 .novel-reading .rpg-text-window p{line-height:1.6}
 .novel-reading .rpg-name{font-size:.875rem}
 .novel-reading .narrative-footer{padding-top:6px}
}
@media(max-width:800px) and (max-height:650px) and (orientation:portrait){
 .novel-choosing .narrative-scroll{max-height:50dvh}
}
@media(max-height:520px) and (orientation:landscape){
 .novel-mode .novel-cast{right:48%}
 .novel-mode .novel-standee.is-listening{display:none}
 .novel-mode .novel-standee{--standee-centre:50%}
 .novel-reading .narrative-scroll{left:49%;right:14px;bottom:0}
 .novel-reading:not(.cinema-art-only) .narrative-scroll{left:49%;right:14px;height:calc(100dvh - var(--scene-header,80px) - 10px);padding-top:0}
 .novel-mode .narrative-header{padding-bottom:8px}
 .novel-mode .narrative-header-actions{max-width:none;flex-wrap:nowrap;align-items:center}
 .novel-mode .narrative-position{width:auto}
 .novel-reading .rpg-text-window p{font-size:.875rem;line-height:1.5}
 .novel-mode .narrative-location,.novel-mode .event-phase{display:none}
 .novel-mode.cinema-art-only .novel-cast{right:0}
 .novel-reading .rpg-text-window{max-height:max(72px,calc(100dvh - var(--scene-header,80px) - var(--scene-controls,80px) - 20px))}
}
@media(prefers-reduced-motion:reduce){.novel-standee{animation:none}}
.motion-paused .novel-standee{animation:none}
