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

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
}

/* Shared Container Styles */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: #FFFFFF; /* Fallback, specific colors for sections below */
}

/* Header Top Section */
.header-top {
  background-color: #00502A; /* Darker shade of primary for contrast */
  color: #FFFFFF;
  padding: 15px 0;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px; /* Minimum height for content */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  order: 1;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  order: 2;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}

.btn-register, .btn-login {
  background-color: #C30808; /* Register/Login red */
  color: #FFFF00; /* Register/Login yellow text */
  border: 1px solid #C30808;
}

.btn-register:hover, .btn-login:hover {
  background-color: #a30606;
  color: #FFFFFF;
}

/* Main Navigation Section - Desktop */
.main-nav {
  background-color: #017439; /* Primary green */
  padding: 10px 0;
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  position: static; /* Desktop default: static */
  justify-content: center;
}

.main-nav .nav-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #e0e0e0;
}

/* Mobile Specific Styles */
.hamburger-menu, .mobile-nav-buttons, .mobile-menu-overlay {
  display: none; /* Hidden by default on desktop */
}

/* Site Footer */
.site-footer {
  background-color: #00502A; /* Darker shade of primary */
  color: #FFFFFF;
  padding: 40px 20px;
}

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

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

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-col h3 {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 15px;
  color: #FFFFFF;
}

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

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

.footer-nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 14px;
}

.footer-nav a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.copyright {
  font-size: 13px;
  color: #cccccc;
  margin-top: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-container, .nav-container, .footer-container {
    width: 100%;
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
  }

  body {
    overflow-x: hidden;
  }
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Header Top Mobile */
  .header-top .header-container {
    justify-content: space-between;
    padding: 10px 15px;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
    order: 2;
    margin: 0;
    padding: 0;
  }
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    cursor: pointer;
    order: 1;
    z-index: 1001;
    position: relative;
  }

  .hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #FFFFFF;
    transition: all 0.3s ease;
  }

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

  .desktop-nav-buttons {
    display: none;
  }

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: space-between;
    background-color: #FFFFFF; /* White background for buttons */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Mobile (Hidden by default, shown with JS) */
  .main-nav {
    display: none; /* Mobile default: hidden */
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 70%;
    max-width: 300px;
    height: calc(100% - var(--header-offset));
    background-color: #017439; /* Primary green */
    flex-direction: column; /* Mobile: column */
    padding: 20px 0;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
  }

  .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;
    gap: 15px;
  }

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

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
    opacity: 0;
  }

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

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .footer-col {
    min-width: unset;
    width: 100%;
  }
  .footer-logo {
    margin-bottom: 10px;
  }
  .copyright {
    margin-top: 10px;
  }
}
/* 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;
  }
}
