/* ── Animations placeholder button (occupies the old search bar spot) ──── */
#search-wrapper {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#animations-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

#animations-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

#animations-svg {
  width: 20px;
  height: 20px;
  animation: animationsWheelSpin 6s linear infinite;
}

@keyframes animationsWheelSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.animations-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-float);
  z-index: 10;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #search-wrapper {
    right: 10px;
    top: 42%;
  }

  #animations-btn {
    width: 26px;
    height: 26px;
  }

  #animations-svg {
    width: 9px;
    height: 9px;
  }
}

body.circuit-panel-open #search-wrapper {
  display: none;
}



/* ── Route animation overlay ──────────────────────────────────────────── */
#route-anim-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  cursor: pointer;
  background: transparent;
}




/* Positioned dynamically via JS to sit just above the animations button —
   left/top are set inline, this just handles the floating look. Anchor
   point is set via JS per-frame (left/right/center) so it never clips
   off the left or right edge of the screen. */
#route-anim-label {
  position: fixed;
  z-index: 5001;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(-100%) translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

#route-anim-label.visible {
  opacity: 1;
  transform: translateY(-100%) translateY(0);
}

.route-anim-label-round {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.route-anim-label-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1px;
}

body.light-theme #route-anim-label {
  text-shadow: 0 1px 3px rgba(255,255,255,0.85);
}











#route-anim-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5001;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
  letter-spacing: 0.03em;
}

.route-anim-line {
  pointer-events: none;
}

/* Marker pulse — a glow ring only; the marker's own status color is
   never touched, exactly as requested. */
@keyframes routeMarkerPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.65); transform: scale(1); }
  40%  { box-shadow: 0 0 0 12px rgba(255,255,255,0); transform: scale(1.3); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); transform: scale(1); }
}

.route-marker-pulse {
  animation: routeMarkerPulse 0.8s ease-out;
  border-radius: 50%;
}

/* Button glows while an animation is actively playing */
#animations-btn.playing {
  border-color: var(--accent);
  color: var(--accent);
}



/* ── Route animation intro splash ──────────────────────────────────────── */
#route-anim-intro {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5002;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#route-anim-intro.visible {
  opacity: 1;
}

.route-intro-year {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  letter-spacing: 0.02em;
}

.route-intro-count {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

body.light-theme .route-intro-year,
body.light-theme .route-intro-count {
  text-shadow: 0 1px 4px rgba(255,255,255,0.85);
}

@media (max-width: 768px) {
  .route-intro-year   { font-size: 1.25rem; }
  .route-intro-count  { font-size: 0.75rem; }
}