*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#map {
  width: 100%;
  height: 100%;
}

/* ---------- Control buttons ---------- */

#controls {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

#controls button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(26, 26, 46, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#controls button:active {
  background: rgba(233, 69, 96, 0.6);
}

#controls button.active {
  background: rgba(233, 69, 96, 0.45);
}

/* ---------- Speed indicator ---------- */

#status-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  z-index: 10;
  background: rgba(26, 26, 46, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 8px 14px;
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Turn panel ---------- */

#turn-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: rgba(26, 26, 46, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#turn-panel.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

#turn-content {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#turn-arrow {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  color: #e94560;
}

#turn-text {
  font-size: 16px;
  color: #f0f0f0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#btn-skip {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: rgba(233, 69, 96, 0.35);
  color: #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-skip:active {
  background: rgba(233, 69, 96, 0.7);
}

/* ---------- GPS arrow marker ---------- */

.gps-arrow {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 4px rgba(233, 69, 96, 0.6));
}

/* ---------- Route overlay ---------- */

.route-line {
  line-cap: round;
  line-join: round;
}

/* ---------- MapLibre overrides ---------- */

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  display: none;
}
