:root {
  --primary-color: #26A9E0; /* Blue */
  --secondary-color: #FFFFFF; /* White */
  --text-color: #e0e0e0; /* Light gray for general text */
  --dark-bg: #0a0a0a; /* Dark background for neon */
  --dark-bg-light: #1a1a2e; /* Slightly lighter dark background */
  --dark-bg-dark: #16213e; /* Slightly darker dark background */
  
  /* Neon colors derived from primary/secondary for dynamic effects */
  --neon-primary: var(--primary-color); /* Base blue */
  --neon-secondary: #FF00FF; /* Magenta for contrast */
  --neon-accent: #FFFF00; /* Yellow for contrast */
  
  --header-offset: 155px; /* Desktop: Marquee 45px + Header 110px */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 145px; /* Mobile: Marquee 45px + Header 100px */
  }
}

/* Global styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: var(--dark-bg);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Neon Dynamic Color Animations --- */
@keyframes rainbow-border {
  0% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
  16.6% { border-color: #ff8000; box-shadow: 0 0 10px #ff8000, 0 0 20px #ff8000; }
  33.3% { border-color: #ffff00; box-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00; }
  50% { border-color: #00ff00; box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
  66.6% { border-color: #0000ff; box-shadow: 0 0 10px #0000ff, 0 0 20px #0000ff; }
  83.3% { border-color: #8000ff; box-shadow: 0 0 10px #8000ff, 0 0 20px #8000ff; }
  100% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
}

@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%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes random-glow {
  0% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff; }
  20% { border-color: #00ffff; box-shadow: 0 0 20px #00ffff; }
  40% { border-color: #ffff00; box-shadow: 0 0 20px #ffff00; }
  60% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00; }
  80% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
  100% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff; }
}

@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(38, 169, 224, 0.3); /* Based on primary-color */
  }
  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, 0, 255, 0.3); /* Based on neon-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, 255, 0, 0.3); /* Based on neon-accent */
  }
}

@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: var(--secondary-color);
  }
  50% {
    text-shadow: 
      0 0 5px var(--neon-secondary),
      0 0 10px var(--neon-secondary),
      0 0 15px var(--neon-secondary);
    color: var(--secondary-color);
  }
  100% {
    text-shadow: 
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      0 0 15px var(--neon-accent);
    color: var(--secondary-color);
  }
}

/* --- Marquee Section --- */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--dark-bg), var(--dark-bg-light), var(--dark-bg-dark));
  color: var(--secondary-color);
  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(38, 169, 224, 0.1);
  z-index: 1001;
  height: 45px; /* Fixed height for calculation */
  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),
    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: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  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: var(--secondary-color);
}

.marquee-separator {
  font-size: 16px;
  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%); }
}

/* --- Site Header (Desktop First) --- */
.site-header {
  position: fixed;
  top: 45px; /* Marquee height */
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--dark-bg); /* Fallback */
}

/* Header Top Section (Logo + Desktop Buttons) */
.header-top {
  background: linear-gradient(135deg, var(--dark-bg), var(--dark-bg-light));
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic color border */
  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(38, 169, 224, 0.1); /* Based on primary-color */
  padding: 10px 0;
  min-height: 60px; /* For offset calculation */
  display: flex;
  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 - NO NEON EFFECTS */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* White for clear contrast */
  text-decoration: none;
  flex-shrink: 0; /* Prevent logo from shrinking */
  display: block; /* Ensure logo is visible */
}

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

/* Hamburger Menu - Desktop hidden */
.hamburger-menu {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1002; /* Above overlay */
  flex-shrink: 0;
}

.hamburger-menu .bar {
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
  box-shadow: 
    0 0 5px var(--neon-secondary),
    0 0 10px var(--neon-secondary);
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto; /* Push to right */
}

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

/* Main Navigation (Desktop) */
.main-nav {
  background: linear-gradient(135deg, var(--dark-bg-light), var(--dark-bg-dark));
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: rainbow-border 6s linear infinite; /* Different dynamic color for contrast */
  box-shadow: 
    0 0 10px var(--neon-secondary),
    0 0 20px var(--neon-secondary),
    0 0 30px var(--neon-secondary),
    inset 0 0 20px rgba(255, 0, 255, 0.1); /* Based on neon-secondary */
  padding: 10px 0;
  min-height: 50px; /* For offset calculation */
  display: flex; /* Desktop default */
  align-items: center;
  width: 100%;
}

.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center; /* Center nav links */
  align-items: center;
  gap: 25px;
  padding: 0 20px;
  box-sizing: border-box;
}

.nav-link {
  color: var(--secondary-color); /* Regular color, no neon */
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 5px 0;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  white-space: nowrap; /* Prevent wrapping for nav links */
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color); /* Highlight color on hover */
  text-shadow: 0 0 5px var(--primary-color);
}

/* General Button Styles */
.btn {
  position: relative;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
  padding: 12px 20px;
  color: var(--secondary-color);
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic color border */
  text-shadow: 
    0 0 5px var(--secondary-color),
    0 0 10px var(--neon-primary);
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap; /* Prevent text wrapping by default */
}

