/* Custom keyframes and animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(9, 178, 67, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(9, 178, 67, 0.8), 0 0 60px rgba(253, 202, 56, 0.4);
  }
}

@keyframes slide-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes tilt {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

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

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: slide-marquee 30s linear infinite;
}

.shimmer-bg {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
}

.bounce-in {
  animation: bounce-in 0.6s ease-out;
}

/* Prose styling for readability */
.prose {
  max-width: 65ch;
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
}

.prose p {
  margin-bottom: 1.25em;
}

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
}

/* Custom gradient backgrounds */
.hero-gradient {
  background: linear-gradient(135deg, #09b243 0%, #fdca38 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(9, 178, 67, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.pattern-dots {
  background-image: radial-gradient(rgba(9, 178, 67, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
}

.pattern-grid {
  background-image: linear-gradient(rgba(9, 178, 67, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9, 178, 67, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Prevent horizontal scroll globally */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Ensure all containers respect viewport width */
* {
  box-sizing: border-box;
}

/* Custom button styles */
.btn-primary {
  background: linear-gradient(135deg, #09b243, #07933a);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #07933a, #065c2a);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(9, 178, 67, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #fdca38, #f5b82a);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #f5b82a, #e0a020);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(253, 202, 56, 0.3);
}

/* Card hover effects */
.game-card {
  transition: all 0.3s ease;
}

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

/* Mobile menu styles - Outside header for proper positioning */
#mobile-menu {
  height: 100vh;
  height: 100dvh; /* For mobile browsers */
  z-index: 9999; /* Ensure it's above everything else */
  touch-action: pan-y; /* Allow vertical scrolling but prevent horizontal gestures */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  will-change: transform; /* Optimize for animations */
}

#mobile-menu.active {
  transform: translateX(0) !important;
}

#mobile-menu-overlay {
  z-index: 9998; /* Just below the menu */
  touch-action: none; /* Prevent all touch interactions on overlay */
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
}

#mobile-menu-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  #mobile-menu {
    height: -webkit-fill-available;
  }
}

/* Prevent iOS bounce scroll when menu is open */
body.menu-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Sticky elements */
.sticky-header {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  /* Ensure header doesn't cause horizontal scroll */
  max-width: 100vw;
  overflow-x: hidden;
}

/* Responsive container fixes */
.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Navigation responsive fixes */
@media (max-width: 767px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Ensure mobile navigation elements don't overflow */
  nav {
    min-width: 0;
    flex-wrap: nowrap;
  }
  
  /* Logo sizing for mobile */
  nav img {
    max-height: 2.5rem;
    width: auto;
  }
  
  /* iOS touch improvements */
  button, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  #menu-btn, #close-menu {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Winner table animations */
.winner-row {
  animation: bounce-in 0.5s ease-out;
}

/* Badge styles */
.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
}
