:root {
  --primary-base-color: #0A2463;
  --secondary-base-color: #E3B505; /* Bright yellow/gold */

  /* Derived neon colors - using E3B505 as a base for yellow/orange, and adding contrasting blues/pinks */
  --neon-primary: #FFEA00; /* Bright Yellow */
  --neon-secondary: #00FFFF; /* Cyan */
  --neon-accent: #FF00FF; /* Magenta */
  --neon-glow-color-1: #FFEA00; /* Bright Yellow */
  --neon-glow-color-2: #00FFFF; /* Cyan */
  --neon-glow-color-3: #FF00FF; /* Magenta */
  --neon-glow-color-4: #FF6600; /* Bright Orange */
  --neon-glow-color-5: #00FF00; /* Lime Green */
  --neon-glow-color-6: #FF1493; /* Deep Pink */

  --dark-bg-1: #0a0a0a;
  --dark-bg-2: #1a1a2e;
  --dark-bg-3: #16213e;
  --dark-bg-4: #0f3460; /* Slightly lighter dark blue for contrast */

  --header-height-desktop: 100px; /* Estimate for desktop */
  --header-top-height-mobile: 60px;
  --mobile-buttons-height: 60px;
  --header-height-mobile: calc(var(--header-top-height-mobile) + var(--mobile-buttons-height));
}

/* Base styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: var(--dark-bg-1);
  padding-top: var(--header-height-desktop); /* Default padding for fixed header */
}

* {
  box-sizing: border-box;
}

/* Animations for dynamic neon effects */
@keyframes rainbow-border {
  0% { border-color: var(--neon-glow-color-1); box-shadow: 0 0 10px var(--neon-glow-color-1), 0 0 20px var(--neon-glow-color-1); }
  16.6% { border-color: var(--neon-glow-color-4); box-shadow: 0 0 10px var(--neon-glow-color-4), 0 0 20px var(--neon-glow-color-4); }
  33.3% { border-color: var(--neon-glow-color-5); box-shadow: 0 0 10px var(--neon-glow-color-5), 0 0 20px var(--neon-glow-color-5); }
  50% { border-color: var(--neon-glow-color-2); box-shadow: 0 0 10px var(--neon-glow-color-2), 0 0 20px var(--neon-glow-color-2); }
  66.6% { border-color: var(--neon-glow-color-3); box-shadow: 0 0 10px var(--neon-glow-color-3), 0 0 20px var(--neon-glow-color-3); }
  83.3% { border-color: var(--neon-glow-color-6); box-shadow: 0 0 10px var(--neon-glow-color-6), 0 0 20px var(--neon-glow-color-6); }
  100% { border-color: var(--neon-glow-color-1); box-shadow: 0 0 10px var(--neon-glow-color-1), 0 0 20px var(--neon-glow-color-1); }
}

@keyframes hue-spin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@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 var(--neon-glow-color-1), 0 0 20px var(--neon-glow-color-4); }
  50% { background-position: 100% 50%; box-shadow: 0 0 10px var(--neon-glow-color-2), 0 0 20px var(--neon-glow-color-3); }
  100% { background-position: 0% 50%; box-shadow: 0 0 10px var(--neon-glow-color-1), 0 0 20px var(--neon-glow-color-4); }
}

@keyframes random-glow {
  0% { border-color: var(--neon-glow-color-1); box-shadow: 0 0 20px var(--neon-glow-color-1); }
  20% { border-color: var(--neon-glow-color-2); box-shadow: 0 0 20px var(--neon-glow-color-2); }
  40% { border-color: var(--neon-glow-color-3); box-shadow: 0 0 20px var(--neon-glow-color-3); }
  60% { border-color: var(--neon-glow-color-4); box-shadow: 0 0 20px var(--neon-glow-color-4); }
  80% { border-color: var(--neon-glow-color-5); box-shadow: 0 0 20px var(--neon-glow-color-5); }
  100% { border-color: var(--neon-glow-color-1); box-shadow: 0 0 20px var(--neon-glow-color-1); }
}

