/* ====================
   ENHANCED VISUAL EFFECTS
   ==================== */

/* Gradient Background with Subtle Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 20% 30%,
    rgba(11, 15, 20, 0.9) 0%,
    rgba(11, 15, 20, 0.95) 100%
  ),
  linear-gradient(
    135deg,
    rgba(255, 122, 26, 0.03) 0%,
    rgba(168, 216, 255, 0.01) 100%
  );
  z-index: -1;
  animation: gradientShift 20s ease infinite alternate;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* Animated Header Text */
.site-header h1 {
  background: linear-gradient(90deg, var(--fg), var(--ice), var(--fg));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s linear infinite;
  display: inline-block;
  padding: 0 0.5rem;
  position: relative;
  overflow: hidden;
}

.site-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fg), transparent);
  opacity: 0.6;
  animation: linePulse 4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

@keyframes linePulse {
  0%, 100% { opacity: 0.3; width: 40%; }
  50% { opacity: 0.8; width: 80%; }
}

/* Subtle Glow Effects */
.game-card {
  position: relative;
  overflow: visible;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(45deg, var(--fg), var(--ice));
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.game-card:hover::before {
  opacity: 0.6;
  animation: borderGlow 2s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { opacity: 0.3; filter: blur(2px); }
  100% { opacity: 0.8; filter: blur(1px); }
}

/* Hover Effects for Links */
a:not(.game-card a) {
  position: relative;
  padding: 0.1rem 0.2rem;
  z-index: 1;
}

a:not(.game-card a)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
  z-index: -1;
}

a:not(.game-card a):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Back to Top Button Animation */
.back-to-top {
  position: relative;
  padding-right: 1.5rem;
  transition: all 0.3s ease;
}

.back-to-top::after {
  content: '↑';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.back-to-top:hover {
  padding-right: 1.8rem;
  color: var(--fg) !important;
}

.back-to-top:hover::after {
  transform: translateY(-50%) translateY(-3px);
  animation: bounce 1s ease infinite;
}

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

/* Subtle Card Hover Lift */
.game-card {
  will-change: transform, box-shadow;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Loading Animation (for future use) */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-card {
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

/* Add staggered delay for cards */
.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }
.game-card:nth-child(7) { animation-delay: 0.7s; }
.game-card:nth-child(8) { animation-delay: 0.8s; }
.game-card:nth-child(9) { animation-delay: 0.9s; }
.game-card:nth-child(10) { animation-delay: 1.0s; }
.game-card:nth-child(11) { animation-delay: 1.1s; }
.game-card:nth-child(12) { animation-delay: 1.2s; }

/* Subtle Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 15, 20, 0.8);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--fg), var(--ice));
  border-radius: 5px;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--ice), var(--fg));
}

/* Print Optimization */
@media print {
  body::before,
  .game-card::before,
  .site-header h1::after {
    display: none;
  }
  
  .site-header h1 {
    -webkit-text-fill-color: var(--fg);
    background: none;
    animation: none;
  }
  
  .game-card {
    animation: none;
    opacity: 1;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
}
