:root {
  --primary-color: #1A2B42; /* Dark blue/grey */
  --secondary-color: #FFD700; /* Gold */
  --accent-color: #FF69B4; /* Pink for contrast */

  /* Dynamic neon colors based on theme */
  --neon-primary: var(--secondary-color); /* Gold/Yellow */
  --neon-secondary: #00FFFF; /* Cyan */
  --neon-accent: #FF00FF; /* Magenta */

  /* Dark backgrounds */
  --dark-bg-1: #0a0a0a;
  --dark-bg-2: #1a1a2e;
  --dark-bg-3: #16213e;

  --header-top-height: 60px; /* Estimated height of header-top */
  --main-nav-height: 50px; /* Estimated height of main-nav */
  --mobile-buttons-height: 60px; /* Estimated height of mobile button area */

  --header-height-desktop: calc(var(--header-top-height) + var(--main-nav-height));
  --header-height-mobile: calc(var(--header-top-height) + var(--mobile-buttons-height));
}

/* Base styles for header elements */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

/* Header Top Area - Logo and Buttons */
.header-top {
  background: linear-gradient(135deg, var(--dark-bg-1), var(--dark-bg-2));
  border-bottom: 2px solid; /* Dynamic color via animation */
  animation: theme-colors 4s ease-in-out infinite; /* Apply dynamic border color */
  box-shadow:
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 15px rgba(255, 255, 255, 0.1); /* Initial glow, animation will update */
  padding: 10px 0;
  min-height: var(--header-top-height);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Padding from container edges */
  height: 100%; /* Ensure container fills header-top height */
}

.logo {
  font-family: 'Electrolize', sans-serif; /* Or a similar retro-futuristic font */
  font-size: 2.5em;
  font-weight: bold;
  text-decoration: none;
  color: #ffffff; /* Base color, text-shadow will add glow */
  white-space: nowrap;
  animation: text-glow-flow 3s ease-in-out infinite alternate; /* Dynamic text glow */
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Show on desktop */
  gap: 15px;
}

/* Main Navigation Area - Menu Links */
.main-nav {
  background: linear-gradient(135deg, var(--dark-bg-2), var(--dark-bg-3));
  border-top: 2px solid; /* Dynamic color via animation */
  border-bottom: 2px solid; /* Dynamic color via animation */
  animation: theme-colors 4s ease-in-out infinite; /* Apply dynamic border color */
  box-shadow:
    0 0 10px var(--neon-secondary),
    0 0 20px var(--neon-secondary),
    0 0 30px var(--neon-secondary),
    inset 0 0 15px rgba(255, 255, 255, 0.1); /* Initial glow, animation will update */
  padding: 10px 0;
  display: flex; /* Desktop: show as flex row */
  flex-direction: row;
  min-height: var(--main-nav-height);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller desktop screens */
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  padding: 10px 15px;
  font-size: 1.1em;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  white-space: nowrap; /* Prevent menu items from breaking */
}

.nav-link:hover,
.nav-link.active {
  color: var(--neon-primary);
  text-shadow:
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary);
}

/* Buttons */
.btn {
  position: relative;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
  padding: 12px 25px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid; /* Dynamic color via animation */
  animation: theme-colors 4s ease-in-out infinite; /* Apply dynamic border color */
  text-shadow:
    0 0 5px #ffffff,
    0 0 10px var(--neon-primary); /* Initial text shadow, animation will update */
  transition: all 0.3s ease;
  font-weight: bold;
  white-space: nowrap;
  box-shadow:
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    inset 0 0 10px rgba(255, 255, 255, 0.1); /* Initial glow, animation will update */
}

.btn:hover {
  animation-duration: 2s; /* Faster animation on hover */
  transform: translateY(-2px);
  box-shadow:
    0 0 15px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background: #ffffff;
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
  box-shadow:
    0 0 5px var(--neon-accent),
    0 0 10px var(--neon-accent); /* Neon glow for hamburger lines */
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Mobile Nav Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

/* Mobile Menu Overlay (Hidden on Desktop) */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
}

/* General Body Padding to prevent fixed header from obscuring content */
body {
  padding-top: var(--header-height-desktop); /* Desktop padding */
  margin: 0;
  font-family: Arial, sans-serif;
  color: #ffffff;
  background-color: var(--dark-bg-1);
}

