/* Status rails occupy their own space, never the animated battlefield. */
:is(#battle,#gameShell) .enemy-huds,:is(#battle,#gameShell) .ally-huds{position:relative;inset:auto;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:6px;flex:none;background:#101a2a;z-index:1}
:is(#battle,#gameShell) .enemy-huds:has(>.hud:only-child){grid-template-columns:minmax(0,1fr);max-width:none}
:is(#battle,#gameShell) .hud{display:grid;grid-template-columns:72px minmax(0,.85fr) minmax(0,1.2fr);grid-template-rows:auto auto auto;align-items:center;gap:3px 8px;padding:6px 8px;font-size:14px;box-shadow:inset 0 1px 0 #f1fdff40;border-radius:8px;min-width:0}
:is(#battle,#gameShell) .hud .hud-name-row{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
:is(#battle,#gameShell) .hud .hud-mon-portrait{grid-column:1;grid-row:1/4;align-self:center;width:72px!important;height:72px!important;flex:0 0 72px;border-radius:7px}
:is(#battle,#gameShell) .hud b{font-size:14px;line-height:1.25;letter-spacing:0;white-space:normal;overflow-wrap:anywhere}
:is(#battle,#gameShell) .hud .hud-types{grid-column:2;grid-row:2;gap:3px;margin:0;flex-wrap:wrap}
:is(#battle,#gameShell) .hud .hud-types .type-emblem{font-size:12px;line-height:1.2;padding:2px 4px;gap:3px}
:is(#battle,#gameShell) .hud .hud-types svg{width:13px;height:13px}
:is(#battle,#gameShell) .hud .scrolls{grid-column:2;grid-row:3;font-size:12px;line-height:1;letter-spacing:2px}
:is(#battle,#gameShell) .hud .hp{grid-column:3;grid-row:1;min-height:30px;height:auto!important;margin:0!important}
:is(#battle,#gameShell) .hud .meter-copy{padding:4px 6px;gap:2px 6px;flex-wrap:wrap}
:is(#battle,#gameShell) .hud .meter-name{font-size:12px;line-height:1.2;flex:1 1 auto;min-width:0}
:is(#battle,#gameShell) .hud .meter-hp{font-size:14px;line-height:1.2}
:is(#battle,#gameShell) .hud .stamina-meter{grid-column:3;grid-row:2;height:20px;margin:0;font-size:12px;line-height:18px;border-radius:4px}
:is(#battle,#gameShell) .hud .finisher-meter{grid-column:3;grid-row:3;min-height:20px;height:auto;margin:0;padding:2px 4px;font-size:12px;line-height:1.25}
:is(#battle,#gameShell) .hud .hud-owner{grid-column:1/-1;grid-row:4;font-size:12px;margin:0}
:is(#battle,#gameShell) .hud .attack-boost{font-size:12px}

:is(#battle,#gameShell) .hud .hud-tamer{font:12px/1.2 Arial,sans-serif;color:#b5cddd;overflow-wrap:anywhere}
:is(#battle,#gameShell) .hud .meter-copy{flex-wrap:nowrap}
:is(#battle,#gameShell) .hud .meter-name{flex:0 0 auto;font-size:12px}
@media(max-width:850px){
 :is(#battle,#gameShell) .hud{grid-template-columns:60px minmax(0,1fr);gap:3px 6px}
 :is(#battle,#gameShell) .hud .hud-mon-portrait{width:60px!important;height:60px!important;grid-column:1;grid-row:1/3}
 :is(#battle,#gameShell) .hud .hud-name-row{grid-column:2;grid-row:1}
 :is(#battle,#gameShell) .hud .hud-types{grid-column:2;grid-row:2}
 :is(#battle,#gameShell) .hud .hp{grid-column:1/-1;grid-row:3}
 :is(#battle,#gameShell) .hud .stamina-meter{grid-column:1/-1;grid-row:4}
 :is(#battle,#gameShell) .hud .finisher-meter{grid-column:1/-1;grid-row:5}
 :is(#battle,#gameShell) .hud .scrolls{grid-column:1/-1;grid-row:6}
 :is(#battle,#gameShell) .hud .hud-owner{grid-column:1/-1;grid-row:7}
}

#gameShell .hud{position:relative;inset:auto;width:100%;clip-path:none}
#gameShell .enemy-huds,#gameShell .ally-huds{grid-template-columns:minmax(0,1fr)}
#gameShell .hud-finishers{display:contents}
#gameShell .hud .lvl{font-size:12px;line-height:1.2;color:#b5cddd}
#gameShell .hud .team-strip{margin:0;min-height:16px;gap:6px}
#gameShell .hud .team-scroll{width:16px;height:12px}
#gameShell .hud .hud-owner:not(:has(.status.show)){display:none}
#gameShell .hud .status{font-size:12px}

/* Phone battle header and singles card: keep the face prominent beside the meters. */
@media(max-width:600px){
 body:has(#gameShell:not([hidden])) .topbar,body:has(#battle:not([hidden])) .topbar{grid-template-columns:minmax(0,1fr) auto!important;min-height:78px!important;height:auto!important;padding:6px 10px!important;gap:6px!important;margin-bottom:6px!important}
 body:has(#gameShell:not([hidden])) .topbar>.brand.mojumon-brand,body:has(#battle:not([hidden])) .topbar>.brand.mojumon-brand{grid-column:1;grid-row:1;align-items:flex-start;gap:0}
 body:has(#gameShell:not([hidden])) .mojumon-logo,body:has(#battle:not([hidden])) .mojumon-logo{width:150px;height:66px}
 body:has(#gameShell:not([hidden])) .topbar .brand small,body:has(#battle:not([hidden])) .topbar .brand small{font-size:12px;line-height:1.2}
 body:has(#gameShell:not([hidden])) .topbar>.header-actions,body:has(#battle:not([hidden])) .topbar>.header-actions{grid-column:2;grid-row:1;justify-self:end;max-width:150px;gap:4px}
 body:has(#gameShell:not([hidden])) .header-actions button,body:has(#battle:not([hidden])) .header-actions button{min-height:44px;padding:6px;font-size:12px}
 #gameShell .hud{grid-template-columns:64px minmax(0,1fr);gap:3px 8px}
 #gameShell .hud .hud-mon-portrait{grid-column:1;grid-row:1/5;width:64px!important;height:64px!important;align-self:center}
 #gameShell .hud .hud-name-row{grid-column:2;grid-row:1;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 6px}
 #gameShell .hud .hud-name{font-size:14px;word-break:normal;overflow-wrap:normal}
 #gameShell .hud .hud-tamer{flex-basis:100%}
 #gameShell .hud .lvl{font-size:12px}
 #gameShell .hud .hud-types{grid-column:2;grid-row:2}
 #gameShell .hud .hp{grid-column:2;grid-row:3;min-height:25px}
 #gameShell .hud .meter-copy{padding:3px 5px}
 #gameShell .hud .meter-hp{margin:0}
 #gameShell .hud .stamina-meter{grid-column:2;grid-row:4}
 #gameShell .hud .finisher-meter{grid-column:2;grid-row:5}
 #gameShell .hud .scrolls{grid-column:1;grid-row:5;align-self:center;justify-content:center;gap:4px;transform:none}
 #gameShell .hud .team-scroll{width:12px;height:10px}
 #gameShell .hud .hud-owner{grid-column:2;grid-row:6}
}
