.constellation-card {
  overflow: hidden;
  padding: 0;
}

.constellation-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.constellation-tools div {
  display: flex;
  gap: 6px;
}

.constellation-tools button {
  min-width: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--elevated);
  color: var(--fg);
  cursor: pointer;
}

.constellation-scroll {
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--fg) 5%, transparent), transparent 44%),
    radial-gradient(circle, color-mix(in srgb, var(--fg) 20%, transparent) 0.7px, transparent 0.9px);
  background-size: auto, 23px 23px;
}

#constellation-svg {
  width: 100%;
  min-width: 760px;
  height: min(72dvh, 720px);
  user-select: none;
}

.constellation-scene {
  transform-origin: 0 0;
  transition: transform 220ms ease;
}

.constellation-scene.dragging {
  transition: none;
}

.star-edge {
  stroke: color-mix(in srgb, var(--fg) 22%, transparent);
  stroke-width: 1.3;
  pointer-events: none;
}

.star-edge.active {
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
  stroke-width: 1.8;
}

.star-verb {
  fill: var(--faint);
  font-size: 9px;
  text-anchor: middle;
  opacity: 0;
  paint-order: stroke;
  stroke: var(--elevated);
  stroke-width: 5px;
  transition: opacity 180ms ease;
}

.star-verb.visible {
  opacity: 1;
}

.star-node {
  cursor: pointer;
  outline: none;
}

.star-node.held {
  cursor: grabbing;
}

.star-node .hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.star-node circle.body {
  fill: var(--fg);
  stroke: var(--elevated);
  stroke-width: 4px;
  transition: filter 180ms ease, opacity 180ms ease, stroke 180ms ease;
}

.star-node.warn circle.body {
  fill: var(--warn);
}

.star-node text {
  fill: var(--fg);
  font-size: 11px;
  font-weight: 650;
  paint-order: stroke;
  stroke: var(--elevated);
  stroke-linejoin: round;
  stroke-width: 5px;
  pointer-events: none;
}

.star-node:hover circle.body,
.star-node:focus-visible circle.body,
.star-node.selected circle.body {
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 70%, transparent));
}

.star-node.connected circle.body {
  stroke: color-mix(in srgb, var(--accent) 55%, var(--elevated));
}

.star-node.dimmed {
  opacity: 0.38;
}

@media (prefers-reduced-motion: reduce) {
  .constellation-scene,
  .star-node circle,
  .star-verb {
    transition: none;
  }
}

@media (max-width: 720px) {
  .constellation-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  #constellation-svg {
    min-width: 680px;
    height: 62dvh;
  }
}
