/* The flexible scene gets every pixel left after the compact controls. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
.game-screen,.shelter-screen{height:100vh;height:100dvh;min-height:0;width:100%;padding:12px max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr);gap:6px;overflow:hidden}
.game-screen{grid-template-rows:auto auto auto minmax(0,1fr) auto auto 3px}
.game-header{grid-row:1}.game-screen>.reward-banner{grid-row:2}.scene-label{grid-row:3}.story-area{grid-row:5}.supply-strip{grid-row:6}.progress-dots{grid-row:7}
.game-header,.shelter-header{width:100%;align-items:center;gap:10px}
.game-logo>span{font-size:24px}.game-logo strong{font-size:15px}.game-logo small{font-size:9px}
.hud{padding:5px 14px;gap:18px}.hud-item strong,.hud-item strong b{font-size:20px}.hud-item small{font-size:9px}.hud-divider{height:25px}.restart{padding:7px 9px;font-size:11px;min-height:30px}
.reward-banner{margin:0 auto;max-width:100%;padding:4px 10px;font-size:10px;line-height:1.3;box-shadow:none}
.reward-banner+.scene-label,.scene-label{margin:0 auto;padding:4px 12px;font-size:10px;gap:12px}
.character-art{position:relative;grid-column:1;grid-row:4;left:auto;top:auto;bottom:auto;transform:none;align-self:stretch;justify-self:center;margin:0;width:min(55vw,360px);height:100%;min-height:0;z-index:0;pointer-events:none}
.character-art .visitor-sprite{object-fit:contain;object-position:center center}
.ambient-copy{grid-row:4;grid-column:1;position:absolute;top:6px;left:0;max-width:160px;padding:6px 9px;font-size:10px;z-index:1}
.scene-caption{grid-row:4;grid-column:1;position:absolute;left:50%;top:auto;bottom:2px;transform:translateX(-50%);width:90%;max-width:600px;white-space:normal;text-align:center;font-size:10px;line-height:1.35;pointer-events:none}
.backpack,.journal-toggle{grid-row:4;grid-column:1;position:absolute;right:0;top:6px;width:145px;z-index:8}
.journal-toggle{top:61px}.backpack summary{padding:5px 9px}.bag-icon{font-size:21px}.backpack summary span:nth-child(2){font-size:11px}.backpack summary small{font-size:9px}.journal-toggle summary{font-size:10px;padding:7px 9px}
.backpack .bag-content,.journal-toggle .journal{max-height:min(320px,50dvh);overflow:auto;box-shadow:0 8px 24px #0009}
.story-area{width:min(960px,100%);margin:0 auto;gap:8px;grid-template-columns:1.15fr 1fr;align-items:stretch;z-index:5}
.dialogue-box{position:relative;min-height:0;padding:10px 13px}.speaker{padding-bottom:5px;gap:6px}.speaker-ornament{font-size:17px}.speaker h2{font-size:16px;letter-spacing:.06em}.speaker span:not(.speaker-ornament):not(.visitor-id){font-size:9px}.visitor-id{font-size:9px}.dialogue{font-size:13px;line-height:1.5;margin-top:6px}
.deal-area{padding:9px 12px}.offer-box{padding-bottom:6px}.offer-box small{font-size:9px}.offer-items{gap:4px;margin-top:4px}.offer-chip{font-size:10px;padding:3px 5px}.offer-price strong{font-size:19px;margin-top:2px}.action-row{margin-top:7px;gap:5px;grid-template-columns:1.2fr 1fr 1fr}.action-row button{min-height:34px;font-size:11px}.action-row button span{font-size:9px}.transaction-note{font-size:9px;line-height:1.3;margin-top:5px}
.supply-strip{position:relative;width:min(960px,100%);margin:0 auto;padding:5px 8px;gap:5px;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;z-index:6}.supply-label{font-size:10px}.supply-label small{font-size:8px}.supply-preview{flex-wrap:nowrap;gap:4px}.supply-pill{font-size:10px;padding:4px 5px}.finish-button{font-size:10px;padding:6px;min-height:30px}.supply-help{grid-column:1/-1;justify-self:end;font-size:9px}.supply-help summary,.quick-guide summary{cursor:pointer;list-style:none;color:#d4c09a}.supply-help summary::-webkit-details-marker,.quick-guide summary::-webkit-details-marker{display:none}.supply-help>p,.quick-guide>div{position:absolute;bottom:calc(100% + 6px);right:0;width:min(320px,85vw);padding:12px;color:#ffefd3;background:#24302ff5;border:1px solid #b5a17a;box-shadow:0 6px 25px #000b;line-height:1.6;font-size:11px;z-index:12}.quick-guide{position:absolute;right:12px;top:10px;font-size:9px}.quick-guide>div{bottom:calc(100% + 15px)}.quick-guide .guide-tip{margin:0 0 7px;padding:0 0 7px;background:none;border:0;border-bottom:1px solid #c3ae7655;font-size:11px}.speaker .visitor-id{margin-right:58px}.progress-dots{margin:0;gap:4px;align-self:center}.progress-dots i{height:2px;width:14px}
.shelter-screen{grid-template-rows:auto auto auto minmax(0,1fr) auto}
.shelter-header{grid-row:1}.shelter-screen>.reward-banner{grid-row:2}.shelter-status{grid-row:3;margin:0 auto;padding:6px 9px;max-width:960px;gap:5px}.shelter-title{font-size:23px}.shelter-title span{font-size:16px}.shelter-clock{padding:5px 12px}.shelter-clock strong{font-size:17px}.shelter-stock span{padding:4px 6px;font-size:10px}
.shelter-screen .peephole,.shelter-screen.peeking .peephole{grid-row:4;grid-column:1;position:relative;top:auto;left:auto;transform:none;justify-self:center;align-self:stretch;width:100%;height:100%;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.peephole-inner{height:min(285px,72vw,calc(100% - 30px));width:auto;aspect-ratio:1;max-width:none;flex-shrink:1;min-height:0;border-width:10px}.peephole>span{margin:0;padding:4px 10px;font-size:9px;flex-shrink:0}
.shelter-event,.shelter-screen.peeking .shelter-event{grid-row:5;width:min(960px,100%);margin:0 auto;padding:12px 16px;z-index:5}.shelter-event h2{font-size:19px;margin:5px 0}.shelter-event p{font-size:12px;line-height:1.5}.shelter-choices{gap:6px;margin-top:9px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.shelter-choices button{min-width:0;padding:8px 9px}.shelter-choices strong{font-size:12px}.shelter-choices span{font-size:10px}
.shelter-log-toggle{grid-row:4;grid-column:1;position:absolute;right:0;top:5px;width:120px;z-index:8}.shelter-log-toggle summary{padding:7px;font-size:10px}.shelter-log-toggle .journal{max-height:45dvh}
@media(max-width:760px){
 .game-screen,.shelter-screen{padding-top:max(6px,env(safe-area-inset-top));padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right));padding-bottom:max(6px,env(safe-area-inset-bottom));gap:4px}
 .game-header,.shelter-header{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 6px}.game-logo{gap:4px}.game-logo>span{font-size:19px}.game-logo strong{font-size:12px}.game-logo small{font-size:8px;display:block}.header-buttons,.shelter-header .header-buttons{grid-column:2;grid-row:1;justify-content:end;flex-wrap:nowrap;gap:3px}.header-buttons .restart,.shelter-header .header-buttons .rank-open{font-size:10px;padding:4px 6px;min-height:28px}.restart span{display:none}
 .hud{grid-row:2;grid-column:1/-1;justify-content:space-around;padding:4px 8px;gap:8px}.hud-item{display:flex;align-items:center;gap:5px}.weather-hud{display:flex}.hud-item small{font-size:9px}.hud-item strong,.hud-item strong b{font-size:15px;margin:0}.hud-item i{font-size:9px}.hud-divider{height:17px}.reward-banner{font-size:9px;padding:4px 6px}.scene-label,.reward-banner+.scene-label{font-size:9px;padding:3px 9px;gap:9px}.scene-label span+span{padding-left:9px}
 .character-art{width:min(65vw,300px);height:100%;top:auto;bottom:auto}.ambient-copy{top:3px;max-width:105px;font-size:9px;padding:4px 5px}.ambient-copy span{font-size:8px}.ambient-copy p{margin-top:2px}.backpack,.journal-toggle{width:100px;top:3px}.backpack summary{padding:4px 6px;gap:4px}.bag-icon{font-size:17px}.backpack summary span:nth-child(2){font-size:10px}.backpack summary small{font-size:8px}.journal-toggle{top:46px}.journal-toggle summary{font-size:9px;padding:5px 6px}.scene-caption{font-size:9px;bottom:1px;max-width:88%;line-height:1.25}
 .story-area{grid-template-columns:1fr;gap:4px;margin:0 auto}.dialogue-box{padding:7px 9px}.speaker{padding-bottom:3px}.speaker h2{font-size:13px}.speaker-ornament{font-size:14px}.dialogue{font-size:11px;line-height:1.4;margin-top:4px;letter-spacing:0}.quick-guide{right:9px;top:8px}.speaker .visitor-id{margin-right:53px}.deal-area{padding:6px 8px}.offer-box{gap:5px;padding-bottom:4px}.offer-box small{font-size:8px}.offer-items{margin-top:3px;gap:3px}.offer-chip{font-size:9px;padding:3px 4px}.offer-price strong{font-size:17px}.action-row{margin-top:5px;gap:4px}.action-row button{min-height:32px;font-size:10px}.transaction-note{font-size:8px;line-height:1.35;margin-top:4px}
 .supply-strip{grid-template-columns:auto minmax(0,1fr);gap:4px;padding:4px 6px}.supply-preview{justify-content:space-between;gap:3px}.supply-pill{font-size:9px;padding:3px;flex:1;text-align:center}.supply-label{font-size:9px}.supply-label small{font-size:7px}.supply-strip .finish-button{font-size:9px;padding:5px;min-height:28px}.supply-help{grid-column:auto;justify-self:end}.supply-strip .finish-button:nth-of-type(1){grid-column:1}.supply-strip .finish-button:nth-of-type(2){grid-column:2;justify-self:stretch}.supply-help{position:relative;left:auto;top:auto;grid-column:1/-1;justify-self:end;z-index:7}.supply-help>p{left:0;right:auto}.progress-dots i{width:11px}
 .shelter-title{font-size:19px;gap:4px}.shelter-title span{font-size:12px}.shelter-title small{font-size:8px}.shelter-clock{grid-row:2;grid-column:1/-1;padding:4px 9px;justify-content:center;gap:12px}.shelter-clock strong{font-size:14px}.shelter-clock span{font-size:10px}.shelter-status{width:100%;padding:5px 6px;gap:3px;font-size:10px;justify-content:center}.shelter-status b{font-size:11px}.shelter-stock{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;width:100%}.shelter-stock span{padding:3px 4px;font-size:9px;text-align:center}
 .peephole-inner{height:min(245px,65vw,calc(100% - 30px));width:auto;border-width:8px}.shelter-event,.shelter-screen.peeking .shelter-event{padding:8px 10px;margin:0 auto}.shelter-event-label{font-size:9px}.shelter-event h2{font-size:16px;margin:4px 0}.shelter-event p{font-size:11px;line-height:1.45}.shelter-choices{gap:4px;margin-top:6px}.shelter-choices button{padding:6px 5px;min-width:0}.shelter-choices strong{font-size:10px}.shelter-choices span{font-size:9px;line-height:1.35}.shelter-log-toggle{top:4px;right:0;width:93px}.shelter-log-toggle summary{font-size:9px;padding:5px}
 .overlay{padding:8px}.setup-card,.event-card,.result-card,.rank-card{max-height:calc(100dvh - 16px);padding:17px 20px}.setup-seal{font-size:20px}.setup-card h1{font-size:28px;margin:7px 0}.setup-card>p{font-size:10px;line-height:1.5}.setup-kicker{font-size:9px}.opening-guide{margin-top:7px;font-size:9px;gap:4px 7px}.setup-fields{grid-template-columns:1fr 1fr;align-items:center;gap:8px;margin:10px 0}.fixed-start{padding:6px;font-size:10px;line-height:1.8}.setup-fields label{font-size:10px}.setup-fields select{font-size:10px;padding:7px;margin-top:4px}.reward-summary{padding:7px 9px;margin-bottom:6px}.reward-summary strong{font-size:11px}.reward-summary span,.reward-summary small{font-size:9px}.start-button{height:36px;min-height:36px}.setup-card>small{font-size:9px;margin-top:7px}
}
@media(max-height:650px) and (orientation:portrait){
 .game-screen,.shelter-screen{gap:3px}.dialogue{font-size:10px;line-height:1.3}.dialogue-box{padding:5px 8px}.speaker h2{font-size:12px}.transaction-note{font-size:8px;margin-top:3px}.deal-area{padding:5px 7px}.offer-items{margin-top:2px}.action-row button{min-height:30px}.shelter-event p{font-size:10px}.shelter-choices span{font-size:8px}.shelter-event h2{font-size:14px}.shelter-choices button{padding:5px}.setup-card{padding:12px 16px}.setup-card h1{font-size:24px}.setup-card>small{margin-top:4px}.setup-fields{margin:7px 0}.setup-seal{display:none}
}
@media(orientation:landscape) and (max-height:520px){
 .game-screen{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-rows:auto auto auto minmax(0,1fr) auto 3px;column-gap:12px}
 .game-header,.game-screen>.reward-banner,.scene-label{grid-column:1/-1}.game-header{display:flex;flex-wrap:nowrap}.hud{grid-row:auto;grid-column:auto;flex:1}.header-buttons{grid-row:auto;grid-column:auto}.character-art{grid-row:4/7;grid-column:1;width:90%}.story-area{grid-row:4;grid-column:2;align-self:end;grid-template-columns:1fr}.supply-strip{grid-row:5;grid-column:2}.progress-dots{grid-row:6;grid-column:2}.ambient-copy,.backpack,.journal-toggle,.scene-caption{grid-row:4/7;grid-column:1}.ambient-copy{max-width:95px}.backpack,.journal-toggle{width:90px}.scene-caption{font-size:8px}
 .shelter-screen{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-rows:auto auto auto minmax(0,1fr);column-gap:12px}.shelter-header,.shelter-screen>.reward-banner,.shelter-status{grid-column:1/-1}.shelter-header{display:flex}.shelter-status{flex-wrap:nowrap}.shelter-stock{display:flex;width:auto}.shelter-clock{padding:3px 8px}.shelter-screen .peephole,.shelter-screen.peeking .peephole{grid-row:4;grid-column:1}.shelter-event,.shelter-screen.peeking .shelter-event{grid-row:4;grid-column:2;align-self:end}.shelter-log-toggle{grid-row:4;grid-column:1}.peephole-inner{height:min(220px,calc(100% - 25px))}.shelter-choices span{font-size:8px}
}

