:root {
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #8B0000; /* Dark Red */
  --header-bg-top: #1a1a1a; /* Very dark grey */
  --header-bg-nav: #2a2a2a; /* Darker grey */
  --footer-bg: #1a1a1a; /* Very dark grey */
  --text-color-light: #f0f0f0;
  --text-color-dark: #333;

  --header-offset: 110px; /* Desktop: header-top (approx 60px) + main-nav (approx 50px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: header-top (approx 55px) + mobile-nav-buttons (approx 55px) */
  }
}

/* Base styles */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-color-light);
  background-color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-offset); /* Apply header offset to body */
}

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

a:hover {
  color: var(--secondary-color);
}

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--header-bg-top); /* Default for fixed header */
}

.header-top {
  background-color: var(--header-bg-top);
  padding: 10px 0; /* Vertical padding for desktop header-top */
  min-height: 40px; /* Base height for header-top content */
  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; /* Desktop padding */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure logo is visible on desktop */
  white-space: nowrap;
}

.logo:hover {
  color: var(--secondary-color);
}

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

.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown on mobile */
  background-color: var(--header-bg-nav);
  padding: 10px 20px;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

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

.btn-register {
  background-color: var(--primary-color);
  color: var(--text-color-dark); /* Dark text for gold button for contrast */
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

.btn-register:hover {
  background-color: #e6c200; /* Slightly darker gold */
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.6);
}

.btn-login {
  background-color: var(--secondary-color);
  color: var(--text-color-light); /* Light text on dark red for contrast */
  box-shadow: 0 4px 10px rgba(139, 0, 0, 0.4);
}

.btn-login:hover {
  background-color: #a00000; /* Slightly darker red */
  box-shadow: 0 6px 15px rgba(139, 0, 0, 0.6);
}

.main-nav {
  background-color: var(--header-bg-nav);
  padding: 10px 0; /* Vertical padding for desktop main-nav */
  min-height: 30px; /* Base height for main-nav content */
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  width: 100%;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center; /* Center nav links on desktop */
  align-items: center;
  padding: 0 20px; /* Desktop padding */
}

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

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(255, 215, 0, 0.1); /* Light gold background on hover/active */
}

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

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

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

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

.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 */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--text-color-light);
  padding: 40px 0 20px;
  font-size: 14px;
}

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

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 20px;
  padding-right: 20px;
}

.footer-section:last-child {
  padding-right: 0;
}

.footer-title {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.site-footer p {
  margin-bottom: 10px;
  color: #ccc;
}

.site-footer ul li a {
  color: #ccc;
  transition: color 0.3s ease;
  display: block;
  padding: 3px 0;
}

.site-footer ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-container, .nav-container, .site-footer .footer-container {
    width: 100%;
    max-width: none; /* Important: remove max-width for mobile containers */
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Header mobile adjustments */
  .header-top {
    padding: 10px 0;
    min-height: 55px; /* Adjust height for mobile */
  }

  .header-container {
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    order: 0; /* Place to the left */
  }

  .logo {
    order: 1; /* Place logo in the middle */
    flex: 1; /* Allow logo to take available space */
    text-align: center; /* Center text logo */
    font-size: 24px;
    padding: 0 10px; /* Give some space around the logo text */
  }

  /* Placeholder for the right side of header-top to balance logo */
  .header-container::after {
    content: '';
    display: block;
    width: 30px; /* Same width as hamburger for visual balance */
    order: 2;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    padding: 10px 15px; /* Mobile padding */
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center the two buttons */
    min-height: 55px; /* Adjust height for mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .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 for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Start below the visible header */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--header-bg-nav);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    align-items: flex-start; /* Align links to the left */
    overflow-y: auto; /* Allow scrolling for long menus */
  }

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

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

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

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

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

  .footer-section {
    min-width: unset;
    padding-right: 0;
  }

  .footer-title {
    margin-top: 20px;
  }
  
  /* Mobile content overflow prevention */
  .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;
  }
}
