/* 3D stage: canvas, pins, the guess-target arc and its distance label */

#stage { position: fixed; inset: 0; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
#stage.idle { cursor: default; }
#stage.orbit { cursor: grab; }
#stage.orbit.dragging { cursor: grabbing; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .35s; overflow: visible; }
#lineGlow { fill: none; stroke: color-mix(in srgb, var(--arc-mid) 22%, transparent); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
#line { fill: none; stroke: url(#arcGrad); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#lineHead { fill: var(--arc-mid); stroke: color-mix(in srgb, var(--arc-mid) 35%, transparent); stroke-width: 6; visibility: hidden; }
#pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .3s; will-change: transform; }
.pin.show { opacity: 1; }
.pin .dot {
  position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--pin-border); box-shadow: 0 2px 10px rgba(0,0,0,.45); transform: scale(0);
}
.pin.guess .dot { background: var(--pin-guess); }
.pin.target .dot { background: var(--pin-target); }
.pin.show .dot { animation: pop .5s cubic-bezier(.2,.9,.3,1.35) forwards; }
/* touch: the unconfirmed guess is bigger, with a halo saying it can be grabbed */
.pin.guess.pending .dot {
  left: -11px; top: -11px; width: 22px; height: 22px;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--pin-guess) 28%, transparent), 0 2px 10px rgba(0,0,0,.45);
}
.pin .ring {
  position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--pin-ring); opacity: 0;
}
.pin.show .ring { animation: pulse 1.7s ease-out .5s infinite; }
.arc-label { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; visibility: hidden; will-change: transform; }
.arc-label span {
  position: absolute; left: 0; top: -14px; transform: translate(-50%, -100%) translateY(4px); opacity: 0;
  transition: opacity .3s, transform .3s cubic-bezier(.2,.8,.2,1);
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 6px 12px;
  font: 700 14px/1.1 var(--font-body); white-space: nowrap; letter-spacing: .01em;
}
.arc-label span::after {
  content: ''; position: absolute; left: 50%; top: calc(100% + 1px); margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--surface);
}
.arc-label.show span { opacity: 1; transform: translate(-50%, -100%); }
.is-mobile .arc-label span { font-size: 13px; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }

@media (max-width: 640px) { .arc-label span { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) {
  .pin.show .dot { animation: none; transform: scale(1); }
  .pin.show .ring { animation: none; }
  .arc-label span, .arc-label.show span { transform: translate(-50%, -100%); transition: opacity .3s; }
}
