/* ==================== 7. SCREEN-SPACE 1:1 CRISP HUD OVERLAY ==================== */
#hud-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s ease;
}

#hud-layer.show {
  opacity: 1;
  visibility: visible;
}

#hudSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#hudPoly {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

#hudBar {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--chrome-border-strong);
  box-shadow: var(--chrome-shadow);
  color: var(--chrome-text);
}

#hudBar button {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--chrome-text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

#hudBar button:hover {
  background: var(--chrome-hover);
}

#hudBar button.on {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

#hudBar button.dim {
  opacity: 0.42;
}

#hudBar .del:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.hud-sep {
  width: 1px;
  height: 16px;
  background: var(--chrome-border-strong);
  margin: 0 2px;
  flex: none;
}

.q-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.24);
  flex: none;
}

#hudHandle {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  pointer-events: auto;
  display: grid;
  place-items: center;
  background: var(--chrome-solid);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  cursor: nwse-resize;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: background-color 0.12s ease, color 0.12s ease;
}

#hudHandle:hover {
  background: var(--accent);
  color: var(--accent-fg);
}

#hudSize {
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: #111827;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
  display: none;
}

#hudSize.show {
  display: block;
}