/* Footer Styling */
.site-footer {
  background-color: var(--primary-color); /* Dark background for footer */
  color: #c0c0c0;
  padding: 40px 0 20px;
  font-size: 0.9em;
  line-height: 1.6;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
  color: var(--secondary-color); /* Gold color for footer headings */
  font-size: 1.2em;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.footer-logo {
  font-family: 'Electrolize', sans-serif;
  font-size: 2em;
  font-weight: bold;
  text-decoration: none;
  color: var(--secondary-color); /* Gold color for footer logo */
  margin-bottom: 10px;
  display: block;
}

.footer-description {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 8px;
}

.footer-nav a {
  color: #c0c0c0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--secondary-color);
}

.payment-icons,
.game-providers-icons,
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px; /* Consistent gap for all icon sections */
  width: 100%;
}

.payment-icons img,
.game-providers-icons img,
.social-media-icons img {
  max-height: 50px; /* Consistent height for icons */
  height: auto;
  width: auto;
  filter: brightness(0.8) grayscale(0.2); /* Slightly dim and desaturate for footer */
  transition: filter 0.3s ease;
}

.payment-icons img:hover,
.game-providers-icons img:hover,
.social-media-icons img:hover {
  filter: brightness(1) grayscale(0); /* Brighten on hover */
}

.footer-mid-section {
  padding: 30px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 30px; /* Gap between game providers and social media sections */
}

.game-providers-section h4,
.social-media-section h4 {
  margin-bottom: 15px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 20px;
}

.copyright {
  margin-bottom: 10px;
}

.footer-legal-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.footer-legal-nav a {
  color: #c0c0c0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-legal-nav a:hover {
  color: var(--secondary-color);
}

/* === Dynamic Neon Animations === */
@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    box-shadow:
      0 0 10px currentColor,
      0 0 20px currentColor,
      0 0 30px currentColor,
      inset 0 0 15px currentColor;
  }
  20%, 24%, 55% {
    opacity: 0.8;
    box-shadow:
      0 0 5px currentColor,
      0 0 10px currentColor,
      0 0 15px currentColor,
      inset 0 0 10px currentColor;
  }
}

@keyframes pulse-glow {
  from {
    box-shadow:
      0 0 5px currentColor,
      0 0 10px currentColor;
  }
  to {
    box-shadow:
      0 0 15px currentColor,
      0 0 30px currentColor,
      0 0 45px currentColor;
  }
}

@keyframes led-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

@keyframes rainbow-border {
  0% {
    border-color: #ff0000;
    box-shadow:
      0 0 10px #ff0000,
      0 0 20px #ff0000;
  }
  16.6% {
    border-color: #ff8000;
    box-shadow:
      0 0 10px #ff8000,
      0 0 20px #ff8000;
  }
  33.3% {
    border-color: #ffff00;
    box-shadow:
      0 0 10px #ffff00,
      0 0 20px #ffff00;
  }
  50% {
    border-color: #00ff00;
    box-shadow:
      0 0 10px #00ff00,
      0 0 20px #00ff00;
  }
  66.6% {
    border-color: #0000ff;
    box-shadow:
      0 0 10px #0000ff,
      0 0 20px #0000ff;
  }
  83.3% {
    border-color: #8000ff;
    box-shadow:
      0 0 10px #8000ff,
      0 0 20px #8000ff;
  }
  100% {
    border-color: #ff0000;
    box-shadow:
      0 0 10px #ff0000,
      0 0 20px #ff0000;
  }
}

