/* ============================================================================
   Eldritch Agency — LOCATION SELECT (map) screen
   All selectors scoped with .loc- to avoid clashing with styles.css.
   Reuses :root variables from styles.css.
   ========================================================================= */

.loc-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
  font-family: var(--font);
  color: var(--parchment);
}

/* ---- map stage ----------------------------------------------------------- */
.loc-stage { position: absolute; inset: 0; overflow: hidden; }
/* The map + markers are zoomed/panned to the current hemisphere by JS (inline
   transform), so one globe fills the space right of the dispatch panel. */
.loc-scaled { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; transition: transform .3s ease; }

/* ---- hemisphere switcher (1:1 over the map) ------------------------------- */
.loc-hemi { position: absolute; top: 16px; left: 452px; right: 24px; z-index: 7;
  display: flex; align-items: center; justify-content: center; gap: 16px; pointer-events: none; }
.loc-hemi-arrow { pointer-events: auto; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 34px; line-height: 1; padding: 0 0 4px; color: var(--gold-hi);
  background: rgba(12, 11, 18, 0.85); border: 1px solid var(--edge-hi); border-radius: 50%; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); }
.loc-hemi-arrow:hover { background: #221f30; border-color: var(--gold); }
.loc-hemi-name { pointer-events: none; color: var(--gold-hi); font-size: 23px; letter-spacing: 3px; text-transform: uppercase;
  background: rgba(12, 11, 18, 0.72); padding: 6px 18px; border: 1px solid var(--edge); border-radius: 4px;
  text-shadow: 0 2px 0 #000; white-space: nowrap; }

.loc-map {
  position: absolute;
  inset: 0;
  background-color: var(--ink);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  image-rendering: pixelated;
}

/* Vignette so markers and text pop against the map. */
.loc-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 55% 45%, rgba(8, 7, 6, 0) 38%, rgba(6, 6, 5, 0.72) 100%),
    linear-gradient(180deg, rgba(6, 6, 5, 0.55) 0%, rgba(6, 6, 5, 0) 22%, rgba(6, 6, 5, 0) 78%, rgba(6, 6, 5, 0.6) 100%);
}

/* ---- markers ------------------------------------------------------------- */
.loc-markers { position: absolute; inset: 0; pointer-events: none; }

.loc-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
}
.loc-marker:hover { z-index: 5; }

