html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--secondary-color);
  background-color: var(--neon-bg-dark); /* Dark background for the whole page */
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Color variables based on user's scheme */
:root {
  --primary-color: #017439; /* User's primary green */
  --secondary-color: #FFFFFF; /* User's secondary white */
  
  /* Neon colors for Header and Marquee, derived from user's primary/secondary but vibrant */
  --neon-bg-dark: #0a0a0a; /* Deep dark background */
  --neon-bg-medium: #1a1a2e; /* Slightly lighter dark background */
  --neon-bg-light: #16213e; /* Another dark background option */

  /* Vibrant neon glow colors, ensure contrast with dark backgrounds */
  --neon-primary-glow: #00ff00; /* Bright green */
  --neon-secondary-glow: #00ffff; /* Cyan */
  --neon-accent-glow: #ff00ff; /* Magenta */
  --neon-text-color: #ffffff; /* White text for readability */

  /* Specific colors from user's custom配色 */
  --btn-register-color: #C30808; /* Red for register */
  --btn-login-color: #C30808; /* Red for login */
  --btn-font-color: #FFFF00; /* Yellow for button text */

  /* Header offset calculation */
  --marquee-height-desktop: 50px; /* Estimated marquee height desktop */
  --header-top-height-desktop: 60px; /* Estimated header top height desktop */
  --main-nav-height-desktop: 50px; /* Estimated main nav height desktop */
  --header-offset: calc(var(--marquee-height-desktop) + var(--header-top-height-desktop) + var(--main-nav-height-desktop)); /* Desktop offset */
}

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

/* Fixed body padding for header offset */
body {
  padding-top: var(--header-offset);
}

/* Reusable container */
.header-container,
.nav-container,
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

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

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

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

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

/* Marquee Section */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--neon-bg-dark), var(--neon-bg-medium), var(--neon-bg-light));
  color: var(--secondary-color);
  overflow: hidden;
  border-bottom: 2px solid;
  animation: border-glow-flow 4s ease-in-out infinite;
  box-shadow: 
    0 0 10px var(--neon-primary-glow),
    0 0 20px var(--neon-primary-glow),
    0 0 30px var(--neon-primary-glow),
    inset 0 0 20px rgba(0, 255, 0, 0.1); /* Green tint for inner glow */
  z-index: 1001;
  height: var(--marquee-height-desktop); /* Fixed height */
  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: 40px;
  height: 40px;
  z-index: 2;
  position: relative;
}

.marquee-icon-emoji {
  font-size: 24px;
  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-glow),
    0 0 10px var(--neon-primary-glow),
    0 0 15px var(--neon-primary-glow);
  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;
  height: 100%; /* Ensure wrapper takes full height to align content */
  display: flex;
  align-items: center;
}

.marquee-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
  gap: 30px;
  height: 100%; /* Ensure content takes full height */
}

.marquee-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--neon-text-color);
  text-decoration: none;
  text-shadow: 
    0 0 5px var(--neon-primary-glow),
    0 0 10px var(--neon-primary-glow),
    0 0 15px var(--neon-primary-glow);
  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-glow),
    0 0 20px var(--neon-primary-glow),
    0 0 30px var(--neon-primary-glow),
    0 0 40px var(--neon-primary-glow);
  transform: scale(1.05);
  color: var(--neon-text-color);
}

.marquee-separator {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  text-shadow: 
    0 0 3px var(--neon-primary-glow),
    0 0 6px var(--neon-primary-glow);
}

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

/* Header Section */
.site-header {
  position: fixed;
  top: var(--marquee-height-desktop); /* Position below marquee */
  left: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(135deg, var(--neon-bg-dark), var(--neon-bg-medium), var(--neon-bg-light));
  border-bottom: 2px solid;
  animation: border-glow-flow 4s ease-in-out infinite; /* Dynamic border color */
  box-shadow: 
    0 0 10px var(--neon-primary-glow),
    0 0 20px var(--neon-primary-glow),
    inset 0 0 15px rgba(0, 255, 0, 0.1); /* Green inner glow */
}

.header-top {
  display: flex;
  align-items: center;
  min-height: var(--header-top-height-desktop); /* Ensure height */
  padding: 10px 0; /* Vertical padding for content */
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 20px;
}

/* Logo - NO NEON EFFECTS */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* White for contrast */
  text-decoration: none;
  flex-shrink: 0; /* Prevent shrinking */
  display: block; /* Ensure it's not inline-flex for mobile centering */
}
.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 50px; /* Desktop logo height */
}

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

/* Main Navigation */
.main-nav {
  display: flex; /* Desktop default: flex */
  align-items: center;
  justify-content: center; /* Center nav links */
  min-height: var(--main-nav-height-desktop); /* Ensure height */
  padding: 10px 0; /* Vertical padding */
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); /* Slightly different dark background */
  border-top: 2px solid;
  animation: border-glow-flow 4s ease-in-out infinite reverse; /* Different animation for contrast */
  box-shadow: 
    0 0 8px var(--neon-secondary-glow),
    0 0 16px var(--neon-secondary-glow),
    inset 0 0 10px rgba(0, 255, 255, 0.1); /* Cyan inner glow */
}

.main-nav .nav-container {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping if many links */
  justify-content: center;
  gap: 25px;
}

