/* nav.css
   Phase 2, Theme 4: navigation / GPS / maps. Styles for the flag-gated nav
   controls on the map bar, the exploration heatmap cells, custom pins, the
   distance/waypoint panel, the "simple" map style, and the floating treasure
   compass. Child-first (large tap targets), and every animation is pinned under
   reduce-motion so the needle/compass never spin for a motion-sensitive player.
   Colours reuse the existing CSS variables; nothing here is themed pack content. */

/* ---- nav controls on the map bar ---------------------------------------- */
.map-controls .nav-btn {
  white-space: nowrap;
}

.nav-readout {
  margin-top: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold-bright, #ffd966);
  font-size: 0.95rem;
  line-height: 1.3;
}
.nav-readout.hidden { display: none; }

/* ---- 34. exploration heatmap ------------------------------------------- */
.illus-heatmap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* above the base, below fog/markers/ship */
}
.illus-heatmap .heat-cell {
  fill: var(--amber, #f5a623);
}

/* ---- 38. simple map style (strip the painted base) --------------------- */
.illus-map.illus-simple .illus-base {
  /* The painted base is set as an inline background-image, so we override it with an
     !important background-IMAGE (a visible hatch), not a plain "background: none" that the
     inline style would win. The old rule set background-image:none !important AND a separate
     background shorthand, so the !important none won and the simple map was a flat blank. */
  background-color: var(--near-black, #06080f);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 12px,
    rgba(255, 255, 255, 0.09) 12px,
    rgba(255, 255, 255, 0.09) 24px
  ) !important;
}

/* ---- 39. custom personal pins ------------------------------------------ */
.illus-custom-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.illus-custom-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  background: none;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
  pointer-events: auto;
  color: var(--sky, #4a90d9);
  min-width: 44px;
  min-height: 44px;
}
.illus-custom-pin .custom-pin-glyph {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.illus-custom-pin .custom-pin-label {
  font-size: 0.7rem;
  max-width: 7rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 36/40. distance + waypoint panel ---------------------------------- */
.nav-dist-panel {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 8;
  width: min(78vw, 18rem);
  max-height: 60%;
  overflow-y: auto;
  background: rgba(6, 8, 15, 0.92);
  border: 1px solid var(--gold-dim, #6b5a2a);
  border-radius: 0.6rem;
  padding: 0.5rem 0.6rem;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.nav-dist-head {
  font-weight: 700;
  color: var(--gold-bright, #ffd966);
  margin-bottom: 0.35rem;
}
.nav-dist-list { list-style: none; margin: 0; padding: 0; }
.nav-dist-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.4rem;
  border-radius: 0.4rem;
  cursor: pointer;
  min-height: 44px;
}
.nav-dist-row + .nav-dist-row { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.nav-dist-row.active { background: rgba(74, 144, 217, 0.25); }
.nav-dist-row.done .nav-dist-label { color: var(--forest, #2d7a2d); }
.nav-dist-val { color: var(--gold-bright, #ffd966); white-space: nowrap; }
.nav-dist-empty, .nav-dist-tip { font-size: 0.8rem; opacity: 0.8; margin: 0.3rem 0 0; }

/* ---- 37. floating treasure compass ------------------------------------- */
.nav-compass {
  position: fixed;
  right: 0.9rem;
  bottom: 5rem;
  z-index: 60;
  width: 8.5rem;
  padding: 0.6rem 0.6rem 0.5rem;
  border-radius: 0.9rem;
  background: rgba(6, 8, 15, 0.92);
  border: 1px solid var(--gold-dim, #6b5a2a);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  color: #fff;
  text-align: center;
}
.nav-compass-dismiss {
  position: absolute;
  top: 0.15rem;
  right: 0.3rem;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.nav-compass-dial {
  width: 5rem;
  height: 5rem;
  margin: 0.4rem auto 0.3rem;
  border-radius: 50%;
  border: 2px solid var(--gold-dim, #6b5a2a);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(74, 144, 217, 0.18), transparent 70%);
}
.nav-compass-needle {
  font-size: 2.2rem;
  line-height: 1;
  color: var(--amber, #f5a623);
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.nav-compass-readout {
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--gold-bright, #ffd966);
}

/* Left-handed mirroring (a11y 64): keep the floating compass off the thumb. */
body.a11y-left-handed .nav-compass { right: auto; left: 0.9rem; }
body.a11y-left-handed .nav-dist-panel { right: auto; left: 0.5rem; }

/* Respect reduce-motion: pin the needle so it never animates its rotation. */
body.reduce-motion .nav-compass-needle { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-compass-needle { transition: none; }
}
