/* Safe-area docks keep variable-height control groups in normal layout flow. */
.match-topbar,.combat-dock{display:contents}
.combat-dock>.hud,.combat-dock>.talent-nudge,.match-topbar>.objective{z-index:2}
.match-immersive,.match-immersive body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background:#08131e}
.match-immersive{--game-safe-top:max(12px,env(safe-area-inset-top));--game-safe-bottom:max(20px,env(safe-area-inset-bottom));--game-safe-left:max(12px,env(safe-area-inset-left));--game-safe-right:max(12px,env(safe-area-inset-right))}
.match-immersive .topbar,.match-immersive #hero-select{display:none}
.match-immersive #game-workspace{position:fixed;inset:auto;left:var(--game-viewport-left,0px);top:var(--game-viewport-top,0px);display:block;width:var(--game-viewport-width,100%);height:100vh;height:var(--game-viewport-height,100dvh);min-height:0;padding:0;margin:0;overflow:hidden}
.match-immersive #battlefield{position:absolute;inset:0;width:100%;height:100%;min-height:0;border:0}
.match-immersive #arena{position:absolute;inset:0;width:100%;height:100%}
.match-immersive .sidebar{display:none}
.match-controls{position:absolute;z-index:7;right:max(12px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));display:flex;gap:6px}
.match-controls button,.match-drawer-close{min-height:44px;border:1px solid #4b657a;background:#102235eb;color:#d4e6f3;padding:8px 11px;border-radius:4px;font-size:12px}
.match-controls button[aria-pressed=true]{border-color:#d3b783;color:#edcf9b}
.match-drawer-close{display:none;margin-bottom:15px;align-self:flex-end}
.match-immersive.match-drawer .sidebar{display:flex;position:absolute;left:var(--game-safe-left);top:calc(var(--game-safe-top) + 52px);bottom:var(--game-safe-bottom);width:min(360px,calc(100% - var(--game-safe-left) - var(--game-safe-right)));z-index:9;overflow:auto;padding:14px 18px 20px;box-shadow:10px 0 50px #000b;border:1px solid #4b657a;border-radius:5px;overscroll-behavior:contain}
.match-immersive.match-drawer .match-drawer-close{display:block;position:absolute;left:var(--game-safe-left);top:var(--game-safe-top);width:min(360px,calc(100% - var(--game-safe-left) - var(--game-safe-right)));margin:0;z-index:10;background:#102235}
.match-immersive .sidebar>*{flex-shrink:0}.match-immersive .sidebar .roster{display:none}
.match-immersive .match-topbar{position:absolute;top:var(--game-safe-top);left:var(--game-safe-left);right:var(--game-safe-right);z-index:7;display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start;pointer-events:none}
.match-immersive .match-controls{position:static;grid-column:2;grid-row:1;justify-content:flex-end;flex-wrap:wrap;min-width:0;pointer-events:auto}
.match-immersive .scoreboard{position:static;grid-column:1;grid-row:1;transform:none;max-width:none;gap:9px;padding:5px 10px;height:44px;min-width:0}
.match-immersive .team{padding-bottom:3px;gap:6px}.match-immersive .team>span{display:none}.match-immersive .team b{font-size:23px}
.match-immersive .match-clock{min-width:44px}.match-immersive .match-clock>span{font-size:13px}.match-immersive .match-clock small{font-size:10px;margin-top:1px}
.match-immersive .objective{position:static;grid-column:1/-1;justify-self:end;max-width:100%;padding:6px 9px;gap:7px}
.match-immersive .objective-glyph,.match-immersive .objective small,.match-immersive .objective div>span{display:none}.match-immersive .objective strong{font-size:12px;margin:0}
.match-immersive .map-meta,.match-immersive .battlefield-footer{display:none}
.match-immersive .arena-notice{top:calc(var(--game-safe-top) + var(--game-topbar-height,80px) + 8px);max-width:85%;font-size:12px;padding:7px 10px;z-index:3}
.match-immersive .combat-dock{position:absolute;left:var(--game-safe-left);right:var(--game-safe-right);bottom:var(--game-safe-bottom);z-index:5;display:flex;flex-direction:column;align-items:stretch;gap:8px;max-height:calc(100% - var(--game-topbar-height,80px) - var(--game-safe-top) - var(--game-safe-bottom) - 20px);overflow:auto;overscroll-behavior:contain;pointer-events:none;padding:3px}
.match-immersive .combat-dock>*{flex:none;pointer-events:auto}
.match-immersive .view-controls{position:static;order:0;display:flex;flex-wrap:wrap;gap:6px;max-width:none;width:auto;align-self:flex-start;min-width:0}
.match-immersive .view-controls button{min-height:44px;min-width:44px;font-size:12px;padding:7px 10px}
.match-immersive .talent-nudge{position:static;order:1;align-self:center;width:auto;transform:none;margin:0}
.match-immersive .talent-nudge button{min-height:44px}
.match-immersive .hud{position:static;order:2;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'vitals vitals' 'abilities utility';gap:8px 4px;align-items:center;width:100%;min-width:0;min-height:0;margin:0;padding:8px;box-shadow:0 6px 18px #0006}
.match-immersive .hud .hero-vitals{grid-area:vitals;position:static;min-width:0;max-width:none;padding:0;border:0;background:none;display:block}
.match-immersive .hud-mark{display:none}
.match-immersive .vitals{display:grid;grid-template-columns:minmax(60px,1fr) 1.4fr 1fr;gap:8px;align-items:center;min-width:0}
.match-immersive .vitals-label{margin:0;font-size:12px;min-width:0}.match-immersive .vitals-label b{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.match-immersive .vitals-label small{display:none}
.match-immersive .health-track,.match-immersive .energy-track{height:16px;margin:0;min-width:0}.match-immersive .health-track span,.match-immersive .energy-track span{line-height:16px}
.match-immersive .abilities{grid-area:abilities;display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:4px;min-width:0}
.match-immersive .ability{width:100%;height:48px;min-width:44px}.match-immersive .ability .glyph{font-size:27px}
.match-immersive .utility-actions{grid-area:utility;padding:0;gap:4px;border:0}.match-immersive .utility-actions button{width:44px;min-height:44px;padding:0}
.match-immersive .ability kbd,.match-immersive .utility-actions kbd{bottom:1px;left:2px;font-size:9px;line-height:12px;min-width:14px;padding:1px 2px}
.match-immersive .end-state{z-index:6;padding-top:calc(var(--game-topbar-height,80px) + var(--game-safe-top) + 12px);padding-bottom:var(--game-safe-bottom)}
@media(min-width:700px){
  .match-immersive .combat-dock{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3fr);align-items:end;gap:8px 12px}
  .match-immersive .view-controls{grid-column:1;grid-row:2;align-self:end}
  .match-immersive .talent-nudge{grid-column:1/-1;grid-row:1;justify-self:center}
  .match-immersive .hud{grid-column:2;grid-row:2}
}
@media(min-width:1100px){
  .match-immersive .hud{grid-template-columns:minmax(120px,1fr) minmax(220px,1.6fr) auto;grid-template-areas:'vitals abilities utility';gap:12px;padding:12px}
  .match-immersive .vitals{display:block}.match-immersive .vitals-label{margin-bottom:6px}.match-immersive .energy-track{margin-top:4px}
}
@media(max-width:380px){
  .match-immersive{--game-safe-left:max(6px,env(safe-area-inset-left));--game-safe-right:max(6px,env(safe-area-inset-right))}
  .match-controls button{padding:7px 6px;font-size:10px}.match-immersive .match-controls{gap:4px}.match-immersive .scoreboard{gap:5px;padding:5px 6px}.match-immersive .team b{font-size:20px}
  .match-immersive .combat-dock{padding:1px}.match-immersive .hud{padding:6px}
}
@media(max-width:310px){.match-immersive .hud{grid-template-areas:'vitals vitals' 'abilities abilities' '. utility'}}

/* Navigation stays in the existing flow dock and Commands drawer. */
.tactical-chart{margin:20px 0;padding-top:18px;border-top:1px solid #2a3e50}
#command-map{display:block;position:static;width:100%;height:auto;aspect-ratio:5/3;margin-top:12px;background:#091621;border:1px solid #426177;overflow:hidden;cursor:crosshair;touch-action:manipulation}
#command-map:focus-visible{outline:2px solid #e9c68b;outline-offset:3px}
.tactical-chart p{font-size:11px;line-height:1.6;color:#9ab1c3;margin:8px 0}
#arena.camera-panning{cursor:grab}#arena.camera-dragging{cursor:grabbing}
.view-controls #camera-pan[aria-pressed="true"]{color:#101b25;background:#e9c68b;border-color:#e9c68b}

#command-map>*{pointer-events:none}
