/* Interactive 16-type Quadra relationship star map for /relations/. */
.qmap-section {
  padding-top: 12px;
  padding-bottom: 18px;
}

.qmap-section .sec-head {
  margin-bottom: 16px;
}

.qmap-board {
  border-radius: 24px;
  border: 1px solid #2A394C;
  background-color: #0E1A29;
  background-image: radial-gradient(circle, rgba(164, 183, 205, .15) .9px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 0 20px 44px rgba(16, 38, 58, .16);
  color: #DCE6EE;
  padding: 12px 20px 12px;
  overflow: hidden;
}

.qmap-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 2px;
  padding: 0 2px;
  font-family: Inter, system-ui, sans-serif;
}

.qmap-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

.qmap-svg {
  width: 100%;
  max-width: min(740px, calc((100svh - 210px) * 700 / 532));
  height: auto;
  display: block;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

/* Interactive node hit targets & hover feedback */
.qmap-node {
  cursor: pointer;
  outline: none;
  transition: opacity .18s cubic-bezier(.22, 1, .36, 1);
}

.qmap-node:focus-visible .qmap-focus-ring {
  opacity: 1;
}

.qmap-focus-ring {
  opacity: 0;
  transition: opacity .14s ease;
  pointer-events: none;
}

.qmap-node-dot {
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), opacity .18s ease;
  transform-box: fill-box;
  transform-origin: center;
}

@media (hover: hover) and (pointer: fine) {
  .qmap-node:hover .qmap-node-dot {
    transform: scale(1.16);
  }
}

.qmap-svg.is-probing .qmap-node.is-dim {
  opacity: .56;
}

/* Connector transitions & clean entrance draw */
.qmap-arc {
  transition: opacity .2s cubic-bezier(.22, 1, .36, 1), stroke-width .18s ease;
}

.qmap-arc-draw {
  stroke-dasharray: 420;
  stroke-dashoffset: 0;
  animation: qmapArcIn .28s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes qmapArcIn {
  from { stroke-dashoffset: 240; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

.qmap-probe-layer {
  pointer-events: none;
}

/* Quiet top-left usage hint */
.qmap-legend-hint {
  color: #829BB2;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.qmap-hint-touch {
  display: none;
}

@media (max-width: 720px), (hover: none) {
  .qmap-hint-desktop {
    display: none;
  }

  .qmap-hint-touch {
    display: inline;
  }
}

@media (max-width: 720px) {
  .qmap-board {
    padding: 12px 10px 14px;
    border-radius: 20px;
  }

  .qmap-topbar {
    margin-bottom: 6px;
    padding: 0 4px;
  }

  .qmap-svg {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qmap-node,
  .qmap-focus-ring,
  .qmap-node-dot,
  .qmap-arc {
    transition: none;
  }

  .qmap-arc-draw {
    animation: none;
  }
}
