/* Glow Effects */
.glow-text {
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

.shadow-neon {
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.5), 0 0 40px rgba(157, 0, 255, 0.3);
}

.shadow-neon-lg {
  box-shadow: 0 0 30px rgba(255, 230, 0, 0.6), 0 0 60px rgba(157, 0, 255, 0.4);
}

.shadow-neon-xl {
  box-shadow: 0 0 40px rgba(255, 230, 0, 0.7), 0 0 80px rgba(157, 0, 255, 0.5);
}

/* Scatter Trail Animation */
.scatter-trail {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, #ffffff, transparent);
  animation: scatter 3s linear infinite;
  opacity: 0.6;
}

@keyframes scatter {
  0% {
    top: -100px;
    left: 10%;
    transform: rotate(45deg);
  }
  100% {
    top: 100%;
    left: 90%;
    transform: rotate(45deg);
  }
}

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

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

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

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

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

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

/* Prose Styling for Readability */
.prose-custom {
  color: #d1d5db;
  line-height: 1.75;
}

.prose {
  max-width: 100%;
  color: #e5e7eb;
  line-height: 1.75;
  font-size: 1rem;
}

.prose h2 {
  color: #ffe600;
  font-size: 2em;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 1em;
  text-shadow: 0 0 20px rgba(255, 230, 0, 0.4);
}

.prose h3 {
  color: #ffffff;
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.prose h4 {
  color: #d1d5db;
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.5em;
  color: #d1d5db;
}

.prose a {
  color: #9d00ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(157, 0, 255, 0.3);
}

.prose a:hover {
  color: #ffe600;
  text-shadow: 0 0 15px rgba(255, 230, 0, 0.5);
}

.prose strong {
  color: #ffe600;
  font-weight: 700;
}

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

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

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

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

.prose li::marker {
  color: #9d00ff;
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.prose blockquote {
  font-style: italic;
  color: #f3f4f6;
  border-left: 0.25rem solid #9d00ff;
  padding-left: 1.5em;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  background: rgba(157, 0, 255, 0.05);
  padding-top: 1em;
  padding-bottom: 1em;
  border-radius: 0.25rem;
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: 0.95em;
  background: rgba(26, 11, 46, 0.5);
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose thead {
  background: linear-gradient(135deg, rgba(157, 0, 255, 0.3), rgba(255, 230, 0, 0.2));
}

.prose thead th {
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid #9d00ff;
}

.prose tbody tr {
  border-bottom: 1px solid rgba(157, 0, 255, 0.2);
  transition: background 0.2s ease;
}

.prose tbody tr:hover {
  background: rgba(157, 0, 255, 0.1);
}

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

.prose td {
  padding: 0.875rem 1rem;
  color: #d1d5db;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-top: 2em;
  margin-bottom: 2em;
  box-shadow: 0 0 30px rgba(157, 0, 255, 0.3), 0 0 60px rgba(255, 230, 0, 0.2);
}

.prose code {
  color: #ffe600;
  background: rgba(26, 11, 46, 0.8);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: "Courier New", monospace;
}

.prose pre {
  background: rgba(26, 11, 46, 0.8);
  border: 1px solid rgba(157, 0, 255, 0.3);
  border-radius: 0.5rem;
  padding: 1.25em;
  overflow-x: auto;
  margin-top: 1.75em;
  margin-bottom: 1.75em;
}

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

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

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

  .prose h2 {
    font-size: 1.75em;
  }

  .prose h3 {
    font-size: 1.35em;
  }

  .prose table {
    font-size: 0.875em;
  }

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

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

  .prose h2 {
    font-size: 1.5em;
    margin-top: 1.5em;
  }

  .prose h3 {
    font-size: 1.25em;
    margin-top: 1.25em;
  }

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

.prose-custom h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose-custom h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #ffe600;
  font-size: 1.5rem;
  font-weight: 700;
}

.prose-custom p {
  margin-bottom: 1.5rem;
}

.prose-custom a {
  color: #9d00ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.prose-custom a:hover {
  color: #ffe600;
}

.prose-custom ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.prose-custom li {
  margin-bottom: 0.5rem;
}

.prose-custom strong {
  color: #ffe600;
  font-weight: 700;
}

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

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

/* Mobile Menu Animation */
#mobile-menu {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button Hover Effects */
a[href="/play"] {
  position: relative;
  overflow: hidden;
}

a[href="/play"]::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;
}

a[href="/play"]:hover::before {
  width: 300px;
  height: 300px;
}

/* Neon Border Pulse */
@keyframes neon-pulse {
  0%,
  100% {
    border-color: rgba(157, 0, 255, 0.3);
  }
  50% {
    border-color: rgba(255, 230, 0, 0.6);
  }
}

.game-card:hover > div {
  animation: neon-pulse 2s ease-in-out infinite;
}

/* Loading Spinner for Images */
img {
  background: linear-gradient(90deg, #1a0b2e 25%, #2d1b4e 50%, #1a0b2e 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

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

img[src] {
  animation: none;
  background: none;
}

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

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .glow-text {
    text-shadow: none;
  }

  .shadow-neon,
  .shadow-neon-lg,
  .shadow-neon-xl {
    box-shadow: none;
    border: 2px solid currentColor;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .parallax {
    transform: none !important;
  }
}