@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, 234, 0, 0.3);
  }
  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);
  }
  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);
  }
}

@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 text-glow-flow {
  0% {
    text-shadow: 0 0 5px var(--neon-glow-color-1), 0 0 10px var(--neon-glow-color-1), 0 0 15px var(--neon-glow-color-1);
    color: #ffffff;
  }
  50% {
    text-shadow: 0 0 5px var(--neon-glow-color-2), 0 0 10px var(--neon-glow-color-2), 0 0 15px var(--neon-glow-color-2);
    color: #ffffff;
  }
  100% {
    text-shadow: 0 0 5px var(--neon-glow-color-3), 0 0 10px var(--neon-glow-color-3), 0 0 15px var(--neon-glow-color-3);
    color: #ffffff;
  }
}

/* General Neon Glow Class */
.neon-glow {
  box-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px currentColor,
    inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Styles for Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent; /* Background handled by header-top and main-nav */
  display: flex;
  flex-direction: column;
}

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

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-family: 'Electrolize', sans-serif; /* Example retro-futuristic font */
  font-size: 2.2em;
  font-weight: bold;
  text-decoration: none;
  color: #fff; /* Base color for text glow */
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: text-glow-flow 3s ease-in-out infinite alternate; /* Dynamic text glow */
  white-space: nowrap;
  padding-right: 20px; /* Space from hamburger menu on mobile */
}

.desktop-nav-buttons {
  display: flex;
  gap: 15px;
}

.main-nav {
  background: linear-gradient(135deg, var(--dark-bg-2), var(--dark-bg-4));
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 2px solid var(--neon-secondary);
  box-shadow: 
    0 0 8px var(--neon-secondary),
    0 0 15px var(--neon-secondary),
    0 0 25px var(--neon-secondary),
    inset 0 0 15px rgba(0, 255, 255, 0.1);
  animation: alternate-colors 4s ease-in-out infinite alternate; /* Dynamic border glow */
  padding: 10px 0;
  width: 100%;
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
}

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

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

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

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

.btn:hover {
  animation-duration: 2s; /* hover时加快颜色变化速度 */
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 15px rgba(255, 234, 0, 0.4); /* Enhanced hover glow */
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 25px;
  position: relative;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border glow */
  padding: 3px; /* for glow effect */
  border-radius: 3px;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--neon-primary);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 5px var(--neon-primary), 0 0 10px var(--neon-primary); /* Glow effect */
}

.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 (Mobile Only) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  background: linear-gradient(135deg, var(--dark-bg-3), var(--dark-bg-4));
  padding: 15px 20px;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 2px solid var(--neon-accent);
  box-shadow: 
    0 0 8px var(--neon-accent),
    0 0 15px var(--neon-accent),
    0 0 25px var(--neon-accent),
    inset 0 0 15px rgba(255, 0, 255, 0.1);
  animation: random-glow 5s linear infinite; /* Dynamic border glow */
}

