/* Camada isolada e carregada por último: um único tooltip para todo o HUD. */
html body.rush-hud-v3 #game #topbar [data-tooltip] {
  position: relative !important;
  overflow: visible !important;
}

html body.rush-hud-v3 #game #topbar [data-tooltip]::after {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 1000 !important;
  display: none !important;
  box-sizing: border-box !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: 220px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 5px 8px !important;
  transform: translateX(-50%) !important;
  border: 1px solid #ff790d !important;
  border-radius: 6px !important;
  background: linear-gradient(145deg, #21140d, #0d0d0e) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .62), 0 0 9px rgba(255, 91, 12, .38) !important;
  color: #ffe0c1 !important;
  content: attr(data-tooltip) !important;
  font: 800 11px/1 system-ui, sans-serif !important;
  letter-spacing: .15px !important;
  line-height: 1 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

html body.rush-hud-v3 #game #topbar [data-tooltip]:hover::after,
html body.rush-hud-v3 #game #topbar [data-tooltip]:focus-visible::after {
  display: block !important;
}

/* Diamantes é a única etiqueta azul, acompanhando o respectivo botão. */
html body.rush-hud-v3 #game #topbar .hud-diamond-btn[data-tooltip]::after {
  border-color: #4ddfff !important;
  background: linear-gradient(145deg, #0b2835, #0b1118) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .62), 0 0 10px rgba(58, 219, 255, .5) !important;
  color: #aaf4ff !important;
}

/* Não reservar espaço para as categorias antigas substituídas pelos atalhos. */
html body.rush-hud-v3 #game #topbar .hud-nav-group[data-hud-group="utilities"],
html body.rush-hud-v3 #game #topbar .hud-nav-group[data-hud-group="protection"] {
  display: none !important;
}
html body.rush-hud-v3 #game #topbar > .rush-drag-grip,
html body.rush-hud-v3 #game #topbar > .rush-resize-grip,
html body.rush-hud-v3 #game #topbar > .hud-nav-group:not(:has(.hud-category)) {
  display: none !important;
}
html body.rush-hud-v3 #game #topbar .hud-diamond-btn {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* A barra superior é uma sequência flex contínua, nunca uma grade com slots. */
html body.rush-hud-v3 #game #topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  grid-auto-flow: initial !important;
  gap: 6px !important;
}
html body.rush-hud-v3 #game #topbar > .hud-nav-group,
html body.rush-hud-v3 #game #topbar > .hud-diamond-btn,
html body.rush-hud-v3 #game #topbar > .hud-quick-travel,
html body.rush-hud-v3 #game #topbar > .hud-system-actions {
  flex: 0 0 auto !important;
}
html body.rush-hud-v3 #game #topbar > .hud-diamond-btn { order: 10 !important; }
html body.rush-hud-v3 #game #topbar > .hud-quick-travel { order: 20 !important; }
html body.rush-hud-v3 #game #topbar > .hud-system-actions { order: 21 !important; }

/* Controle independente do menu: ↑ ao lado da barra, ↓ ao ocultar. */
html body.rush-hud-v3 #game #topbar {
  overflow: visible !important;
}
html body.rush-hud-v3 #game #topbar #topbar-collapse {
  position: absolute !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: calc(100% + 10px) !important;
  z-index: 260 !important;
  display: grid !important;
  width: 43px !important;
  min-width: 43px !important;
  height: 43px !important;
  min-height: 43px !important;
  place-items: center !important;
  transform: translateY(-50%) !important;
  border: 1px solid rgba(255, 113, 18, .8) !important;
  border-radius: 11px !important;
  background: rgba(13, 18, 23, .72) !important;
  color: #ff790d !important;
  cursor: pointer !important;
}
html body.rush-hud-v3 #game #topbar-toggle {
  position: fixed !important;
  top: 5px !important;
  left: 50% !important;
  z-index: 270 !important;
  display: none !important;
  width: 94px !important;
  height: 34px !important;
  place-items: center !important;
  transform: translateX(-50%) !important;
  border: 1px solid rgba(255, 113, 18, .8) !important;
  border-radius: 10px !important;
  background: rgba(13, 18, 23, .9) !important;
  color: #ff790d !important;
  cursor: pointer !important;
}
html body.rush-hud-v3.topbar-hidden #game #topbar-toggle { display: grid !important; }
