:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-btn-bg: #C30808;
  --login-btn-bg: #C30808;
  --btn-font-color: #FFFF00;
  --bg-color: #FFFFFF;

  /* Neon specific colors, derived from or complementing the theme */
  --neon-primary: #39ff14; /* Vibrant green */
  --neon-secondary: #ffff00; /* Neon yellow */
  --neon-accent-red: #ff0000; /* Neon red */
  --neon-header-bg: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
  --neon-nav-bg: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);

  /* Header offset calculation */
  --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: 45 + 60 + 50 = 155px */
}

@media (max-width: 768px) {
  :root {
    --marquee-height-mobile: 45px; /* Consistent with desktop */
    --header-top-height-mobile: 60px; /* Consistent with desktop */
    --mobile-nav-buttons-height-mobile: 60px; /* Adjusted to be consistent */
    --header-offset: calc(var(--marquee-height-mobile) + var(--header-top-height-mobile) + var(--mobile-nav-buttons-height-mobile)); /* Mobile: 45 + 60 + 60 = 165px */
  }
}

/* Base styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: #121212; /* Dark base background */
  color: #e0e0e0;
  overflow-x: hidden; /* Prevent horizontal scroll for body */
}

/* Animations for dynamic neon colors */
@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-red);
    box-shadow: 
      0 0 10px var(--neon-accent-red),
      0 0 20px var(--neon-accent-red);
  }
}

@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-red),
      0 0 10px var(--neon-accent-red),
      0 0 15px var(--neon-accent-red);
    color: #ffffff;
  }
}

/* Marquee Section Styles */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--marquee-height-desktop); /* Use CSS variable */
  background: var(--neon-header-bg);
  color: #ffffff;
  overflow: hidden;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  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, 0, 255, 0.1);
  z-index: 1001;
  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 size */
  height: 30px; /* Adjusted size */
  z-index: 2;
  position: relative;
}

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

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

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

.marquee-text {
  font-size: 15px; /* Adjusted size */
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
  line-height: 1.5;
  display: inline-block;
  vertical-align: middle;
  animation: text-glow-flow 3s ease-in-out infinite alternate;
  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 size */
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  text-shadow: 
    0 0 3px var(--neon-primary),
    0 0 6px var(--neon-primary);
}

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

/* Header Section Styles */
.site-header {
  position: fixed;
  top: var(--marquee-height-desktop); /* Position below marquee */
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent; /* Background handled by header-top and main-nav */
}

.header-top {
  width: 100%;
  height: var(--header-top-height-desktop); /* Use CSS variable */
  background: var(--neon-header-bg);
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  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, 0, 255, 0.1);
  display: flex;
  align-items: center;
}

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

.logo {
  color: #ffffff; /* Regular color, no neon glow */
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  padding: 5px 0; /* Ensures proper vertical alignment */
  display: block; /* Ensure it's not inline-flex by default */
  /* NO neon effects for LOGO */
}

.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 40px; /* Desktop height */
}

.desktop-nav-buttons {
  display: flex; /* Show for desktop */
  gap: 15px;
  align-items: center;
}

.mobile-nav-buttons {
  display: none; /* Hidden for desktop, shown for mobile */
}

.main-nav {
  width: 100%;
  height: var(--main-nav-height-desktop); /* Use CSS variable */
  background: var(--neon-nav-bg);
  border-top: 2px solid; /* Use border-top for separation */
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic color for nav border */
  box-shadow: 
    0 0 10px var(--neon-secondary), /* Use a different neon color for nav glow */
    0 0 20px var(--neon-secondary),
    0 0 30px var(--neon-secondary),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  display: flex; /* Show for desktop */
  align-items: center;
}

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

.nav-link {
  color: #ffffff; /* Regular color for nav links */
  text-decoration: none;
  font-weight: 500;
  padding: 10px 15px;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--neon-primary); /* Use neon primary for hover */
}

