/* 11.00: phone navigation only. All desktop rules and vessel geometry stay intact. */
@media(max-width:650px){
 body[data-room]{--phone-edge:max(8px,env(safe-area-inset-left),env(safe-area-inset-right))}
 body[data-room] main{
  width:calc(100% - var(--phone-edge)*2);margin:0 auto;
  padding:0 0 max(4px,env(safe-area-inset-bottom));
 }
 /* Keep the previous SOLO measuring width: freeing the rail must not enlarge
    or thin the vessels. Fit-layout.js and the frame renderer are unchanged. */
 body[data-room] .game-content,body[data-room].cinema-mode .game-content{
  width:calc(100vw - 50px);max-width:100%;margin:0 auto;
 }
 body[data-room] .topbar{
  position:relative;inset:auto;width:100%;height:auto;min-height:0;
  padding:max(3px,env(safe-area-inset-top)) var(--phone-edge) 0;
  box-sizing:border-box;z-index:40;
 }
 body[data-room] .topbar .header-actions{
  position:relative;inset:auto;transform:none;width:100%;height:44px;
  max-height:none;box-sizing:border-box;display:grid;grid-template-columns:1fr 1fr;
  gap:3px;padding:2px;margin:0;border-radius:13px;
 }
 body[data-room] .topbar .platform-nav,
 body[data-room] .topbar .header-utilities{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  flex-direction:row;gap:2px;width:100%;min-width:0;
  padding:0;margin:0;border:0;
 }
 body[data-room] .topbar .header-utilities{border-left:1px solid #ffffff18;padding-left:3px}
 body[data-room] .topbar .header-utilities>details{position:static}
 body[data-room] .topbar .platform-nav button,
 body[data-room] .topbar .game-options>summary,
 body[data-room] .topbar .utility-menu>summary,
 body[data-room] .topbar #rules-open{
  position:relative;box-sizing:border-box;height:38px;min-height:38px;
  width:100%;min-width:0;padding:3px 0;gap:2px;border-radius:8px;
  font:500 8px/10px 'Manrope',sans-serif;letter-spacing:0;
 }
 body[data-room] .topbar .platform-nav button::before,
 body[data-room] .topbar .game-options>summary::before,
 body[data-room] .topbar .utility-menu>summary::before,
 body[data-room] .topbar #rules-open::before{width:16px;height:16px}
 body[data-room] .topbar .platform-nav button[aria-pressed=true]::after{
  top:auto;bottom:0;left:25%;width:50%;height:1px;border-radius:2px;
 }
 body[data-room] .topbar .version-button{
  top:calc(100% + 7px);left:var(--phone-edge);min-height:20px;
  padding:2px 4px;z-index:1;
 }
 body[data-room] .topbar .version-button b{font-size:9px}
 body[data-room] .topbar .game-options .settings-popover{
  position:absolute;top:calc(100% + 7px);right:0;bottom:auto;left:auto;
  width:300px;max-width:calc(100vw - var(--phone-edge)*2);
  max-height:calc(100svh - 66px - env(safe-area-inset-top));overflow:auto;
 }
 body[data-room] .topbar .utility-menu nav{
  position:absolute;top:calc(100% + 7px);right:0;bottom:auto;left:auto;
  width:230px;max-width:calc(100vw - var(--phone-edge)*2);
  max-height:calc(100svh - 66px - env(safe-area-inset-top));overflow:auto;
 }
 /* Reclaim the header/footer space, not the glass. Keep the brand above Aurora. */
 body[data-room] .shared-masthead{padding:3px 0 0}
 body[data-room] .shared-masthead .brand{height:10px;line-height:10px;margin:0 0 2px;font-size:6px}
 body[data-room] #game-title{font-size:24px;line-height:24px;margin:0}
 body[data-room] #game-title span{font-size:6px;line-height:6px;margin-top:2px}
 body[data-room] .world-selector{margin:1px auto}
 body[data-room] .console-bottom{
  display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:0 6px;
 }
 body[data-room] .console-bottom .arena-footer{
  flex:0 1 auto;width:auto;min-height:0;padding:0;margin:0;
  font-size:6px;line-height:10px;letter-spacing:0;white-space:nowrap;
 }
 /* Open history remains readable; expanded panels and the keyboard may scroll. */
 body[data-room] .console-bottom:has(.session-drawer[open]){flex-wrap:wrap}
 body[data-room] .console-bottom .session-drawer[open]{width:100%}
 /* Multi keeps both machines stacked and their established row size. Only the
    available player-panel width grows into the former rail reservation. */
 body[data-room][data-platform=duel] #duel-view{width:100%;padding-left:0;padding-right:0}
 body[data-room] .duel-players{margin-left:auto;margin-right:auto}
 body[data-room] .duel-instrument{justify-self:center}
}
