html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  background-color: var(--bg-color, #FFFFFF);
  color: #333;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll from mobile content overflow rules */
}

/* Base neon color variables for dynamic effects */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-color: #C30808;
  --login-color: #C30808;
  --bg-color: #FFFFFF;
  --reg-log-font-color: #FFFF00;

  /* Neon specific colors */
  --neon-primary: #00FFFF; /* Cyan */
  --neon-secondary: #FF00FF; /* Magenta */
  --neon-accent: #FFFF00; /* Yellow */

  /* Specific glow colors for header sections */
  --neon-header-top-glow: #FFFF00; /* Yellow */
  --neon-main-nav-glow: #FF0000; /* Red */
  --neon-button-glow: var(--register-color, #C30808); /* Red from config */
  --neon-button-text: var(--reg-log-font-color, #FFFF00); /* Yellow from config */

  /* Header offset calculation based on actual heights */
  --marquee-height-desktop: 45px;
  --header-top-height-desktop: 60px;
  --main-nav-height-desktop: 50px;
  --header-offset: calc(var(--marquee-height-desktop) + var(--header-top-height-desktop) + var(--main-nav-height-desktop)); /* Desktop: Marquee + Header-top + Main-nav */
}

@media (max-width: 768px) {
  :root {
    --marquee-height-mobile: 30px;
    --header-top-height-mobile: 50px; /* Hamburger + Logo */
    --mobile-nav-buttons-height: 50px; /* Buttons row */
    --header-offset: calc(var(--marquee-height-mobile) + var(--header-top-height-mobile) + var(--mobile-nav-buttons-height)); /* Mobile: Marquee + Header-top + Mobile-buttons */
  }
}

/* Dynamic neon color animations */
@keyframes theme-colors {
  0%, 100% {
    border-color: var(--neon-primary);
    box-shadow: 
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
  33% {
    border-color: var(--neon-secondary);
    box-shadow: 
      0 0 10px var(--neon-secondary),
      0 0 20px var(--neon-secondary);
  }
  66% {
    border-color: var(--neon-accent);
    box-shadow: 
      0 0 10px var(--neon-accent),
      0 0 20px var(--neon-accent);
  }
}

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

@keyframes marquee-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

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

/* Marquee Section Styles (MANDATORY) */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
  color: #ffffff;
  overflow: hidden;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* 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 20px rgba(0, 255, 255, 0.1);
  z-index: 1001; /* Ensure above header */
  height: var(--marquee-height-desktop); /* Fixed height for desktop */
  display: flex;
  align-items: center;
}

.marquee-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
}

.marquee-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; /* Adjusted for visual balance */
  height: 30px; /* Adjusted for visual balance */
  z-index: 2;
  position: relative;
}

.marquee-icon-emoji {
  font-size: 20px; /* Adjusted for visual balance */
  display: inline-block;
  animation: marquee-pulse 2s ease-in-out infinite, text-glow-flow 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.marquee-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.marquee-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
  gap: 30px;
  padding-right: 30px; /* Ensure content doesn't abruptly end */
}

.marquee-text {
  font-size: 15px; /* Adjusted for visual balance */
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  animation: text-glow-flow 3s ease-in-out infinite alternate;
  line-height: 1.5;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  transition: all 0.3s ease;
}

.marquee-text:hover {
  text-shadow: 
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    0 0 40px var(--neon-primary);
  transform: scale(1.05);
  color: #ffffff;
}

.marquee-separator {
  font-size: 15px; /* Adjusted for visual balance */
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  text-shadow: 
    0 0 3px var(--neon-primary),
    0 0 6px var(--neon-primary);
}

/* Header Styles (Desktop First) */
.site-header {
  position: fixed;
  top: var(--marquee-height-desktop); /* Position below marquee */
  left: 0;
  width: 100%;
  z-index: 1000; /* Below marquee, above content */
  background: transparent; /* Background handled by sub-sections */
  box-sizing: border-box;
}

.header-top {
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  box-shadow: 
    0 0 10px var(--neon-header-top-glow),
    0 0 20px var(--neon-header-top-glow),
    0 0 30px var(--neon-header-top-glow),
    inset 0 0 20px rgba(255, 255, 0, 0.1);
  min-height: var(--header-top-height-desktop);
  display: flex; /* Ensure it takes full height */
  align-items: center;
}

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

.logo {
  font-size: 28px; /* Adjusted for visual balance */
  font-weight: bold;
  color: var(--secondary-color); /* Regular color, no neon for logo */
  text-decoration: none;
  display: block; /* Ensure it's visible */
  padding: 10px 0; /* Add some padding around the logo */
}
.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 40px; /* Desktop logo height */
}

/* 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: 1002; /* Above logo and menu */
  padding: 5px; /* Add padding for clickable area */
  box-sizing: content-box;
}

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

/* Desktop navigation buttons */
.desktop-nav-buttons {
  display: flex; /* Display on desktop */
  gap: 10px;
  align-items: center;
}

/* Mobile navigation buttons (hidden on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

.main-nav {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); /* Darker background for nav */
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  box-shadow: 
    0 0 10px var(--neon-main-nav-glow),
    0 0 20px var(--neon-main-nav-glow),
    0 0 30px var(--neon-main-nav-glow),
    inset 0 0 20px rgba(255, 0, 0, 0.1);
  min-height: var(--main-nav-height-desktop);
  display: flex; /* Display on desktop */
  align-items: center;
  width: 100%;
}

