:root {
  color-scheme: dark;
  --bg: #111514;
  --panel: #1b211e;
  --panel-strong: #242b26;
  --text: #f6f0df;
  --muted: #b5b09e;
  --line: rgba(246, 240, 223, 0.16);
  --gold: #f7c95f;
  --mint: #60d6b1;
  --tomato: #ee7666;
  --ink: #0c100f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 50% 16%, rgba(247, 201, 95, 0.16), transparent 26rem),
    linear-gradient(160deg, #111514 0%, #171c1a 50%, #0d1110 100%);
  color: var(--text);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
}

.hero {
  min-height: calc(100svh - 210px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.topbar,
.section-title,
.safety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.label,
.section-title p,
.place-main small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  margin-top: 8px;
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1.05;
}

h3 {
  font-size: 17px;
}

.icon-button,
.primary,
.secondary,
.place-button,
.safety a {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font: inherit;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 23px;
}

.compass-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 30px 0;
  overflow: visible;
}

.range-control {
  position: absolute;
  top: 8px;
  right: 0;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 20, 0.78);
  backdrop-filter: blur(14px);
}

.range-control span,
.range-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
}

.range-options {
  display: grid;
  gap: 4px;
}

.range-options button {
  width: 28px;
  height: 26px;
  border: 1px solid rgba(246, 240, 223, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 820;
}

.range-options button.active {
  border-color: rgba(247, 201, 95, 0.82);
  background: var(--gold);
  color: var(--ink);
}

.compass {
  position: relative;
  width: min(78vw, 350px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(246, 240, 223, 0.26) 0deg 1deg, transparent 1deg 10deg),
    radial-gradient(circle, #202721 0 56%, #141918 57% 100%);
  box-shadow: inset 0 0 0 1px rgba(246, 240, 223, 0.18), 0 26px 70px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--compass-rotation, 0deg));
  transition: transform 180ms linear;
  will-change: transform;
}

.ring {
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(247, 201, 95, 0.34);
  border-radius: 50%;
}

.mark {
  position: absolute;
  width: 36px;
  height: 26px;
  margin: -13px 0 0 -18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.north {
  top: 10%;
  left: 50%;
  color: var(--gold);
}

.east {
  top: 50%;
  left: 90%;
}

.south {
  top: 90%;
  left: 50%;
}

.west {
  top: 50%;
  left: 10%;
}

.needle {
  position: absolute;
  inset: 0;
  transform: rotate(var(--needle-rotation, 0deg));
  transition: transform 180ms linear;
  will-change: transform;
}

.needle-tip {
  position: absolute;
  top: 13%;
  left: 50%;
  width: 34px;
  height: 43%;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 100%, 50% 84%, 0 100%);
  background: linear-gradient(180deg, var(--tomato), var(--gold));
  filter: drop-shadow(0 10px 18px rgba(238, 118, 102, 0.28));
}

.center-orbit {
  position: absolute;
  inset: 43%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0, 0, 0, 0.28);
}

.center-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint);
}

.compass-labels {
  --marker-radius: min(42vw, 194px);
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.compass-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 118px;
  padding: 4px 7px;
  border: 1px solid rgba(246, 240, 223, 0.16);
  border-radius: 999px;
  background: rgba(17, 21, 20, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translate(-50%, -50%) rotate(var(--marker-angle)) translateY(calc(-1 * var(--marker-radius))) rotate(var(--counter-angle));
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.22, 1), color 120ms ease, border-color 120ms ease, background 120ms ease;
  will-change: transform;
}

.compass-marker.active {
  border-color: rgba(247, 201, 95, 0.82);
  background: rgba(247, 201, 95, 0.18);
  color: var(--gold);
}

.destination {
  min-height: 116px;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.metrics span {
  min-width: 92px;
  flex: 1 1 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--gold);
  font-weight: 750;
  text-align: center;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(64px, 0.62fr) minmax(0, 1.28fr);
  gap: 10px;
}

.primary,
.secondary {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 760;
  text-align: center;
}

.primary {
  background: var(--gold);
  color: var(--ink);
}

.secondary {
  background: rgba(255, 255, 255, 0.06);
}

.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.nearby {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.place-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.place-button {
  width: 100%;
  min-height: 64px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}

.place-button.active {
  border-color: rgba(247, 201, 95, 0.72);
  background: rgba(247, 201, 95, 0.12);
}

.place-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.place-main strong,
.place-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-distance {
  flex: 0 0 auto;
  color: var(--mint);
  font-weight: 740;
}

.safety {
  margin-top: 18px;
}

.safety a {
  flex: 1;
  min-height: 42px;
  display: grid;
  place-items: center;
  background: rgba(96, 214, 177, 0.08);
  color: var(--mint);
  font-size: 14px;
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .range-control {
    right: -4px;
    transform: scale(0.92);
    transform-origin: top right;
  }
}
