/* V5.158: one shared ONLINE HUD; restore it on every common-menu page. */
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus{
 display:block!important;visibility:visible!important;position:fixed!important;z-index:100270!important;
 top:7px!important;right:8px!important;min-width:0!important;width:clamp(175px,23vw,305px)!important;
 max-width:calc(100vw - 16px)!important;max-height:min(46vh,230px)!important;overflow:hidden!important;
 padding:5px 8px!important;text-align:left!important;border-radius:7px!important;
}
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlineSub,
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{
 display:block!important;
}
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{
 display:grid!important;max-height:min(30vh,156px)!important;overflow:hidden!important;gap:2px!important;
}
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayer{
 font-size:10px!important;grid-template-columns:minmax(50px,1fr) minmax(0,1.6fr)!important;
}
body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .pstate{
 white-space:normal!important;text-align:right!important;overflow-wrap:anywhere!important;font-size:9px!important;
}
/* Retire the duplicate header-only HUD; the original global HUD now serves every page. */
body.hdCommonMainActive #hdCommonMain .hdPresence{display:none!important}
/* Course selector overlays the common menu and must not obscure the ONLINE HUD. */
body.hdCommonMainActive:has(#hdCourseGate:not([hidden])):not(.haruna-diag-presence-off) #globalOnlineStatus{
 z-index:100290!important;top:58px!important;
}
/* Chat header has BACK on the right; ONLINE HUD is below header in the CHAT content's right column. */
body.hdCommonMainActive:has(#hdCommonMain.hdChatOpen):not(.haruna-diag-presence-off) #globalOnlineStatus{
 top:108px!important;right:12px!important;width:clamp(170px,31vw,405px)!important;
 max-height:125px!important;
}
body.hdCommonMainActive:has(#hdCommonMain.hdChatOpen):not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{
 max-height:75px!important;
}
#hdCommonMain .hdChatPage .hdChatWorkspace{display:grid;grid-template-columns:minmax(0,56fr) minmax(220px,44fr);gap:10px;min-height:0;flex:1;padding:10px}
#hdCommonMain .hdChatPage .hdChatWorkspace .hdChatBody{padding:0!important;min-width:0;min-height:0}
#hdCommonMain .hdChatPage .hdChatMapHost{min-width:0;min-height:0;overflow:auto;border-left:1px solid #1d7ca5;
 padding:132px 2px 4px 10px;color:#c9f7ff;background:#02121b88}
#hdCommonMain .hdChatPage .hdChatMapHost>strong{display:block;font:900 12px/1.3 Arial,sans-serif;margin-bottom:7px}
#hdCommonMain .hdChatPage .hdChatMapHost .onlineMaps{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
#hdCommonMain .hdChatPage .hdChatMapHost .onlineMapCard{width:100%;min-width:0}
#hdCommonMain .hdChatPage .hdChatMapHost .onlineLobbyCanvas{height:clamp(105px,21vh,170px)!important;min-height:0!important;width:100%!important}
#hdCommonMain .hdChatPage .hdChatMapHost .onlineBoxTitle{font-size:11px!important}
#hdCourseGate .hdFlowMethodBtn .hdFlowActivity{display:block;margin:6px auto 0;max-width:30ch;
 font:800 clamp(10px,1.05vw,14px)/1.3 Arial,sans-serif!important;letter-spacing:0;color:#8eeecb;
 white-space:normal;overflow-wrap:anywhere;text-transform:none}
@media (max-width:800px){
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus{top:3px!important;right:3px!important;width:min(43vw,220px)!important;padding:3px 5px!important;max-height:110px!important}
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlineMain{font-size:10px!important}
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlineMain b{font-size:12px!important}
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{max-height:65px!important}
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayer{font-size:8px!important;gap:3px!important}
 body.hdCommonMainActive:not(.haruna-diag-presence-off) #globalOnlineStatus .pstate{font-size:7px!important}
 body.hdCommonMainActive:has(#hdCommonMain.hdChatOpen):not(.haruna-diag-presence-off) #globalOnlineStatus{top:94px!important;right:5px!important;width:42vw!important;max-height:90px!important}
 body.hdCommonMainActive:has(#hdCommonMain.hdChatOpen):not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{max-height:45px!important}
 #hdCommonMain .hdChatPage .hdChatWorkspace{grid-template-columns:minmax(0,58fr) minmax(130px,42fr);gap:5px;padding:5px}
 #hdCommonMain .hdChatPage .hdChatMapHost{padding:95px 2px 3px 5px}
 #hdCommonMain .hdChatPage .hdChatMapHost .onlineLobbyCanvas{height:100px!important}
 #hdCourseGate .hdFlowMethodBtn .hdFlowActivity{font-size:9px!important}
}
/* Diagnostic OFF still takes precedence on every screen. */
body.haruna-diag-presence-off #globalOnlineStatus{display:none!important;visibility:hidden!important}

/* Keep the same complete roster on RANKING / OPTION / GARAGE. Earlier CSS compacted it to only ONLINE count. */
body.hdCommonMainActive:is(:has(#rankingOverlay.show),:has(#onlineOptionOverlay.show),:has(#garageOverlay.show)):not(.haruna-diag-presence-off) #globalOnlineStatus{
 display:block!important;min-width:0!important;width:clamp(175px,23vw,305px)!important;max-width:305px!important;
}
body.hdCommonMainActive:is(:has(#rankingOverlay.show),:has(#onlineOptionOverlay.show),:has(#garageOverlay.show)):not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlineSub{display:block!important}
body.hdCommonMainActive:is(:has(#rankingOverlay.show),:has(#onlineOptionOverlay.show),:has(#garageOverlay.show)):not(.haruna-diag-presence-off) #globalOnlineStatus .globalOnlinePlayers{display:grid!important}
