:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-color-register-login: #C30808;
  --button-text-color: #FFFF00;
  --header-top-bg: #00502a; /* Darker green for header top */
  --header-nav-bg: var(--primary-color); /* Primary green for main nav */
  --footer-bg: var(--header-top-bg); /* Darker green for footer */
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
  color: #333333; /* Default text color */
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: var(--secondary-color); /* Page background color */
  overflow-x: hidden; /* Prevent horizontal scroll on desktop */
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--header-top-bg); /* Default background for the whole header, will be overridden by header-top and main-nav */
}

/* Header Top Section (Logo + Buttons) */
.header-top {
  background-color: var(--header-top-bg);
  color: var(--secondary-color);
  padding: 10px 0; /* Vertical padding */
  min-height: 40px; /* Roughly 60px total with padding */
  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; /* Desktop side padding */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--button-text-color); /* Yellow for logo text */
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure logo is always visible */
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 15px;
  align-items: center;
}

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

/* Main Navigation Section */
.main-nav {
  background-color: var(--header-nav-bg);
  padding: 10px 0; /* Vertical padding for desktop nav */
  min-height: 30px; /* Roughly 50px total with padding */
  display: flex; /* Desktop: visible, row */
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: static; /* Desktop: static position */
  width: 100%;
  box-sizing: border-box;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px; /* Desktop side padding */
  box-sizing: border-box;
  flex-wrap: wrap; /* Allow wrapping if many nav items */
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent nav links from wrapping on desktop */
}

.nav-link:hover,
.nav-link.active {
  color: var(--button-text-color); /* Yellow on hover/active */
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  z-index: 1002; /* Above logo and buttons on mobile */
  margin-right: 15px; /* Space from logo */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

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

/* Hamburger Menu Active State */
.hamburger-menu.active span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap; /* Prevent buttons from wrapping on desktop */
  box-sizing: border-box;
}

.btn-register, .btn-login {
  background-color: var(--button-color-register-login);
  color: var(--button-text-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-register:hover, .btn-login:hover {
  background-color: #a30606; /* Slightly darker red on hover */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Footer Styles */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--secondary-color);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--button-text-color);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 15px;
}

.footer-section h3 {
  color: var(--button-text-color);
  font-size: 18px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--button-text-color);
}

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

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

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

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

/* Media Queries for Mobile */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: header-top (60px) + mobile-nav-buttons (50px) */
  }

  /* Prevent body scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

  /* Header Top for Mobile */
  .header-top {
    padding: 10px 0;
    min-height: 40px; /* Roughly 60px total with padding */
  }

  .header-container {
    padding: 0 15px; /* Smaller side padding for mobile */
    max-width: none; /* Crucial: allow container to take full width */
    width: 100%;
    justify-content: space-between; /* Space out hamburger and logo */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center the logo */
    align-items: center !important;
    font-size: 24px;
    margin-right: 0; /* No extra margin */
  }

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

  /* Mobile Navigation Buttons - Always visible below header-top */
  .mobile-nav-buttons {
    display: flex !important; /* MUST be flex and visible */
    background-color: var(--header-top-bg); /* Same as header-top or different for distinction */
    width: 100%;
    max-width: 100%; /* Crucial: prevent overflow */
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for mobile buttons */
    overflow: hidden; /* Prevent buttons from overflowing */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    justify-content: center; /* Center buttons if less than 2, or evenly spaced if 2 */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Reduced padding */
    font-size: 13px; /* Reduced font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow word breaking */
    overflow-wrap: break-word;
  }

  /* Hamburger Menu for Mobile */
  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place it to the far left */
  }

  /* Main Navigation for Mobile (Slide-in menu) */
  .main-nav {
    display: none; /* Default hidden on mobile */
    flex-direction: column; /* Vertical layout */
    position: fixed; /* Fixed position for slide-in */
    top: var(--header-offset); /* Start below the fixed header + mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below fixed header */
    background-color: var(--header-nav-bg); /* Same as desktop nav */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Enable scrolling for long menus */
    padding: 20px 0; /* Vertical padding for mobile menu items */
  }

  .main-nav.active {
    display: flex; /* MUST be flex or block to show */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 0 20px;
    max-width: none; /* Crucial: allow container to take full width */
    width: 100%;
    align-items: flex-start; /* Align links to the left */
    gap: 15px; /* Spacing between mobile nav links */
  }

  .nav-link {
    width: 100%; /* Full width for clickable area */
    padding: 10px 0;
    font-size: 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal; /* Allow nav links to wrap if text is too long */
  }

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

  /* Footer for Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px;
  }

  .footer-section {
    min-width: unset;
    flex: unset;
  }

  /* Mobile content area 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;
  }
}
/* 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;
  }
}
