:root {
  --primary-color: #017439;
  --auxiliary-color: #FFFFFF;
  --register-btn-bg: #C30808;
  --login-btn-bg: #C30808;
  --btn-text-color: #FFFF00;
  --header-offset: 120px; /* Desktop: header-top (65px) + main-nav (55px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: header-top (65px) + mobile-nav-buttons (45px) */
  }
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--auxiliary-color); /* Default background, will be overridden by sections */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.header-top {
  background-color: #004d2e; /* Darker green for header top */
  min-height: 65px; /* Fixed height for header-top */
  display: flex;
  align-items: center;
  padding: 10px 0; /* Vertical padding */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Desktop padding */
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--auxiliary-color);
  text-decoration: none;
  display: block; /* Ensure it's block for centering on mobile */
  line-height: 1; /* Adjust line height for vertical alignment */
}

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

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  color: var(--btn-text-color); /* Use specified font color for buttons */
}

.btn-register {
  background-color: var(--register-btn-bg); /* Red for register */
}

.btn-login {
  background-color: var(--login-btn-bg); /* Red for login */
}

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

.main-nav {
  background-color: var(--primary-color); /* Primary green for main nav */
  min-height: 55px; /* Fixed height for main-nav */
  display: flex; /* Desktop default: flex */
  align-items: center;
}

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

.nav-link {
  color: var(--auxiliary-color);
  text-decoration: none;
  padding: 8px 15px;
  font-size: 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 4px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--auxiliary-color);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--auxiliary-color); /* White lines */
  margin-bottom: 5px;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

/* Hamburger menu active state */
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

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

.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown on mobile */
  background-color: #004d2e; /* Same as header-top for continuity */
  padding: 10px 15px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* Prevent buttons from overflowing */
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: center; /* Center buttons if only one */
}

/* Footer styles */
.site-footer {
  background-color: #222; /* Dark grey footer */
  color: var(--auxiliary-color);
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-col h3 {
  color: var(--primary-color); /* Green headings */
  font-size: 16px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color); /* Green logo in footer */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-col p {
  line-height: 1.6;
  color: #ccc;
}

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

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

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

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

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #aaa;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px; /* Smaller padding on mobile */
    justify-content: space-between; /* Hamburger left, Logo center */
    position: relative; /* For absolute positioning of logo */
    min-height: 65px; /* Ensure enough height for elements */
  }

  .logo {
    position: absolute !important; /* Force absolute positioning */
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: block !important; /* Ensure it's block for centering */
    text-align: center; /* For text logo centering */
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    font-size: 20px; /* Smaller logo font on mobile */
    color: var(--auxiliary-color); /* Ensure white color */
  }

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

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    padding: 10px 15px; /* Consistent mobile padding */
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    background-color: #004d2e; /* Ensure background color */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure text wraps within button */
    overflow-wrap: break-word;
    line-height: 1.2; /* Adjust line height for wrapped text */
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 250px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color); /* Menu background */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease-out;
    z-index: 999; /* Below hamburger, above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    padding-top: 10px; /* Add some padding at the top of the menu */
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0; /* Remove horizontal padding for vertical menu */
    align-items: flex-start; /* Align menu items to the left */
    max-width: none; /* Remove max-width for mobile container */
    width: 100%; /* Ensure container takes full width */
  }

  .nav-link {
    width: 100%; /* Full width for mobile menu items */
    padding: 12px 20px; /* Larger padding for touch targets */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }

  .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.5); /* Semi-transparent overlay */
    z-index: 998; /* Below menu, above page content */
  }

  .mobile-menu-overlay.active {
    display: block; /* Show overlay when active */
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-col {
    min-width: unset; /* Remove min-width restriction */
    width: 100%;
    text-align: center;
  }

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

  .footer-nav {
    text-align: center;
  }

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Mobile content overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}
/* 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;
  }
}
