/* Animations & Custom Styles */

/* Parallax Background */
.parallax-bg {
  transform: translateZ(-1px) scale(1.5);
  will-change: transform;
}

/* Animated Sparks */
.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd700, transparent);
  animation: sparkShoot 3s ease-in-out infinite;
  opacity: 0;
}

.spark-1 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  background: radial-gradient(circle, #bfff00, transparent);
}

.spark-2 {
  top: 40%;
  right: 15%;
  animation-delay: 0.8s;
  background: radial-gradient(circle, #ff1493, transparent);
}

.spark-3 {
  bottom: 30%;
  left: 20%;
  animation-delay: 1.6s;
  background: radial-gradient(circle, #00ffff, transparent);
}

.spark-4 {
  top: 60%;
  right: 25%;
  animation-delay: 2.4s;
  background: radial-gradient(circle, #ffd700, transparent);
}

@keyframes sparkShoot {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  90% {
    opacity: 1;
    transform: translate(100px, -100px) scale(1.5);
  }
  100% {
    opacity: 0;
    transform: translate(150px, -150px) scale(0);
  }
}

/* Bonus Glow Effect */
.bonus-glow {
  animation: bonusPulse 2s ease-in-out infinite;
}

@keyframes bonusPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
  }
}

/* Marquee Animation */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.marquee-content {
  display: flex;
  gap: 2rem;
  animation: marqueeScroll 30s linear infinite;
  width: max-content;
}

.game-card {
  flex-shrink: 0;
  width: 280px;
}

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

/* Duplicate marquee content for seamless loop */
.marquee-content::after {
  content: "";
  display: flex;
  gap: 2rem;
}

/* Prose Styling for Readability */
.prose {
  color: #e5e7eb;
  line-height: 1.75;
  max-width: 100%;
}

.prose h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.2;
  color: #ffd700;
  background: linear-gradient(135deg, #ffd700, #bfff00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prose h3 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  line-height: 1.3;
  color: #bfff00;
}

.prose h4 {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.4;
  color: #00ffff;
}

.prose p {
  margin-bottom: 1.5em;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: #d1d5db;
  line-height: 1.8;
}

.prose a {
  color: #ffd700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 215, 0, 0.3);
  text-underline-offset: 0.2em;
  transition: all 0.3s ease;
}

.prose a:hover {
  color: #bfff00;
  text-decoration-color: rgba(191, 255, 0, 0.6);
}

.prose strong {
  font-weight: 600;
  color: #ffffff;
}

.prose em {
  font-style: italic;
  color: #f3f4f6;
}

.prose ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5em;
  margin-top: 1em;
}

.prose ul li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: 0.75em;
  color: #d1d5db;
  line-height: 1.7;
}

.prose ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #ffd700;
  font-weight: bold;
  font-size: 1.1em;
}

.prose ol {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
  margin-bottom: 1.5em;
  margin-top: 1em;
}

.prose ol li {
  position: relative;
  padding-left: 2.5em;
  margin-bottom: 0.75em;
  counter-increment: item;
  color: #d1d5db;
  line-height: 1.7;
}

.prose ol li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  color: #ffd700;
  font-weight: 600;
  min-width: 2em;
}

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  background: rgba(26, 26, 26, 0.6);
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose thead {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(191, 255, 0, 0.15));
}

.prose th {
  text-align: left;
  padding: 1em;
  font-weight: 600;
  color: #ffd700;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  white-space: nowrap;
}

.prose td {
  padding: 0.875em 1em;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  color: #d1d5db;
}

.prose tbody tr:hover {
  background: rgba(255, 215, 0, 0.05);
  transition: background 0.2s ease;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose blockquote {
  border-left: 0.25rem solid #ffd700;
  padding-left: 1.5em;
  margin: 2em 0;
  font-style: italic;
  color: #f3f4f6;
  background: rgba(255, 215, 0, 0.05);
  padding: 1.5em;
  border-radius: 0.5rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2em 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.prose code {
  background: rgba(255, 215, 0, 0.1);
  color: #bfff00;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: "Courier New", monospace;
}

.prose pre {
  background: rgba(26, 26, 26, 0.8);
  padding: 1.5em;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 2em 0;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.prose pre code {
  background: none;
  padding: 0;
  color: #e5e7eb;
}

.prose hr {
  border: none;
  border-top: 2px solid rgba(255, 215, 0, 0.2);
  margin: 3em 0;
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

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

/* Mobile Menu Transitions */
#mobile-menu {
  transition: all 0.3s ease-in-out;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* Loading Animation for Images */
img {
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Responsive Typography */
@media (max-width: 768px) {
  .prose {
    font-size: 0.95rem;
  }

  .prose h2 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
  }

  .prose h3 {
    margin-top: 1.25em;
    margin-bottom: 0.5em;
  }

  .prose table {
    font-size: 0.8rem;
  }

  .prose th,
  .prose td {
    padding: 0.625em 0.75em;
  }

  .prose ul li,
  .prose ol li {
    padding-left: 1.5em;
  }
}

@media (max-width: 480px) {
  .prose {
    font-size: 0.9rem;
  }

  .prose table {
    font-size: 0.75rem;
  }

  .prose th,
  .prose td {
    padding: 0.5em 0.625em;
  }
}

/* Game Card Hover Effects */
.game-card:hover {
  transform: translateY(-5px);
  transition: transform 0.3s ease;
}

/* Gradient Text Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.bg-gradient-to-r {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}
