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

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

/* General styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  color: #333333;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent body overflow on mobile */
}

a {
  text-decoration: none;
  color: inherit;
}

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

.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Site Header */
.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(--secondary-color); /* Fallback, actual bg set on header-top/main-nav */
}

.header-top {
  background-color: var(--header-top-bg);
  min-height: 60px;
  display: flex;
  align-items: center;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 20px; /* Ensure logo and buttons have padding from edges */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 0;
  display: block; /* Ensure logo is block-level for flex alignment */
}

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

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

.btn-register {
  background-color: var(--button-color-register);
  color: var(--button-font-color);
  border: 1px solid var(--button-color-register);
}

.btn-register:hover {
  background-color: #A00707; /* Darker shade on hover */
  transform: translateY(-2px);
}

.btn-login {
  background-color: var(--button-color-login);
  color: var(--button-font-color);
  border: 1px solid var(--button-color-login);
}

.btn-login:hover {
  background-color: #A00707; /* Darker shade on hover */
  transform: translateY(-2px);
}

/* Main Navigation */
.main-nav {
  background-color: var(--main-nav-bg);
  min-height: 50px;
  display: flex; /* Desktop: default flex */
  align-items: center;
  justify-content: center; /* Center nav links */
}

.main-nav .nav-container {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping if many links */
  justify-content: center; /* Center nav links */
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 10px 20px;
}

.nav-link {
  color: var(--secondary-color);
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #FFD700; /* Gold-like highlight on hover */
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Ensure it's above other elements */
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin-bottom: 5px;
  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 (Hidden by default on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

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

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

/* Site Footer */
.site-footer {
  background-color: #222222; /* Dark background for footer */
  color: #cccccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer h3 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
}

.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}

.site-footer .footer-section {
  flex: 1;
  min-width: 250px;
}

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

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

.site-footer ul li a {
  color: #cccccc;
  transition: color 0.3s ease;
}

.site-footer ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #333333;
  padding-top: 20px;
  margin-top: 30px;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: #999999;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-container, .nav-container, .footer-container {
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-top .header-container {
    display: flex;
    justify-content: space-between; /* Hamburger left, Logo center */
    align-items: center;
    padding: 0 15px;
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
    padding: 5px 0;
    max-width: calc(100% - 80px); /* Adjust max-width to make space for hamburger (15px padding + 25px hamburger width + 10px padding = ~50px, so 100px for both sides) */
    text-align: center; /* For text logo centering */
  }
  
  /* If logo is an image, use this for centering */
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

  .hamburger-menu {
    display: block;
    order: -1; /* Place hamburger menu to the left */
    position: relative;
    z-index: 1001;
  }

  .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; /* Add padding to the button container */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--header-top-bg); /* Same background as header-top */
    justify-content: center;
  }

  .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;
    font-size: 13px;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Allow long words to break */
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Adjust width as needed */
    max-width: 300px; /* Max width for mobile menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--main-nav-bg);
    transform: translateX(-100%); /* Hide off-screen */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    align-items: flex-start; /* Align menu items to the left */
    padding-top: 20px;
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    width: 100%;
  }

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

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

  .site-footer .footer-container {
    flex-direction: column;
    align-items: center;
  }

  .site-footer .footer-section {
    width: 100%;
    min-width: unset;
    text-align: center;
    margin-bottom: 30px;
  }
  
  .site-footer .footer-section:last-child {
    margin-bottom: 0;
  }

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