.nav-link {
  color: var(--secondary-color); /* White text for readability */
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

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

/* Buttons (Neon Style) */
.btn {
  position: relative;
  padding: 12px 25px;
  color: var(--btn-font-color); /* Yellow text */
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  background: var(--btn-register-color); /* Solid red from custom colors */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: border-glow-flow 4s ease-in-out infinite, pulse-glow 2s ease-in-out infinite alternate; /* Dynamic border & pulse glow */
  text-shadow: 
    0 0 5px var(--btn-font-color),
    0 0 10px var(--btn-font-color);
  box-shadow: 
    0 0 10px var(--btn-register-color),
    0 0 20px var(--btn-register-color),
    inset 0 0 10px rgba(195, 8, 8, 0.3);
  -webkit-appearance: none; /* Reset button styles for consistency */
  -moz-appearance: none;
  appearance: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 0 15px var(--btn-register-color),
    0 0 30px var(--btn-register-color),
    0 0 45px var(--btn-register-color),
    inset 0 0 15px rgba(195, 8, 8, 0.4);
}

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

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Hidden on desktop, shown on mobile */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above mobile menu overlay */
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: all 0.3s ease;
  animation: border-glow-flow 4s ease-in-out infinite reverse; /* Dynamic border color */
  box-shadow: 
    0 0 5px var(--neon-accent-glow),
    0 0 10px var(--neon-accent-glow),
    inset 0 0 5px rgba(255, 0, 255, 0.1); /* Magenta inner glow */
  border-radius: 3px;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--neon-text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
  animation: text-glow-flow 3s ease-in-out infinite alternate; /* Dynamic color for hamburger icon */
}

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

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

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

/* Mobile Menu Overlay */
.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 mobile menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}
.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

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

.site-footer h4 {
  color: var(--secondary-color); /* White headings */
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: bold;
}

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

.site-footer a:hover {
  color: var(--primary-color); /* Green on hover */
}

.footer-top {
  padding-bottom: 30px;
  border-bottom: 1px solid #333333;
}

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

.footer-col {
  margin-bottom: 20px;
}

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

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

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

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

.payment-icons,
.game-providers-icons,
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px; /* Consistent gap */
  width: 100%;
}
.payment-icons img,
.game-providers-icons img,
.social-media-icons img {
  max-height: 50px;
  height: auto;
  width: auto;
  object-fit: contain; /* Ensure images fit without distortion */
}

.footer-middle {
  padding: 30px 0;
  border-bottom: 1px solid #333333;
}

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


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

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

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Marquee */
  .marquee-section {
    height: var(--marquee-height-mobile); /* Mobile fixed height */
    padding: 0;
  }
  .marquee-container {
    gap: 10px;
    padding: 0 5px;
  }
  .marquee-icon {
    width: 25px;
    height: 25px;
  }
  .marquee-icon-emoji {
    font-size: 16px;
  }
  .marquee-text {
    font-size: 13px;
    line-height: 1.3;
  }
  .marquee-separator {
    font-size: 13px;
    margin: 0 8px;
  }
  .marquee-content {
    gap: 15px;
    animation: marquee-scroll 25s linear infinite; /* Faster scroll on mobile */
  }

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

  .header-top {
    min-height: var(--header-top-height-mobile); /* Mobile height */
    padding: 5px 0;
  }
  
  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For absolute logo centering */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 0; /* Place to the left */
    margin-right: auto; /* Push logo to center */
  }

  /* Mobile Logo Centering (Method 1 - Flexbox with !important) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Adjust logo size for mobile */
    position: absolute; /* Take out of flow for better centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
    pointer-events: auto; /* Ensure it's clickable */
  }
  .logo img {
    max-height: 40px; /* Mobile logo height */
  }
  
  /* Hide desktop buttons, show mobile buttons */
  .desktop-nav-buttons {
    display: none;
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    background: linear-gradient(135deg, var(--neon-bg-light), var(--neon-bg-dark)); /* Dark background for button row */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
    min-height: var(--mobile-nav-buttons-height); /* Ensure height */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
  }

  .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 Navigation (Mobile) */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: calc(var(--marquee-height-mobile) + var(--header-top-height-mobile) + var(--mobile-nav-buttons-height)); /* Position below header top and mobile buttons */
    left: 0;
    width: 250px; /* Sidebar width */
    height: calc(100% - var(--marquee-height-mobile) - var(--header-top-height-mobile) - var(--mobile-nav-buttons-height)); /* Full height below header */
    background: linear-gradient(90deg, var(--neon-bg-medium), var(--neon-bg-dark)); /* Sidebar background */
    overflow-y: auto;
    transition: transform 0.3s ease;
    transform: translateX(-100%); /* Off-screen by default */
    z-index: 1000; /* Above overlay */
    border-right: 2px solid;
    animation: border-glow-flow 4s ease-in-out infinite; /* Dynamic border color */
    box-shadow: 
      0 0 10px var(--neon-primary-glow),
      0 0 20px var(--neon-primary-glow),
      inset 0 0 15px rgba(0, 255, 0, 0.1);
    padding: 20px 0; /* Padding for menu items */
  }

  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }
  
  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to the left */
    gap: 15px;
    width: 100%; /* Ensure container takes full width of sidebar */
    max-width: none; /* No max-width on mobile */
    padding: 0 20px; /* Padding for links within sidebar */
  }

  .nav-link {
    width: 100%; /* Full width links */
    padding: 10px 0;
    font-size: 15px;
  }

  /* Page Content overflow prevention */
  .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 {
    overflow: hidden;
  }

  /* Footer */
  .footer-top .footer-container {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
  }
  .footer-col {
    margin-bottom: 0;
  }
  .footer-logo {
    font-size: 20px;
  }
  .site-footer h4 {
    font-size: 16px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
