:root {
  --site-primary: #0056B3;
  --site-secondary: #FFC107;
  --dark-bg-1: #0a0a0a;
  --dark-bg-2: #1a1a2e;
  --dark-bg-3: #16213e;
  --neon-header-top-color: #00FFFF; /* Cyan */
  --neon-main-nav-color: #FF00FF; /* Magenta */
  --neon-button-primary: #FFD700; /* Gold */
  --neon-button-secondary: #FF69B4; /* Hot Pink */
  --neon-accent-color: #FF0000; /* Red */

  /* Dynamic neon colors for animations */
  --neon-primary: var(--site-primary);
  --neon-secondary: var(--site-secondary);
  --neon-accent: var(--neon-accent-color);
}

/* Base Reset & Body Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: var(--dark-bg-1);
  min-height: 150vh; /* Ensure scrollable content for sticky header test */
}

body.no-scroll {
  overflow: hidden;
}

/* Common Container */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* Default desktop padding */
  width: 100%;
}

/* Animations for Neon Effects */
@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 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(0, 86, 179, 0.3); /* Derived from site-primary */
  }
  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(255, 193, 7, 0.3); /* Derived from site-secondary */
  }
  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, 0, 0.3); /* Derived from neon-accent-color */
  }
}

@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;
  }
}

/* Header Styling (Desktop First) */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.header-top {
  background: linear-gradient(135deg, var(--dark-bg-1), var(--dark-bg-2));
  border-bottom: 2px solid var(--neon-header-top-color);
  box-shadow:
    0 0 10px var(--neon-header-top-color),
    0 0 20px var(--neon-header-top-color),
    0 0 30px var(--neon-header-top-color),
    inset 0 0 15px rgba(0, 255, 255, 0.1);
  padding: 10px 0;
  animation: neon-flicker 2s infinite alternate, theme-colors 4s ease-in-out infinite;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--neon-header-top-color);
  text-decoration: none;
  text-transform: uppercase; /* Ensure uppercase for logo */
  animation: text-glow-flow 3s ease-in-out infinite alternate, pulse-glow 2s ease-in-out infinite alternate;
  padding: 5px 0;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.btn {
  position: relative;
  background: linear-gradient(135deg, var(--neon-button-primary), var(--neon-button-secondary));
  padding: 12px 30px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  text-shadow:
    0 0 5px #ffffff,
    0 0 10px var(--neon-button-primary);
  transition: all 0.3s ease;
  font-weight: bold;
  white-space: nowrap;
}

.btn:hover {
  animation-duration: 2s; /* hover时加快颜色变化速度 */
  transform: translateY(-2px);
  opacity: 0.9;
}

.main-nav {
  background: linear-gradient(135deg, var(--dark-bg-2), var(--dark-bg-3));
  border-top: 2px solid var(--neon-main-nav-color);
  border-bottom: 2px solid var(--neon-main-nav-color);
  box-shadow:
    0 0 10px var(--neon-main-nav-color),
    0 0 20px var(--neon-main-nav-color),
    0 0 30px var(--neon-main-nav-color),
    inset 0 0 15px rgba(255, 0, 255, 0.1);
  padding: 10px 0;
  display: flex; /* Desktop: show main-nav */
  flex-direction: row; /* Desktop: horizontal */
  justify-content: center;
  align-items: center;
  animation: theme-colors 5s linear infinite alternate;
}

.nav-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.nav-link {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--neon-main-nav-color);
  text-shadow: 0 0 8px var(--neon-main-nav-color), 0 0 15px var(--neon-main-nav-color);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
}

.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

/* Adjust body padding to prevent content overlap with fixed header */
body {
  padding-top: 120px; /* Default desktop header height */
}

/* Footer Styling */
.site-footer {
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
  color: #e0e0e0;
  padding-top: 40px;
  border-top: 1px solid #333;
  font-size: 0.9em;
}

.footer-main {
  padding-bottom: 30px;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.footer-col h4 {
  color: #FFC107;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.footer-logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #FFC107;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
  text-transform: uppercase; /* Ensure uppercase for footer logo */
}

.footer-description {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* Ensure full display, no ellipsis */
}

.footer-nav {
  list-style: none;
}

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

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

.footer-nav a:hover {
  color: #FFC107;
}

.payment-icons, .game-providers-icons, .social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.payment-icons img, .game-providers-icons img, .social-media-icons img {
  max-height: 50px;
  height: auto;
  width: auto;
  object-fit: contain;
  filter: brightness(0.8) contrast(1.2);
}

.footer-middle-sections {
  padding: 20px 0;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}

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

.game-providers-section:last-child, .social-media-section:last-child {
  margin-bottom: 0;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
}

.copyright {
  color: #888;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header-container, .nav-container, .footer-container {
    padding: 0 15px;
    max-width: none; /* Mobile containers take full width */
    width: 100%;
  }

  .site-header {
    flex-direction: column;
  }

  .header-top {
    padding: 10px 0;
  }

  .header-container {
    justify-content: space-between;
    position: relative;
  }

  .logo {
    order: 2;
    flex-grow: 1;
    text-align: center;
    font-size: 1.5em;
  }

  .desktop-nav-buttons {
    display: none;
  }

  .hamburger-menu {
    display: block;
    order: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
    color: var(--neon-header-top-color);
    animation: pulse-glow 2s ease-in-out infinite alternate;
  }

  .hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: currentColor;
    position: relative;
    transition: background-color 0.3s ease;
  }

  .hamburger-icon::before, .hamburger-icon::after {
    content: '';
    display: block;
    width: 25px;
    height: 3px;
    background-color: currentColor;
    position: absolute;
    transition: transform 0.3s ease;
  }

  .hamburger-icon::before {
    top: -8px;
  }

  .hamburger-icon::after {
    top: 8px;
  }

  .hamburger-menu.active .hamburger-icon {
    background-color: transparent;
  }

  .hamburger-menu.active .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.active .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
  }

  .mobile-nav-buttons {
    display: flex; /* Always visible on mobile */
    justify-content: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--dark-bg-1), var(--dark-bg-2));
    border-bottom: 2px solid var(--neon-button-primary);
    box-shadow:
      0 0 5px var(--neon-button-primary),
      0 0 10px var(--neon-button-primary);
    gap: 10px;
    flex-wrap: wrap;
  }

  .mobile-nav-buttons .btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.9em;
    padding: 10px 15px;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical on mobile */
    position: fixed;
    top: 0; /* Adjusted by JS to be below header-top and mobile-nav-buttons */
    left: 0;
    width: 80%;
    height: 100%;
    background: linear-gradient(180deg, var(--dark-bg-2), var(--dark-bg-3));
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease-out;
    z-index: 9999;
    overflow-y: auto;
    padding-top: 20px; /* Space from top edge */
    border-right: 2px solid var(--neon-main-nav-color);
  }

  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    padding: 0 20px;
  }

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

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

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
  }

  .mobile-menu-overlay.visible {
    display: block;
  }

  /* Dynamic padding for body to account for fixed header and mobile buttons */
  body {
    padding-top: 170px; /* Increased for mobile header + button area */
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col h4 {
    margin-bottom: 10px;
  }

  .footer-logo {
    margin: 0 auto 10px;
  }

  .footer-nav {
    padding-left: 0;
  }

  .footer-nav li {
    display: inline-block;
    margin: 0 10px 5px 0;
  }
}
