/**
 * Link integrity HUD — signal bars + RTT.
 *
 * Mounted in PAGE FOOTER next to "world map" (see LinkHud.js).
 * Do NOT use position:fixed — that was the old chip over controls.
 */

/* ── Footer inline HUD ── */
.tmj-link-hud,
#tmj-link-hud,
body.chess-page .tmj-link-hud,
body.chess-page #tmj-link-hud,
footer.chess-mini-foot .tmj-link-hud,
#chess-page-footer .tmj-link-hud {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  inset: auto !important;
  z-index: auto !important;
  float: none !important;
  transform: none !important;

  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  vertical-align: middle;

  margin: 0 0 0 0.15rem !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  color: #6a9a7a;
  font-family: "Courier New", monospace;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  white-space: nowrap;
}

.tmj-link-hud .tmj-link-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.tmj-link-hud .tmj-link-bars i {
  display: block;
  width: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
}

.tmj-link-hud .tmj-link-bars i:nth-child(1) {
  height: 4px;
}
.tmj-link-hud .tmj-link-bars i:nth-child(2) {
  height: 6px;
}
.tmj-link-hud .tmj-link-bars i:nth-child(3) {
  height: 8px;
}
.tmj-link-hud .tmj-link-bars i:nth-child(4) {
  height: 11px;
}

.tmj-link-hud .tmj-link-bars i.is-on {
  background: #3dffa0;
}

.tmj-link-hud.is-constrained .tmj-link-bars i.is-on,
.tmj-link-hud.is-constrained {
  color: #e0c060;
}
.tmj-link-hud.is-constrained .tmj-link-bars i.is-on {
  background: #ffcc66;
}

.tmj-link-hud.is-hostile .tmj-link-bars i.is-on,
.tmj-link-hud.is-offline .tmj-link-bars i.is-on {
  background: #ff6b6b;
}
.tmj-link-hud.is-hostile,
.tmj-link-hud.is-offline {
  color: #ffb0b0;
}

.tmj-link-hud .tmj-link-label {
  min-width: 0;
  white-space: nowrap;
}

/* Hostile path: kill heavy atmosphere that steals frames */
body.link-lite .chess-lightning-canvas,
body.link-lite .immersion-layer,
body.link-lite .immersion-glow,
body.link-offline .chess-lightning-canvas {
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

/* If HUD was ever left next to controls, force it out of rail flow visually
   until JS re-homes it (should not stay there after LinkHud.ensure) */
#controls-panel-module + #tmj-link-hud,
.match-actions + #tmj-link-hud,
.match-rail-body > #tmj-link-hud {
  /* Still static — but mark for humans in DOM; JS re-appends to footer */
}