.btn {
  position: relative;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
  padding: 10px 20px; /* Adjusted padding */
  color: var(--btn-font-color); /* Use custom button font color */
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  font-weight: bold;
  font-size: 16px; /* Adjusted font size */
  transition: all 0.3s ease;
  text-shadow: 
    0 0 5px var(--btn-font-color),
    0 0 10px var(--neon-primary);
  display: inline-block; /* Ensure proper sizing */
}

.btn:hover {
  animation-duration: 2s;
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-primary),
    0 0 30px var(--neon-primary),
    0 0 45px var(--neon-primary),
    inset 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Hidden for desktop */
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1002; /* Above logo and mobile menu */
  padding: 0;
  margin-right: 20px; /* Space from logo */
  /* Neon glow for hamburger */
  box-shadow: 0 0 5px var(--neon-primary);
  animation: theme-colors 4s ease-in-out infinite;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  margin-bottom: 5px;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
  box-shadow: 0 0 3px #ffffff;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

.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);
}

.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 */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer Styles */
.site-footer {
  background-color: #1a1a2e; /* Dark background for footer */
  color: #e0e0e0;
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer h4 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: bold;
}

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

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

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

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

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  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; /* Adjusted gap for tighter spacing */
  width: 100%;
}

.payment-icons img, .game-providers-icons img, .social-media-icons img {
  max-height: 45px; /* Adjusted size for footer icons */
  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%); /* Color on hover, optional */
}

.game-providers-section, .social-media-section {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.footer-bottom {
  text-align: center;
  font-size: 13px;
  color: #a0a0a0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Marquee Mobile */
  .marquee-section {
    height: var(--marquee-height-mobile); /* Use mobile height */
    padding: 0; /* Remove padding */
  }
  .marquee-container {
    padding: 0 10px; /* Smaller padding */
    gap: 10px;
  }
  .marquee-icon {
    width: 20px;
    height: 20px;
  }
  .marquee-icon-emoji {
    font-size: 14px;
  }
  .marquee-text {
    font-size: 12px;
  }
  .marquee-separator {
    font-size: 12px;
    margin: 0 5px;
  }
  .marquee-content {
    gap: 15px;
    animation-duration: 20s; /* Faster scroll on mobile */
  }

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

  .header-top {
    height: var(--header-top-height-mobile); /* Use mobile height */
    padding: 0 15px; /* Add padding for container */
  }

  .header-container {
    padding: 0; /* Container padding handled by header-top */
    flex-wrap: nowrap; /* Prevent wrapping */
    justify-content: flex-start; /* Align hamburger to left */
    gap: 10px;
    width: 100%; /* Occupy full width */
    max-width: none; /* No max-width on mobile */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Order it first */
    margin-right: 0; /* No right margin, gap handles it */
  }

  .logo {
    order: 2; /* Order it second */
    flex: 1 !important; /* Take remaining space */
    display: flex !important; /* Use flex for centering */
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    font-size: 22px; /* Smaller logo text */
    padding: 0; /* Remove padding */
  }

  .logo img {
    max-height: 35px; /* Smaller logo image */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the button bar */
    overflow: hidden;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background: var(--neon-header-bg); /* Use similar background for consistency */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
    height: var(--mobile-nav-buttons-height-mobile); /* Use CSS variable */
    align-items: center; /* Center buttons vertically */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* 50% width minus half of the 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 for mobile, controlled by JS */
    flex-direction: column; /* Vertical menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header elements */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background: var(--neon-nav-bg); /* Use nav background */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Hide off-screen */
    transition: transform 0.3s ease;
    z-index: 1000; /* Above overlay */
    padding: 20px 0;
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    padding: 0 15px;
    width: 100%;
    max-width: none; /* No max-width */
  }

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

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

  /* Footer Mobile */
  .footer-container {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
  }

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

  .site-footer h4 {
    margin-top: 20px;
    margin-bottom: 10px;
  }
  .game-providers-section, .social-media-section {
    padding: 15px 0;
    margin-bottom: 15px;
  }

  /* Mobile Content Overflow */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* body no-scroll for mobile menu */
body.no-scroll {
  overflow: hidden;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
