/* Unscaled, scrollable menus. Night field coordinates remain unchanged. */
#stage{top:var(--field-center-y,50%)}
.rig-scope-note{color:#766284;overflow-wrap:anywhere}
body:not(.mobile-ui) .rig-scope-note{max-width:480px}
body.mobile-ui .rig-scope-note{font-size:13px}
body.mobile-ui:not([data-mode="night"]) #stage{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;margin:0;transform:none!important;transform-origin:0 0}
body.mobile-ui:not([data-mode="night"]) .screen:not(.screen-day){padding:calc(24px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain;font-size:16px}
body.mobile-ui #day-panel.screen-day{height:100vh;height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:clip;touch-action:manipulation}
body.mobile-ui[data-mode="day"] #game{display:none!important}
body.mobile-ui #day-panel .day-head{gap:5px;padding:0 5px}
body.mobile-ui #day-panel .day-title{max-width:150px;font-size:11px}
body.mobile-ui #day-panel .day-status{gap:1px 5px;font-size:9px}
body.mobile-ui #day-panel .day-content{padding:4px}
body.mobile-ui #day-panel .tab{padding:2px 5px}
body.mobile-ui .screen-head{flex-wrap:wrap;justify-content:flex-start;gap:8px}
body.mobile-ui:not([data-mode="night"]):not([data-mode="day"]) .btn,body.mobile-ui .pause-overlay .btn,body.mobile-ui .wave-report .btn,body.mobile-ui .wh-panel .btn{min-width:44px;min-height:44px;padding:8px 12px;font-size:14px;touch-action:manipulation}
body.mobile-ui .screen-title,body.mobile-ui .logo{font-size:22px}
body.mobile-ui .lead,body.mobile-ui .brief-desc,body.mobile-ui .card-desc,body.mobile-ui .card-uniq,body.mobile-ui .legend,body.mobile-ui .controls,body.mobile-ui .brief-extra{font-size:14px;line-height:1.55}
body.mobile-ui .seed-choice{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px}
body.mobile-ui .seed-choice input{font-size:16px;min-height:44px;width:170px;max-width:100%}
body.mobile-ui .seed-choice a{display:inline-flex;align-items:center;min-height:44px}
body.mobile-ui .card-list{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;padding-bottom:10px}
body.mobile-ui .card{height:auto;min-height:280px;padding:10px;touch-action:pan-y}
body.mobile-ui .card canvas{height:160px;object-fit:contain}
body.mobile-ui .card-name{font-size:18px}
body.mobile-ui .brief-grid{grid-template-columns:150px minmax(0,1fr);gap:14px;padding-bottom:96px}
body.mobile-ui .brief-who canvas{width:140px;height:175px;margin:auto}
body.mobile-ui .brief-main,body.mobile-ui .brief-who{min-width:0}
body.mobile-ui .brief-main .sub-title{font-size:15px}
body.mobile-ui .brief-main .slot-grid,body.mobile-ui .brief-main .legend{grid-template-columns:1fr}
body.mobile-ui .controls{grid-template-columns:max-content minmax(0,1fr)}
body.mobile-ui #screen-brief .btn-row{position:fixed;z-index:4;left:12px;right:12px;bottom:env(safe-area-inset-bottom);margin:0;display:grid;grid-template-columns:1fr 1fr;padding:10px;background:#fff9f3f5;border:2px solid #c5acd8;border-radius:14px}
body.mobile-ui #screen-brief .btn-row .btn{min-height:48px}
body.mobile-ui .pause-overlay,body.mobile-ui .wave-report{position:fixed;inset:0;z-index:60;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}
body.mobile-ui .pause-box{max-width:100%;padding:22px;font-size:16px}
body.mobile-ui #btn-resume{width:100%;min-height:48px}
body.mobile-ui .wave-card{width:min(100%,778px);height:auto;max-height:100%;padding:16px;overflow:auto;touch-action:pan-y;overscroll-behavior:contain}
body.mobile-ui .wave-title{font-size:25px}
body.mobile-ui .wave-sub,body.mobile-ui .wave-stat dt,body.mobile-ui .wave-time,body.mobile-ui .wave-supplies,body.mobile-ui .wave-foot span{font-size:14px}
body.mobile-ui .wave-body{height:auto;grid-template-columns:100px minmax(0,1fr);gap:10px}
body.mobile-ui .wave-who{min-height:150px}
body.mobile-ui .wave-who canvas{left:0;bottom:22px;width:96px;height:130px}
body.mobile-ui .wave-stats{grid-template-columns:1fr;gap:5px}
body.mobile-ui .wave-stat{padding:6px 10px}
body.mobile-ui .wave-reward-slot{min-height:0}
body.mobile-ui .wave-choice-slot{height:auto}
body.mobile-ui .wave-choices{grid-template-columns:1fr}
body.mobile-ui .wave-choices small{font-size:12px}
body.mobile-ui .wave-foot{position:static;flex-wrap:wrap;margin-top:12px}
body.mobile-ui #wave-skip{width:100%}
body.mobile-ui .wh-panel{position:fixed;z-index:50;left:12px;right:12px;top:max(12px,env(safe-area-inset-top));bottom:calc(144px + env(safe-area-inset-bottom));width:auto;max-width:600px;max-height:none;padding:10px;font-size:14px}
body.mobile-ui .wh-head{flex-wrap:wrap;gap:6px}
body.mobile-ui .wh-note{white-space:normal;font-size:13px}
body.mobile-ui .wh-hint{display:none}
body.mobile-ui .wh-close{margin-left:auto}
body.mobile-ui .wh-body{min-height:0;overflow:auto;touch-action:pan-y;overscroll-behavior:contain}
body.mobile-ui .wh-panel .slot-row,body.mobile-ui .hs .slot-row{grid-template-columns:24px minmax(0,1fr);padding:6px;min-height:44px}
body.mobile-ui .slot-btns{grid-column:2;flex-wrap:wrap}
body.mobile-ui .hs .slot-body{display:block}
body.mobile-ui .hs-row{grid-template-columns:1fr}
body.mobile-ui .result-stats{font-size:16px}
body.mobile-ui .result-portrait{position:static!important;display:block;margin:12px auto;width:140px!important;height:180px!important}
body.mobile-ui .version-label{font-size:10px}
@media(max-width:600px){body.mobile-ui .brief-grid{grid-template-columns:1fr}body.mobile-ui .brief-who{display:grid;grid-template-columns:140px minmax(0,1fr);gap:8px;align-items:center}body.mobile-ui .brief-who canvas{grid-row:span 2}body.mobile-ui .brief-name{font-size:18px}}
body.mobile-ui .hours{flex-wrap:wrap;max-width:100%;min-width:0}body.mobile-ui .hours-text{font-size:13px}
@media(pointer:coarse){body.mobile-ui[data-mode="night"] #hud-top .hud-buttons>*{display:none}}
@media(pointer:coarse){body.mobile-ui[data-mode="night"] #hud-top{padding-right:calc(64px * var(--inv-scale,1))}}
/* The rotate gate belongs directly to body; disable any old in-field banner. */
#stage .touch-rotate,.touch-controls .touch-rotate{display:none!important}
/* Short landscape phones: the title and lead used the whole height, so the character cards started below the fold. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px){body.mobile-ui #screen-select .select-intro{padding:2px 5px 0}body.mobile-ui #screen-select .select-intro .eyebrow,body.mobile-ui #screen-select .select-intro .lead{display:none}body.mobile-ui #screen-select .select-intro .screen-title{font-size:20px;margin:0}body.mobile-ui #screen-select .select-footer{margin:4px 5px 0}body.mobile-ui #screen-select .card-list{margin-top:6px}body.mobile-ui #screen-select .card{height:auto;min-height:max(240px,calc(100dvh - 128px))}body.mobile-ui #screen-select .card canvas{height:60px}body.mobile-ui #screen-select .card-desc,body.mobile-ui #screen-select .card-uniq{line-height:1.35}body.mobile-ui #screen-select .card-text{padding-top:6px}}
/* Phones in landscape: the version stamp overlaps screen headings (result eyebrow, night HUD), keyboard hints do not apply, and the card's bottom band must not cover its text. */
@media(pointer:coarse) and (orientation:landscape){body.mobile-ui .version-label{display:none}}
@media(pointer:coarse){body.mobile-ui #pause-help{display:none}body.mobile-ui #screen-select .card{display:flex;flex-direction:column}body.mobile-ui #screen-select .card canvas{flex:none}body.mobile-ui #screen-select .card-text{flex:1 0 auto}body.mobile-ui #screen-select .card::after{position:static;flex:none}}
