.signal-tunnel {
  margin: 0 0 5rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(10, 13, 11, 0.5);
  box-shadow: var(--shadow);
}

.signal-tunnel.is-hidden {
  display: none;
}

.signal-tunnel-head p {
  max-width: 48rem;
  color: var(--muted);
}

.run-status {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(7, 9, 8, 0.55);
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.tunnel-wrap {
  margin-top: 1rem;
  border: 1px solid rgba(216, 255, 110, 0.16);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(216, 255, 110, 0.04), transparent 28%, rgba(159, 214, 255, 0.04)),
    rgba(7, 9, 8, 0.72);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.26);
}

#signal-tunnel-canvas {
  display: block;
  width: 100%;
  height: 220px;
}

#drone-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.drone-ops {
  position: fixed;
  right: 16px;
  top: calc(max(14px, 12vh) + 56px);
  z-index: 41;
  display: flex;
  gap: 0.45rem;
}

.drone-ops button {
  min-height: 30px;
  border: 1px solid rgba(216, 255, 110, 0.36);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(7, 9, 8, 0.7);
  color: rgba(216, 255, 110, 0.9);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.drone-ops button:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.signal-portal {
  position: fixed;
  right: 18px;
  bottom: 32px;
  z-index: 39;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(216, 255, 110, 0.56);
  background:
    linear-gradient(0deg, rgba(216, 255, 110, 0.06), rgba(216, 255, 110, 0.06)),
    rgba(7, 9, 8, 0.8);
  box-shadow:
    0 0 0 1px rgba(216, 255, 110, 0.1) inset,
    0 0 28px rgba(216, 255, 110, 0.2);
  pointer-events: auto;
}

.signal-portal::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(216, 255, 110, 0.36);
}

.signal-portal::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(216, 255, 110, 0.28);
}

.portal-pad {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(216, 255, 110, 0.7);
  color: rgba(216, 255, 110, 0.86);
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 14px rgba(216, 255, 110, 0.42);
}

.portal-hint {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 3;
  border: 1px solid rgba(216, 255, 110, 0.44);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: rgba(7, 9, 8, 0.82);
  color: rgba(216, 255, 110, 0.9);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.portal-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.signal-portal.is-hidden {
  display: none;
}



/* Flight is an optional desktop interaction, never an overlay on arrival. */
#drone-overlay, .drone-ops, .signal-portal { display: none; }
.drone-enabled #drone-overlay, .drone-enabled .signal-portal { display: block; }
.drone-enabled .drone-ops { display: flex; }
.drone-enabled .signal-portal.is-hidden { display: none; }
.drone-ops button { background: #171916; color: var(--ink); border-radius: 0; }
.signal-tunnel { border-radius: 0; box-shadow: none; }
@media (max-width: 760px), (pointer: coarse) {
  #drone-overlay, .drone-ops, .signal-portal, .drone-invitation, .signal-tunnel { display: none !important; }
}
