/* map — star chart. The SVG is a window onto space, so it stays dark in both themes.
   Rule from the incident log: every <text> gets an explicit fill; never set fill:none on a group that holds text. */
@layer pages {
  .map-card { padding: 6px; border-radius: var(--r-lg); background: #070b18; box-shadow: inset 0 0 0 1.5px rgba(160, 185, 255, .2), 0 var(--depth) 0 var(--edge); }
  .map-wrap { position: relative; width: 100%; aspect-ratio: 760 / 470; border-radius: calc(var(--r-lg) - 6px); overflow: hidden; }
  #star-map { display: block; width: 100%; height: 100%; }

  #star-map .map-band { fill: none; stroke: rgba(124, 92, 255, .16); stroke-width: 34; stroke-linecap: round; }
  #star-map .map-orbit { fill: none; stroke: rgba(150, 170, 255, .16); stroke-width: 1.2; stroke-dasharray: 3 8; }
  #star-map .map-route { fill: none; stroke: rgba(150, 170, 255, .22); stroke-width: 1.8; stroke-linecap: round; }
  #star-map .map-route.available { stroke: rgba(255, 226, 122, .5); stroke-dasharray: 5 6; }
  #star-map .map-route.explored { stroke: var(--info); stroke-width: 2.4; }

  #star-map .map-node { cursor: pointer; }
  #star-map .node-hit { fill: transparent; }
  #star-map .node-halo { fill: rgba(92, 200, 255, .1); }
  #star-map .node-ring { fill: none; stroke: rgba(150, 170, 255, .4); stroke-width: 2; }
  #star-map .node-core { fill: #18213f; stroke: rgba(190, 210, 255, .45); stroke-width: 2; }
  #star-map .node-region-ring { fill: none; stroke-width: 2.4; stroke-opacity: .7; stroke-dasharray: 5 5; }
  #star-map .node-icon { font-size: 26px; fill: #fff; stroke: none; }
  #star-map .node-label { transform: translateY(5px); font-family: var(--font); font-size: 22px; font-weight: 800; text-anchor: middle; fill: #dbe6ff; stroke: #070b18; stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; }

  /* region identity colours — the same hues as the legend dots */
  #star-map .region-core .node-region-ring { stroke: var(--r-core); }
  #star-map .region-industry .node-region-ring { stroke: var(--r-industry); }
  #star-map .region-overload .node-region-ring { stroke: var(--r-overload); }
  #star-map .region-deep .node-region-ring { stroke: var(--r-deep); }

  /* the four states must stay distinguishable */
  #star-map .map-node.explored .node-core { fill: #123a4a; stroke: var(--info); }
  #star-map .map-node.explored .node-halo { fill: rgba(92, 200, 255, .22); }
  #star-map .map-node.available .node-core { fill: #3a3010; stroke: var(--dust); }
  #star-map .map-node.available .node-halo { fill: rgba(255, 226, 122, .18); }
  #star-map .map-node.available .node-label { fill: #ffeaa0; }
  #star-map .map-node.locked { opacity: .68; }
  #star-map .map-node.locked .node-label { font-size: 19px; font-weight: 700; fill: #aab6dc; }
  #star-map .map-node.locked .node-icon { opacity: .6; }
  #star-map .map-node.selected .node-ring { stroke: #fff; stroke-width: 3; }
  #star-map .map-node.selected .node-label { fill: #fff; }
  #star-map .map-node.just-explored .node-halo { animation: halo 1.2s ease-out 3; }
  .map-wrap.discovering { animation: discover 1.1s ease-out; }
  /* region legend: a coloured dot per region, effect-only text (member names are already on the chart) */
  .map-regions { margin-top: 10px; }
  .region-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .region-legend-item { --rc: var(--ink-3); display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: var(--r-md); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px var(--line); }
  .region-legend-item.region-core { --rc: var(--r-core); } .region-legend-item.region-industry { --rc: var(--r-industry); }
  .region-legend-item.region-overload { --rc: var(--r-overload); } .region-legend-item.region-deep { --rc: var(--r-deep); }
  .region-legend-item.active { box-shadow: inset 0 0 0 2px var(--rc); background: rgba(255, 255, 255, .1); }
  .rl-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
  .region-legend-item > div { min-width: 0; }
  .rl-title { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; white-space: nowrap; }
  .rl-title b { margin-left: 2px; color: var(--info-ink); }
  .rl-desc { font-size: 12px; color: var(--ink-3); }
  .region-chip { display: inline-flex; margin: 6px 6px 0 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--dust-ink); background: rgba(255, 226, 122, .12); }

  .map-detail { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
  .md-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 24px; background: rgba(255, 255, 255, .1); }
  .md-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
  .md-main b { font-size: 16px; font-weight: 900; }
  .md-main span { font-size: 12px; line-height: 1.5; color: var(--ink-3); }
  .map-detail .btn { flex: none; }
}
