:root {
  --header-offset: 120px; /* Desktop: header + button area total height */
  --marquee-height: 60px; /* Estimated marquee height */
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #000000; /* Black */
  --accent-color: #00FFFF; /* Cyan for neon accent */

  /* Neon specific colors for dynamic effects */
  --neon-gold: #FFD700;
  --neon-yellow: #FFFF00;
  --neon-magenta: #FF00FF;
  --neon-cyan: #00FFFF;
  --neon-red: #FF0000;
  --neon-blue: #0000FF;
  --neon-green: #00FF00;
}

@media (max-width: 768px) {
  :root {
    --header-offset: 200px; /* Mobile: marquee + header + button area total height */
    --marquee-height: 40px; /* Estimated mobile marquee height */
  }
}

/* Base neon glow effect - fallback if animation not used */
.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);
}

/* Dynamic neon color animations */
@keyframes rainbow-border {
  0% { border-color: var(--neon-red); box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red); }
  16.6% { border-color: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-gold); }
  33.3% { border-color: var(--neon-yellow); box-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow); }
  50% { border-color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green); }
  66.6% { border-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan); }
  83.3% { border-color: var(--neon-magenta); box-shadow: 0 0 10px var(--neon-magenta), 0 0 20px var(--neon-magenta); }
  100% { border-color: var(--neon-red); box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red); }
}

@keyframes hue-spin {
  0% { filter: hue-rotate(0deg); box-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-gold); }
  100% { filter: hue-rotate(360deg); box-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-gold); }
}

@keyframes alternate-colors {
  0% { border-color: var(--neon-yellow); box-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow); }
  100% { border-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan); }
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-gold); }
  50% { background-position: 100% 50%; box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-blue); }
  100% { background-position: 0% 50%; box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-gold); }
}

@keyframes random-glow {
  0% { border-color: var(--neon-magenta); box-shadow: 0 0 20px var(--neon-magenta); }
  20% { border-color: var(--neon-cyan); box-shadow: 0 0 20px var(--neon-cyan); }
  40% { border-color: var(--neon-yellow); box-shadow: 0 0 20px var(--neon-yellow); }
  60% { border-color: var(--neon-green); box-shadow: 0 0 20px var(--neon-green); }
  80% { border-color: var(--neon-red); box-shadow: 0 0 20px var(--neon-red); }
  100% { border-color: var(--neon-magenta); box-shadow: 0 0 20px var(--neon-magenta); }
}

/* Theme flow animation using defined primary, accent, and a derived secondary for neon */
@keyframes theme-colors {
  0%, 100% {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  }
  33% {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
  }
  66% {
    border-color: var(--neon-magenta); /* Using a fixed neon for variety */
    box-shadow: 0 0 10px var(--neon-magenta), 0 0 20px var(--neon-magenta);
  }
}

/* Text glow flow for dynamic text shadows */
@keyframes text-glow-flow {
  0% {
    text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 15px var(--primary-color);
    color: #ffffff;
  }
  50% {
    text-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color), 0 0 15px var(--accent-color);
    color: #ffffff;
  }
  100% {
    text-shadow: 0 0 5px var(--neon-magenta), 0 0 10px var(--neon-magenta), 0 0 15px var(--neon-magenta);
    color: #ffffff;
  }
}

/* Flicker and pulse effects */
@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; }
}

/* General body reset and base styles */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #e0e0e0;
  background-color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Marquee Section Styles */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
  color: #ffffff;
  overflow: hidden;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  box-shadow:
    0 0 10px var(--primary-color),
    0 0 20px var(--primary-color),
    0 0 30px var(--primary-color),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
  z-index: 1001;
  min-height: var(--marquee-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: 5px 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(--primary-color),
    0 0 10px var(--primary-color),
    0 0 15px var(--primary-color);
  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%;
  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%;
}

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

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

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

/* Header Section Styles (Desktop First) */
.site-header {
  position: fixed;
  top: var(--marquee-height); /* Position below marquee */
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column; /* Stack top and nav bars */
}

