/* Shared landmark HUD: compact game-style modules over the world view. */
body.scene-theme.hud-grouped{--hud-gap:10px;--hud-bottom:0px}
body.hud-grouped nav.app-nav{top:max(12px,env(safe-area-inset-top))}
body.hud-grouped .place-title{left:max(20px,calc((100vw - 1120px)/2));top:var(--hud-top,100px);width:280px;max-width:calc(100vw - 40px)}

/* Three separate islands replace the former full-width white footer. */
body.shared-theme.hud-grouped .scene-dock{
 position:fixed;
 z-index:38;
 left:50%;
 bottom:calc(16px + env(safe-area-inset-bottom) + var(--hud-bottom));
 transform:translateX(-50%);
 box-sizing:border-box;
 width:min(920px,calc(100% - 24px));
 display:grid;
 grid-template-columns:240px auto minmax(360px,420px);
 justify-content:center;
 align-items:end;
 gap:var(--hud-gap);
 padding:0;
 background:transparent;
 color:var(--hl-ink);
 border:0;
 border-radius:0;
 box-shadow:none;
 pointer-events:none;
}
body.shared-theme.hud-grouped .scene-dock>:not([hidden]){pointer-events:auto}
body.shared-theme.hud-grouped .dock-player,
body.shared-theme.hud-grouped .dock-camera-mode,
body.shared-theme.hud-grouped .dock-chat{
 box-sizing:border-box;
 min-height:58px;
 background:var(--hl-paper,#fffef8);
 border:1px solid var(--hl-line,#d6ddce);
 border-radius:14px;
 box-shadow:0 7px 20px #17271b1a;
}

/* Player identity stays readable; secondary actions live in Tools. */
body.shared-theme.hud-grouped .dock-player{
 position:relative;
 display:flex;
 align-items:center;
 gap:6px;
 min-width:0;
 padding:6px;
 overflow:visible;
}
body.shared-theme.hud-grouped .dock-player::before{
 content:'';
 position:absolute;
 left:-1px;
 top:12px;
 bottom:12px;
 width:3px;
 background:var(--hl-green,#2f8f5f);
 box-shadow:0 4px 0 var(--hl-active,#d2f65a);
}
body.shared-theme.hud-grouped .scene-dock .player-card{
 position:static;
 inset:auto;
 display:flex;
 align-items:center;
 gap:7px;
 flex:1 1 auto;
 width:auto;
 max-width:none;
 min-width:0;
 min-height:44px;
 margin:0;
 padding:0 3px;
 background:transparent;
 border:0!important;
 border-radius:0!important;
 box-shadow:none!important;
}
body.shared-theme.hud-grouped .scene-dock .player-card canvas{flex:0 0 auto;width:34px;height:34px;border-radius:8px;background:var(--hl-secondary,#edf1e5)}
body.shared-theme.hud-grouped .scene-dock .player-card>div{min-width:0;flex:1}
body.shared-theme.hud-grouped .scene-dock .player-card strong{font-size:11px;line-height:1.35}
body.shared-theme.hud-grouped .scene-dock .player-card span{font-size:10px;line-height:1.35;color:var(--hl-muted,#627368)}
body.shared-theme.hud-grouped .scene-dock .player-card strong,
body.shared-theme.hud-grouped .scene-dock .player-card span{display:block;max-width:104px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.shared-theme.hud-grouped .scene-dock .player-card>.dock-change-role{display:none!important}

/* Tools opens above its own compact module and keeps all original handlers. */
body.shared-theme.hud-grouped .dock-tools{position:relative;flex:0 0 auto}
body.shared-theme.hud-grouped .dock-tools>summary{
 display:flex;
 align-items:center;
 justify-content:center;
 gap:6px;
 min-width:58px;
 min-height:44px;
 padding:8px 10px;
 border:1px solid var(--hl-line,#d6ddce);
 border-radius:10px;
 background:var(--hl-secondary,#edf1e5);
 font:600 12px var(--hl-font);
 cursor:pointer;
 list-style:none;
}
body.shared-theme.hud-grouped .dock-tools>summary::after{content:'+';font-size:17px;line-height:1;color:var(--hl-brand,#2f8f5f)}
body.shared-theme.hud-grouped .dock-tools[open]>summary::after{content:'−'}
body.shared-theme.hud-grouped .dock-tools:not([open])>.dock-tool-content{display:none!important}
body.shared-theme.hud-grouped .dock-tool-content{
 position:absolute;
 right:0;
 bottom:calc(100% + 8px);
 box-sizing:border-box;
 display:flex;
 flex-direction:column;
 width:min(292px,calc(100vw - 24px));
 max-height:min(320px,48dvh);
 overflow:auto;
 overscroll-behavior:contain;
 touch-action:pan-y;
 padding:10px;
 background:var(--hl-paper,#fffef8);
 border:1px solid var(--hl-line,#d6ddce);
 border-radius:14px;
 box-shadow:var(--hl-shadow,0 8px 24px #17271b1a);
}
body.shared-theme.hud-grouped .dock-tool-content .land-tools{
 position:static!important;
 inset:auto!important;
 display:flex;
 flex-wrap:wrap;
 width:100%;
 gap:8px;
 margin:0;
 padding:0;
 background:none;
 border:0!important;
 box-shadow:none!important;
}
body.shared-theme.hud-grouped .dock-tool-content .view-tools{display:none!important}
body.shared-theme.hud-grouped .dock-tool-content button{flex:1;min-height:42px;white-space:nowrap}
body.shared-theme.hud-grouped .dock-tool-content .dock-change-role{order:-1;flex:none;width:100%;margin:0 0 8px}
body.shared-theme.hud-grouped .dock-tool-content .land-tools small{width:100%;padding:4px 0;background:none;border:0;color:var(--hl-muted,#627368)}

/* Camera controls form a small central action bar. */
body.shared-theme.hud-grouped .dock-camera-mode{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px}
body.shared-theme.hud-grouped .dock-camera-mode button{min-width:54px;min-height:44px;padding:8px 11px;border-radius:10px;font-size:12px}

/* The chat composer is its own right-side module; connection text remains live for assistive tech. */
body.shared-theme.hud-grouped .dock-chat{position:relative;min-width:0;padding:6px}
body.shared-theme.hud-grouped .scene-dock .chat-dock{
 position:relative!important;
 inset:auto!important;
 width:100%!important;
 transform:none!important;
 margin:0!important;
 padding:0!important;
 background:transparent!important;
 border:0!important;
 border-radius:0!important;
 box-shadow:none!important;
}
body.shared-theme.hud-grouped .scene-dock .chat-dock form{display:flex!important;align-items:center;gap:6px}
body.shared-theme.hud-grouped .scene-dock .chat-dock input{flex:1;min-width:0;width:0;height:44px;min-height:44px;padding:9px 12px;border-radius:10px;font-size:13px}
body.shared-theme.hud-grouped .scene-dock .chat-dock .emoji-toggle{flex:0 0 44px;width:44px;min-width:44px;min-height:44px;padding:0;border-radius:10px;font-size:16px!important}
body.shared-theme.hud-grouped .scene-dock .chat-dock form button[type=submit]{flex:0 0 auto;min-width:62px;min-height:44px;padding:8px 13px;border-radius:10px}
body.shared-theme.hud-grouped .scene-dock .chat-dock>small[role=status]{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;padding:0!important;white-space:nowrap}

body.hud-grouped .town-help{display:none}
body.hud-grouped .town-bottom{display:none!important}
body.hud-grouped[data-room] .places-panel{top:calc(var(--hud-top,100px) + 180px);left:max(20px,calc((100vw - 1120px)/2))}
body.hud-grouped .parcel-inspector{top:var(--hud-top,100px)!important;right:max(20px,calc((100vw - 1120px)/2))!important;max-height:calc(100dvh - var(--hud-top,100px) - 110px)}
body.hud-grouped.choosing-role .scene-dock{display:none}
body.hud-grouped :is(button,a,summary,input):focus-visible{outline:3px solid #356b9c;outline-offset:3px}

@media(max-width:760px){
 body.hud-grouped .place-title{top:var(--hud-top,140px)!important;left:12px!important;width:calc(100% - 24px)!important;max-width:none!important;box-sizing:border-box;padding:10px 12px}
 body.hud-grouped .place-title>small{display:none}
 body.hud-grouped .place-title h1{margin:0;padding-right:80px;font-size:16px}
 body.hud-grouped .place-title p{display:none}
 body.hud-grouped .place-title .map-status{margin-top:6px;padding-top:6px!important;gap:4px 8px;font-size:11px!important}
 body.hud-grouped .map-status time{width:auto}
 body.hud-grouped .scene-online{top:10px;right:12px}
 body.shared-theme.hud-grouped .scene-dock,
 body.shared-theme.hud-grouped .scene-dock.dock-compact{
  width:calc(100% - 16px);
  grid-template-columns:minmax(0,1fr) auto;
  align-items:stretch;
  gap:6px;
  bottom:calc(8px + env(safe-area-inset-bottom) + var(--hud-bottom));
 }
 body.shared-theme.hud-grouped .dock-player,
 body.shared-theme.hud-grouped .dock-camera-mode,
 body.shared-theme.hud-grouped .dock-chat{min-height:54px;border-radius:12px;box-shadow:0 5px 16px #17271b18}
 body.shared-theme.hud-grouped .dock-player{gap:4px;padding:5px}
 body.shared-theme.hud-grouped .scene-dock .player-card{gap:6px;padding:0 2px}
 body.shared-theme.hud-grouped .scene-dock .player-card canvas{width:32px;height:32px}
 body.shared-theme.hud-grouped .scene-dock .player-card strong,
 body.shared-theme.hud-grouped .scene-dock .player-card span{max-width:88px;font-size:10px}
 body.shared-theme.hud-grouped .dock-tools>summary{min-width:52px;padding-inline:8px}
 body.shared-theme.hud-grouped .dock-camera-mode{gap:4px;padding:5px}
 body.shared-theme.hud-grouped .dock-camera-mode button{min-width:46px;padding-inline:8px}
 body.shared-theme.hud-grouped .dock-chat{grid-column:1/-1;padding:5px}
 body.shared-theme.hud-grouped .dock-tool-content{position:fixed;left:8px;right:8px;bottom:calc(124px + env(safe-area-inset-bottom) + var(--hud-bottom));width:auto}
 body.hud-grouped[data-room] .places-panel{left:12px;top:calc(var(--hud-top,140px) + 110px);max-width:160px}
 body.hud-grouped .parcel-inspector{top:calc(var(--hud-top,140px) + 100px)!important;right:12px!important;width:min(260px,calc(100vw - 24px));max-height:35dvh}
 body.shared-theme.hud-grouped[data-keyboard=true] .dock-player,
 body.shared-theme.hud-grouped[data-keyboard=true] .dock-camera-mode,
 body.hud-grouped[data-keyboard=true] .place-title,
 body.hud-grouped[data-keyboard=true] .places-panel{display:none!important}
 body.shared-theme.hud-grouped[data-keyboard=true] .scene-dock{grid-template-columns:1fr}
 body.shared-theme.hud-grouped[data-keyboard=true] .dock-chat{grid-column:1/-1}
}

@media(max-width:390px){
 body.shared-theme.hud-grouped .scene-dock .player-card span{display:none}
 body.shared-theme.hud-grouped .scene-dock .player-card strong{max-width:76px}
 body.shared-theme.hud-grouped .dock-tools>summary{min-width:48px;padding-inline:6px}
 body.shared-theme.hud-grouped .dock-camera-mode button{min-width:44px;padding-inline:6px}
 body.shared-theme.hud-grouped .scene-dock .chat-dock form button[type=submit]{min-width:54px;padding-inline:9px}
}

@media(min-width:620px) and (max-width:950px) and (max-height:500px){
 body.hud-grouped .place-title{width:230px;max-width:45vw;padding:8px 12px}
 body.hud-grouped .place-title p,body.hud-grouped .place-title>small{display:none}
 body.hud-grouped .place-title h1{margin:0;font-size:14px}
 body.shared-theme.hud-grouped .scene-dock.dock-compact{width:calc(100% - 16px);grid-template-columns:minmax(205px,240px) auto minmax(240px,360px);gap:6px;bottom:calc(6px + var(--hud-bottom))}
 body.shared-theme.hud-grouped .dock-player,
 body.shared-theme.hud-grouped .dock-camera-mode,
 body.shared-theme.hud-grouped .dock-chat{min-height:52px}
 body.shared-theme.hud-grouped .scene-dock .dock-chat{grid-column:auto}
 body.shared-theme.hud-grouped .dock-tool-content{position:absolute;left:auto;right:0;bottom:calc(100% + 8px);width:min(292px,calc(100vw - 24px))}
 body.hud-grouped[data-room] .places-panel{display:none}
}
