/* HUD: a generic node status popover in navy with a terminal texture (from the phosphor study).
   Phone: drops from the status bar when a pill is tapped. Desktop: docked at the top of the right column. */

.hud {
  --caret-x: 60%;
  position: fixed; z-index: 60;
  top: calc(var(--bar-h) + 10px); left: 10px; right: 10px;
  max-width: 520px; margin: 0 auto;
  padding: 10px 14px 12px;
  border-radius: 8px;
  background: var(--pop-bg);
  color: var(--pop-ink);
  border: 1px solid var(--pop-line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(185, 188, 217, .07);
  font: 400 12px/1.3 var(--f-mono);
  font-variant-numeric: tabular-nums;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  outline: none;
}
.hud.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
/* spectral hairline on the top edge */
.hud::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(25, 227, 255, .8), rgba(67, 255, 140, .9), rgba(210, 255, 42, .8), transparent);
  filter: drop-shadow(0 0 4px rgba(67, 255, 140, .8));
}
/* faint scanlines */
.hud::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(185, 188, 217, .028) 0 1px, transparent 1px 3px);
}
.hud-caret {
  position: absolute; top: -6px; left: var(--caret-x);
  width: 11px; height: 11px; margin-left: -5.5px;
  background: var(--pop-bg);
  border-left: 1px solid var(--pop-line); border-top: 1px solid var(--pop-line);
  transform: rotate(45deg);
}
.hud.no-caret .hud-caret { display: none; }
.hud-top { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px; border-radius: 5px;
  background: var(--pop-pill); color: var(--pop-bg);
  font: 600 12px/1 var(--f-mono); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 16px rgba(156, 245, 201, .25);
}
.hud-pill svg, .hud-era svg { width: 12px; height: 12px; flex: none; }
.hud-era { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--f-mono); color: var(--pop-ink); }
.hud-era svg { color: var(--pop-pill); }
.hud-net { margin-left: auto; font: 500 11px/1 var(--f-mono); color: var(--pop-label); letter-spacing: .04em; }
.hud.is-preview .hud-net { color: #ffc27a; }
.hud-x {
  width: 28px; height: 28px; margin: -4px -6px -4px 0; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 5px; background: none; color: var(--pop-label);
}
.hud-x svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.hud-x:hover { color: #fff; background: rgba(185, 188, 217, .1); }

.hud-rows {
  position: relative;
  display: grid; grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 10px; row-gap: 4px;
}
.hud-rows .hr { display: contents; }
.hud-rows dt { color: var(--pop-label); }
.hud-rows dd { color: var(--pop-ink); min-width: 0; overflow-wrap: anywhere; }
.hud-rows dd i { font-style: normal; color: var(--pop-label); }
.hud-rows .who { color: var(--keeper); font-weight: 600; text-shadow: 0 0 10px var(--keeper-glow); }
.hud-rows .rpc-url { color: var(--pop-ink); }
.hud-btn {
  margin-left: 8px; padding: 1px 7px; border-radius: 4px;
  border: 1px solid rgba(185, 188, 217, .32); background: rgba(185, 188, 217, .06);
  font: 500 11px/1.5 var(--f-mono); color: var(--pop-ink);
  vertical-align: 1px;
}
.hud-btn:hover { border-color: var(--pop-pill); color: #fff; }
.hud-act {
  padding: 0; border: 0; background: none;
  font: 600 12px/1.3 var(--f-mono); color: var(--pop-pill);
  text-shadow: 0 0 10px rgba(156, 245, 201, .35);
}
.hud-act span { border-bottom: 1px dashed rgba(156, 245, 201, .55); }
.hud-act:hover span { border-bottom-style: solid; }
.cursor {
  display: inline-block; width: .55em; height: 1.05em; margin-left: 4px; vertical-align: -2px;
  background: var(--pop-pill); box-shadow: 0 0 8px rgba(156, 245, 201, .7);
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hud.flash { animation: hudflash .9s ease-out; }
@keyframes hudflash {
  0% { box-shadow: 0 24px 64px rgba(0, 0, 0, .7), 0 0 0 1px rgba(156, 245, 201, .6), 0 0 34px rgba(156, 245, 201, .28); }
  100% { box-shadow: 0 24px 64px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .5); }
}

.hud-scrim { display: none; }
.hud-open .hud-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); }

@media (min-width: 1024px) {
  .hud {
    position: relative; top: auto; left: auto; right: auto; z-index: 3;
    max-width: none; margin: 0;
    padding: 11px 18px 12px;
    opacity: 1; visibility: visible; transform: none; transition: none;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(185, 188, 217, .07);
    font-size: 12.5px;
  }
  .hud-x { display: none; }
  .hud-rows { grid-template-columns: 74px minmax(0, 1fr); column-gap: 12px; row-gap: 3px; }
  .hud-rows dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .hud-scrim, .hud-open .hud-scrim { display: none; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .hud { padding: 10px 16px 11px; }
  .hud-top { margin-bottom: 7px; }
  .hud-rows { row-gap: 3px; }
}