@keyframes hue-spin {
  0% {
    filter: hue-rotate(0deg);
    box-shadow:
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
  100% {
    filter: hue-rotate(360deg);
    box-shadow:
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
}

@keyframes alternate-colors {
  0% {
    border-color: var(--neon-primary);
    box-shadow:
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
  100% {
    border-color: var(--neon-secondary);
    box-shadow:
      0 0 10px var(--neon-secondary),
      0 0 20px var(--neon-secondary);
  }
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
    box-shadow:
      0 0 10px #ff0000,
      0 0 20px #ff8000;
  }
  50% {
    background-position: 100% 50%;
    box-shadow:
      0 0 10px #00ffff,
      0 0 20px #0000ff;
  }
  100% {
    background-position: 0% 50%;
    box-shadow:
      0 0 10px #ff0000,
      0 0 20px #ff8000;
  }
}

@keyframes random-glow {
  0% {
    border-color: #ff00ff;
    box-shadow: 0 0 20px #ff00ff;
  }
  20% {
    border-color: #00ffff;
    box-shadow: 0 0 20px #00ffff;
  }
  40% {
    border-color: #ffff00;
    box-shadow: 0 0 20px #ffff00;
  }
  60% {
    border-color: #00ff00;
    box-shadow: 0 0 20px #00ff00;
  }
  80% {
    border-color: #ff0000;
    box-shadow: 0 0 20px #ff0000;
  }
  100% {
    border-color: #ff00ff;
    box-shadow: 0 0 20px #ff00ff;
  }
}

@keyframes theme-colors {
  0%, 100% {
    border-color: var(--neon-primary);
    box-shadow:
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary),
      inset 0 0 10px rgba(255, 215, 0, 0.3); /* Based on --secondary-color (gold) */
  }
  33% {
    border-color: var(--neon-secondary);
    box-shadow:
      0 0 10px var(--neon-secondary),
      0 0 20px var(--neon-secondary),
      inset 0 0 10px rgba(0, 255, 255, 0.3); /* Based on --neon-secondary (cyan) */
  }
  66% {
    border-color: var(--neon-accent);
    box-shadow:
      0 0 10px var(--neon-accent),
      0 0 20px var(--neon-accent),
      inset 0 0 10px rgba(255, 0, 255, 0.3); /* Based on --neon-accent (magenta) */
  }
}

@keyframes text-glow-flow {
  0% {
    text-shadow:
      0 0 5px var(--neon-primary),
      0 0 10px var(--neon-primary),
      0 0 15px var(--neon-primary);
    color: #ffffff;
  }
  50% {
    text-shadow:
      0 0 5px var(--neon-secondary),
      0 0 10px var(--neon-secondary),
      0 0 15px var(--neon-secondary);
    color: #ffffff;
  }
  100% {
    text-shadow:
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      0 0 15px var(--neon-accent);
    color: #ffffff;
  }
}

/* === Mobile Specific Styles === */
@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile); /* Mobile padding for fixed header + buttons */
  }

  .header-container,
  .nav-container,
  .footer-container {
    width: 100%;
    max-width: none; /* Crucial: no max-width on mobile */
    padding-left: 15px;
    padding-right: 15px;
  }

  .header-top {
    min-height: var(--header-top-height);
    padding: 10px 0;
  }

  .header-container {
    justify-content: space-between;
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger */
    order: 0; /* Place to the left */
  }

  .logo {
    order: 1; /* Place in the middle */
    flex: 1; /* Allows logo to take available space and center */
    text-align: center; /* Center the logo text */
    font-size: 2em; /* Adjust size for mobile */
  }

  /* Empty div to balance flex for logo centering */
  .header-container::after {
    content: '';
    display: block;
    width: 30px; /* Same width as hamburger for balance */
    order: 2;
  }

  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons */
  }

  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: var(--header-height-mobile); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu takes 80% width */
    max-width: 300px; /* Max width for menu on larger mobile screens */
    height: calc(100% - var(--header-height-mobile)); /* Fill remaining height */
    overflow-y: auto;
    transform: translateX(-100%); /* Off-screen initially */
    transition: transform 0.3s ease-in-out;
    background: var(--dark-bg-3); /* Darker background for mobile menu */
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 998; /* Below hamburger, above overlay */
    border-right: 2px solid; /* Dynamic color via animation */
    animation: theme-colors 4s ease-in-out infinite; /* Apply dynamic border color */
  }

  .main-nav.active {
    display: flex; /* CRITICAL: Must be flex/block to show */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align menu items to the left */
    padding: 20px 0;
    width: 100%;
    max-width: none;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .mobile-nav-buttons {
    display: flex; /* Show mobile buttons */
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--dark-bg-2), var(--dark-bg-3)); /* Same as main-nav for consistency */
    padding: 10px 15px;
    border-bottom: 2px solid; /* Dynamic color via animation */
    animation: theme-colors 4s ease-in-out infinite; /* Apply dynamic border color */
    box-shadow:
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      inset 0 0 5px rgba(255, 255, 255, 0.1);
    z-index: 999; /* Below header-top, above main-nav */
    min-height: var(--mobile-buttons-height);
  }

  /* Adjust button padding for mobile */
  .mobile-nav-buttons .btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }

  .mobile-menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 997; /* Below menu, above content */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .mobile-menu-overlay.active {
    display: block; /* CRITICAL: Must be block to show */
    opacity: 1;
  }

  body.no-scroll {
    overflow: hidden;
  }

  /* Footer responsiveness */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .footer-legal-nav ul {
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }
}