/**
 * 动画和特效样式
 */

/* ========== 成就通知 ========== */
.achievement-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  max-width: 400px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: 3px solid var(--color-warning);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideInRight 0.5s ease, pulse 2s ease infinite;
}

.achievement-notification.hidden {
  display: none;
}

@keyframes slideInRight {
  from {
    transform: translateX(500px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: var(--shadow-lg);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

.achievement-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: var(--spacing-md);
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.achievement-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: white;
  text-align: center;
  margin-bottom: var(--spacing-sm);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.achievement-message {
  font-size: 1rem;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========== 特效容器 ========== */
.effect-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1500;
  overflow: hidden;
}

/* ========== Confetti 特效 ========== */
.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========== Sparkle 特效 ========== */
.sparkle-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--color-warning);
  border-radius: 50%;
  animation: sparkleFloat 2s ease-out forwards;
  box-shadow: 0 0 10px currentColor;
}

@keyframes sparkleFloat {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ========== Racing Flag 特效 ========== */
.racing-flag-particle {
  position: absolute;
  width: 20px;
  height: 15px;
  background: repeating-linear-gradient(
    45deg,
    #000,
    #000 5px,
    #fff 5px,
    #fff 10px
  );
  animation: flagWave 2.5s ease-out forwards;
}

@keyframes flagWave {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ========== 装备操作动画 ========== */
.equip-animation {
  animation: equipPop 0.3s ease;
}

@keyframes equipPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.unequip-animation {
  animation: unequipFade 0.3s ease;
}

@keyframes unequipFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* ========== 悬停效果 ========== */
.hover-glow {
  transition: all var(--transition-normal);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--color-primary);
  filter: brightness(1.2);
}

/* ========== 闪烁效果 ========== */
.blink {
  animation: blink 1s ease infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ========== 旋转加载 ========== */
.rotate-loading {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========== 淡入淡出 ========== */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-out {
  animation: fadeOut 0.5s ease;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ========== 滑入滑出 ========== */
.slide-in-up {
  animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-out-down {
  animation: slideOutDown 0.5s ease;
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(50px);
    opacity: 0;
  }
}

/* ========== 缩放动画 ========== */
.scale-in {
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-out {
  animation: scaleOut 0.3s ease;
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}

/* ========== 属性汇总面板动画 ========== */
.attribute-panel {
  animation: slideInUp 0.5s ease;
}

.attribute-update {
  animation: attributePulse 0.5s ease;
}

@keyframes attributePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    color: var(--color-success);
  }
}

/* ========== F1发车灯反应测试 ========== */
.race-go-btn {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 60px;
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
  border: 4px solid #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 8px 32px rgba(0, 255, 0, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: goBtnPulse 1s ease-in-out infinite;
  z-index: 10;
}

.race-go-btn:hover:not(:disabled) {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 
    0 12px 48px rgba(0, 255, 0, 0.8),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.race-go-btn:active:not(:disabled) {
  transform: translateX(-50%) scale(0.95);
}

.race-go-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

@keyframes goBtnPulse {
  0%, 100% {
    box-shadow: 
      0 8px 32px rgba(0, 255, 0, 0.6),
      inset 0 2px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 
      0 12px 48px rgba(0, 255, 0, 0.9),
      inset 0 2px 0 rgba(255, 255, 255, 0.4);
  }
}

/* 反应结果显示 */
.reaction-result {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  animation: scaleIn 0.5s ease;
}

.reaction-time {
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 
    0 0 20px rgba(0, 255, 0, 0.8),
    0 4px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  animation: reactionTimePop 0.5s ease;
}

@keyframes reactionTimePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.reaction-rating {
  font-size: 2rem;
  font-weight: 700;
  padding: 15px 40px;
  border-radius: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: ratingSlideIn 0.5s ease 0.3s both;
}

@keyframes ratingSlideIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.reaction-rating.legendary {
  background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 152, 0, 0.8);
  animation: ratingSlideIn 0.5s ease 0.3s both, legendaryGlow 1s ease-in-out infinite;
}

.reaction-rating.epic {
  background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
  color: #fff;
  box-shadow: 0 0 25px rgba(156, 39, 176, 0.7);
}

.reaction-rating.rare {
  background: linear-gradient(135deg, #2196f3 0%, #03a9f4 100%);
  color: #fff;
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
}

.reaction-rating.common {
  background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
  color: #fff;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.reaction-rating.slow {
  background: linear-gradient(135deg, #757575 0%, #9e9e9e 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(117, 117, 117, 0.4);
}

@keyframes legendaryGlow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.8);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 152, 0, 1);
  }
}

/* 抢跑提示 */
.race-start-text {
  transition: color 0.3s ease;
}
