/* Wordnest – keyframes and effects (jiggle, shake, pop, fill wave). Reduced motion falls back to static highlights. */

/* One-shot effects: add the class to a cell/box, remove it on animationend. */
@keyframes fx-jiggle { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-10deg) scale(1.08); } 20%, 40% { transform: rotate(10deg) scale(1.08); } }
@keyframes fx-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes fx-pop { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes fx-fill { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fx-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.fx-jiggle { animation: fx-jiggle 1.2s var(--ease) 1; box-shadow: 0 0 0 3px var(--c-accent); }
.fx-shake { animation: fx-shake 400ms var(--ease) 1; }
.fx-pop { animation: fx-pop 600ms var(--ease-bounce) 1; }
/* Staggered pop-in wave for a new grid: set --i (cell index) on each cell; ≈15 ms per cell. */
.fx-fill { animation: fx-fill 300ms var(--ease-bounce) both; animation-delay: calc(var(--i, 0) * 15ms); }

.fx-layer { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  /* No movement: jiggle keeps its static accent ring, shake keeps an error outline, toasts just appear. */
  .fx-jiggle, .fx-shake, .fx-pop, .fx-fill, .toast { animation: none; }
  .fx-shake { outline: 3px solid var(--c-error); outline-offset: -3px; }
  .fx-layer { display: none; }
}

/* Match me reshuffle with reduced motion: the column only fades (no movement). */
@keyframes fx-fade { from { opacity: 0.25; } to { opacity: 1; } }
.fx-fade { animation: fx-fade 300ms var(--ease) 1; }

