/* 动效（与主题无关的公共动画） */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.3);
    opacity: 0.4;
  }
  60% {
    transform: scale(1.18);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes hint-glow {
  0% {
    box-shadow: inset 0 0 0 2px var(--c-gold), 0 0 0 rgba(0, 0, 0, 0);
  }
  50% {
    box-shadow: inset 0 0 14px 3px var(--c-gold);
  }
  100% {
    box-shadow: inset 0 0 0 2px transparent;
  }
}

/* 填入数字时的弹入 */
.cell .val {
  display: inline-block;
}

.cell.user .val {
  animation: pop 0.22s ease;
}

/* 填错抖动 */
.cell.wrong .val {
  animation: shake 0.4s ease;
}

/* 提示高亮 */
.cell.hint-fill,
.cell.hint-note,
.cell.hint-focus {
  animation: hint-glow 0.9s ease 2;
}

/* 覆盖层打开时棋盘轻微虚化 */
body:has(#overlay:not([hidden])) .board {
  filter: blur(3px) brightness(0.85);
  transition: filter 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
