/* Portrait usability corrections: no overlapping action groups, touch targets >=44px. */
#create .housegrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#create .housegrid .house{box-sizing:border-box;min-width:0;width:100%;min-height:96px;padding:10px 4px!important;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
#create .housegrid .house *{max-width:100%}
#create .housegrid .house span,#create .housegrid .house small,#create .housegrid .house strong{overflow-wrap:normal;word-break:normal;hyphens:none;text-align:center}
#create .housegrid .house{font-size:clamp(9px,2.65vw,13px)!important;letter-spacing:0!important;line-height:1.1!important}
#create .housegrid .house.selected{outline:2px solid #a9c5ed;outline-offset:1px}
@media(max-width:750px) and (orientation:portrait){
 #gameScreen{--touch-clearance:calc(110px + env(safe-area-inset-bottom))}
 /* Place groups in independent absolute areas rather than nesting skills inside the bottom bar. */
 #gameScreen .bottom{position:static!important;inset:auto!important}
 #gameScreen .joystick{position:absolute!important;left:12px!important;bottom:calc(var(--touch-clearance) + 28px)!important;width:clamp(96px,28vw,126px)!important;height:clamp(96px,28vw,126px)!important;z-index:10}
 #gameScreen .reference-hotbar{bottom:var(--touch-clearance)!important;width:min(76vw,300px)!important;z-index:10}
 #gameScreen .weapon-actions{position:absolute!important;right:8px!important;left:auto!important;bottom:calc(var(--touch-clearance) + 80px)!important;display:grid!important;grid-template-columns:repeat(2,64px)!important;gap:7px!important;width:135px!important;z-index:11}
 #gameScreen .weapon-actions .skill{width:64px!important;min-width:64px!important;height:64px!important;min-height:64px!important;overflow:hidden!important;padding:10px!important}
 #gameScreen .weapon-actions .rpg-attack-label{display:none!important}
 #gameScreen .weapon-actions .skill img{height:31px!important;max-width:36px}
 #gameScreen #skills{position:absolute!important;right:8px!important;left:auto!important;bottom:calc(var(--touch-clearance) + 223px)!important;display:grid!important;grid-template-columns:repeat(2,60px)!important;gap:9px!important;width:129px!important;max-width:129px!important;z-index:11}
 #gameScreen #skills .skill{box-sizing:border-box!important;width:60px!important;min-width:60px!important;height:60px!important;min-height:60px!important;padding:9px!important;overflow:hidden!important;position:relative!important}
 #gameScreen #skills .skill span{display:none!important}
 #gameScreen #skills .skill i{font-size:22px!important;font-style:normal}
 #gameScreen #skills .skill em{position:absolute;right:6px;bottom:5px;font-size:10px}
 #gameScreen .actionline{position:absolute!important;right:5px!important;left:auto!important;top:calc(35% + 18px)!important;bottom:auto!important;display:flex!important;flex-direction:column!important;gap:6px!important;z-index:11}
 #gameScreen .actionline .orn{box-sizing:border-box!important;width:83px!important;min-width:83px!important;max-width:83px!important;height:51px!important;min-height:51px!important;padding:8px 9px!important;font-size:11px!important;line-height:1.1!important;overflow-wrap:normal!important;word-break:normal!important}
 #gameScreen .hall-controls{top:calc(192px + env(safe-area-inset-top))!important;right:8px!important}
 #gameScreen .reference-quest{max-width:calc(100vw - 120px)!important}
 #gameScreen .hall-prompt{bottom:calc(var(--touch-clearance) + 370px)!important}
 #gameScreen .toast{bottom:calc(var(--touch-clearance) + 350px)!important}
}
@media(max-width:750px) and (orientation:portrait) and (max-height:740px){
 #gameScreen{--touch-clearance:calc(94px + env(safe-area-inset-bottom))}
 #gameScreen .actionline{top:33%!important}
 #gameScreen #skills{bottom:calc(var(--touch-clearance) + 206px)!important;gap:5px!important}
 #gameScreen .weapon-actions{bottom:calc(var(--touch-clearance) + 70px)!important;gap:4px!important}
 #gameScreen .reference-quest{top:calc(118px + env(safe-area-inset-top))!important}
}
@media(max-width:390px){
 #create .housegrid{gap:5px}
 #create .housegrid .house{font-size:9px!important;padding:8px 2px!important}
}
