/* ---------- Radial menu (GTA-style hold-to-pick) ---------- */

.radial-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: radial-gradient(circle at center, rgba(7, 9, 13, 0.55), rgba(7, 9, 13, 0.85) 70%);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none; /* mouse passes through; we track move on document */
}
.radial-overlay.is-open {
  opacity: 1;
}

.radial {
  position: absolute;
  width: calc(var(--radial-outer) * 2);
  height: calc(var(--radial-outer) * 2);
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  transition:
    transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.radial-overlay.is-open .radial {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.radial__svg {
  position: absolute;
  inset: -4px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

.radial__wedge {
  fill: rgba(34, 47, 62, 0.78);
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1.5;
  transition: fill 180ms ease, stroke 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}
.radial__wedge.is-active {
  fill: rgba(94, 226, 160, 0.18);
  stroke: rgba(94, 226, 160, 0.55);
}
.radial__wedge.is-hovered {
  fill: rgba(124, 140, 255, 0.45);
  stroke: rgba(124, 140, 255, 0.85);
  filter: drop-shadow(0 0 14px rgba(124, 140, 255, 0.55));
}
.radial__wedge.is-hovered.is-active {
  fill: rgba(94, 226, 160, 0.5);
  stroke: rgba(94, 226, 160, 0.9);
  filter: drop-shadow(0 0 18px rgba(94, 226, 160, 0.65));
}

/* Dwell progress: while the user holds the cursor on a dwellable wedge, ramp
   the glow over its dwellMs so the expansion isn't a surprise. The
   `--dwell-ms` custom property is set per-node by RadialMenu._setHovered. */
@keyframes radial-dwell-charge {
  from { filter: drop-shadow(0 0 14px rgba(124, 140, 255, 0.55)); }
  to   { filter: drop-shadow(0 0 28px rgba(124, 140, 255, 0.95)); }
}
@keyframes radial-dwell-label {
  from { transform: translate(-50%, -50%) scale(1.06); }
  to   { transform: translate(-50%, -50%) scale(1.14); }
}
.radial__wedge.is-dwelling {
  animation: radial-dwell-charge var(--dwell-ms, 1000ms) linear forwards;
}
.radial__label.is-dwelling {
  animation: radial-dwell-label var(--dwell-ms, 1000ms) linear forwards;
}

.radial__label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: rgba(230, 233, 239, 0.85);
  letter-spacing: 0.02em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: color 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.radial__label.is-hovered {
  color: #fff;
  transform: translate(-50%, -50%) scale(1.06);
}
.radial__label.is-active .radial__icon {
  color: var(--success, #5ee2a0);
  text-shadow: 0 0 12px rgba(94, 226, 160, 0.6);
}
.radial__icon {
  font-size: 22px;
  line-height: 1;
}
.radial__text {
  font-weight: 600;
}

.radial__center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--radial-inner) * 1.6);
  text-align: center;
  pointer-events: none;
  display: grid;
  gap: 4px;
}
.radial__center-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(230, 233, 239, 0.5);
}
.radial__center-hint {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(230, 233, 239, 0.9);
  min-height: 1.4em;
}

/* ---------- Branch arc (fan-out submenu) ---------- */

/* Sits behind the base svg so the base wedges stay readable on top, and
   absolute-positioned within `.radial` (JS sets left/top to recenter it). */
.radial__branch-svg {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.6));
  animation: radial-branch-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

@keyframes radial-branch-in {
  from { opacity: 0; transform: scale(0.86); }
  to   { opacity: 1; transform: scale(1); }
}

.radial__wedge--branch {
  fill: rgba(28, 38, 54, 0.92);
  stroke: rgba(124, 140, 255, 0.22);
}
.radial__wedge--branch.is-hovered {
  fill: rgba(124, 140, 255, 0.55);
  stroke: rgba(160, 174, 255, 0.95);
  filter: drop-shadow(0 0 16px rgba(124, 140, 255, 0.65));
}

/* Parent wedge while its branch is open — locked-in look so the user can see
   which wedge the arc belongs to. Overrides hover so it doesn't flicker if the
   user drifts back over it. */
.radial__wedge.is-expanded,
.radial__wedge.is-expanded.is-hovered {
  fill: rgba(124, 140, 255, 0.32);
  stroke: rgba(124, 140, 255, 0.75);
  filter: drop-shadow(0 0 18px rgba(124, 140, 255, 0.55));
}
.radial__label.is-expanded {
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
}

.radial__label--branch {
  font-size: 12px;
  animation: radial-branch-label-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.radial__label--branch .radial__icon {
  font-size: 18px;
}
@keyframes radial-branch-label-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
