/* Universal Box-Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --header-offset: 110px; /* Desktop offset */
  --primary-color: #000000;
  --secondary-color: #FFFFFF;
  --login-btn-color: #FCBC45;
  --register-btn-color: #FFFFFF;
  --text-dark: #333333; /* For text on light backgrounds */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile offset */
  }
}

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

/* Fixed 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);
  display: flex; /* Desktop-first: flex for row layout */
  flex-direction: column; /* Stack header-top and main-nav vertically */
  background-color: transparent; /* Base, specific sections will have colors */
}

/* Header Top Section (Logo & Buttons) */
.header-top {
  background-color: var(--primary-color); /* Black */
  min-height: 60px; /* Ensure sufficient height */
  display: flex;
  align-items: center;
  padding: 10px 0; /* Vertical padding */
}

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

.site-header .logo {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--secondary-color); /* White text on black background */
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0; /* Add padding to make it clickable area larger */
  display: block; /* Ensure it's a block-level element for text alignment/flex */
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Show on desktop */
  gap: 10px; /* Space between buttons */
}

.desktop-nav-buttons .btn,
.mobile-buttons .btn {
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  display: inline-block; /* Ensure padding works */
  text-align: center;
}

.btn-login {
  background-color: var(--login-btn-color); /* #FCBC45 */
  color: var(--text-dark); /* Black text on yellowish background */
}

.btn-login:hover {
  background-color: #e0a73b; /* Slightly darker */
}

.btn-register {
  background-color: var(--register-btn-color); /* #FFFFFF */
  color: var(--text-dark); /* Black text on white background */
  border: 1px solid var(--text-dark); /* Add a subtle border for contrast */
}

.btn-register:hover {
  background-color: #f0f0f0; /* Slightly darker */
}

/* Main Navigation (Desktop) */
.main-nav {
  background-color: #1a1a1a; /* Dark grey, contrasts with black header-top */
  min-height: 50px; /* Ensure sufficient height */
  display: flex; /* Desktop-first: flex for row layout */
  align-items: center;
  padding: 10px 0; /* Vertical padding */
}

.main-nav .nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px; /* Desktop horizontal padding */
  flex-wrap: wrap; /* Allow items to wrap if screen is too small before mobile breakpoint */
}

.main-nav .nav-link {
  color: var(--secondary-color); /* White text */
  text-decoration: none;
  padding: 8px 15px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  font-weight: 500;
}

.main-nav .nav-link:hover {
  color: var(--login-btn-color); /* Yellowish hover */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above logo */
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color); /* White bars */
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
}

/* Mobile Buttons (Hidden on Desktop) */
.mobile-buttons {
  display: none; /* Hidden on desktop */
  background-color: var(--primary-color); /* Black */
  padding: 10px 20px;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
}

/* Footer Styles */
.site-footer {
  background-color: var(--primary-color); /* Black */
  color: var(--secondary-color); /* White text */
  padding: 40px 0;
  font-size: 0.9em;
  line-height: 1.8;
}

.site-footer .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px; /* Space between columns */
}

.site-footer .footer-col {
  flex: 1;
  min-width: 200px; /* Minimum width for columns */
}

.site-footer .footer-logo {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--secondary-color); /* White text */
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.site-footer h3 {
  color: var(--login-btn-color); /* Yellowish for headings */
  font-size: 1.2em;
  margin-bottom: 15px;
}

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

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

.site-footer ul li a {
  color: var(--secondary-color); /* White text */
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer ul li a:hover {
  color: var(--login-btn-color); /* Yellowish hover */
}

/* Mobile specific styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px; /* Smaller horizontal padding for mobile */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Space out hamburger, logo, etc. */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Position left */
  }

  .site-header .logo {
    order: 2; /* Center logo */
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 1.5em; /* Adjust size for mobile */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header/buttons */
    left: 0;
    width: 80%; /* Menu takes 80% width */
    max-width: none; /* No max-width on mobile */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color); /* Black background for mobile menu */
    flex-direction: column; /* Stack menu items vertically */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
  }

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

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

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

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

  /* Mobile Buttons Section */
  .mobile-buttons {
    display: flex; /* Show mobile buttons */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: center;
    padding: 10px 15px;
    gap: 10px;
    position: relative; /* Ensure it's part of normal flow and doesn't overlap header-top content */
    z-index: 990; /* Below hamburger menu, above main content */
  }

  /* Hamburger menu animation */
  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }

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

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

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

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

  /* Footer mobile adjustments */
  .site-footer .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 15px;
  }

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

  .site-footer .footer-logo {
    margin-bottom: 10px;
  }

  .site-footer h3 {
    margin-top: 25px;
  }

  .site-footer ul {
    margin-bottom: 20px;
  }

  /* Mobile Content 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 class for JS */
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;
  }
}
