*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#map {
  height: 100dvh;
}

#total-length {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;

  padding: 6px 10px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);

  font-family: sans-serif;
  font-size: 14px;
  color: #116679;
}

#locate-btn {
  position: fixed;
  bottom: 32px;
  right: 12px;
  z-index: 1000;

  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 20px;
  border: 2px solid #116679;

  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);

  display: flex;
  align-items: center;
  justify-content: center;
}

#locate-btn.locating {
  pointer-events: none;
  animation: locate-pulse 1.2s ease-out infinite;
}

#locate-btn.locating svg {
  opacity: 0.6;
}

@keyframes locate-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(17, 102, 121, 0.5),
      0 0 8px 0 rgba(0, 0, 0, 0.2);
  }
  100% {
    box-shadow:
      0 0 0 12px rgba(17, 102, 121, 0),
      0 0 8px 0 rgba(0, 0, 0, 0.2);
  }
}

@keyframes locate-fade {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  #locate-btn.locating {
    animation: locate-fade 1.2s ease-in-out infinite;
  }
}
