/* JVMF SYSTEM / SURVEILLANCE — a 16:9 composition for recording in OBS. */
.surveillance-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.3vh, 18px);
  padding: clamp(20px, 2.3vw, 45px);
  background: #000;
  color: #ffd400;
  font-family: 'JetBrains Mono', Consolas, monospace;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity .35s ease;
  overflow: hidden;
}
.surveillance-screen.is-online { opacity: 1; }
.surveillance-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.surveillance-eyebrow, .surveillance-header-right, .surveillance-footer { font-size: clamp(10px, .85vw, 15px); }
.surveillance-header h1 { margin: 6px 0 0; font-size: clamp(20px, 2.05vw, 37px); font-weight: 500; }
.surveillance-header-right { text-align: right; line-height: 1.8; }
.surveillance-header-right strong { color: #00ff77; }
.surveillance-caret { animation: surveillance-blink .8s steps(1) infinite; }
.surveillance-progress { height: 3px; background: rgba(255, 212, 0, .13); }
.surveillance-progress span { display: block; height: 100%; width: 0; background: #ffd400; transition: width 15s linear; }
.surveillance-screen.is-online .surveillance-progress span { width: 100%; }
.surveillance-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1vw, 18px); position: relative; }
.surveillance-camera { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid rgba(255, 212, 0, .8); background: #000; opacity: 0; transform: scale(.975); transition: opacity .3s, transform .4s, border-color .4s; overflow: hidden; }
.surveillance-camera.is-visible { opacity: 1; transform: scale(1); }
.surveillance-camera.is-connected { border-color: #ffd400; box-shadow: inset 0 0 0 1px rgba(255, 212, 0, .2); }
.surveillance-camera-top, .surveillance-camera-bottom { display: flex; justify-content: space-between; padding: 5px 10px; gap: 8px; font-size: clamp(10px, .8vw, 15px); white-space: nowrap; }
.surveillance-camera-top { border-bottom: 1px solid rgba(255, 212, 0, .55); }
.surveillance-camera-bottom { border-top: 1px solid rgba(255, 212, 0, .55); }
.surveillance-camera-state, .surveillance-signal { color: #ffd400; }
.surveillance-camera.is-connected .surveillance-signal { color: #00ff77; }
.surveillance-camera.is-target { border-color: #00ff77; box-shadow: inset 0 0 0 2px rgba(0, 255, 119, .5); }
.surveillance-camera.is-target .surveillance-camera-state { color: #00ff77; }
.surveillance-feed { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #050505; display: grid; place-items: center; }
.surveillance-feed::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,212,0,.04) 4px 5px); }
.surveillance-crosshair { color: rgba(255, 212, 0, .36); font-size: clamp(24px, 4vw, 60px); font-weight: 400; line-height: 1; }
.surveillance-placeholder { position: absolute; bottom: 16px; font-size: clamp(9px, .72vw, 13px); color: rgba(255, 212, 0, .6); }
.surveillance-footer { display: flex; justify-content: space-between; gap: 20px; line-height: 1.4; }
.surveillance-footer-right { text-align: right; opacity: .65; }
.surveillance-final { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 16px 32px; border: 1px solid #00ff77; background: rgba(0,0,0,.9); color: #00ff77; font-size: clamp(16px, 2vw, 35px); text-align: center; opacity: 0; transition: opacity .35s; white-space: nowrap; }
.surveillance-final span { display: block; margin-top: 7px; font-size: .48em; letter-spacing: .18em; }
body.surveillance-matte .surveillance-feed { background: #ff00ff; }
body.surveillance-matte .surveillance-feed::after,
body.surveillance-matte .surveillance-crosshair,
body.surveillance-matte .surveillance-placeholder { display: none; }
@keyframes surveillance-blink { 50% { opacity: 0; } }
@media (max-width: 700px) {
  .surveillance-screen { padding: 12px; }
  .surveillance-header-right, .surveillance-footer-right { display: none; }
  .surveillance-camera-top, .surveillance-camera-bottom { padding: 4px; }
}

/* Manual feed selection and full-frame mode: only the selected HUD survives. */
.surveillance-screen.is-camera-fullscreen { padding: 0; }
.surveillance-screen.is-camera-fullscreen .surveillance-header,
.surveillance-screen.is-camera-fullscreen .surveillance-progress,
.surveillance-screen.is-camera-fullscreen .surveillance-footer { display: none; }
.surveillance-screen.is-camera-fullscreen .surveillance-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100vw;
  height: 100vh;
  gap: 0;
}
.surveillance-screen.is-camera-fullscreen .surveillance-camera:not(.is-selected) { display: none; }
.surveillance-screen.is-camera-fullscreen .surveillance-camera.is-selected {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform: none;
  opacity: 1;
  border: 1px solid #ffd400;
}
.surveillance-screen.is-camera-fullscreen .surveillance-camera-top,
.surveillance-screen.is-camera-fullscreen .surveillance-camera-bottom {
  padding: 12px clamp(15px, 2vw, 38px);
  font-size: clamp(12px, 1.1vw, 20px);
}
.surveillance-screen.is-camera-fullscreen .surveillance-crosshair {
  font-size: clamp(40px, 6vw, 110px);
}
.surveillance-screen.is-camera-fullscreen .surveillance-placeholder {
  font-size: clamp(12px, 1vw, 20px);
}
.surveillance-screen.is-target-locked .surveillance-final {
  opacity: 1;
  z-index: 5;
  pointer-events: none;
}
.surveillance-screen.is-target-locked .surveillance-camera.is-target {
  border: 2px solid #00ff77;
}
.surveillance-screen.is-glitching .surveillance-grid {
  animation: surveillance-lock-glitch .76s steps(1, end) both;
}
.surveillance-screen.is-glitching::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0 14px, rgba(0, 255, 119, .12) 15px 18px,
    transparent 19px 50px, rgba(255, 212, 0, .13) 51px 53px
  );
  animation: surveillance-lock-static .76s steps(1, end) both;
}
@keyframes surveillance-lock-glitch {
  0%, 30%, 52%, 75%, 100% { transform: translate(0,0); filter: none; }
  16% { transform: translate(7px,-3px); filter: saturate(2); }
  36% { transform: translate(-9px,2px); filter: contrast(1.7); }
  60% { transform: translate(4px,1px); filter: hue-rotate(30deg); }
}
@keyframes surveillance-lock-static {
  0%, 100% { opacity: 0; }
  12%, 28%, 43%, 67% { opacity: 1; }
  20%, 32%, 48%, 75% { opacity: 0; }
}
