/* ============================================
   灵犀塔罗 - 动画样式表
   GPU 加速 · 流畅过渡 · 魔法效果
   ============================================ */

/* --- 粒子浮升动画 --- */
@keyframes float-up {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0;
  }
}

/* --- 旋转动画 (加载) --- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- 脉冲动画 --- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- 淡入上浮 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 淡入缩放 --- */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* --- 闪光扫过 --- */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* --- 洗牌快速切换 --- */
@keyframes shuffleCard {
  0% { transform: translateX(-30px) rotate(-5deg) scale(0.9); opacity: 0.4; }
  25% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
  50% { transform: translateX(30px) rotate(5deg) scale(0.9); opacity: 0.4; }
  75% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateX(-30px) rotate(-5deg) scale(0.9); opacity: 0.4; }
}

/* --- 翻牌 - 3D 翻转 --- */
@keyframes cardReveal {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

/* --- 打字机光标 --- */
@keyframes blinkCursor {
  0%, 100% { border-right-color: var(--color-accent); }
  50% { border-right-color: transparent; }
}

/* --- 魔法光晕扩散 --- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--color-gold-glow); }
  50% { box-shadow: 0 0 40px var(--color-gold-glow), 0 0 80px var(--color-accent-glow); }
}

/* --- 星星闪烁 --- */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* --- 侧面板滑入 --- */
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* --- 应用动画的类 --- */
.animate-fadeInUp {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-fadeInScale {
  animation: fadeInScale 0.4s ease forwards;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 168, 67, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* --- 面板动画 --- */
.side-panel {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-panel.visible {
  transform: translateX(0);
}

.side-panel.closing {
  animation: slideOutRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --- 洗牌卡片应用动画 --- */
.shuffle-card {
  width: 80px;
  height: 120px;
  background: linear-gradient(135deg, #1a1a3e, #2a1a4e);
  border: 2px solid var(--color-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 15px var(--color-gold-glow);
}

.shuffle-card:nth-child(1) { animation: shuffleCard 0.6s ease-in-out infinite; }
.shuffle-card:nth-child(2) { animation: shuffleCard 0.6s ease-in-out 0.1s infinite; }
.shuffle-card:nth-child(3) { animation: shuffleCard 0.6s ease-in-out 0.2s infinite; }

/* --- 翻牌效果 --- */
.card-display {
  animation: fadeInScale 0.5s ease forwards;
}

.card-display.revealed .card-inner {
  transform: rotateY(180deg);
}

/* --- 打字机效果 --- */
.typing-text {
  display: inline;
  border-right: 2px solid var(--color-accent);
  animation: blinkCursor 0.8s step-end infinite;
}

.typing-text.done {
  border-right: none;
  animation: none;
}

/* --- 解读内容淡入 --- */
.reading-content p,
.reading-content h2,
.reading-content h3 {
  animation: fadeInUp 0.4s ease forwards;
}

/* --- 遮罩淡入淡出 --- */
.overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.visible {
  opacity: 1;
}
