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

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

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-color: #EA7C07;
  --dark-grey: #333333;
  --darker-blue: #1a7ea3; /* For footer */
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

.header-top {
  background-color: var(--dark-grey); /* Dark background for top bar */
  color: var(--secondary-color);
  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 30px; /* Desktop padding */
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  white-space: nowrap;
}

.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 */
  cursor: pointer;
}

.btn-login {
  background-color: var(--login-color); /* Orange for login */
  color: var(--secondary-color);
}

.btn-register {
  background-color: var(--primary-color); /* Primary blue for register */
  color: var(--secondary-color);
}

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

.main-nav {
  background-color: var(--primary-color); /* Primary blue for main nav */
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: flex */
  align-items: center;
  position: static; /* Desktop default: static */
  width: 100%;
  box-sizing: border-box;
}

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

.nav-link {
  color: var(--secondary-color);
  padding: 15px 20px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping */
}

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

/* Hamburger menu - hidden on desktop */
.hamburger-menu {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  z-index: 1002; /* Above logo for clickability */
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  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: 11px; }
.hamburger-menu span:nth-child(3) { top: 22px; }

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

/* Mobile menu overlay - hidden on desktop */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
}

/* Footer */
.site-footer {
  background-color: var(--darker-blue); /* Darker blue for footer */
  color: var(--secondary-color);
  padding: 40px 20px 20px;
  font-size: 14px;
}

.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;
  max-width: 30%; /* For desktop layout */
}

.footer-col h3, .footer-col h4 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

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

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

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

.footer-nav a {
  color: var(--secondary-color);
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--login-color); /* Orange on hover */
}

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
  :root {
    --header-offset: 95px; /* Mobile: header-top (50px) + mobile-nav-buttons (45px) */
  }

  /* Body 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;
  }
  body.no-scroll {
    overflow: hidden;
  }

  .header-top {
    min-height: 50px; /* Mobile height */
  }

  .header-container {
    padding: 0 15px; /* Mobile padding */
    width: 100%; /* Mobile: full width */
    max-width: none; /* Mobile: no max-width */
    justify-content: space-between; /* Hamburger left, Logo center, empty space right */
  }

  .logo {
    font-size: 20px;
    flex: 1; /* Allows logo to take available space for centering */
    text-align: center; /* Center text logo */
    order: 2; /* Place logo in the middle */
    z-index: 1001; /* Ensure logo is clickable */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: 1; /* Place hamburger on the left */
    z-index: 1002; /* Ensure hamburger is above logo */
  }
  .hamburger-menu span:nth-child(1) { top: 0; }
  .hamburger-menu span:nth-child(2) { top: 9px; } /* Adjust for mobile height */
  .hamburger-menu span:nth-child(3) { top: 18px; } /* Adjust for mobile height */

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

  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }
  
  /* Mobile Nav Buttons (CRITICAL) */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for mobile buttons */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--dark-grey); /* Same as header-top for consistency */
    min-height: 45px; /* Approximate height */
    justify-content: center;
    align-items: center;
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    flex-direction: column; /* Vertical menu on mobile */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Start below the header and mobile buttons */
    left: 0;
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    width: 250px; /* Sidebar width */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-out;
    background-color: var(--primary-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 9999; /* Ensure menu is above everything */
    overflow-y: auto; /* Scrollable if content is long */
  }

  .main-nav.active {
    display: flex; /* CRITICAL: Must be block/flex to show */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 20px 0;
    width: 100%; /* Mobile: full width */
    max-width: none; /* Mobile: no max-width */
    align-items: flex-start; /* Align links to the left */
  }

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

  .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); /* Semi-transparent overlay */
    z-index: 9998; /* Below menu, above content */
  }

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

  .footer-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px; /* Mobile padding */
  }

  .footer-col {
    max-width: 100%; /* Full width on mobile */
    min-width: unset;
    text-align: center;
  }
  .footer-col h3, .footer-col h4 {
    text-align: center;
  }
  .footer-nav ul {
    text-align: center;
  }
  .footer-col p {
    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;
  }
}
