/* Global Reset & Body Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #FFFFFF; /* Custom background color */
}

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

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

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

/* Site Header - Fixed & Suspended */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: #FFFFFF; /* Default background, will be overridden by header-top and main-nav */
  box-sizing: border-box; /* Ensure padding doesn't add to total width */
  overflow-x: hidden; /* Prevent horizontal scroll from header itself */
}

/* Header Top Section (Desktop: Logo + Buttons, Mobile: Hamburger + Logo) */
.header-top {
  background-color: #017439; /* Primary color for header top */
  padding: 15px 0; /* Vertical padding */
  color: #FFFFFF;
}

.header-top .header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Horizontal padding for content */
  height: 60px; /* Fixed height for desktop header-top */
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  display: block; /* Ensure it's not hidden */
}

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

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  background-color: #017439; /* Same as header-top */
  padding: 10px 20px; /* Vertical & horizontal padding */
  box-sizing: border-box;
}

/* Buttons General Style */
.btn {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap; /* Prevent text wrap on desktop */
  text-align: center;
  border: none;
}

.btn-register, .btn-login {
  background-color: #C30808; /* Custom Register/Login button color */
  color: #FFFF00; /* Custom Register/Login font color */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-register:hover, .btn-login:hover {
  background-color: #a00606; /* Slightly darker on hover */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Main Navigation (Desktop: Menu, Mobile: Hidden/Sidebar) */
.main-nav {
  background-color: #005f2e; /* A slightly darker green for main nav, contrasting with header-top */
  padding: 10px 0; /* Vertical padding */
  display: flex; /* Desktop default: flex */
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 40px; /* Fixed height for desktop main-nav */
}

.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px; /* Horizontal padding for content */
  flex-wrap: wrap; /* Allow menu items to wrap on smaller desktop screens if needed */
  gap: 20px; /* Spacing between nav links */
}

.nav-link {
  color: #FFFFFF;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
}

.nav-link:hover {
  color: #FFD700; /* Gold-like color on hover */
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001;
  margin-right: 15px; /* Spacing from logo */
  order: 1; /* For mobile flex order */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 8px; }
.hamburger-menu span:nth-child(3) { top: 16px; }

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 8px;
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 8px;
}

/* Mobile Menu Overlay (hidden on desktop) */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Footer Styles */
.site-footer {
  background-color: #017439; /* Primary color for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.site-footer .footer-col {
  flex: 1;
  min-width: 250px;
}

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

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

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

.site-footer ul li a {
  color: #FFFFFF;
  transition: color 0.3s ease;
}

.site-footer ul li a:hover {
  color: #FFD700; /* Gold-like color on hover */
}

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

.site-footer .footer-bottom p {
  margin: 0;
  color: #FFFFFF;
}

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

  /* Prevent horizontal scroll for mobile 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;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .header-top {
    padding: 10px 0; /* Smaller vertical padding */
    height: 50px; /* Fixed height for mobile header-top */
  }

  .header-top .header-container {
    padding: 0 15px; /* Smaller horizontal padding */
    width: 100%; /* Occupy full width */
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Hamburger left, Logo center, empty right */
    position: relative; /* For logo absolute positioning */
    min-height: 50px; /* Ensure height for logo */
  }

  /* Hamburger Menu visible on mobile */
  .hamburger-menu {
    display: block;
    margin-right: 0; /* Adjust margin for proper spacing */
    order: 1; /* Place it first */
  }

  /* Logo Centering on Mobile */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
    font-size: 20px; /* Smaller font size */
    order: 2; /* Place it second */
  }

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

  /* Mobile buttons visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Force display on mobile */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Adjust padding for mobile */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    justify-content: center; /* Center buttons if only one, or distribute if two */
    height: 50px; /* Fixed height for mobile buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    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 for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure long words break */
    overflow-wrap: break-word; /* Standard property for word break */
  }

  /* Main Navigation (Mobile: hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 250px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #004d26; /* Darker background for mobile menu */
    flex-direction: column; /* Vertical menu */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Enable scrolling for long menus */
    justify-content: flex-start; /* Align items to top */
  }

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

  .main-nav .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 20px 15px;
    max-width: none; /* No max-width */
    width: 100%;
    align-items: flex-start; /* Align links to left */
    gap: 15px; /* Spacing between nav links */
  }

  .nav-link {
    width: 100%; /* Full width for mobile links */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator */
  }

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

  /* Footer Responsive */
  .site-footer .footer-container {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
  }

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

  /* Empty div to balance hamburger menu in header-top on mobile */
  .header-top .header-container::after {
    content: "";
    width: 30px; /* Same width as hamburger menu */
    height: 20px; /* Same height as hamburger menu */
    order: 3; /* Place it last */
  }
}

/* Hide mobile-specific elements on desktop */
@media (min-width: 769px) {
  .hamburger-menu { display: none; }
  .mobile-menu-overlay { display: none; }
  .mobile-nav-buttons { display: none; }
}

/* 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;
  }
}
