/* ============================================
   拾光计划 - 动画样式表
   ============================================ */

/* === 关键帧 === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes glyphPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes btnGlow {
  0%, 100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes starTwinkle {
  0%, 100% {
    box-shadow: 0 0 20px var(--color-gold), 0 0 40px rgba(232, 193, 112, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px var(--color-gold), 0 0 60px rgba(232, 193, 112, 0.5);
    transform: scale(1.05);
  }
}

@keyframes illuminateFlash {
  0% {
    box-shadow: 0 0 0 rgba(232, 193, 112, 0);
  }
  30% {
    box-shadow: 0 0 60px rgba(232, 193, 112, 0.6), 0 0 120px rgba(232, 193, 112, 0.3);
  }
  100% {
    box-shadow: 0 0 30px rgba(232, 193, 112, 0.15), inset 0 0 30px rgba(232, 193, 112, 0.05);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes galaxyFlow {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(232, 193, 112, 0.3);
  }
  50% {
    text-shadow: 0 0 40px rgba(232, 193, 112, 0.6), 0 0 60px rgba(232, 193, 112, 0.2);
  }
}

@keyframes particleDrift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift-x, 100px), var(--drift-y, -200px)) scale(0);
    opacity: 0;
  }
}

/* === 过渡类 === */
.fade-enter {
  animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

.fade-exit {
  animation: fadeOut 0.5s ease forwards;
}

.slide-up-enter {
  animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

/* === 场景过渡 === */
.screen-transition-out {
  animation: fadeOut 0.8s ease forwards;
}

.screen-transition-in {
  animation: fadeIn 1s ease forwards;
}

/* === 打字机效果 === */
.typewriter {
  border-right: 2px solid var(--color-gold);
  animation: blink-caret 0.75s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-gold);
  }
}

/* === 点亮动画 === */
.game-card.illuminating {
  animation: illuminateFlash 1.2s ease forwards;
}

/* === 涟漪效果 === */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 193, 112, 0.4) 0%, transparent 70%);
  animation: ripple 1s ease-out forwards;
  pointer-events: none;
}

/* === 浮动装饰 === */
.floating-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-gold);
  animation: particleDrift 4s ease-in-out forwards;
  pointer-events: none;
}

/* === 银河路径高亮 === */
.galaxy-path-glow {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--color-gold), var(--color-gold-light), var(--color-gold), transparent);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.4;
  animation: breathe 4s ease-in-out infinite;
}
