:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --button-register-bg: #C30808;
    --button-login-bg: #C30808;
    --button-text-color: #FFFF00;
    --header-top-bg: #014D2A; /* Darker green for header top */
    --main-nav-bg: #017439; /* Primary green for main nav */
    --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

/* Base styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding-top: var(--header-offset);
    background-color: var(--secondary-color); /* Page background */
    color: #333;
    overflow-x: hidden;
}

/* 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);
    background-color: var(--header-top-bg); /* Default background, overridden by specific sections */
    transition: transform 0.3s ease;
}

.header-top {
    background-color: var(--header-top-bg);
    padding: 10px 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    height: 60px; /* Fixed height for desktop calculation */
    box-sizing: border-box;
}

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

.logo {
    color: var(--secondary-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

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

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
}

.btn-register {
    background-color: var(--button-register-bg);
    color: var(--button-text-color);
}

.btn-register:hover {
    background-color: #A00707;
    transform: translateY(-2px);
}

.btn-login {
    background-color: var(--button-login-bg);
    color: var(--button-text-color);
}

.btn-login:hover {
    background-color: #A00707;
    transform: translateY(-2px);
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    order: 0; /* Ensures it's on the left */
    position: relative;
}

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

.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);
}

.main-nav {
    background-color: var(--main-nav-bg);
    padding: 10px 0;
    display: flex; /* Desktop default: flex */
    flex-direction: row; /* Desktop default: row */
    justify-content: center;
    align-items: center;
    min-height: 30px;
    position: static; /* Desktop default: static */
    height: 50px; /* Fixed height for desktop calculation */
    box-sizing: border-box;
}

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

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

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
    opacity: 0;
}

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

/* Footer */
.site-footer {
    background-color: #222;
    color: #eee;
    padding: 40px 0 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: 0 20px;
}

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

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

.footer-col p {
    margin-bottom: 15px;
}

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

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

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

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

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

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

/* Responsive */
@media (max-width: 1200px) {
    .header-container, .nav-container, .footer-container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    /* Body overflow 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;
    }

    .header-top {
        padding: 5px 0;
        min-height: 40px;
        height: 50px; /* Fixed height for mobile calculation */
    }
    .header-container {
        padding: 0 15px;
        width: 100%;
        max-width: none; /* Ensure it takes full width */
        justify-content: space-between;
    }
    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 24px;
        order: 1; /* Center the logo */
    }
    /* If .logo was an img, this would apply */
    .logo img {
      display: block !important;
      max-width: 100%;
      height: auto;
      max-height: 40px;
    }
    .desktop-nav-buttons {
        display: none; /* Hide desktop buttons */
    }
    .hamburger-menu {
        display: block;
        order: 0; /* Place hamburger on left */
    }

    .mobile-nav-buttons {
        display: flex !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: var(--header-top-bg); /* Match header top background */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        height: 50px; /* Fixed height for mobile calculation */
    }
    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Account for gap */
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }

    .main-nav {
        display: none; /* Hidden by default */
        flex-direction: column;
        position: fixed; /* Mobile: fixed */
        top: var(--header-offset);
        left: 0;
        width: 280px;
        height: calc(100% - var(--header-offset));
        background-color: #2c3e50; /* Darker background for mobile menu */
        transform: translateX(-100%); /* Off-screen by default */
        transition: transform 0.3s ease;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        z-index: 999;
        padding: 0; /* Reset padding for mobile menu */
        height: auto; /* Allow content to define height */
    }

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

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 15px;
        width: 100%;
        max-width: none; /* Ensure it takes full width */
    }

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

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

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-col {
        max-width: 100%;
        min-width: unset;
    }
    .footer-col h3 {
        margin-top: 20px;
    }
}

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