:root {
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #8B0000; /* Dark Red */
  --text-color-dark: #333;
  --text-color-light: #fff;
  --bg-dark: #1a1a1a;
  --bg-medium-dark: #2a2a2a;
  --header-offset: 100px; /* Desktop: header-top (~60px) + main-nav (~40px) */
}

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

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-color-dark);
  padding-top: var(--header-offset); /* Apply offset to body */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-dark); /* Dark background for the whole header */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  color: var(--text-color-light);
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent header content overflow */
}

.header-top {
  background-color: var(--secondary-color); /* Dark Red for top bar */
  padding: 15px 0;
  min-height: 30px; /* Ensure minimum 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 20px; /* Padding for desktop container */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color); /* Gold logo text */
  text-decoration: none;
  display: inline-block; /* Ensure it's not hidden */
}

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

.btn {
  padding: 10px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--primary-color); /* Gold button */
  color: var(--text-color-dark);
  border: 2px solid var(--primary-color);
}

.btn-primary:hover {
  background-color: #e6c200; /* Darken gold on hover */
  color: var(--text-color-dark);
}

.btn-secondary {
  background-color: var(--secondary-color); /* Dark red button */
  color: var(--text-color-light);
  border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #7a0000; /* Darken red on hover */
  color: var(--text-color-light);
}

.main-nav {
  background-color: var(--primary-color); /* Gold for main nav bar */
  padding: 10px 0;
  display: flex; /* Desktop default: flex */
  position: static; /* Desktop default: static */
  min-height: 20px; /* Ensure minimum height */
  align-items: center;
}

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

.nav-link {
  color: var(--text-color-dark);
  text-decoration: none;
  padding: 8px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  z-index: 1001; /* Above other header elements */
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary-color); /* Gold lines */
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

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

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

.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 */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer styles */
.site-footer {
  background-color: var(--bg-dark); /* Dark background for footer */
  color: #ccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-col h3 {
  color: var(--primary-color); /* Gold headings */
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color); /* Gold logo text */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

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

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

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: var(--primary-color); /* Gold on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #aaa;
}

/* Mobile styles */
@media (max-width: 768px) {
  .site-header {
    min-height: var(--header-offset); /* Ensure header has enough height */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* Full width for mobile container */
    width: 100%;
    position: relative; /* For logo centering */
    padding-right: 15px; /* Ensure consistent padding */
  }

  .header-top {
    justify-content: space-between; /* Hamburger left, Logo center */
    padding: 10px 0; /* Reduced padding for mobile top bar */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Place it first */
    margin-right: 15px; /* Space between hamburger and logo */
  }

  .logo {
    order: 2; /* Place logo second */
    flex: 1; /* Allow logo to take available space */
    display: flex !important; /* Force flex for centering */
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    font-size: 24px;
    position: absolute; /* Absolute positioning for better centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
  }
  
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for mobile button area */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--bg-medium-dark); /* Slightly lighter dark background */
    justify-content: center;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit with gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Ensure text breaks */
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    position: fixed;
    top: 0; /* Align to top of viewport */
    left: 0;
    width: 250px; /* Sidebar width */
    height: 100%;
    background-color: var(--bg-dark); /* Dark background for mobile menu */
    flex-direction: column; /* Vertical menu */
    padding-top: var(--header-offset); /* Push menu content below fixed header */
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    z-index: 1000; /* Ensure it's above content */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    max-width: none; /* Full width for mobile container */
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color-light); /* Light text for dark background */
  }

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

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

  .footer-col {
    min-width: unset; /* Remove min-width constraint */
    width: 100%;
    text-align: center;
  }

  .footer-col h3 {
    margin-top: 20px;
  }

  .footer-col ul {
    text-align: center;
  }

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }

  /* Prevent content images from overflowing */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: 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;
  }
}