.mobile-nav-buttons .btn {
  flex: 1 1 auto; /* Allow buttons to grow/shrink */
  min-width: 120px; /* Minimum width for buttons */
  max-width: 100%; /* Ensure button does not overflow */
  font-size: 0.9em;
  padding: 10px 15px;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: var(--dark-bg-2);
  color: #c0c0c0;
  padding: 40px 20px 20px;
  font-size: 0.9em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-top-grid {
  max-width: 1200px;
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 30px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1em;
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

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

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

.footer-col ul li a:hover {
  color: var(--secondary-base-color);
}

.footer-logo {
  font-family: 'Electrolize', sans-serif;
  font-size: 1.8em;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.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: grayscale(80%) brightness(150%); /* Make icons fit dark theme */
  transition: filter 0.3s ease;
}

.payment-icons img:hover, .game-providers-icons img:hover, .social-media-icons img:hover {
  filter: grayscale(0%) brightness(100%);
}

.footer-middle-sections {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding-top: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 30px;
}

.game-providers-section h4, .social-media-section h4 {
  color: #fff;
  font-size: 1.1em;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
}

.copyright {
  color: #888;
  margin-bottom: 15px;
}

.footer-legal-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

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

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

/* Media Queries for Mobile */
@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile); /* Adjust for mobile header + buttons */
  }

  .header-top {
    padding: 10px 0;
    min-height: var(--header-top-height-mobile);
    display: flex;
    align-items: center;
    justify-content: center; /* Center logo */
    position: relative; /* For hamburger positioning */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    position: relative; /* Ensure logo is centered within this */
    justify-content: center; /* Center the logo */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger */
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  .logo {
    flex-grow: 1;
    text-align: center;
    padding-right: 0; /* No extra padding for hamburger */
    font-size: 1.8em;
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical menu */
    position: fixed;
    top: var(--header-height-mobile); /* Position below header-top and mobile buttons */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100vh - var(--header-height-mobile));
    background: linear-gradient(180deg, var(--dark-bg-3), var(--dark-bg-1));
    border-right: 2px solid var(--neon-secondary);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease-in-out;
    z-index: 1000; /* Above overlay */
    overflow-y: auto;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 20px 15px;
    align-items: flex-start;
    width: 100%;
    max-width: none;
  }

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

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

  .mobile-nav-buttons {
    display: flex; /* Show mobile buttons */
    position: relative;
    width: 100%;
    min-height: var(--mobile-buttons-height);
  }

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

  .site-footer {
    padding: 30px 15px 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .footer-col h4 {
    margin-top: 20px;
  }

  .footer-middle-sections {
    padding-top: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .footer-legal-nav {
    flex-direction: column;
    gap: 10px;
  }
}

/* Ensure body padding is correctly applied if JS fails to update it or for initial load */
@media (min-width: 769px) {
  body {
    padding-top: var(--header-height-desktop);
  }
}

/* Specific glow styles (can be applied via classes) */
.neon-tube {
  border: 2px solid;
  animation: neon-flicker 2s infinite alternate, theme-colors 4s linear infinite;
}

.cyber-grid {
  background: 
    linear-gradient(90deg, transparent 95%, currentColor 100%),
    linear-gradient(180deg, transparent 95%, currentColor 100%);
  background-size: 20px 20px;
  border: 1px solid;
  animation: hue-spin 4s linear infinite;
}

.neon-pulse {
  border: 2px solid;
  animation: pulse-glow 2s ease-in-out infinite alternate, theme-colors 4s ease-in-out infinite;
}

.rainbow-flow {
  border: 2px solid;
  animation: rainbow-border 3s linear infinite;
}

.hue-rotate {
  border: 2px solid;
  filter: hue-rotate(0deg);
  animation: hue-spin 4s linear infinite;
}

.alternate-glow {
  border: 2px solid;
  animation: alternate-colors 2s ease-in-out infinite alternate;
}

.color-stream {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(45deg, 
    #ff0000, #ff8000, #ffff00, #00ff00, 
    #00ffff, #0000ff, #8000ff, #ff0080
  );
  background-size: 400% 400%;
  animation: gradient-flow 3s ease infinite;
}

.random-colors {
  border: 2px solid;
  animation: random-glow 5s linear infinite;
}

.theme-flow {
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
}

.led-matrix {
  border: 2px solid;
  box-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor;
  position: relative;
  animation: random-glow 5s linear infinite;
}

.led-matrix::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: 
    radial-gradient(circle at 0% 0%, currentColor 2px, transparent 3px),
    radial-gradient(circle at 100% 0%, currentColor 2px, transparent 3px),
    radial-gradient(circle at 0% 100%, currentColor 2px, transparent 3px),
    radial-gradient(circle at 100% 100%, currentColor 2px, transparent 3px);
  background-size: 20px 20px;
  animation: led-blink 1s steps(2) infinite;
}
