/* A game screen owns the available viewport. Artwork yields space before controls do. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
html,body{height:100%;overscroll-behavior:none}
body{overflow:hidden}
.cinema{height:100dvh;min-height:0;max-width: min(100%,max(360px,calc(100dvh * .5625)))}
.cinema .screen{height:100%;min-height:0;max-height:100%;overflow:clip}
.cinema .screen:not(.welcome):not(.opening-screen){--pad:clamp(16px,4vw,24px);padding:calc(68px + var(--safe-top)) var(--pad) calc(10px + var(--safe-bottom));gap:0;max-width:none;margin:0}
.cinema :is(.hero-choice-screen,.identity,.dream-screen,.experience-screen){display:flex;flex-direction:column}
.screen .chapter{font-size:9px;margin:0 0 8px}
.screen :is(.identity-heading,.dream-heading,.hero-heading,.experience-heading,.casting-heading){flex:none;min-height:0;padding:0}
.screen :is(.identity-heading,.dream-heading,.hero-heading,.experience-heading) h2{font-size:clamp(25px,3.7dvh,34px);line-height:1.13;margin:0}
.screen :is(.guest-session,.dream-footnote,.experience-note){margin:8px 0 0;font-size:9px;line-height:1.35}
.screen .guest-session{font-size:8px}
.screen .start-button{min-height:48px;padding:11px 12px;font-size:14px}
.screen :is(.identity-controls,.dream-bottom,.hero-choice-footer,.casting-footer,.experience-footer){flex:none}
.screen .identity-controls{padding-top:10px}
.screen .identity-status{min-height:16px;margin:7px 0;font-size:11px}
.screen .flow-back{left:18px}
.toolbar,.screen .flow-back{top:calc(12px + var(--safe-top))}
.welcome{padding-bottom:calc(10px + var(--safe-bottom))}
.welcome .title-composition{padding-top:0}
.entry{justify-content:space-between}
.entry .entry-heading h2{font-size:clamp(27px,4.8dvh,43px)}
.entry .entry-invitation{margin-bottom:12px}
.entry .account-choice{min-height:64px;padding-top:12px;padding-bottom:12px}
.entry .guest-choice{min-height:48px}
.entry .choice-note{margin:8px 0}
.entry .availability{margin:2px 0 0}
.casting .casting-heading h2{font-size:clamp(27px,4.6dvh,39px)}
.casting .casting-hint{margin-top:8px}
.casting .portrait-stage{flex:1 1 0;min-height:0;height:auto;margin-top:10px}
.casting .casting-footer{padding:5px 0 0}
.casting .selection-status{min-height:0;margin:4px 0 8px}
.hero-heading>p:last-child{margin:10px 0 0;font-size:12px;line-height:1.45}
.hero-choice-screen .ready-hero-choices{flex:1 1 0;min-height:0;margin:15px 0;align-items:stretch;max-height:400px}
.hero-choice-screen .ready-hero-choice{height:100%;min-height:0}
.hero-choice-screen .hero-choice-footer{margin-top:auto}
.hero-choice-footer p[role=status]{margin:0 0 8px;min-height:0}
.identity-name .identity-stage,.identity-traits .identity-stage{flex:1 1 0;min-height:0;height:auto;max-height:360px;margin:10px calc(-1 * var(--pad)) 0;container-type:size}
.identity-name .identity-hero,.identity-traits .identity-hero{--portrait-width:min(275px,90cqh);width:var(--portrait-width);left:calc(50% - var(--portrait-width)/2);height:100%}
.identity-name .identity-hero[data-gender=man],.identity-traits .identity-hero[data-gender=man]{width:100%;left:0}
.identity-name .identity-hero[data-gender=man] .static-hero-portrait,.identity-traits .identity-hero[data-gender=man] .static-hero-portrait{width:var(--portrait-width);left:calc(50% - var(--portrait-width)/2)}
.identity-name .identity-controls{margin-top:auto}
.identity .identity-dialogue{padding:9px 12px;left:14px;right:14px}
.identity .identity-line{font-size:17px;line-height:1.35;min-height:0}
.identity .identity-moment{font-size:10px;margin-bottom:5px}
#hero-name{font-size:26px;padding:8px;min-height:46px}
.traits-instruction{margin:0 auto 8px;font-size:11px;line-height:1.35}
.trait-choices{gap:6px}
.trait-choice{min-height:62px;padding:8px 17px 8px 9px}
.trait-choice strong{font-size:12px;line-height:1.2;overflow-wrap:anywhere}
.trait-description{font-size:11px;line-height:1.25;margin-top:4px}
.identity-traits .identity-status{margin:6px 0;min-height:16px}
#identity-ready .identity-stage{height:auto;flex:1 1 0;min-height:0;max-height:none;margin:8px calc(-1 * var(--pad)) 0;width:calc(100% + var(--pad)*2)}
#identity-ready .identity-controls{padding-top:8px}
#identity-ready .identity-name{font-size:26px;margin:0 0 3px}
#identity-ready .chosen-traits{font-size:12px;margin:0 0 8px}
#identity-ready .identity-promise{font-size:15px;line-height:1.35;margin:0 0 5px}
.identity-edit{gap:10px}
.identity-edit button{min-height:44px;padding:6px 4px;font-size:11px}
.identity-dream-next{margin-top:8px}
.sphere-stage{min-height:0;flex:1 1 0;margin:0 0 12px}
.sphere-caption{padding-top:10px}
.sphere-caption h3{font-size:26px}
.sphere-caption>p:last-child{margin-top:6px;font-size:12px}
.scene-count{margin-bottom:6px}
.sphere-choices{gap:6px;margin-bottom:10px}
.sphere-choice,.sphere-choice img{min-height:48px}
.sphere-choice img{width:42px}
.dream-invitation{margin-top:8px;font-size:12px}
.dream-breathing{min-height:0;flex:1 1 0;padding:10px 4px 12px}
.dream-breathing p{font-size:17px;line-height:1.35}
#dream-selected-detail{display:none}
.dream-options{gap:7px}
.dream-choice{min-height:72px;padding:10px;gap:10px}
.dream-choice strong{font-size:18px;line-height:1.15}
.dream-choice small{font-size:11px;line-height:1.3;margin-top:5px}
#dream-selection-status{min-height:14px;margin:8px 0}
.dream-confirmation .dream-actor-stage{height:auto;min-height:0;flex:1 1 0;margin:8px calc(-1 * var(--pad)) 0;container-type:size}
.dream-confirmation .dream-actor{width:min(520px,calc(100cqh * 1.7));height:auto;aspect-ratio:2/3}
.dream-confirmation .identity-name{font-size:26px;margin:4px 0 8px}
.dream-ready-line{font-size:16px;line-height:1.4;margin-bottom:8px}
.dream-kept{margin:6px 0;font-size:10px}
.experience-heading #experience-prologue{font-size:11px;line-height:1.4;margin:8px auto 0}
.experience-heading .experience-location{margin:7px 0 0;font-size:10px;line-height:1.35}
.experience-screen .experience-stage{flex:1 1 0;min-height:90px;max-height:300px;margin:5px calc(-1 * var(--pad)) 0}
.experience-object{min-height:0;height:calc(100% - 30px)}
.experience-side{top:5%;height:85px;width:64px}
.experience-side img{height:44px}
.experience-side span{width:44px;height:44px}
#experience-object-name{font-size:17px}
#experience-counter{margin-bottom:2px}
.experience-hint{margin:5px 0;font-size:9px;min-height:0}
.experience-objects{height:44px;min-height:44px;flex:none;margin-bottom:5px}
.experience-token{height:44px}
.experience-recollection{min-height:0;flex:none;padding:5px 0 8px}
#experience-narrator{margin-bottom:5px}
#experience-memory{font-size:15px;line-height:1.35;min-height:0;margin-bottom:7px}
#experience-title-item{font-size:12px;margin-bottom:3px}
#experience-benefit{font-size:10px;line-height:1.3}
.experience-screen .episode-start{margin-top:5px}
.experience-screen .experience-kept{font-size:17px;margin:0}
.experience-confirmed .experience-objects{min-height:0}

/* Compact portrait: retain every choice and its description; reclaim decorative gaps. */
@media(max-height:760px){
 .screen .chapter{font-size:8px;margin-bottom:6px}
 .cinema .screen:not(.welcome):not(.opening-screen){padding-top:calc(62px + var(--safe-top))}
 .screen :is(.identity-heading,.dream-heading,.hero-heading,.experience-heading) h2{font-size:26px}
 .screen .start-button{min-height:44px;padding:10px 12px}
 .screen .guest-session{margin-top:6px}
 .identity-traits .identity-stage{max-height:210px;margin-top:6px}
 .identity-traits .identity-hero{left:0;width:38%;--portrait-width:min(180px,100cqh)}
 .identity-traits .identity-hero:not([data-gender=man]) .static-hero-portrait{width:var(--portrait-width);left:calc(50% - var(--portrait-width)/2);overflow:visible}
 .identity-traits .identity-hero[data-gender=man]{left:0;width:38%}
 .identity-traits .identity-dialogue{left:38%;right:10px;top:50%;bottom:auto;transform:translateY(-50%);padding:7px 9px;background:linear-gradient(100deg,#111d2633,#111d26c9)}
 .identity-traits .identity-moment{font-size:9px;line-height:1.3}
 .identity-traits .identity-line{font-size:15px;line-height:1.3}
 .trait-choice{min-height:58px}
 .identity-controls{padding-top:6px!important}
 .dream-confirmation .identity-name,#identity-ready .identity-name{font-size:23px}
 .experience-heading .experience-location{display:none}
 .experience-heading h2{font-size:25px}
 .experience-recollection{padding-top:3px}
 #experience-memory{font-size:14px}
 .experience-footer .experience-note:not(.guest-session){margin-top:5px}
 .hero-heading>p:last-child{font-size:11px}
}
/* Wide, short viewports have room beside the scene, not below it. */
@media(orientation:landscape) and (max-height:600px){
 .cinema{width:100%;max-width:1000px;min-width:0}
 .cinema .screen:not(.welcome):not(.opening-screen){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-template-rows:auto minmax(0,1fr);column-gap:24px;padding:calc(60px + var(--safe-top)) max(18px,env(safe-area-inset-right)) calc(8px + var(--safe-bottom)) max(18px,env(safe-area-inset-left))}
 .screen :is(.identity-heading,.dream-heading,.hero-heading,.experience-heading,.casting-heading){grid-column:1;grid-row:1}
 .screen :is(.identity-stage,.portrait-stage,.ready-hero-choices,.sphere-stage,.dream-breathing,.dream-actor-stage){grid-column:1;grid-row:2;min-height:0;margin:0;max-height:none;width:100%}
 .screen :is(.identity-controls,.dream-bottom,.hero-choice-footer,.casting-footer,.entry-actions){grid-column:2;grid-row:1 / 3;align-self:center;margin:0;padding:0!important}
 .screen :is(.identity-heading,.dream-heading,.hero-heading,.experience-heading) h2,.casting .casting-heading h2{font-size:25px}
 .entry .entry-heading{align-self:center;grid-row:1 / 3}
 .entry .entry-heading h2{font-size:29px}
 .entry .entry-invitation{margin-bottom:6px;font-size:12px}
 .entry .account-choice{min-height:56px;padding:8px 12px}
 .entry .guest-choice{margin-top:8px;min-height:44px}
 .entry .choice-note{margin:5px 0;font-size:10px}
 .entry .login-link{min-height:44px;margin:0}
 .entry .availability{font-size:9px}
 .hero-choice-screen .ready-hero-choice{height:100%;border-radius:65px 65px 12px 12px}
 .hero-choice-screen .hero-heading>p:last-child{margin-top:5px}
 .hero-choice-screen .ready-hero-caption{font-size:12px;left:8px;right:8px;bottom:10px}
 .identity-traits .identity-hero,.identity-traits .identity-hero[data-gender=man]{width:100%;left:0;--portrait-width:min(215px,90cqh)}
 .identity-traits .identity-dialogue{left:8px;right:8px;top:auto;bottom:0;transform:none;background:linear-gradient(#111d26aa,#111d26f0)}
 .identity-traits .identity-moment{display:none}
 .identity-traits .identity-line{font-size:14px}
 .identity-traits .trait-choice{min-height:54px;padding:6px 17px 6px 8px}
 .identity-traits .trait-description{font-size:10px}
 .identity-traits .trait-choice strong{font-size:11px}
 .identity-traits .traits-instruction{margin-bottom:5px;font-size:10px}
 .identity-traits .identity-status{margin:4px 0;font-size:10px}
 #identity-ready .identity-stage{height:auto;width:100%;margin:6px 0 0}
 .dream-confirmation .dream-actor-stage{margin:6px 0 0}
 .dream-choice{padding:8px;min-height:63px}
 .dream-choice strong{font-size:17px}
 .dream-choice small{font-size:10px;margin-top:3px}
 .dream-footnote{font-size:9px!important}
 .sphere-caption h3{font-size:24px}
 .sphere-stage{margin-bottom:0}
 .cinema .experience-screen{grid-template-rows:auto minmax(0,1fr) auto auto}
 .experience-screen .experience-heading{grid-row:1;grid-column:1}
 .experience-screen .experience-stage{grid-row:2 / 5;grid-column:1;min-height:0;max-height:none;margin:5px 0 0}
 .experience-screen .experience-hint{grid-row:1;grid-column:2;align-self:end;margin:0 0 3px}
 .experience-screen .experience-objects{grid-row:2;grid-column:2;align-self:end;margin:0}
 .experience-screen .experience-recollection{grid-row:3;grid-column:2;padding:6px 0}
 .experience-screen .experience-footer{grid-row:4;grid-column:2}
 .experience-screen #experience-narrator{margin-bottom:3px}
 .experience-screen #experience-memory{font-size:13px;line-height:1.3;margin-bottom:5px}
 .experience-screen #experience-benefit{font-size:10px}
 .experience-screen .experience-note:not(.guest-session){margin-top:4px}
}
@media(max-height:550px) and (orientation:portrait),(max-height:360px) and (orientation:landscape){
 .dream-choice{min-height:48px;padding:8px 10px}
 .dream-choice small{display:none}
 #dream-scene-line{display:none}
 #dream-selected-detail{display:block;font-size:14px;line-height:1.35}
 .dream-breathing{padding:6px 0}
 #dream-selection-status{margin:5px 0;font-size:9px}
 .experience-confirmed .experience-hint,.experience-confirmed #experience-prologue{display:none}
 .experience-confirmed .experience-stage{min-height:70px}
 .experience-confirmed .experience-kept{display:none}
 .identity-traits .guest-session{display:none}
 .identity-traits .trait-choice{min-height:48px;padding-top:5px;padding-bottom:5px}
 .identity-traits .trait-description{font-size:10px;margin-top:3px}
 .identity-traits .traits-instruction{font-size:10px;margin-bottom:5px}
 .identity-traits .identity-status{font-size:9px;margin:4px 0}
}
@media(max-height:550px) and (orientation:portrait){
 #spheres .dream-invitation,#spheres .scene-count{display:none}
 #spheres .sphere-caption{padding-top:0}
 #spheres .sphere-caption h3{font-size:23px}
 #spheres .sphere-caption>p:last-child{font-size:11px;line-height:1.25;margin-top:4px}
 #spheres .scene-arrow{margin-bottom:10px}
}
@media(max-height:360px) and (orientation:landscape){
 .identity-traits .trait-choice{padding-top:3px;padding-bottom:3px}
 .identity-traits .trait-description{line-height:1.2}
}

/* The table composition is portrait even when the containing desktop window is wide. */
.lo-heading{top:max(18px,var(--safe-top))}
.lo-top-controls{top:max(8px,var(--safe-top))}
.lo-controls{bottom:max(13px,var(--safe-bottom))}
.lo-dock{bottom:calc(85px + var(--safe-bottom))}
.lo-table-prop .lo-dock{top:32%;bottom:auto}
.lo-table-prop .lo-item{display:none}
.lo-table-prop .lo-thought{padding:14px 18px 16px}
.lo-table-prop .lo-line{font-size:clamp(17px,4.6vw,22px);line-height:1.35}
@media(max-height:600px) and (orientation:portrait){.lo-table-prop .lo-thought{padding:10px 14px}.lo-table-prop .lo-line{margin-top:6px}}
@media(orientation:landscape) and (max-height:600px){
 .living-opening{max-width:none}
 .lo-visual{width:calc(100dvh * .667);max-width:46%;left:calc((48% - min(46%,100dvh * .667))/2);right:auto}
 .lo-heading{left:16px;top:max(10px,var(--safe-top))}
 .lo-heading h2{font-size:17px}.lo-heading p{font-size:7px}
 .lo-top-controls{left:calc(48% - 92px);right:auto;top:max(6px,var(--safe-top))}
 .lo-dock,.lo-table-prop .lo-dock{top:auto;left:50%;right:16px;bottom:calc(66px + var(--safe-bottom));max-height:none;overflow:visible;padding:0}
 .lo-thought{padding:12px 14px;border-radius:20px}
 .lo-thought::before,.lo-thought::after{display:none}
 .lo-line,.lo-table-prop .lo-line,.living-opening[data-kind=budget] .lo-line,.living-opening[data-kind=detail] .lo-line{font-size:16px;line-height:1.3;margin-top:6px}
 .lo-speaker{font-size:9px}
 .lo-controls{left:50%;right:16px;bottom:max(8px,var(--safe-bottom))}
 .lo-controls button{min-height:44px}
 .lo-choices{margin-top:8px;gap:5px}
 .lo-choice{min-height:44px!important;padding:9px 11px;font-size:14px!important}
 .lo-fact{margin:7px 0;padding-bottom:7px}
 .lo-fact strong{font-size:20px}
 .living-opening .lo-dream{left:50%;right:16px;top:12px;width:auto;max-width:none;display:grid;grid-template-columns:64px 1fr;min-height:70px}
 .living-opening .lo-dream img{grid-row:1 / 3;height:100%;min-height:70px}
 .living-opening .lo-dream span{padding:8px 10px 0;font-size:8px}
 .living-opening .lo-dream p{margin:4px 10px 9px;font-size:13px;line-height:1.25}
 .living-opening[data-kind=choice] .lo-thought{padding:10px 12px}
 .living-opening[data-kind=choice] .lo-line{font-size:15px;line-height:1.2}
}
