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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  color: #333333;
  line-height: 1.6;
}

/* Global styles for site-header (Desktop First) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: #FFFFFF; /* Auxiliary color for overall header */
}

.header-top {
  background-color: #017439; /* Primary color for top bar */
  color: #FFFFFF;
  padding: 10px 0; /* Total height 40px content + 20px padding = 60px */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  min-height: 40px; /* Base height for content */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF; /* White for contrast on primary background */
  text-decoration: none;
  display: block; /* Ensure it's not hidden by default */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

.btn-register {
  background-color: #C30808; /* Custom red for register */
  color: #FFFF00; /* Custom yellow for register text */
}

.btn-register:hover {
  background-color: #e02020;
}

.btn-login {
  background-color: #C30808; /* Custom red for login */
  color: #FFFF00; /* Custom yellow for login text */
}

.btn-login:hover {
  background-color: #e02020;
}

.main-nav {
  background-color: #f8f8f8; /* Light grey for nav bar, different from header-top */
  padding: 10px 0; /* Total height 30px content + 20px padding = 50px */
  width: 100%;
  display: flex; /* Desktop default: flex */
  min-height: 30px; /* Base height for content */
}

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

.nav-link {
  color: #333333; /* Dark color for contrast on light grey background */
  text-decoration: none;
  font-weight: 600;
  padding: 8px 0;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping on desktop */
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #017439; /* Primary color on hover/active */
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #017439;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

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

/* Footer styles */
.site-footer {
  background-color: #017439; /* Primary color for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  line-height: 1.6;
}

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

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

.footer-col {
  flex: 1 1 280px; /* Responsive columns */
  margin-bottom: 20px;
}

.footer-col p {
  font-size: 14px;
}

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

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

.footer-nav a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #cccccc;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
}

/* Mobile styles */
@media (max-width: 768px) {
  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .header-top {
    padding: 10px 0; /* Total height 30px content + 20px padding = 50px */
  }

  .header-container {
    padding: 0 15px;
    justify-content: space-between;
    min-height: 30px; /* Base height for content */
  }

  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
  }

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

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

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

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

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
    padding: 0 10px; /* Prevent logo from touching hamburger */
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Total height approx 32px content + 20px padding = 52px */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #f5f5f5; /* Light background for mobile buttons */
    box-shadow: inset 0 -1px 3px rgba(0,0,0,0.05);
    min-height: 32px; /* Base height for content */
  }

  .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;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Start below the header */
    left: 0;
    width: 70%; /* Adjust as needed */
    height: calc(100% - var(--header-offset));
    background-color: #FFFFFF; /* White background for mobile menu */
    flex-direction: column;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  }

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

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

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  .nav-link:last-child {
    border-bottom: none;
  }
  .nav-link::after {
    display: none; /* Disable underline effect on mobile */
  }

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

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

  /* Prevent horizontal scroll for page content */
  .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-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-col {
    flex: 1 1 100%;
    text-align: center;
  }
  .footer-col ul {
    text-align: center;
  }
  .footer-nav li {
    display: inline-block;
    margin: 0 5px;
  }
  .footer-nav a {
    font-size: 13px;
  }
  .footer-bottom {
    font-size: 12px;
  }
}

/* No scroll for body when 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;
  }
}
