#star-map {
  --map-line: #c9c4ab44;
  --map-ink: #eeeade;
  --map-muted: #c0bbac;
  width: 100%;
  min-width: 0;
  color: var(--map-ink);
}

#star-map .map-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: clamp(26rem, 36vw, 36.5rem);
  border: 0;
  border-bottom: 1px solid var(--map-line);
  background: #0b0d0e;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

#star-map .map-frame.is-dragging { cursor: grabbing; }
#star-map .map-frame.is-pannable { touch-action: none; }
#star-map .map-frame canvas { width: 100%; height: 100%; display: block; }

#star-map .map-coords {
  position: absolute;
  inset: 1.05rem auto auto 1.15rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  pointer-events: none;
  font-size: .875rem;
  color: var(--map-muted);
  text-shadow: 0 1px 7px #000;
}

#star-map .map-coords output {
  font: .75rem/1.3 'Space Mono', Consolas, monospace;
  color: #ded8c8;
}

#star-map .map-atlas-mark {
  position: absolute;
  top: 1.3rem;
  right: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
  color: #a0bad3;
  border: 1px solid #99b2ce42;
  border-radius: 50%;
}

#star-map .map-atlas-mark::before, #star-map .map-atlas-mark::after {
  content: '';
  position: absolute;
  background: currentColor;
}

#star-map .map-atlas-mark::before { top: 50%; left: -25%; height: 1px; width: 150%; }
#star-map .map-atlas-mark::after { left: 50%; top: -25%; width: 1px; height: 150%; }

#star-map button {
  font-family: inherit;
  font-weight: 500;
  line-height: 1.25;
  color: inherit;
  cursor: pointer;
}

#star-map button:focus-visible, #star-map .map-frame:focus-visible {
  outline: 2px solid #efc88e;
  outline-offset: -3px;
}

#star-map .map-node {
  --node-accent: #f1ce9e;
  position: absolute;
  width: 8.1rem;
  height: 4.6rem;
  margin: -1.6rem 0 0 -4.05rem;
  padding: 0;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  display: grid;
  justify-items: center;
  align-content: start;
  box-shadow: none;
  text-shadow: 0 1px 6px #000;
}

#star-map .map-node[data-map-story="sea"] { --node-accent: #91e5ee; }
#star-map .map-node[data-map-story="seed"] { --node-accent: #e3caff; }
#star-map .map-node[hidden] { display: none; }

#star-map .map-reticle {
  display: block;
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid transparent;
  border-radius: 50%;
}

#star-map .map-reticle::before {
  content: '';
  position: absolute;
  inset: -.22rem;
  border-radius: 50%;
  border: 1px dashed transparent;
}

#star-map .map-node[aria-pressed="true"] .map-reticle {
  border-color: color-mix(in srgb, var(--node-accent) 70%, transparent);
}

#star-map .map-node[aria-pressed="true"] .map-reticle::before {
  border-color: color-mix(in srgb, var(--node-accent) 52%, transparent);
  animation: celestial-reticle-turn 32s linear infinite;
}

@keyframes celestial-reticle-turn { to { transform: rotate(1turn); } }

#star-map .map-node-label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .55rem;
  margin-top: .25rem;
  border-radius: 0;
  background: #0a0c0dcc;
  color: #e7e3d8;
  font-size: .875rem;
  white-space: nowrap;
}

#star-map .map-node[aria-pressed="true"] .map-node-label { color: var(--node-accent); }
#star-map .map-node[data-saved="true"] .map-node-label::before { content: '✓'; color: #9fedc4; }

#star-map .map-controls {
  position: absolute;
  right: .9rem;
  bottom: .9rem;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 1px solid #aaa48e55;
  border-radius: 0;
  background: #111310eb;
}

#star-map .map-controls button {
  height: 2.75rem;
  min-width: 2.75rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #ddd7c8;
  font-size: 1.12rem;
}

#star-map .map-controls .map-text-control { font-size: .875rem; padding-inline: .55rem; }
#star-map .map-controls button:hover, #star-map .map-controls [aria-pressed="true"] { background: #32332c; }
#star-map .map-controls button:disabled { color: #6a788c; cursor: default; }
#star-map .map-scale {
  position: absolute;
  left: 1.15rem;
  bottom: 1.3rem;
  display: grid;
  gap: .3rem;
  color: #c4bfaf;
  font: .75rem/1 'Space Mono', Consolas, monospace;
  pointer-events: none;
}
#star-map .map-scale::after {
  content: '';
  display: block;
  width: 3.1rem;
  height: .25rem;
  border: 1px solid #97b5d0a6;
  border-top: 0;
}
#star-map .map-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#star-map .map-pan-toggle { display: none; }
@media (pointer: coarse) {
  #star-map .map-pan-toggle { display: inline-block; }
}
@media (max-width: 650px) {
  #star-map .map-frame { height: clamp(24rem, 110vw, 30rem); }
  #star-map .map-controls { right: .6rem; bottom: .65rem; }
  #star-map .map-pan-toggle { display: inline-block; }
  #star-map .map-coords { top: .85rem; left: .8rem; gap: .5rem; }
  #star-map .map-scale { left: .8rem; bottom: 1.05rem; }
  #star-map .map-node { width: 6.2rem; margin-left: -3.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  #star-map .map-node .map-reticle::before { animation: none; }
}
html[data-motion="still"] #star-map .map-node .map-reticle::before { animation: none; }