.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  flex-wrap: wrap; /* Allow wrapping if many links */
}

.nav-link {
  color: var(--secondary-color); /* Regular color for nav links */
  text-decoration: none;
  padding: 8px 15px;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary-color); /* Hover effect with primary color */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Button Styles */
.btn {
  position: relative;
  background: linear-gradient(135deg, var(--register-color), var(--login-color)); /* Use specified colors */
  padding: 12px 25px;
  color: var(--neon-button-text); /* Use specified font color */
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  text-shadow: 
    0 0 5px var(--neon-button-text),
    0 0 10px var(--neon-button-text),
    0 0 15px var(--neon-button-text);
  transition: all 0.3s ease;
  font-weight: bold;
  white-space: nowrap; /* Prevent button text from wrapping on desktop */
  box-sizing: border-box;
}

.btn:hover {
  animation-duration: 2s; /* Faster animation on hover */
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-button-glow),
    0 0 30px var(--neon-button-glow),
    0 0 45px var(--neon-button-glow),
    inset 0 0 15px rgba(195, 8, 8, 0.3);
}

/* Footer Styles (Regular, no neon) */
.site-footer {
  background-color: #1a1a1a; /* Dark footer background */
  color: #cccccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

.footer-top {
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4-column layout */
  gap: 30px;
  box-sizing: border-box;
}

.footer-col {
  padding-right: 15px; /* Add some spacing between columns */
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color); /* Use primary color for footer logo */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

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

.footer-col h4 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 20px;
  position: relative;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
}

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

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

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

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

.payment-icons,
.game-providers-icons,
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px; /* Use smaller gap for compact look */
  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(100%) brightness(150%); /* Make icons fit dark theme, optional */
  transition: filter 0.3s ease;
}
.payment-icons img:hover,
.game-providers-icons img:hover,
.social-media-icons img:hover {
  filter: grayscale(0%) brightness(100%);
}

.game-providers-section,
.social-media-section {
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.game-providers-section h4,
.social-media-section h4 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 20px;
  position: relative;
  padding: 0 20px; /* Match container padding */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.game-providers-section h4::after,
.social-media-section h4::after {
  content: '';
  position: absolute;
  left: 20px; /* Adjust for padding */
  bottom: -5px;
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
}

.game-providers-section .game-providers-icons,
.social-media-section .social-media-icons {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.copyright {
  margin: 0;
  color: #999999;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Mobile Content Overflow Rules */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  /* Marquee Mobile Adaptations */
  .marquee-section {
    height: var(--marquee-height-mobile); /* Shorter height for mobile */
    padding: 0;
  }
  .marquee-container {
    gap: 10px;
    padding: 0 10px;
  }
  .marquee-icon {
    width: 20px;
    height: 20px;
  }
  .marquee-icon-emoji {
    font-size: 14px;
  }
  .marquee-text {
    font-size: 13px;
  }
  .marquee-separator {
    font-size: 13px;
    margin: 0 8px;
  }
  .marquee-content {
    gap: 20px;
    animation: marquee-scroll 25s linear infinite;
  }

  /* Header Mobile Adaptations */
  .site-header {
    top: var(--marquee-height-mobile); /* Position below mobile marquee */
  }

  .header-top {
    min-height: var(--header-top-height-mobile); /* Shorter height for mobile */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding */
    justify-content: space-between; /* Hamburger left, logo center */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 0; /* Leftmost */
    margin-right: 15px; /* Space between hamburger and logo */
    position: relative;
    z-index: 1002; /* Ensure it's clickable */
  }
  .hamburger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger-menu.active span:nth-child(2) { opacity: 0; }
  .hamburger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important; /* Use flex to center image */
    justify-content: center !important; /* Center horizontally */
    align-items: center !important; /* Center vertically */
    padding: 0; /* Remove padding from logo for better centering */
    font-size: 22px; /* Smaller font size for mobile logo */
    order: 1; /* Center position */
    max-width: calc(100% - 100px); /* Limit width to avoid overlapping hamburger */
  }
  .logo img {
    max-height: 35px; /* Mobile logo height */
  }
  
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  /* Mobile navigation buttons (always visible below header-top) */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px; /* Space between buttons */
    justify-content: center;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
    border-bottom: 2px solid;
    animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
    box-shadow: 
      0 0 5px var(--neon-header-top-glow),
      0 0 10px var(--neon-header-top-glow);
    min-height: var(--mobile-nav-buttons-height); /* Set height */
    align-items: center;
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    text-align: center;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header + mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: #111; /* Dark background for mobile menu */
    overflow-y: auto;
    transform: translateX(-100%); /* Initially off-screen */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Above overlay */
    border-right: 2px solid;
    animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    padding: 20px 15px;
    align-items: flex-start;
    max-width: none; /* No max-width for mobile container */
    width: 100%; /* Full width */
  }

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

  .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: 999; /* Below menu, above content */
  }
  .mobile-menu-overlay.active {
    display: block; /* Show when active */
  }

  /* Footer Mobile Adaptations */
  .footer-container {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
    padding: 0 15px; /* Smaller padding */
  }
  .footer-col {
    padding-right: 0;
  }
  .footer-col h4 {
    padding-left: 0; /* Remove padding for mobile */
  }
  .game-providers-section h4,
  .social-media-section h4 {
    padding: 0 15px; /* Adjust padding for mobile */
  }
  .game-providers-section .game-providers-icons,
  .social-media-section .social-media-icons {
    padding: 0 15px; /* Adjust padding for mobile */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
