/* ============================================================
   INSTANT — 3D globe enhancement (2D route map stays as fallback)
   ============================================================ */

.globe-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(360px, 33vw, 500px);
  overflow: hidden !important;
  background: #0b111b;
  cursor: grab;
}

.globe-stage:active {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .globe-hint,
  .globe-legend {
    display: none !important;
  }
}

.globe-stage .globe-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}

.globe-stage.is-globe-ready .globe-fallback {
  opacity: 0;
  visibility: hidden;
}

.globe-stage.is-globe-failed .globe-fallback {
  opacity: 1;
  visibility: visible;
}

.globe-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.globe-stage.is-globe-ready .globe-canvas {
  opacity: 1;
}

.globe-stage.is-globe-failed .globe-canvas {
  display: none;
}

.globe-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: pan-y;
}

/* Touch-only devices: the globe is a visual layer, not a scroll trap. */
@media (hover: none) {
  .globe-canvas canvas {
    pointer-events: none;
  }
}

/* Keep the existing map vignette above the canvas, but below the hint */
.globe-stage.map-stage::after {
  z-index: 2;
  pointer-events: none;
}

.globe-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.68);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}

.globe-hint span {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.12);
}

.globe-stage.is-globe-ready .globe-hint {
  opacity: 1;
  transform: none;
}

.globe-stage.is-globe-failed .globe-hint {
  display: none;
}

.globe-legend {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.62);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.globe-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.globe-legend i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
}

.globe-legend .is-origin {
  background: var(--orange);
}

.globe-legend .is-europe {
  background: var(--amber);
}

.globe-legend .is-mexico {
  background: var(--blue);
}

.globe-legend .is-usa {
  background: var(--green);
}

.globe-stage.is-globe-ready .globe-legend {
  opacity: 1;
}

.globe-stage.is-globe-failed .globe-legend {
  display: none;
}

.network-detail .globe-stage {
  flex: none;
  aspect-ratio: auto;
  min-height: clamp(440px, 44vw, 620px);
}

.network-detail .globe-stage .globe-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 900px) {
  .globe-stage {
    min-height: 400px;
  }

  .network-detail .globe-stage {
    min-height: 440px;
  }
}

@media (max-width: 720px) {
  .globe-stage {
    min-height: 340px;
  }

  .network-detail .globe-stage {
    min-height: 370px;
  }

  .globe-stage .globe-fallback,
  .network-detail .globe-stage .globe-fallback {
    object-fit: cover;
  }

  .globe-hint {
    left: 12px;
    bottom: 12px;
    font-size: 8.5px;
  }

  .globe-legend {
    right: 12px;
    bottom: 12px;
    gap: 8px;
    padding: 5px 8px;
  }

  .globe-legend span {
    font-size: 8px;
  }
}
