/* Custom animations and styling */

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

body {
  position: relative;
  margin: 0;
  padding: 0;
}

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

/* Prevent any element from exceeding viewport */
section,
main,
article,
header,
footer {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Constrain container divs */
.container,
section > div,
main > section {
  max-width: 100%;
}

/* Critical: Force proper grid column count on mobile */
.grid {
  max-width: 100%;
  width: 100%;
}

.grid.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Ensure gaps don't cause overflow - mobile first */
.gap-4,
.md\:gap-6 {
  gap: 0.5rem;
}

.gap-6,
.gap-8 {
  gap: 0.75rem;
}

/* Ensure grid items have minimum width */
.grid > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .gap-4 {
    gap: 1rem;
  }
  
  .gap-6 {
    gap: 1.5rem;
  }
  
  .gap-8 {
    gap: 2rem;
  }
  
  .md\:gap-6 {
    gap: 1.5rem;
  }
}

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

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

.parallax-float-delayed {
  animation: parallax-float 6s ease-in-out infinite;
  animation-delay: 3s;
}

/* Marquee animation for payment methods */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

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

.marquee-content:hover {
  animation-play-state: paused;
}

/* Glow effects for disco style */
@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8), 0 0 60px rgba(59, 130, 246, 0.5);
  }
}

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

