/* Broadcast Monitor HUD — scoped to .broadcast-frame
   IMPORTANT: All .live-badge and .live-dot rules MUST be scoped to .broadcast-frame
   to avoid overriding the nav's existing .live-badge (red) and .live-dot (blink) styles */

.broadcast-frame {
  position: relative;
  display: inline-block;
  border-radius: 12px;
  overflow: visible;
}

/* ── HUD Top Bar ──────────────────────────────────────────── */
.broadcast-hud-top {
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.broadcast-frame .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 60, 60, 0.4);
  color: #ff6b6b;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.broadcast-frame .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4444;
  display: inline-block;
  flex-shrink: 0;
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.5); }
  50%      { opacity: 0.5; box-shadow: 0 0 0 5px rgba(255, 68, 68, 0); }
}

.signal-quality {
  color: rgba(144, 224, 239, 0.75);
  font-size: 8px;
  letter-spacing: 0.1em;
}

/* ── Photo Canvas Wrap ────────────────────────────────────── */
.photo-canvas-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(0, 180, 216, 0.25);
  box-shadow:
    0 0 0 1px rgba(0, 180, 216, 0.08),
    0 0 32px rgba(0, 180, 216, 0.12),
    0 24px 70px rgba(0, 0, 0, 0.56);
}

/* Corner bracket accents (::before / ::after for TL / BR) */
.photo-canvas-wrap::before,
.photo-canvas-wrap::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 5;
  pointer-events: none;
}

.photo-canvas-wrap::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid rgba(0, 180, 216, 0.8);
  border-left: 2px solid rgba(0, 180, 216, 0.8);
  border-radius: 2px 0 0 0;
}

.photo-canvas-wrap::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 2px solid rgba(0, 180, 216, 0.8);
  border-right: 2px solid rgba(0, 180, 216, 0.8);
  border-radius: 0 0 2px 0;
}

/* TR / BL corners — injected by photo-decode.js after decode */
.photo-canvas-wrap .corner {
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 5;
  pointer-events: none;
}

.photo-canvas-wrap .corner.tr {
  top: 6px;
  right: 6px;
  border-top: 2px solid rgba(0, 180, 216, 0.8);
  border-right: 2px solid rgba(0, 180, 216, 0.8);
  border-radius: 0 2px 0 0;
}

.photo-canvas-wrap .corner.bl {
  bottom: 6px;
  left: 6px;
  border-bottom: 2px solid rgba(0, 180, 216, 0.8);
  border-left: 2px solid rgba(0, 180, 216, 0.8);
  border-radius: 0 0 0 2px;
}

#photo-decode-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── HUD Bottom Bar ───────────────────────────────────────── */
.broadcast-hud-bottom {
  position: absolute;
  bottom: -28px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  pointer-events: none;
}

.signal-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.signal-meter span {
  display: block;
  width: 4px;
  background: #00b4d8;
  border-radius: 1px;
  opacity: 0.7;
}

.signal-meter span:nth-child(1) { height: 4px;  animation: meter-breathe 2.0s 0.0s ease-in-out infinite; }
.signal-meter span:nth-child(2) { height: 6px;  animation: meter-breathe 2.0s 0.2s ease-in-out infinite; }
.signal-meter span:nth-child(3) { height: 9px;  animation: meter-breathe 2.0s 0.4s ease-in-out infinite; }
.signal-meter span:nth-child(4) { height: 11px; animation: meter-breathe 2.0s 0.6s ease-in-out infinite; }
.signal-meter span:nth-child(5) { height: 14px; animation: meter-breathe 2.0s 0.8s ease-in-out infinite; }

@keyframes meter-breathe {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.signal-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(144, 224, 239, 0.65);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .photo-canvas-wrap {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 600px) {
  .photo-canvas-wrap {
    width: 180px;
    height: 180px;
  }
  .broadcast-hud-top,
  .broadcast-hud-bottom {
    font-size: 7px;
  }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .broadcast-frame .live-dot,
  .signal-meter span {
    animation: none !important;
    opacity: 1 !important;
  }
}
