/* Visible viewport, scrollable menu content, and intrinsic combat controls. */
#modal.screen-menu #modal-content .menu-page:not(.menu-probe){justify-content:flex-start!important;align-content:start!important;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:5px;padding-bottom:8px}
#modal.screen-menu #modal-content .dialogue-copy{min-height:min-content;overflow-wrap:anywhere}
#modal.screen-menu #modal-content .dialogue-card{flex:0 0 auto;min-height:min-content}
#modal.screen-menu #modal-content :is(.boss-replies,.boss-promise){flex-shrink:0}
#modal.screen-menu #modal-content .dialogue-copy p{white-space:normal;overflow-wrap:anywhere}
body.immersive-game.playing #play{position:fixed;left:calc(var(--menu-x,50vw) - var(--menu-width,100vw)/2);top:calc(var(--menu-y,50dvh) - var(--menu-height,100dvh)/2);width:var(--menu-width,100vw);height:var(--menu-height,100dvh)!important;min-height:0!important;max-height:var(--menu-height,100dvh);padding:0!important;box-sizing:border-box}
body.immersive-game.playing #play .game-shell{width:100%!important;height:100%!important;max-height:100%!important;min-height:0;box-sizing:border-box}
body.immersive-game:not(.wide-game) .game-bottom{height:auto;bottom:0;padding:6px max(8px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));box-sizing:border-box}
body.immersive-game:not(.wide-game) .control-row{display:flex;flex-wrap:nowrap;gap:6px;justify-content:space-between;min-height:60px;padding-top:6px;align-items:center}
body.immersive-game:not(.wide-game) .control-row>p{display:none!important}
body.immersive-game:not(.wide-game) .control-row button{width:clamp(44px,14vw,62px);height:clamp(52px,16vw,68px);min-width:44px;min-height:52px;flex:0 1 62px;padding:3px;box-sizing:border-box}
body.immersive-game:not(.wide-game) .control-row button small{font-size:12px;line-height:1.15;white-space:normal}
body.immersive-game:not(.wide-game) .xp-label{min-height:28px;align-items:center;gap:6px}
body.immersive-game:not(.wide-game) .xp-label #kills{min-height:30px;padding:3px 7px;font-size:14px;line-height:1.3}
body.immersive-game:not(.wide-game) .alchemy-status{bottom:calc(var(--battle-controls-height,170px) + 6px)}
body.immersive-game:not(.wide-game) .alchemy-feed{bottom:calc(var(--battle-controls-height,170px) + 58px)}
body.immersive-game .game-hud{padding-top:max(6px,env(safe-area-inset-top))}
body.immersive-game .game-shell #game-message{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));width:auto;max-width:none;box-sizing:border-box;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;transform:none;font-size:clamp(18px,5vw,26px);line-height:1.45;letter-spacing:0;text-align:center}
@media(max-width:719px){#modal.screen-menu{max-height:calc(var(--menu-height,100dvh) - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)))}#modal.screen-menu #modal-content .menu-header{padding-right:0}#modal.screen-menu #modal-content .menu-header:has(.close){padding-right:44px}#modal.screen-menu #modal-content .dialogue-card{flex-direction:column!important;align-items:stretch;gap:12px!important}#modal.screen-menu #modal-content .dialogue-portrait{width:min(220px,52vw)!important;height:min(220px,52vw)!important;max-height:none!important;flex:0 0 auto!important;align-self:center}#modal.screen-menu #modal-content .dialogue-copy{justify-content:flex-start!important}#modal.screen-menu #modal-content .dialogue-copy h3{font-size:26px!important}#modal.screen-menu #modal-content .dialogue-copy p{font-size:21px!important;line-height:1.55!important}#modal.screen-menu #modal-content .modal-actions button{min-height:44px;white-space:normal;overflow-wrap:anywhere}}
@media(max-width:719px) and (max-height:500px){#modal.screen-menu #modal-content .dialogue-portrait{width:150px!important;height:150px!important}#modal.screen-menu #modal-content .dialogue-copy p{font-size:20px!important}}

/* Cards expand with their labels; text never spills from a fixed-height button. */
#modal.screen-menu #modal-content .upgrade{height:auto!important;max-height:none!important;min-height:min-content!important;white-space:normal!important;overflow-wrap:anywhere;align-content:start}
#modal.screen-menu #modal-content .upgrade>span:last-child{min-width:0;max-width:100%;height:auto;overflow:visible}
#modal.screen-menu #modal-content .upgrade :is(strong,small){max-width:100%;white-space:normal!important;overflow-wrap:anywhere;height:auto;line-height:1.5!important}
#modal.screen-menu[data-kind="training"] #modal-content .choice-option .weapon-card{height:auto!important;align-self:stretch;grid-template-columns:minmax(0,1fr)!important;align-items:start!important;min-height:min-content!important;padding:10px!important}
#modal.screen-menu[data-kind="training"] #modal-content .choice-option{align-items:stretch;min-height:min-content!important;gap:8px!important}
#modal.screen-menu[data-kind="training"] #modal-content .weapon-card .art-medallion{display:none!important}
#modal.screen-menu[data-kind="training"] #modal-content .weapon-card>span:last-child{width:100%}
#modal.screen-menu #modal-content .choice-info{height:auto!important;align-self:center}
@media(max-width:719px){#modal.screen-menu #modal-content .cards{flex:0 0 auto!important;min-height:min-content!important;grid-template-columns:1fr!important;grid-auto-rows:auto!important;gap:12px}#modal.screen-menu #modal-content .cards .upgrade{flex:none!important;min-height:min-content!important;padding:14px!important}#modal.screen-menu #modal-content .menu-header .dream-pursuit{font-size:18px!important;line-height:1.4!important}#modal.screen-menu[data-kind="training"] #modal-content .weapon-card strong{font-size:23px!important;line-height:1.4!important}}
