/* Variables for colors and header offset */
:root {
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --login-button-color: #EA7C07; /* Orange */
  --text-color: #000000; /* Black */
  --dark-blue-bg: #1A7BB0; /* Darker shade for header-top */
  --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) */
  }
}

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

a {
  text-decoration: none;
  color: var(--primary-color);
}

a:hover {
  color: #1A7BB0; /* Darker primary for hover */
}

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

.btn-register {
  background-color: var(--login-button-color);
  color: var(--secondary-color);
}

.btn-register:hover {
  background-color: #D46A00; /* Darker orange */
}

.btn-login {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.btn-login:hover {
  background-color: #1A7BB0; /* Darker primary */
}

/* 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, specific sections will override */
  box-sizing: border-box; /* Ensure padding/border don't cause overflow */
  overflow-x: hidden; /* Prevent horizontal scroll within header */
}

.header-top {
  background-color: var(--dark-blue-bg); /* Darker blue background for top bar */
  padding: 10px 0; /* Vertical padding for the top bar */
  min-height: 40px; /* Minimum height for content */
  display: flex; /* Ensure flex behavior */
  align-items: center; /* Vertically align items */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Padding for logo and buttons from container edges */
  width: 100%; /* Take full width of parent (header-top) */
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White logo text on dark blue background */
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

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

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above other header elements */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color); /* White lines */
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

/* Mobile nav buttons (hidden on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden by default, shown on mobile */
}

/* Main Navigation (Desktop) */
.main-nav {
  background-color: var(--secondary-color); /* White background for nav bar */
  padding: 10px 0; /* Vertical padding for the nav bar */
  min-height: 30px; /* Minimum height for content */
  display: flex; /* Display as flex by default for desktop */
  justify-content: center; /* Center nav links */
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Horizontal layout for desktop */
  justify-content: center;
  align-items: center;
  padding: 0 20px; /* Padding for nav links from container edges */
  width: 100%; /* Take full width of parent (main-nav) */
  box-sizing: border-box;
  flex-wrap: wrap; /* Allow wrapping if many links */
  gap: 15px; /* Spacing between nav links */
}

.nav-link {
  color: var(--text-color); /* Black text on white background */
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap; /* Prevent wrapping for individual links */
}

.nav-link:hover {
  color: var(--primary-color);
}

/* 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); /* Semi-transparent black */
  z-index: 998; /* Below menu, above page content */
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Footer Styles */
.site-footer {
  background-color: var(--dark-blue-bg); /* Dark blue background for footer */
  color: var(--secondary-color); /* White text */
  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; /* Minimum width for columns before wrapping */
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  display: block;
}

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

.footer-col p,
.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.footer-col ul li a {
  color: var(--secondary-color);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-col ul li a:hover {
  opacity: 1;
  color: var(--primary-color); /* Hover effect for footer links */
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.8;
}

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

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

  .site-header {
    min-height: auto; /* Allow height to adjust */
  }

  .header-top {
    padding: 10px 0; /* Consistent padding */
  }

  .header-container {
    padding: 0 15px; /* Smaller horizontal padding for mobile */
    width: 100%;
    max-width: none; /* Crucial: remove max-width for mobile containers */
    justify-content: space-between; /* Space out hamburger and logo */
  }

  .logo {
    flex: 1; /* Allow logo to take available space for centering */
    display: flex;
    justify-content: center; /* Center the text logo */
    align-items: center;
    font-size: 20px;
    white-space: normal; /* Allow logo text to wrap if too long */
    text-align: center; /* For text inside flex item */
    min-width: 0; /* Prevent overflow if text is too long */
  }
  
  /* Ensure the hamburger menu and logo are properly positioned */
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place hamburger first */
    margin-right: auto; /* Push logo to center */
    color: var(--secondary-color); /* Keep white for visibility */
  }

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

  /* Mobile Nav Buttons - MUST BE VISIBLE & BELOW HEADER-TOP */
  .mobile-nav-buttons {
    display: flex !important; /* Force display on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the button bar */
    overflow: hidden; /* Prevent horizontal overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background-color: var(--primary-color); /* Background for the button bar */
    justify-content: center; /* Center buttons if less than 2 */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile - hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + buttons */
    left: 0;
    width: 70%; /* Adjust width as needed for slide-out menu */
    max-width: 300px; /* Max width for mobile menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--secondary-color); /* White background for menu */
    flex-direction: column; /* Vertical layout for mobile */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    z-index: 999; /* Below overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to the left */
    padding: 20px 15px; /* Padding for mobile menu items */
    gap: 10px; /* Spacing between mobile nav links */
    width: 100%;
    max-width: none; /* Remove max-width for mobile containers */
  }

  .nav-link {
    width: 100%; /* Full width for mobile links */
    padding: 10px 0;
    border-bottom: 1px solid #eee; /* Separator for mobile links */
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Hamburger menu animation */
  .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);
  }

  /* Footer */
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-col {
    min-width: auto;
    width: 100%;
  }

  .footer-bottom {
    margin-top: 20px;
  }
}

/* No Scroll for Body */
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;
  }
}
