/* Global styles & variables */
:root {
  --primary-color: #017439; /* Site primary green */
  --secondary-color: #FFFFFF; /* Site auxiliary white */
  --register-color: #C30808;
  --login-color: #C30808;
  --bg-color: #FFFFFF; /* Page body background */
  --register-login-font-color: #FFFF00;

  /* Neon colors based on site primary green and complementary vibrant tones */
  --neon-primary: #00ff00; /* Vibrant green */
  --neon-secondary: #ff00ff; /* Magenta */
  --neon-accent: #00ffff; /* Cyan */

  /* Header offset based on marquee (44px) + header-top (~80px) + main-nav (~52px) */
  --header-top-height: 80px;   /* Approximate height for header-top (logo 60px + 10px top/bottom padding) */
  --main-nav-height: 52px;     /* Approximate height for main-nav */
  --header-offset: calc(44px + var(--header-top-height) + var(--main-nav-height));
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Account for fixed header and marquee */
  background-color: var(--bg-color); /* Page body background */
  color: #333;
  line-height: 1.6;
}

/* 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); box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary); }
  100% { filter: hue-rotate(360deg); box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary); }
}

@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%; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff8000; }
  50% { background-position: 100% 50%; box-shadow: 0 0 10px #00ffff, 0 0 20px #0000ff; }
  100% { background-position: 0% 50%; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff8000; }
}

@keyframes random-glow {
  0% { border-color: var(--neon-primary); box-shadow: 0 0 20px var(--neon-primary); }
  20% { border-color: var(--neon-secondary); box-shadow: 0 0 20px var(--neon-secondary); }
  40% { border-color: var(--neon-accent); box-shadow: 0 0 20px var(--neon-accent); }
  60% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00; }
  80% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
  100% { border-color: var(--neon-primary); box-shadow: 0 0 20px var(--neon-primary); }
}

@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(0, 255, 0, 0.3);
  }
  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);
  }
  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(0, 255, 255, 0.3);
  }
}

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

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

/* Marquee Section */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  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(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 20px rgba(0, 255, 0, 0.1);
  z-index: 1001;
}

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

.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: #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: 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 */
.site-header {
  position: fixed; /* Ensure the header is fixed */
  top: 44px; /* Position it directly below the marquee-section */
  left: 0;
  width: 100%;
  z-index: 1000; /* Ensure it's above page content but below marquee */
  background-color: var(--bg-color); /* Use site background color or a specific header background */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Optional: add a subtle shadow */
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px; /* Adjust padding as needed */
  height: var(--header-top-height); /* Set height to control --header-offset */
  box-sizing: border-box; /* Include padding in height */
  background-color: #f8f8f8; /* A light background for visibility */
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px; /* Max width for content */
  margin: 0 auto;
}

.logo img {
  max-height: 60px; /* Already defined in HTML, but good to have a fallback */
  height: auto;
  width: auto;
  display: block;
}

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

.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
  padding: 10px 20px;
  background-color: #f0f0f0;
  justify-content: center;
  gap: 10px;
}