.header-top {
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  box-shadow:
    0 0 10px var(--primary-color),
    0 0 20px var(--primary-color),
    0 0 30px var(--primary-color),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
  width: 100%;
  padding: 10px 0;
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  color: #ffffff; /* Regular color, no neon glow */
  padding: 5px 0;
  display: block; /* Ensure it takes up space */
}

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

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
}

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

.btn:hover {
  animation-duration: 2s;
  transform: translateY(-2px);
  box-shadow:
    0 0 15px var(--primary-color),
    0 0 30px var(--primary-color),
    inset 0 0 15px rgba(255, 215, 0, 0.4);
}

.main-nav {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: rainbow-border 6s linear infinite; /* Different neon effect for contrast */
  box-shadow:
    0 0 10px var(--neon-red),
    0 0 20px var(--neon-red),
    0 0 30px var(--neon-red),
    inset 0 0 20px rgba(255, 0, 0, 0.1);
  width: 100%;
  display: flex; /* Desktop: visible and horizontal */
  justify-content: center;
  padding: 10px 0;
}

.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 */
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
  text-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--primary-color);
}

.nav-link.active {
  color: var(--primary-color);
  text-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--primary-color);
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002; /* Above logo */
  animation: text-glow-flow 3s ease-in-out infinite alternate; /* Neon glow for hamburger */
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 5px var(--primary-color); /* Neon glow */
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

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

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  backdrop-filter: blur(5px);
}

/* Footer Section Styles */
.site-footer {
  background-color: var(--secondary-color); /* Black background */
  color: #e0e0e0;
  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);
  gap: 30px;
}

.footer-col h4 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

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

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

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

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

.footer-nav a {
  color: #e0e0e0;
  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; /* Consistent gap for all icon sections */
  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%); /* Subtle effect for icons */
  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 {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.game-providers-section h4, .social-media-section h4 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 15px;
  position: relative;
}

.game-providers-section h4::after, .social-media-section h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  color: #b0b0b0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Marquee Mobile */
  .marquee-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: var(--marquee-height);
  }
  .marquee-container {
    gap: 10px !important;
    padding: 0 5px;
  }
  .marquee-icon {
    width: 25px !important;
    height: 25px !important;
  }
  .marquee-icon-emoji {
    font-size: 16px !important;
  }
  .marquee-text {
    font-size: 13px !important;
  }
  .marquee-separator {
    font-size: 13px !important;
    margin: 0 8px !important;
  }
  .marquee-content {
    gap: 20px;
    animation: marquee-scroll 25s linear infinite;
  }

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

  .header-top {
    padding: 8px 0;
  }

  .header-container {
    padding: 0 15px;
    min-height: 45px;
    position: relative; /* For logo absolute positioning */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
    order: 2; /* Center the logo */
    max-width: calc(100% - 60px); /* Adjust based on hamburger width */
  }
  .logo img {
    max-height: 40px;
  }

  .hamburger-menu {
    display: block;
    order: 1; /* Left side */
    margin-right: auto; /* Push logo to center */
    box-shadow: 0 0 5px var(--primary-color);
  }
  .hamburger-menu span {
    box-shadow: 0 0 3px var(--primary-color);
  }

  .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;
    overflow: hidden;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background: linear-gradient(135deg, #0f3460, #16213e); /* Darker background for button bar */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 8px 12px;
    font-size: 13px;
    text-align: center;
  }

  .main-nav {
    display: none; /* Hidden by default, toggled by JS */
    flex-direction: column;
    position: fixed;
    top: calc(var(--marquee-height) + 45px + 45px); /* Marquee + HeaderTop + MobileButtons */
    left: 0;
    width: 100%;
    height: calc(100% - (var(--marquee-height) + 45px + 45px)); /* Remaining height */
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
    box-shadow: none; /* Remove border/shadow for full screen menu */
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%); /* Off-screen by default */
    z-index: 1000; /* Above overlay */
    padding-bottom: 20px; /* Space at bottom of menu */
  }

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

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

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

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

  /* Footer Mobile */
  .site-footer {
    padding: 30px 0 15px;
  }

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

  .footer-col h4 {
    margin-bottom: 15px;
  }

  .footer-middle {
    margin: 20px auto;
    padding: 0 15px;
  }
  
  .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 class 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;
  }
}