.btn:hover {
  animation-duration: 2s; /* Faster color change on hover */
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-primary),
    0 0 25px var(--neon-primary),
    inset 0 0 15px rgba(38, 169, 224, 0.5); /* Based on primary-color */
}

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

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

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

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

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

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

.site-footer h4 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

.site-footer .footer-description {
  line-height: 1.6;
  word-wrap: break-word; /* Ensure text wraps */
  overflow-wrap: break-word; /* Ensure text wraps */
  /* No text-overflow: ellipsis or -webkit-line-clamp */
}

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

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

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

.site-footer .payment-icons img,
.site-footer .game-providers-icons img,
.site-footer .social-media-icons img {
  max-height: 50px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.site-footer .footer-middle {
  padding: 30px 0;
}

.site-footer .game-providers-section,
.site-footer .social-media-section {
  margin-bottom: 25px;
}

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

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

.site-footer .footer-bottom .footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.site-footer .footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 15px; /* Adjust gap for small screens */
}

.site-footer .footer-legal-links .separator {
  color: rgba(255, 255, 255, 0.5);
}

/* --- Responsive Styles (Mobile First Override) --- */
@media (max-width: 768px) {
  /* Marquee */
  .marquee-section {
    height: 45px; /* Consistent height */
  }
  .marquee-container {
    padding: 0 10px;
    gap: 10px;
  }
  .marquee-icon {
    width: 30px;
    height: 30px;
  }
  .marquee-icon-emoji {
    font-size: 18px;
  }
  .marquee-text, .marquee-separator {
    font-size: 14px;
  }
  .marquee-content {
    gap: 20px;
    animation: marquee-scroll 25s linear infinite;
  }

  /* Header */
  .site-header {
    top: 45px; /* Marquee height */
  }

  .header-top {
    padding: 10px 0;
    min-height: 50px; /* Mobile height for offset calc */
  }

  .header-container {
    padding: 0 15px;
    justify-content: space-between; /* Hamburger left, Logo center */
    position: relative; /* For absolute logo positioning if needed */
  }

  /* Hamburger Menu - Mobile visible */
  .hamburger-menu {
    display: block;
    order: 0; /* Leftmost */
    margin-right: auto; /* Push logo to center */
    z-index: 1002;
    animation: text-glow-flow 3s ease-in-out infinite alternate; /* Neon glow for hamburger */
  }

  .hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
  .hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* Logo - Mobile Centering */
  .logo {
    flex: 1 !important; /* Allow logo to take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 1; /* Center position */
    padding: 0 5px; /* Small padding to prevent touching hamburger */
    max-width: calc(100% - 80px); /* Adjust max-width to not overlap hamburger */
  }

  .logo img {
    max-height: 40px !important; /* Mobile logo height */
  }

  /* Desktop Nav Buttons - Mobile hidden */
  .desktop-nav-buttons {
    display: none;
  }

  /* Mobile Nav Buttons - Mobile visible */
  .mobile-nav-buttons {
    display: flex !important; /* Force display on mobile */
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--dark-bg-dark), var(--dark-bg)); /* Darker background */
    border-bottom: 2px solid;
    animation: alternate-colors 4s ease-in-out infinite; /* Different dynamic color */
    box-shadow: 
      0 0 8px var(--neon-secondary),
      0 0 15px var(--neon-secondary),
      inset 0 0 10px rgba(255, 0, 255, 0.1); /* Based on neon-secondary */
    min-height: 50px; /* For offset calculation */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
  }

  .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 wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout */
    position: fixed;
    top: var(--header-offset); /* Below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background: linear-gradient(180deg, var(--dark-bg-dark), var(--dark-bg)); /* Dark background */
    border-right: 2px solid;
    animation: theme-colors 4s ease-in-out infinite reverse; /* Dynamic border */
    box-shadow: 
      5px 0 15px rgba(0, 0, 0, 0.5),
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary); /* Based on primary-color */
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000; /* Above overlay, below hamburger */
    overflow-y: auto; /* Scrollable if many links */
    padding: 20px 0;
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
    width: 100%; /* Take full width of sidebar */
    max-width: none; /* Remove max-width constraint */
    align-items: flex-start; /* Align links to left */
  }

  .nav-link {
    width: 100%;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: left;
  }

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

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

  .site-footer .footer-col ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 15px;
  }
  
  .site-footer .footer-col ul li {
    margin-bottom: 0;
  }

  .site-footer .footer-col ul li a {
    padding: 5px 0;
  }

  .site-footer .footer-logo {
    margin-bottom: 10px;
  }

  .site-footer .footer-description {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .site-footer .payment-icons,
  .site-footer .game-providers-icons,
  .site-footer .social-media-icons {
    justify-content: center;
  }

  .site-footer .footer-legal-links {
    flex-direction: column;
    gap: 5px;
  }

  .site-footer .footer-legal-links .separator {
    display: none;
  }

  /* Mobile Content Overflow Protection */
  .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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