/* General button styling */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn.theme-flow {
  background: linear-gradient(45deg, var(--register-color), #ff4d4d);
  color: var(--register-login-font-color);
  border-color: var(--register-color);
  animation: theme-colors 4s ease-in-out infinite;
}

.btn.rainbow-flow {
  background: linear-gradient(45deg, #ff0000, #ff8000, #ffff00, #00ff00, #0000ff, #8000ff, #ff0000);
  background-size: 400% 400%;
  color: var(--register-login-font-color);
  animation: gradient-flow 6s ease infinite, rainbow-border 6s linear infinite;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Main Navigation */
.main-nav {
  background-color: var(--primary-color);
  padding: 0;
  height: var(--main-nav-height); /* Set height for --header-offset */
  box-sizing: border-box; /* Include padding in height */
  display: flex; /* Ensure it's a flex container for nav-container */
  align-items: center; /* Vertically center nav-container */
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px; /* Space between links */
  flex-wrap: wrap; /* Allow links to wrap on smaller screens */
  padding: 0 10px; /* Add some horizontal padding */
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 8px 15px;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 5px;
  white-space: nowrap; /* Prevent links from breaking */
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,0.7);
}

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 3px; /* This will be the middle line */
  position: relative;
  background-color: #333; /* Color of the middle line */
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  transition: background-color 0.3s ease;
}

.hamburger-menu::before,
.hamburger-menu::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #333; /* Color of top/bottom lines */
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu::before {
  top: -10px; /* Position above the button */
}

.hamburger-menu::after {
  bottom: -10px; /* Position below the button */
}

.hamburger-menu.active {
  background-color: transparent; /* Hide the middle line when active */
}

.hamburger-menu.active::before {
  transform: rotate(45deg);
  top: 0; /* Move to center and rotate */
  background-color: var(--primary-color);
}

.hamburger-menu.active::after {
  transform: rotate(-45deg);
  bottom: 0; /* Move to center and rotate */
  background-color: var(--primary-color);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 992px) { /* Adjust breakpoint as needed */
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on smaller screens */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on smaller screens */
  }

  .main-nav {
    position: fixed;
    top: calc(44px + var(--header-top-height)); /* Position below marquee and header-top */
    left: -100%; /* Off-screen initially */
    width: 250px; /* Width of the mobile menu */
    height: auto; /* Allow content to determine height */
    background-color: var(--primary-color);
    flex-direction: column; /* Stack links vertically */
    justify-content: flex-start;
    padding-top: 20px;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1000; /* Ensure it's above content but below overlay */
    overflow-y: auto; /* Allow scrolling if many links */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0 20px;
  }

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

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

  .mobile-nav-buttons {
    display: flex; /* Show mobile buttons */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color); /* Match nav background */
    padding: 10px 20px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1001;
    gap: 10px;
    box-sizing: border-box;
    min-height: 70px; /* Give it a minimum height */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Make buttons take equal space */
  }

  /* When mobile menu is open */
  body.mobile-menu-open .main-nav {
    left: 0; /* Slide in */
  }

  /* Adjust body padding-top for mobile */
  body {
    padding-top: calc(44px + var(--header-top-height)); /* Marquee + header-top only */
  }

  :root {
    /* Override header offset for mobile, as main-nav is no longer part of fixed header stack */
    --header-offset: calc(44px + var(--header-top-height));
    --mobile-nav-buttons-height: 70px; /* Define mobile nav button height for calculations */
  }

  /* Adjust main-nav max-height when mobile buttons are present */
  body.mobile-menu-open .main-nav {
      max-height: calc(100vh - 44px - var(--header-top-height) - var(--mobile-nav-buttons-height));
  }
}

/* Adjustments for even smaller screens */
@media (max-width: 768px) {
  .header-top {
    padding: 5px 15px;
    height: 60px; /* Adjust header-top height for smaller mobile */
    --header-top-height: 60px; /* Update variable for media query */
  }

  .logo img {
    max-height: 50px;
  }

  .marquee-container {
    padding: 0 10px;
  }

  .marquee-icon {
    width: 35px;
    height: 35px;
  }

  .marquee-icon-emoji {
    font-size: 20px;
  }

  .marquee-text {
    font-size: 14px;
  }

  .marquee-separator {
    font-size: 14px;
  }

  .mobile-nav-buttons {
    padding: 8px 15px;
    min-height: 60px;
    --mobile-nav-buttons-height: 60px;
  }

  .btn {
    padding: 8px 15px;
    font-size: 14px;
  }
}

/* Payment Methods 图标容器样式 */
.payment-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}

.payment-icons img,
.payment-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Game Providers 图标容器样式 */
.game-providers-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.game-providers-icons img,
.game-provider-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Social Media 图标容器样式 */
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.social-media-icons img,
.social-media-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
