:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-register-bg: #C30808;
  --button-login-bg: #C30808;
  --button-text-color: #FFFF00;
  --header-top-bg: #00502A; /* Darker green */
  --main-nav-bg: var(--primary-color); /* Primary green */
  --footer-bg: #017439; /* Primary green */
  --text-color-light: #F0F0F0;
  --text-color-dark: #333333;

  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

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

/* Base styles for links */
a {
  text-decoration: none;
  color: inherit;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback */
  box-sizing: border-box; /* Include padding in element's total width and height */
  overflow-x: hidden; /* Prevent horizontal scroll within header */
}

.header-top {
  background-color: var(--header-top-bg);
  min-height: 60px; /* Desktop height */
  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 padding */
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  padding: 10px 0; /* Vertical padding to control height */
  display: block; /* Ensure it's treated as a block for sizing */
}

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap; /* Prevent button text from wrapping on desktop */
  text-decoration: none; /* Remove underline for buttons */
}

.btn-register {
  background-color: var(--button-register-bg);
  color: var(--button-text-color);
}

.btn-login {
  background-color: var(--button-login-bg);
  color: var(--button-text-color);
}

.btn:hover {
  transform: translateY(-2px);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1002; /* Above logo if needed */
  margin-right: 15px;
}

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

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

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

.main-nav {
  background-color: var(--main-nav-bg);
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: flex */
  align-items: center;
  padding: 0;
  box-sizing: border-box;
}

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

.nav-link {
  color: var(--secondary-color);
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  text-decoration: none; /* Ensure no underline */
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Mobile specific styles */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

.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);
  z-index: 998;
  cursor: pointer;
}

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

@media (max-width: 768px) {
  .site-header {
    min-height: auto; /* Allow height to adjust for mobile buttons */
  }

  .header-top {
    min-height: 60px; /* Fixed height for top bar */
    padding: 0 15px; /* Mobile padding */
  }

  .header-container {
    padding: 0; /* Reset padding as hamburger and logo handle it */
    width: 100%; /* Full width */
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Space out hamburger and logo */
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Order to be on the left */
    margin-right: 0; /* Reset margin */
  }

  .logo {
    order: 2; /* Order to be in the middle */
    flex: 1 !important; /* Take available space */
    display: flex !important; /* Use flex to center text/image */
    justify-content: center !important; /* Center horizontally */
    align-items: center !important; /* Center vertically */
    padding: 10px 0; /* Reset padding */
    font-size: 20px; /* Adjust font size for mobile */
    max-width: calc(100% - 60px); /* Adjust max-width to not overlap hamburger/buttons if present */
  }
  
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%; /* Full width */
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for buttons */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Keep buttons on one line */
    background-color: var(--header-top-bg); /* Same background as header-top */
    border-top: 1px solid rgba(255,255,255,0.1); /* Separator */
    min-height: 50px; /* Minimum height for buttons area */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical menu */
    position: fixed; /* Fixed position for sidebar menu */
    top: 0; /* Adjusted in JS to be below header-top if needed, but here it's full height */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: 100vh; /* Full viewport height */
    background-color: var(--main-nav-bg);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    padding-top: 60px; /* Space for fixed header-top */
    box-sizing: border-box;
    overflow-y: auto; /* Scroll if content is too long */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 0; /* Reset padding */
    width: 100%; /* Full width */
    max-width: none; /* No max-width on mobile */
    align-items: flex-start; /* Align links to the left */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Larger padding for mobile links */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-link:last-child {
    border-bottom: 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;
  }
}

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

.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;
  max-width: 30%; /* Adjust for 3 columns */
}

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 5px;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--button-text-color); /* Yellow accent */
}

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

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

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

.footer-col ul li a:hover {
  color: var(--button-text-color); /* Yellow accent on hover */
}

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

@media (max-width: 768px) {
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .footer-col {
    max-width: 100%;
    min-width: unset;
  }
  .footer-bottom {
    margin-top: 30px;
  }
}

/* No-scroll class for body when mobile menu is open */
body.no-scroll {
  overflow: 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;
  }
}
