/* Animation Styles */

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

/* Slide Up */
@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.8s ease-out;
}

/* Slide Right */
@keyframes slideRight {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-right {
  animation: slideRight 0.8s ease-out;
}

/* Glow Effect */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(230, 126, 34, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(230, 126, 34, 0.5);
  }
}

.glow {
  animation: glow 2s infinite;
}

/* Pulse Effect */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 5s linear infinite;
}

/* Float Animation */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Page Transitions */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s, transform 0.5s;
}

.page-exit {
  opacity: 1;
}

.page-exit-active {
  opacity: 0;
  transition: opacity 0.5s;
}

/* Button Hover Animation */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.btn:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Card Tilt Effect */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s;
}

.tilt:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
}

.tilt-inner {
  transform-style: preserve-3d;
  transform: translateZ(20px);
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

.typing {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary-color);
  width: 0;
  animation: typing 3.5s steps(40, end) forwards, blink-caret 0.75s step-end infinite;
}

/* Game Card Hover Effects */
.game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(130deg, rgba(226, 209, 166, 0), rgba(226, 209, 166, 0.1) 50%, rgba(226, 209, 166, 0) 100%);
  opacity: 0;
  z-index: -1;
  transform: translateX(-100%);
  transition: all 0.5s ease;
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.game-card:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

/* Dust Particles Animation for Canvas */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* Wheel Track Animation for Buttons */
.btn-track {
  position: relative;
  overflow: hidden;
}

.btn-track::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10" preserveAspectRatio="none"><path d="M0,5 C20,2 40,8 60,5 C80,2 100,8 100,5" stroke="rgba(255,255,255,0.2)" stroke-width="1" fill="none" /></svg>');
  background-size: 100% 100%;
  background-repeat: repeat-x;
  animation: trackMove 2s linear infinite;
  z-index: -1;
}

@keyframes trackMove {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Tire Mark Button Effect */
.btn-tire {
  position: relative;
  overflow: hidden;
}

.btn-tire::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 4" preserveAspectRatio="none"><rect x="0" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="4" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="8" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="12" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="16" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="20" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="24" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="28" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="32" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="36" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="40" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="44" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="48" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="52" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="56" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="60" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="64" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="68" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="72" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="76" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="80" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="84" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="88" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="92" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /><rect x="96" y="0" width="2" height="4" fill="rgba(255,255,255,0.3)" /></svg>');
  background-size: 100% 100%;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.btn-tire:hover::after {
  transform: translateX(0);
}

/* Sand Animation */
@keyframes sandFall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.sand-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: var(--sand-color);
  border-radius: 50%;
  animation: sandFall 5s linear infinite;
}