/* ==========================================================================
   Swarm Multiplayer Cursors & Blueprint Overlay (Clean Borderless Edition)
   Exact cursor physics, shapes (arrow, cross, ibeam, pen), overlays & guide snapping.
   No dark borders/rulers around the screen.
   Strictly silent (no audio/music).
   ========================================================================== */

:root {
  --swarm-blue: #0D99FF;
  --swarm-red: #F24822;
}

/* --- Elements staged for gradual swarm construction --- */
.site-header.swarm-hidden {
  opacity: 0 !important;
  transform: translateY(-24px) !important;
  pointer-events: none !important;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.site-header.swarm-revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.zone-card.swarm-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.zone-card.swarm-building {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
  will-change: clip-path;
}

.zone-card-inner-hidden {
  opacity: 0 !important;
  transform: translateY(12px) !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.zone-card-inner-revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.zone-actions.swarm-hidden {
  opacity: 0 !important;
  transform: scale(0.92) !important;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.zone-actions.swarm-revealed {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* --- Blueprint Grid Overlay --- */
.swarm-blueprint-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9980;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px, 96px 96px, 96px 96px;
  background-position: 0 0;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.swarm-blueprint-grid.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- SVG Overlay Layer (Boxes, Lines, Guides, Badges) --- */
.swarm-overlay-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9985;
  overflow: visible;
  transition: opacity 0.4s ease;
}

.swarm-overlay-layer.fading {
  opacity: 0;
}

.swarm-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.swarm-badges-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

/* --- Badges --- */
.swarm-badge {
  position: absolute;
  transform: translate(-50%, 0);
  padding: 2px 6px;
  border-radius: 3px;
  color: #ffffff;
  font: 600 11px/15px Inter, system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  letter-spacing: 0.02em;
  user-select: none;
}

/* --- Cursors Layer --- */
.swarm-cursors-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: visible;
}

/* Single Cursor */
.swarm-cursor {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.swarm-cursor.visible {
  opacity: 1;
}

.swarm-cursor svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1.5px 2px rgba(0, 0, 0, 0.32));
  transition: transform 0.08s ease-out;
}

/* Aura spawn pop effect */
.swarm-spawn-aura {
  position: fixed;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--aura-color, #0D99FF);
  transform: translate(-50%, -50%) scale(0.2);
  pointer-events: none;
  z-index: 9996;
  animation: swarmAuraExpand 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes swarmAuraExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
    box-shadow: 0 0 14px var(--aura-color, #0D99FF);
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
    box-shadow: 0 0 0 transparent;
  }
}

/* Caret for live text typing */
.swarm-typing-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  margin-right: -2px;
  vertical-align: -0.1em;
  background-color: var(--caret-color, #0D99FF);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--caret-color, #0D99FF);
  animation: swarmBlink 0.7s steps(1) infinite;
}

@keyframes swarmBlink {
  50% { opacity: 0; }
}
