/* True North — spin the needle, pick a distance, throw a dart around the globe.
   Token-only styling on top of the shared arcade tokens/chrome. */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
}
body { display: flex; flex-direction: column; }

.tn-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

/* ── Status row ─────────────────────────────────── */
.tn-status {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.tn-status b { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ── Target card ────────────────────────────────── */
.tn-target {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
}
.tn-target-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-subtle);
}
.tn-target-name { margin: 0; font-size: 26px; line-height: 1.2; }
.tn-target-sub { margin: 4px 0 0; font-size: 13px; color: var(--fg-muted); min-height: 1.2em; }

/* ── Panels (one per state) ─────────────────────── */
.tn-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tn-panel[hidden] { display: none; }

/* ── Compass ────────────────────────────────────── */
.tn-compass {
  position: relative;
  width: min(78vw, 340px);
  aspect-ratio: 1;
  touch-action: none;          /* the dial owns its gestures */
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.tn-ring  { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.tn-face  { fill: var(--bg-elev); stroke: var(--border); stroke-width: 1; }
.tn-ticks line { stroke: var(--border-strong); stroke-width: 2; }
.tn-needle-you path   { fill: var(--accent); }
.tn-needle-you circle { fill: var(--accent); }
.tn-hub { fill: var(--bg); }
#needle-you {
  transform-origin: 120px 120px;
  transition: transform 0.25s ease-out;
}
.tn-compass.is-aiming #needle-you { transition: none; }

.tn-compass.is-aiming .tn-ring {
  stroke: var(--accent);
  stroke-width: 4;
  animation: tn-pulse 1.2s ease-in-out infinite;
}
@keyframes tn-pulse { 50% { stroke-opacity: 0.35; } }

.tn-hold-hint {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  pointer-events: none;
  white-space: nowrap;
}
.tn-compass.is-aiming .tn-hold-hint { color: var(--accent); }

/* ── Nudge rows (aim fine-tune + distance fine-tune) ── */
.tn-nudge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.tn-nudge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.tn-nudge:active { background: var(--border); }
.tn-btn-wide { flex: 0 1 220px; }

/* ── Distance panel ─────────────────────────────── */
.tn-distance-readout {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--fg-muted);
  text-align: center;
}
.tn-distance-readout b {
  font-size: 40px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tn-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;               /* generous touch strip */
  background: transparent;
  touch-action: pan-x;
  cursor: pointer;
}
.tn-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
}
.tn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-md);
  margin-top: -12px;
}
.tn-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
}
.tn-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-md);
}
.tn-slider-note {
  margin: 0;
  font-size: 12px;
  color: var(--fg-subtle);
  text-align: center;
}

/* ── Globe reveal ───────────────────────────────── */
.tn-globe-wrap {
  width: min(92vw, 440px);
  aspect-ratio: 1;
  margin: 0 auto;
}
#globe {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}
.tn-globe-caption {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}
.tn-skip-hint {
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* ── Result ─────────────────────────────────────── */
.tn-result { text-align: center; }
.tn-verdict { margin: 0; font-size: 24px; font-weight: 800; }
.tn-verdict.good { color: var(--good, #22c55e); }
.tn-verdict.warn { color: var(--warn, #eab308); }
.tn-verdict.bad  { color: var(--bad, #ef4444); }
.tn-detail { margin: 4px 0 0; font-size: 14px; color: var(--fg-muted); }

/* ── Buttons ────────────────────────────────────── */
.tn-actions { display: flex; justify-content: center; gap: 10px; }
.tn-btn {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.tn-btn-primary { background: var(--accent); color: var(--bg); border-color: transparent; }
.tn-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.tn-note {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-subtle);
  min-height: 1.2em;
}
