/* Animations & Keyframes */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(129, 140, 248, 0.8);
  }
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateX(100px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(100px) rotate(-360deg);
  }
}

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

/* Particles */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
  border-radius: 50%;
  opacity: 0.6;
  animation: orbit 15s linear infinite;
}

.particle-1 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particle-2 {
  top: 60%;
  left: 80%;
  animation-delay: -5s;
}

.particle-3 {
  top: 40%;
  left: 30%;
  animation-delay: -10s;
}

.particle-4 {
  top: 70%;
  left: 60%;
  animation-delay: -7s;
}

.particle-5 {
  top: 30%;
  left: 70%;
  animation-delay: -3s;
}

/* Bonus Badge Animation */
.bonus-badge {
  animation: float 3s ease-in-out infinite, pulse-glow 2s ease-in-out infinite;
}

/* CTA Buttons */
.cta-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cta-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Mobile Menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.mobile-menu.active {
  max-height: 500px;
}

/* Game Cards */
.game-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Nav Link Hover */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #818cf8, #a5b4fc);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* Prose Styling for Markdown Content */
.prose {
  color: #3e4762;
  line-height: 1.75;
}

.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #495477;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  position: relative;
  padding-bottom: 0.5em;
}

.prose h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4rem;
  height: 3px;
  background: linear-gradient(90deg, #818cf8, #a5b4fc);
  border-radius: 2px;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #556490;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  color: #495477;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose a {
  color: #818cf8;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: #6477a0;
}

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

.prose ul {
  list-style-type: disc;
  padding-left: 1.75em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose ol {
  list-style-type: decimal;
  padding-left: 1.75em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #495477;
  line-height: 1.7;
}

.prose li::marker {
  color: #818cf8;
  font-weight: 600;
}

.prose blockquote {
  border-left: 4px solid #a5b4fc;
  padding-left: 1.5em;
  margin-left: 0;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  font-style: italic;
  color: #556490;
  background: linear-gradient(90deg, rgba(224, 231, 255, 0.3), transparent);
  padding-top: 0.75em;
  padding-bottom: 0.75em;
  padding-right: 1em;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
  overflow-x: auto;
  display: block;
  max-width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.prose thead {
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
}

.prose th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: white;
  font-size: 0.9375rem;
}

.prose td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #d6dfe9;
  color: #495477;
  font-size: 0.9375rem;
}

.prose tbody tr {
  background: white;
  transition: background-color 0.2s ease;
}

.prose tbody tr:nth-child(even) {
  background: #f5f7fa;
}

.prose tbody tr:hover {
  background: #e8ecf3;
}

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

.prose code {
  background: #e8ecf3;
  color: #6477a0;
  padding: 0.25em 0.5em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.prose pre {
  background: #3e4762;
  color: #e8ecf3;
  padding: 1.25em;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  line-height: 1.6;
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Responsive Typography */
@media (max-width: 768px) {
  .prose {
    font-size: 1rem;
  }
  
  .prose h2 {
    font-size: 1.625rem;
    margin-top: 1.5em;
  }
  
  .prose h3 {
    font-size: 1.375rem;
    margin-top: 1.25em;
  }
  
  .prose p {
    font-size: 1rem;
  }
  
  .prose table {
    font-size: 0.875rem;
  }
  
  .prose th,
  .prose td {
    padding: 0.625rem 0.75rem;
  }
}

/* Ensure table scrollability on mobile */
@media (max-width: 640px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
  }
  
  .prose table {
    min-width: 600px;
    display: table;
  }
}

/* Additional Utility Classes */
.parallax {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

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

/* Print Styles */
@media print {
  .particle,
  header,
  footer,
  .cta-btn {
    display: none;
  }
  
  .prose {
    max-width: 100%;
  }
}
