/* =============================================================================
   PENDING — the slow glow on anything the player still has to choose
   =============================================================================
   Applied by src/js/pending-choices.js. `--pending` is red unless a custom accent
   or panel colour crowds it (appearance.js swaps it for the alternate). */

/* ─── THE GLOW ─── */
/* One cycle is PENDING_PULSE_MS in pending-choices.js. */
.needs-choice {
  animation: pending-pulse 2.4s ease-in-out infinite;
}
@keyframes pending-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pending) 40%, transparent),
                0 0 3px 0 color-mix(in srgb, var(--pending) 20%, transparent);
  }
  50% {
    box-shadow: 0 0 0 2px var(--pending),
                0 0 14px 3px color-mix(in srgb, var(--pending) 60%, transparent);
  }
}

/* A scrolling list glows on its inside edge, where its own clipping cannot cut it off. */
#spellbook-list.needs-choice { animation-name: pending-pulse-inset; }
@keyframes pending-pulse-inset {
  0%, 100% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pending) 40%, transparent); }
  50% {
    box-shadow: inset 0 0 0 2px var(--pending),
                inset 0 0 16px 2px color-mix(in srgb, var(--pending) 45%, transparent);
  }
}

#char-name-display.needs-choice { border-radius: 3px; }

/* ─── THE EDGE INDICATORS ─── */
/* A target scrolled out of its scroller lights that edge. Never takes a click. */
#pending-edges {
  position: fixed;
  inset: 0;
  z-index: 650; /* over a dialog, whose own rows can scroll out of sight */
  pointer-events: none;
}
.pending-edge {
  position: fixed;
  height: 28px; /* PENDING_EDGE_HEIGHT in pending-choices.js */
  pointer-events: none;
  animation: pending-edge-pulse 2.4s ease-in-out infinite;
}
.pending-edge.top {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--pending) 70%, transparent), transparent);
}
.pending-edge.bottom {
  background: linear-gradient(to top, color-mix(in srgb, var(--pending) 70%, transparent), transparent);
}
@keyframes pending-edge-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* Steady rather than blinking for anyone who has asked the system for less motion. */
@media (prefers-reduced-motion: reduce) {
  .needs-choice {
    animation: none;
    box-shadow: 0 0 0 2px var(--pending), 0 0 10px 2px color-mix(in srgb, var(--pending) 50%, transparent);
  }
  #spellbook-list.needs-choice { box-shadow: inset 0 0 0 2px var(--pending); }
  .pending-edge { animation: none; opacity: 0.8; }
}