.loc-pin {
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  border: 2px solid var(--edge-hi);
  box-shadow: 0 0 0 2px rgba(11, 13, 12, 0.85), 0 0 12px rgba(139,111,224, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .14s, transform .14s, background .14s;
}
.loc-pin-tier {
  transform: rotate(-45deg);
  color: var(--ink);
  font-size: 19px;
  font-family: var(--font);
  line-height: 1;
}
.loc-marker:hover .loc-pin {
  transform: rotate(45deg) scale(1.18);
  box-shadow: 0 0 0 2px rgba(11, 13, 12, 0.85), 0 0 18px rgba(184,163,255, 0.9);
}

/* Higher tiers glow with a hotter, bloodier intensity. */
.loc-marker[data-tier="2"] .loc-pin { box-shadow: 0 0 0 2px rgba(11, 13, 12, 0.85), 0 0 14px rgba(139,111,224, 0.7); }
.loc-marker[data-tier="3"] .loc-pin,
.loc-marker[data-tier="4"] .loc-pin,
.loc-marker[data-tier="5"] .loc-pin {
  background: linear-gradient(135deg, var(--gold-hi), var(--blood));
  box-shadow: 0 0 0 2px rgba(11, 13, 12, 0.85), 0 0 18px rgba(165, 50, 31, 0.8);
}

.loc-marker.selected .loc-pin {
  transform: rotate(45deg) scale(1.22);
  border-color: var(--gold-hi);
  box-shadow: 0 0 0 2px rgba(11, 13, 12, 0.9), 0 0 22px rgba(184,163,255, 1);
}

.loc-marker-label {
  max-width: 160px;
  padding: 2px 8px;
  background: rgba(11, 13, 12, 0.82);
  border: 1px solid var(--edge);
  color: var(--parchment);
  font-size: 19px;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 #000;
}
.loc-marker:hover .loc-marker-label,
.loc-marker.selected .loc-marker-label {
  color: var(--gold-hi);
  border-color: var(--edge-hi);
}

/* ---- left dispatch panel ------------------------------------------------- */
.loc-panel {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 400px;
  max-width: 46vw;
  padding: 18px 20px 20px;
  z-index: 6;
  background: linear-gradient(180deg, rgba(31, 28, 23, 0.95), rgba(14, 11, 8, 0.95));
  border: 2px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 6px 0 #000, 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(107, 90, 62, 0.35);
  max-height: calc(100% - 48px);
  overflow-y: auto;
}
/* Selected lead detail now lives inside the panel (no bottom popup). Tightened so
   the whole card — including the Choose Party button — fits without scrolling. */
.loc-panel-detail { margin-top: 2px; }
.loc-detail-hint { color: var(--muted); font-size: 19px; line-height: 1.4; padding: 4px 2px; }
.loc-panel .loc-detail {
  position: static; width: auto; max-width: none; transform: none;
  border: 1px solid var(--edge-hi); box-shadow: inset 0 0 0 1px rgba(107, 90, 62, 0.3);
}
.loc-panel .loc-detail-banner { height: 80px; }
.loc-panel .loc-detail-body { padding: 10px 12px 12px; }
.loc-panel .loc-detail-name { font-size: 26px; }
.loc-panel .loc-detail-desc { font-size: 18px; line-height: 1.35; margin-top: 4px; }
.loc-panel .loc-detail-rewards { margin-top: 7px; gap: 4px 12px; }
.loc-panel .loc-detail-unlocks { margin-top: 7px; }
.loc-panel .loc-detail-meta { margin-top: 7px; font-size: 17px; }
.loc-panel .loc-detail-actions { margin-top: 10px; justify-content: stretch; }
.loc-panel .loc-detail-actions .btn { width: 100%; }
.loc-panel-title {
  color: var(--gold);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}
.loc-panel-rule {
  height: 2px;
  margin: 12px 0;
  background: linear-gradient(90deg, var(--edge-hi), rgba(107, 90, 62, 0));
}
.loc-dispatch { display: flex; flex-direction: column; gap: 3px; }
.loc-dispatch-label {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.loc-dispatch-count { color: var(--parchment-2); font-size: 21px; }

/* ---- detail card (rendered inline inside the dispatch panel) -------------- */
.loc-detail {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 5px;
  overflow: hidden;
}
.loc-detail-banner {
  position: relative;
  height: 120px;
  background-color: var(--ink-2);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  border-bottom: 2px solid var(--edge);
  box-shadow: inset 0 -40px 40px -20px rgba(11, 13, 12, 0.95);
}
.loc-detail-tier {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 2px 10px;
  background: rgba(11, 13, 12, 0.85);
  border: 1px solid var(--gold);
  color: var(--gold-hi);
  font-size: 19px;
  letter-spacing: 1px;
}

.loc-detail-body { padding: 14px 16px 16px; }
.loc-detail-name {
  color: var(--gold);
  font-size: 31px;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #000;
}
.loc-detail-desc {
  margin-top: 6px;
  color: var(--parchment-2);
  font-size: 21px;
  line-height: 1.45;
}
.loc-detail-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
}
.loc-reward-bit { color: var(--muted); font-size: 20px; }
.loc-reward-bit b { color: var(--gold-hi); font-size: 21px; }

/* progression: what this expedition unlocks */
.loc-detail-unlocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.loc-unlock-head { color: var(--gold); font-size: 16px; text-transform: uppercase; letter-spacing: 1.5px; margin-right: 2px; }
.loc-unlock-bit { font-size: 19px; padding: 1px 8px; border: 1px solid var(--edge-hi); color: var(--parchment); }
.loc-unlock-bit.expedition { border-color: var(--gold); color: var(--gold-hi); }
.loc-unlock-bit.machination { border-color: var(--occult); color: #c4a8ff; }

.loc-detail-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 19px;
  letter-spacing: 0.5px;
}
.loc-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* ---- loading & empty states --------------------------------------------- */
.loc-loading,
.loc-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.loc-loading-inner,
.loc-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 9;
  text-align: center;
}
.loc-loading-title,
.loc-empty-title {
  color: var(--gold);
  font-size: 34px;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}
.loc-loading-sub,
.loc-empty-sub {
  color: var(--muted);
  font-size: 21px;
}
.loc-loading-sub { animation: loc-pulse 2s infinite; }
@keyframes loc-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
  .loc-panel {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }
  .loc-map { background-size: cover; }
  .loc-detail { width: calc(100vw - 28px); }
}
