/* Brood Front: Sector map (T818, T891). A campaign strip of the eight worlds above
   one drawn map (terrain, route and fog canvases under DOM node buttons). The
   shell never scrolls; only the strip scrolls sideways inside itself. Nodes and
   tiles are at least 44px. Motion (pulse, fog drift, route draw-in) is off under
   .rm and under prefers-reduced-motion. */
#map.screen {
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  padding-top: 8px;
}
#map .mp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
#map .mp-title { margin: 0; font-size: 1.3rem; color: #e6dcff; }
#map .mp-sub { font-size: 0.85rem; color: #c9b8f0; }

/* Campaign strip: the eight worlds, reached ones tappable, later ones dim. */
#map .mp-strip {
  flex: 0 0 auto; display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding: 3px;
}
#map .mp-strip::-webkit-scrollbar { display: none; }
#map .mp-tile {
  flex: 0 0 auto; min-width: 96px; min-height: 48px; padding: 4px 8px 4px 5px;
  display: flex; align-items: center; gap: 6px; text-align: left;
  border: 2px solid var(--tile-b, #7a4fd0); border-radius: 10px;
  font: inherit; color: #f1eaff;
  background: linear-gradient(135deg, var(--tile-a, #3b2a78), rgba(20, 16, 42, 0.85));
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
#map .mp-tile-th {
  position: relative; flex: 0 0 auto; width: 40px; height: 30px; border-radius: 6px; overflow: hidden;
  background: var(--tile-a, #3b2a78); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.5);
}
#map .mp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#map .mp-tile-n {
  position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700; line-height: 1; color: #14102a; background: var(--tile-b, #ffd36b);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
#map .mp-tile-name { font-size: 0.68rem; font-weight: 700; line-height: 1.15; max-width: 6.5em; }
#map .mp-tile.current { box-shadow: 0 0 0 2px #ffd36b, 0 0 12px rgba(255, 211, 107, 0.6); border-color: #ffd36b; }
#map .mp-tile.locked { opacity: 0.4; border-style: dashed; filter: saturate(0.5); }

/* The map. */
#map .mp-stage {
  flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden;
  border-radius: 12px; border: 2px solid rgba(122, 79, 208, 0.5); background: var(--dk, #14102a);
}
#map .mp-terrain, #map .mp-route, #map .mp-fog {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none;
}
#map .mp-nodes { position: absolute; inset: 0; }
#map .mp-fog { transform-origin: 50% 50%; }

#map .mp-pip {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #8a63e0; border-radius: 50%;
  font: inherit; font-weight: 700; color: #e6dcff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at 32% 26%, #6a52b8 0%, #4a3590 38%, #241a4a 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -3px 3px rgba(0, 0, 0, 0.45), 0 3px 5px rgba(0, 0, 0, 0.6);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
#map .mp-pip.cleared {
  background: radial-gradient(circle at 32% 26%, #fff6d0 0%, #ffe08a 36%, #e0a640 100%);
  border-color: #fff1c4; color: #14102a; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.7), inset 0 -3px 3px rgba(150, 90, 10, 0.5), 0 3px 5px rgba(0, 0, 0, 0.6);
}
#map .mp-pip.open {
  border-color: #ffd36b;
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.4), inset 0 -3px 3px rgba(0, 0, 0, 0.45), 0 0 14px 3px rgba(255, 211, 107, 0.65), 0 0 34px 8px rgba(255, 190, 70, 0.28), 0 3px 5px rgba(0, 0, 0, 0.6);
}
#map .mp-pip.locked {
  border-style: dashed; border-color: #6a5aa0; color: #b3a6d6;
  background: radial-gradient(circle at 32% 26%, #3c2f6c, #1a1236);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), inset 0 -2px 3px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5);
}
#map .mp-pip.hive {
  width: 52px; height: 52px; min-width: 52px; min-height: 52px; border-color: #ff8a8a;
  background: radial-gradient(circle at 32% 26%, #c24a78 0%, #8a2f55 40%, #3d1030 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -3px 3px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 90, 110, 0.4), 0 3px 5px rgba(0, 0, 0, 0.6);
}
#map .mp-pip.hive.open {
  border-color: #ffd36b;
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -3px 3px rgba(0, 0, 0, 0.5), 0 0 14px 3px rgba(255, 211, 107, 0.65), 0 0 34px 8px rgba(255, 90, 110, 0.35), 0 3px 5px rgba(0, 0, 0, 0.6);
}
#map .mp-pip.hive.locked { border-color: #9a4a5a; background: radial-gradient(circle at 32% 26%, #5a2442, #2a0c20); }
#map .mp-pip.hive.cleared { background: radial-gradient(circle at 32% 26%, #fff0f0 0%, #ffc0c0 38%, #e07070 100%); border-color: #ffe0e0; }
#map .mp-n { font-size: 1rem; line-height: 1; pointer-events: none; }
#map .mp-ring {
  position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #ffd36b; pointer-events: none; opacity: 0.8;
  box-shadow: 0 0 8px rgba(255, 211, 107, 0.5), inset 0 0 6px rgba(255, 211, 107, 0.3);
}
#map .mp-tag {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 1px; transform: translateX(-50%);
  font-size: 0.6rem; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  color: #ffb4b4; text-shadow: 0 1px 2px #000; pointer-events: none;
}
#map .mp-stars {
  position: absolute; left: 50%; top: 100%; margin-top: 2px; transform: translateX(-50%);
  display: flex; gap: 1px; line-height: 1; pointer-events: none; text-shadow: 0 1px 2px #000;
}
#map .mp-star { font-style: normal; font-size: 0.7rem; line-height: 1; color: rgba(255, 233, 168, 0.5); }
#map .mp-star.lit { color: #ffd36b; }
/* The colony flag: a pole and a pennant, drawn in CSS, on every cleared node. */
#map .mp-flag { position: absolute; right: -9px; top: -15px; width: 16px; height: 20px; pointer-events: none; }
#map .mp-flag::before { content: ""; position: absolute; left: 1px; top: 0; width: 2px; height: 20px; background: #f1eaff; }
#map .mp-flag::after {
  content: ""; position: absolute; left: 3px; top: 1px; width: 12px; height: 9px; background: #ff5a6e;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

#map .mp-back {
  flex: 0 0 auto; min-height: 44px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; color: #e6dcff; background: #2c2060;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
/* Briefing hook buttons sit in the Armory / Launch row (flow.js). */
.fl-extra { display: contents; }

/* Motion: the current node pulses, the fog drifts, a route draws in. */
#map:not(.rm) .mp-ring { animation: mp-pulse 1.3s ease-in-out infinite; }
#map:not(.rm) .mp-fog { transform: scale(1.03); animation: mp-drift 14s ease-in-out infinite alternate; }
#map:not(.rm) .mp-route.draw { animation: mp-draw 0.9s ease-out both; }
@keyframes mp-pulse { 0%, 100% { opacity: 0.9; transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.18); } }
@keyframes mp-drift { from { transform: scale(1.03) translate(-4px, 1px); } to { transform: scale(1.03) translate(4px, -1px); } }
@keyframes mp-draw { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  #map .mp-ring, #map .mp-fog, #map .mp-route { animation: none !important; transform: none; }
  #map .mp-ring { transform: none; }
}
