:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --background-color: #FFFFFF;
  --text-color-dark: #000000;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

html {
  scroll-behavior: smooth;
  font-family: Arial, sans-serif;
  color: #333;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: var(--background-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Base Container */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.2;
}

.btn-register {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  box-shadow: 0 4px 8px rgba(38, 169, 224, 0.3);
}

.btn-register:hover {
  background-color: #1a8cc2; /* Darker shade of primary */
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(38, 169, 224, 0.4);
}

.btn-login {
  background-color: var(--login-button-color);
  color: var(--secondary-color);
  box-shadow: 0 4px 8px rgba(234, 124, 7, 0.3);
}

.btn-login:hover {
  background-color: #c96a06; /* Darker shade of login color */
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(234, 124, 7, 0.4);
}

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

.site-header .header-top {
  background-color: #000000; /* Dark background for top bar */
  min-height: 60px; 
  display: flex;
  align-items: center;
}

.site-header .header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-header .logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
  padding: 10px 0;
}

.site-header .desktop-nav-buttons {
  display: flex; /* Desktop default */
  gap: 10px;
  align-items: center;
}

.site-header .main-nav {
  background-color: var(--primary-color); /* Primary color for nav bar */
  min-height: 50px; 
  display: flex; /* Desktop default */
  flex-direction: row; /* Desktop default */
  align-items: center;
  justify-content: center;
  position: static; /* Desktop default */
  width: 100%;
}

.site-header .main-nav .nav-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on smaller desktop screens */
  gap: 20px;
  padding: 10px 20px;
}

.site-header .nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.site-header .nav-link:hover {
  color: #c9e8f7; /* Lighter shade of secondary */
}

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

.hamburger-menu .bar {
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px 0;
  transition: 0.4s;
}

/* Mobile specific elements (Hidden on Desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown by media query */
}

.mobile-menu-overlay {
  display: none; /* Hidden on desktop, shown by media query */
}

/* Footer */
.site-footer {
  background-color: #1a1a1a; /* Dark background for footer */
  color: #ccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  margin-top: auto; /* Push footer to bottom */
}

.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.site-footer .footer-col {
  flex: 1;
  min-width: 250px;
  max-width: 30%; /* Adjust for 3 columns */
}

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

.site-footer .footer-col p {
  line-height: 1.6;
}

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

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

.site-footer .footer-nav a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

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


/* Media Queries for Mobile */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: header-top (60px) + mobile-nav-buttons (50px) */
  }

  /* Body overflow protection for mobile */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .header-container, .nav-container, .footer-container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: none; /* Important for mobile */
    width: 100%;
  }

  .site-header .header-top .header-container {
    justify-content: flex-start; /* Align hamburger to left, logo will be absolutely positioned */
    position: relative; /* For logo absolute positioning */
    min-height: 60px; /* Ensure enough space */
  }

  .hamburger-menu {
    display: block;
    order: -1; /* Place it at the beginning */
    position: relative;
    z-index: 1002; /* Above logo and overlay */
  }

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

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

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

  .site-header .logo {
    position: absolute !important; /* Force logo centering */
    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 */
    font-size: 24px;
    padding: 0; /* Remove padding that might affect centering */
    height: 100%; /* Take full height of header-top for vertical alignment */
  }

  .site-header .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; /* Adjust padding for mobile */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #333; /* A contrasting background for mobile buttons */
  }

  .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 */
    font-size: 13px; /* Smaller font size */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .site-header .main-nav {
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column; /* Vertical layout */
    position: fixed; /* Fixed position for off-canvas menu */
    top: var(--header-offset); /* Start below header & mobile buttons */
    left: 0;
    width: 80%; /* Adjust width as needed */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: #222; /* Dark background for mobile menu */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Off-canvas */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1001; /* Above overlay */
    align-items: flex-start; /* Align menu items to the left */
    padding-top: 15px;
    padding-bottom: 15px;
  }

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

  .site-header .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0; /* Remove gap for vertical list */
    width: 100%;
    padding: 0 15px;
  }

  .site-header .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #333;
    color: var(--secondary-color);
  }

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

  .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);
    z-index: 999;
  }

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

  .site-footer .footer-container {
    flex-direction: column;
    align-items: center;
  }

  .site-footer .footer-col {
    max-width: 100%;
    text-align: center;
    min-width: unset;
  }

  .site-footer .footer-col h3 {
    text-align: center;
  }

  .site-footer .footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .site-footer .footer-nav li {
    margin-bottom: 0;
  }
}

/* Ensure color contrast for buttons */
.btn-register, .btn-login {
  color: var(--secondary-color); /* White text on colored background */
}
/* 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;
  }
}
