html, body { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --header-offset: 110px; /* Desktop: 60px (header-top) + 50px (main-nav) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 50px (mobile-nav-buttons) */
  }
}
body {
  font-family: 'Arial', sans-serif;
  color: #333333;
  padding-top: var(--header-offset);
  overflow-x: hidden;
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-top {
  background-color: #00502A; /* Darker Green */
  padding: 10px 0;
  min-height: 40px; /* To ensure min height for offset calculation */
  display: flex;
  align-items: center;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0;
  display: block;
}

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

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

.btn-register {
  background-color: #C30808;
  color: #FFFF00;
}

.btn-login {
  background-color: #C30808;
  color: #FFFF00;
}

.main-nav {
  background-color: #017439; /* Primary Green */
  padding: 10px 0;
  display: flex;
  min-height: 30px; /* To ensure min height for offset calculation */
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  flex-wrap: wrap;
  width: 100%;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 8px 15px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  border-radius: 4px;
}

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

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

/* Footer Styles */
.site-footer {
  background-color: #333333;
  color: #FFFFFF;
  padding: 40px 20px;
  text-align: center;
}

.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: 250px;
  text-align: left;
}

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

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

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

.footer-nav li a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  line-height: 2.2;
  display: block;
}

.footer-nav li a:hover {
  text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1001;
    order: -1; /* Place to the left */
  }

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

  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

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

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

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
  }

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

  .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;
    background-color: #00502A; /* Same as header-top for consistency */
    justify-content: center;
    align-items: center;
    min-height: 30px; /* To ensure min height for offset calculation */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* 50% minus half of the gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
  }

  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below header + mobile buttons */
    left: 0;
    width: 280px;
    height: calc(100% - var(--header-offset));
    background-color: #017439;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    z-index: 998;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
  }

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

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

  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 997;
    display: none; /* Hidden by default */
  }

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

  body.no-scroll {
    overflow: hidden;
  }

  /* 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 already set globally, no need to repeat */

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

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

  .footer-nav li a {
    text-align: center;
  }
}
/* 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;
  }
}
