/* FPS-first overrides for the premium map.  Visual weight is preserved with static glows instead of many per-frame filters. */
:root { --gpu-ease: cubic-bezier(.2,.7,.2,1); }

.premium-map,
.dynamic-link-layer,
.premium-links,
.premium-world,
.map-glare,
.map-vignette,
.geo-grid,
.earth-glow,
.constellation {
  contain: layout paint style;
}

.premium-map {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}

/* SVG filter + CSS filter animations are the biggest mobile FPS killer here. */
.premium-world,
.premium-world *,
.premium-links *,
.dynamic-link-layer *,
.constellation,
.packet,
.energy-path,
.data-path {
  filter: none !important;
}

.premium-world [filter] { filter: none !important; }
.premium-world { mix-blend-mode: normal !important; opacity: .48; }
.premium-world path { animation: none !important; }

/* Keep routes visible but stop expensive dash animation on constrained devices. */
body.is-low-power .data-path,
body.is-low-power .dynamic-link-layer path,
body.performance-critical .data-path,
body.performance-critical .dynamic-link-layer path {
  animation: none !important;
  stroke-dasharray: 10 16;
  opacity: .5;
}

body.is-low-power .energy-path,
body.performance-critical .energy-path,
body.is-low-power .packet:nth-of-type(n+5),
body.performance-critical .packet:nth-of-type(n+6),
body.is-low-power .map-orbit,
body.performance-critical .map-orbit,
body.is-low-power .constellation,
body.performance-critical .constellation {
  display: none !important;
}

/* Static gradients instead of many shadows. */
body.is-low-power .node,
body.performance-critical .node {
  box-shadow: 0 0 0 1px rgba(0,246,255,.7), 0 0 12px rgba(0,246,255,.35) !important;
}

body.is-low-power .node.hot,
body.performance-critical .node.hot {
  box-shadow: 0 0 0 1px rgba(255,211,106,.78), 0 0 14px rgba(255,211,106,.38) !important;
}

body.is-low-power .node::before,
body.performance-critical .node::before,
body.is-low-power .radar-ring,
body.performance-critical .radar-ring {
  animation-duration: 8s !important;
}

body.is-low-power .radar-ring-2,
body.is-low-power .radar-ring-3,
body.performance-critical .radar-ring-2,
body.performance-critical .radar-ring-3,
body.is-low-power .earth-glow,
body.performance-critical .earth-glow {
  display: none !important;
}

body.is-low-power .map-scanline,
body.performance-critical .map-scanline,
body.is-low-power .radar-sweep,
body.performance-critical .radar-sweep,
body.is-low-power .premium-map::after,
body.performance-critical .premium-map::after {
  animation-duration: 12s !important;
  opacity: .24 !important;
}

.map-side-panel,
.map-top-metrics span,
.premium-status,
.node::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Avoid promoting too many elements forever; keep promotion for actual movers only. */
.download-card,
.hero-stat { will-change: auto !important; }
.packet,
.radar-sweep,
.map-scanline { will-change: transform, opacity; }

/* Hidden/offscreen state controlled by IntersectionObserver + perf.js. */
.premium-map.is-paused *,
body.map-offscreen .premium-map * {
  animation-play-state: paused !important;
}

@media (max-width: 760px) {
  .premium-map { height: 320px !important; border-radius: 22px; }
  .geo-grid,
  .earth-glow,
  .map-orbit,
  .constellation,
  .energy-path,
  .packet:nth-of-type(n+5) { display: none !important; }
  .premium-world { opacity: .42; }
  .map-side-panel { transform: scale(.9); opacity: .82; }
  .map-top-metrics span:nth-child(2) { display: none; }
}