/* Disco grid background */
.disco-grid {
  background-image: linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Neon text effect */
.neon-text {
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 0 20px rgba(59, 130, 246, 0.6), 0 0 30px rgba(59, 130, 246, 0.4);
}

/* Prose styling for readability */
.prose {
  color: #e5e7eb;
  line-height: 1.7;
}

.prose h1 {
  color: #3b82f6;
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

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

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

.prose h4 {
  color: #93c5fd;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

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

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

.prose ul ul {
  margin-top: 0.5rem;
}

.prose ol {
  list-style: decimal;
}

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

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

.prose a {
  color: #60a5fa;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.prose a:hover {
  color: #3b82f6;
}

/* Button styles in prose */
.prose a[href*="/play"],
.prose a[href*="#"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #2563eb, #7c3aed);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 0.5rem 0;
}

.prose a[href*="/play"]:hover,
.prose a[href*="#"]:hover {
  background: linear-gradient(to right, #1d4ed8, #6d28d9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Blockquote */
.prose blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #9ca3af;
}

/* Code */
.prose code {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: #60a5fa;
}

/* Horizontal rule */
.prose hr {
  border: none;
  border-top: 2px solid rgba(59, 130, 246, 0.3);
  margin: 2rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
}

.prose thead,
.prose tbody,
.prose tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.prose thead {
  background: rgba(59, 130, 246, 0.3);
}

.prose th {
  background: rgba(59, 130, 246, 0.2);
  padding: 0.75rem;
  text-align: left;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.875rem;
  font-weight: 700;
  color: #93c5fd;
}

.prose td {
  padding: 0.75rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.875rem;
  word-wrap: break-word;
  background: rgba(30, 41, 59, 0.3);
}

.prose tbody tr:hover {
  background: rgba(59, 130, 246, 0.1);
}

@media (max-width: 640px) {
  .prose th,
  .prose td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Special table cells with emojis */
.prose td:first-child,
.prose th:first-child {
  font-weight: 600;
}

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

/* Mobile menu transition */
.mobile-menu {
  transition: transform 0.3s ease-in-out;
}

.mobile-menu.hidden {
  transform: translateX(-100%);
}

/* Game card hover effect */
.game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1e293b;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.game-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.game-card .p-4 {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card h3 {
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.game-card a.block {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: white;
  text-align: center;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.3s ease;
  font-weight: 600;
}

.game-card a.block:hover {
  background: #1d4ed8;
}

/* CTA button effects */
.cta-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

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

/* Sidebar transition */
.sidebar {
  transition: transform 0.3s ease-in-out;
}

@media (max-width: 1023px) {
  .sidebar.closed {
    transform: translateX(-100%);
  }
  
  /* Hide sidebar on mobile to prevent layout issues */
  .sidebar {
    display: none;
  }
}

/* Bottom menu island effect */
.bottom-menu {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 -4px 20px rgba(59, 130, 246, 0.3);
}

/* Trustpilot star styling */
.star-rating {
  color: #00b67a;
}

/* Calculator styling */
.calculator-result {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
  border: 2px solid rgba(59, 130, 246, 0.4);
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer.open {
  max-height: 500px;
}

/* Emoji and icon support in headings */
h1, h2, h3, h4, h5, h6 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Game grid styles - ensure they work on all pages */
.game-grid,
.grid.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .game-grid,
  .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .game-grid,
  .grid.lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Ensure aspect ratio for game images */
.game-card .aspect-\[3\/4\] {
  aspect-ratio: 3/4;
  object-fit: cover;
}

.game-card .w-full {
  width: 100%;
}

/* Ensure CTA buttons work everywhere */
a[href*="/play"] {
  display: inline-block;
  transition: all 0.3s ease;
}

a[href*="/play"]:hover {
  transform: translateY(-2px);
}

/* List styling improvements */
ul li::marker {
  color: #3b82f6;
}

ol li::marker {
  color: #3b82f6;
  font-weight: 600;
}

/* Mobile responsiveness fixes */
@media (max-width: 1023px) {
  /* Ensure main content doesn't cause overflow on mobile */
  main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  /* Ensure sections are contained within viewport */
  section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative;
    width: 100% !important;
  }
  
  /* Fix container padding on mobile */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Ensure px-4 doesn't add too much padding */
  .px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Prevent grid items from overflowing */
  .grid {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Ensure nested divs don't overflow */
  .container > div,
  section > div {
    max-width: 100%;
  }
  
  /* Fix for max-w-* utility classes */
  .max-w-xl,
  .max-w-2xl,
  .max-w-3xl,
  .max-w-4xl,
  .max-w-5xl,
  .max-w-6xl,
  .max-w-7xl {
    max-width: calc(100vw - 1.5rem) !important;
  }
  
  /* Force items to respect container width */
  .rounded-xl,
  .rounded-2xl,
  .bg-slate-800,
  .bg-gradient-to-br {
    max-width: 100%;
  }
}

/* Extra mobile responsiveness for small devices */
@media (max-width: 640px) {
  /* Reduce padding on mobile */
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Ensure game cards don't overflow */
  .game-card {
    max-width: 100%;
  }
  
  /* Fix text that might be too large */
  h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
  }
  
  h2 {
    font-size: clamp(1.25rem, 4vw, 2rem);
  }
  
  /* Force all grids to respect viewport */
  .grid {
    width: 100vw;
    max-width: calc(100vw - 1.5rem);
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Reduce gap between grid items */
  .gap-4,
  .gap-6,
  .gap-8 {
    gap: 0.75rem !important;
  }
  
  /* Make rounded elements less wide */
  .rounded-xl,
  .rounded-2xl {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Ensure images don't cause overflow */
img {
  max-width: 100%;
  height: auto;
}

.prose img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* Info boxes and callouts */
.prose > p > strong:first-child {
  display: block;
  margin-bottom: 0.5rem;
  color: #60a5fa;
}

/* Nested list styling */
.prose ul ul,
.prose ol ul,
.prose ul ol,
.prose ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Definition lists if used */
.prose dl {
  margin: 1.5rem 0;
}

.prose dt {
  font-weight: 700;
  color: #3b82f6;
  margin-top: 1rem;
}

.prose dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

/* Prevent wide content from overflowing */
.flex {
  max-width: 100%;
}

/* Fix for main flex container */
body > div.flex {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Ensure all tables are responsive */
table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table thead,
table tbody,
table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Make table containers scrollable on mobile */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.overflow-x-auto::-webkit-scrollbar {
  height: 6px;
}

.overflow-x-auto::-webkit-scrollbar-track {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}

/* Prevent long words from breaking layout */
p, li, td, th, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Fix for wide elements in containers */
.container > * {
  max-width: 100%;
}

/* Ensure grid doesn't overflow */
.grid {
  max-width: 100%;
  overflow: visible;
}

@media (max-width: 768px) {
  /* Make tables more compact on mobile */
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Reduce container padding on mobile */
  .container.mx-auto {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Force 4-column grids to 2 columns on mobile */
  .grid.grid-cols-2.md\:grid-cols-4,
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Force 3-column grids to stay 2 columns on mobile */
  .grid.grid-cols-2.md\:grid-cols-3,
  .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Ensure grid items don't overflow */
  .grid > div,
  .grid > * {
    min-width: 0;
    max-width: 100%;
  }
}
