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

/* Ensure all containers respect viewport width */
.container {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Fix for flex containers on mobile */
@media (max-width: 768px) {
  .flex {
    flex-wrap: wrap;
  }
  
  .flex-nowrap {
    flex-wrap: nowrap;
  }
  
  /* Prevent elements from breaking out of container */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Fix grid layouts on mobile */
  .grid {
    overflow-x: hidden;
  }
  
  /* Ensure mobile containers don't overflow */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Fix for long text that might cause overflow */
  .text-xl, .text-2xl, .text-3xl {
    word-break: break-word;
    hyphens: auto;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Ensure buttons don't overflow */
  .flex.items-center.gap-3 {
    gap: 0.5rem;
  }
  
  .flex.items-center.gap-2 {
    gap: 0.25rem;
  }
}

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

@keyframes float-delayed {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-30px);
  }
}

@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

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

.animate-float-delayed {
  animation: float-delayed 8s ease-in-out infinite;
}

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

.animate-marquee {
  animation: marquee 30s linear infinite;
}

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

/* Game Card Tilt Effect */
.game-card {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

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

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

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

.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #1f2937;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.prose ul,
.prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

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

.prose a {
  color: #ec4899;
  text-decoration: none;
  font-weight: 600;
}

.prose a:hover {
  color: #be185d;
  text-decoration: underline;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.prose th {
  background-color: #fce7f3;
  padding: 0.75rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid #ec4899;
}

.prose td {
  padding: 0.75rem;
  border-bottom: 1px solid #fce7f3;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #fce7f3;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ec4899, #f43f5e);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #db2777, #e11d48);
}

/* Mobile Bottom Navigation Spacing */
@media (max-width: 1023px) {
  body {
    padding-bottom: 80px;
  }
}

/* Details/Summary Styling */
details summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  border-bottom: 1px solid #fce7f3;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #ec4899;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  header,
  footer,
  nav,
  .no-print {
    display: none;
  }
}
