/* ════════════════════════════════════════════ */
/* DEPTH GAUGE — Soviet facility descent        */
/* ════════════════════════════════════════════ */

.depth-gauge {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  height: 55vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 1.5s ease 0.5s;
  pointer-events: none;
}
.depth-gauge.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Shaft background texture */
.depth-gauge::before {
  content: '';
  position: absolute;
  top: -8px;
  bottom: 30px;
  right: -4px;
  width: 28px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 19px,
      rgba(138, 154, 123, 0.04) 19px,
      rgba(138, 154, 123, 0.04) 20px
    );
  border-left: 1px solid rgba(138, 154, 123, 0.06);
  border-right: 1px solid rgba(138, 154, 123, 0.06);
  pointer-events: none;
  border-radius: 2px;
}

/* ──── Track ──── */
.depth-track {
  position: relative;
  flex: 1;
  width: 20px;
}

.depth-rail {
  position: absolute;
  right: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(138, 154, 123, 0.08),
    rgba(138, 154, 123, 0.25) 15%,
    rgba(138, 154, 123, 0.25) 85%,
    rgba(138, 154, 123, 0.08)
  );
  border-radius: 1px;
}

/* Small rivets along the rail */
.depth-rail::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 4px; height: 100%;
  transform: translateX(-50%);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 38px,
      rgba(138, 154, 123, 0.12) 38px,
      rgba(138, 154, 123, 0.12) 40px
    );
}

/* ──── Indicator (elevator car) ──── */
.depth-indicator {
  position: absolute;
  right: 2px;
  top: 0;
  width: 16px;
  height: 3px;
  background: #ffb000;
  border-radius: 1px;
  box-shadow:
    0 0 4px rgba(255, 176, 0, 0.7),
    0 0 10px rgba(255, 176, 0, 0.3),
    0 0 20px rgba(255, 176, 0, 0.1);
  transition: top 0.12s linear;
  z-index: 10;
}

/* Subtle pulse on the indicator */
.depth-indicator::after {
  content: '';
  position: absolute;
  inset: -2px -4px;
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.15);
  animation: indicator-pulse 3s ease-in-out infinite;
}
@keyframes indicator-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ──── Markers ──── */
.depth-marker {
  position: absolute;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(-50%);
  transition: opacity 0.3s ease;
  text-decoration: none;
}
.depth-marker:hover {
  opacity: 1 !important;
}
.depth-marker:hover .depth-label {
  color: rgba(138, 154, 123, 0.9);
}

.depth-tick {
  width: 8px;
  height: 1px;
  background: rgba(138, 154, 123, 0.3);
  flex-shrink: 0;
}

.depth-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: rgba(138, 154, 123, 0.4);
  text-transform: uppercase;
  transition: color 0.3s ease;
  line-height: 1;
}

.depth-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7px;
  color: rgba(138, 154, 123, 0.25);
  letter-spacing: 0.1em;
  line-height: 1;
}

/* Active marker */
.depth-marker.active .depth-label {
  color: rgba(255, 176, 0, 0.7);
}
.depth-marker.active .depth-tick {
  background: rgba(255, 176, 0, 0.5);
  box-shadow: 0 0 4px rgba(255, 176, 0, 0.3);
}

/* Warning marker (quarantine) */
.depth-marker.warning .depth-label {
  color: rgba(192, 57, 43, 0.5);
}
.depth-marker.warning .depth-tick {
  background: rgba(192, 57, 43, 0.4);
  width: 10px;
  height: 2px;
}
.depth-marker.warning.active .depth-label {
  color: rgba(192, 57, 43, 0.8);
}

/* Hazard stripe at quarantine level */
.depth-marker.warning::after {
  content: '';
  position: absolute;
  right: -26px;
  width: 12px;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(192, 57, 43, 0.12) 0px,
    rgba(192, 57, 43, 0.12) 2px,
    transparent 2px,
    transparent 4px
  );
  border-radius: 1px;
}

/* ──── Depth Readout ──── */
.depth-readout {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #ffb000;
  text-shadow: 0 0 4px rgba(255, 176, 0, 0.4);
  letter-spacing: 0.1em;
  text-align: right;
  margin-top: 10px;
  opacity: 0.55;
  padding-right: 2px;
  transition: opacity 0.3s ease;
}
.depth-gauge:hover .depth-readout {
  opacity: 0.85;
}

.depth-prefix {
  opacity: 0.6;
}
.depth-unit {
  opacity: 0.5;
  font-size: 8px;
}

/* Occasional flicker on the readout */
.depth-readout.flicker {
  animation: readout-flicker 0.15s ease;
}
@keyframes readout-flicker {
  0% { opacity: 0.55; }
  30% { opacity: 0.15; }
  60% { opacity: 0.55; }
  80% { opacity: 0.35; }
  100% { opacity: 0.55; }
}

/* ──── Responsive ──── */
@media (max-width: 768px) {
  .depth-gauge {
    display: none;
  }
}
