:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --color-register: #C30808;
  --color-login: #C30808;
  --color-background: #FFFFFF;
  --color-register-login-font: #FFFF00;

  /* Neon colors derived from primary/secondary, ensuring vibrancy and contrast */
  --neon-primary: #00FF00; /* Bright Electric Green */
  --neon-secondary: #FFFF00; /* Bright Yellow */
  --neon-accent: #FF00FF; /* Vibrant Magenta */
  --neon-dark-bg-1: #0a0a0a;
  --neon-dark-bg-2: #1a1a2e;
  --neon-dark-bg-3: #16213e;

  --header-offset: 155px; /* Desktop: Marquee (45px) + Header Top (60px) + Main Nav (50px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 155px; /* Mobile: Marquee (45px) + Header Top (60px) + Mobile Buttons (50px) */
  }
}

/* Animations for dynamic neon effects */
@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    box-shadow: 
      0 0 10px currentColor,
      0 0 20px currentColor,
      0 0 30px currentColor,
      inset 0 0 15px currentColor;
  }
  20%, 24%, 55% {
    opacity: 0.8;
    box-shadow: 
      0 0 5px currentColor,
      0 0 10px currentColor,
      0 0 15px currentColor,
      inset 0 0 10px currentColor;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 
      0 0 5px currentColor,
      0 0 10px currentColor;
  }
  50% {
    box-shadow: 
      0 0 15px currentColor,
      0 0 30px currentColor,
      0 0 45px currentColor;
  }
}

@keyframes rainbow-border {
  0% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
  16.6% { border-color: #ff8000; box-shadow: 0 0 10px #ff8000, 0 0 20px #ff8000; }
  33.3% { border-color: #ffff00; box-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00; }
  50% { border-color: #00ff00; box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
  66.6% { border-color: #0000ff; box-shadow: 0 0 10px #0000ff, 0 0 20px #0000ff; }
  83.3% { border-color: #8000ff; box-shadow: 0 0 10px #8000ff, 0 0 20px #8000ff; }
  100% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
}

@keyframes theme-colors {
  0%, 100% {
    border-color: var(--neon-primary);
    box-shadow: 
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
  33% {
    border-color: var(--neon-secondary);
    box-shadow: 
      0 0 10px var(--neon-secondary),
      0 0 20px var(--neon-secondary);
  }
  66% {
    border-color: var(--neon-accent);
    box-shadow: 
      0 0 10px var(--neon-accent),
      0 0 20px var(--neon-accent);
  }
}

@keyframes text-glow-flow {
  0% {
    text-shadow: 
      0 0 5px var(--neon-primary),
      0 0 10px var(--neon-primary),
      0 0 15px var(--neon-primary);
    color: var(--secondary-color);
  }
  50% {
    text-shadow: 
      0 0 5px var(--neon-secondary),
      0 0 10px var(--neon-secondary),
      0 0 15px var(--neon-secondary);
    color: var(--secondary-color);
  }
  100% {
    text-shadow: 
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      0 0 15px var(--neon-accent);
    color: var(--secondary-color);
  }
}

/* Marquee Section */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--neon-dark-bg-1), var(--neon-dark-bg-2), var(--neon-dark-bg-3));
  color: var(--secondary-color);
  overflow: hidden;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite;
  box-shadow: 
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 20px rgba(0, 255, 0, 0.1); /* Green glow for marquee */
  z-index: 1001;
  height: 45px; /* Fixed height for calculation */
}

.marquee-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
  height: 100%; /* Ensure content fills height */
}

.marquee-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; /* Smaller icon */
  height: 24px;
  z-index: 2;
  position: relative;
}

.marquee-icon-emoji {
  font-size: 20px; /* Smaller font size */
  display: inline-block;
  animation: marquee-pulse 2s ease-in-out infinite, text-glow-flow 3s ease-in-out infinite alternate;
  text-shadow: 
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes marquee-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.marquee-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.marquee-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
  gap: 30px;
  height: 100%;
  line-height: 24px; /* Adjust line-height to center text vertically */
}

.marquee-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  text-decoration: none;
  text-shadow: 
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
  animation: text-glow-flow 3s ease-in-out infinite alternate;
  cursor: pointer;
  transition: all 0.3s ease;
}

.marquee-text:hover {
  text-shadow: 
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    0 0 40px var(--neon-primary);
  transform: scale(1.05);
  color: var(--secondary-color);
}

.marquee-separator {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  text-shadow: 
    0 0 3px var(--neon-primary),
    0 0 6px var(--neon-primary);
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Header Section */
.site-header {
  position: fixed;
  top: var(--marquee-height, 45px); /* Position below marquee */
  left: 0;
  width: 100%;
  z-index: 1000;
  color: var(--secondary-color);
  min-height: 110px; /* Base height for header-top + main-nav */
}

.header-top {
  background: linear-gradient(135deg, var(--neon-dark-bg-1), var(--neon-dark-bg-2));
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic green glow for header-top */
  box-shadow: 
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    inset 0 0 10px rgba(0, 255, 0, 0.1);
  padding: 10px 0;
  height: 60px; /* Fixed height for calculation */
  display: flex; /* For mobile hamburger/logo alignment */
  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;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* LOGO is NOT neon */
  text-decoration: none;
  transition: color 0.3s ease;
  display: block; /* Default for desktop */
}

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

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

.btn {
  position: relative;
  padding: 12px 20px;
  color: var(--color-register-login-font); /* Use specific font color for buttons */
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  font-weight: bold;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
  background: linear-gradient(45deg, var(--color-register), var(--color-login)); /* Use specific button colors */
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic glow for buttons */
  text-shadow: 
    0 0 5px var(--secondary-color),
    0 0 10px var(--color-register-login-font); /* Font color glow */
}

.btn:hover {
  animation-duration: 2s;
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 15px rgba(0, 255, 0, 0.2);
}

.main-nav {
  background: linear-gradient(135deg, var(--neon-dark-bg-3), var(--neon-dark-bg-1)); /* Different dark bg for nav */
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite reverse; /* Different glow animation/color for nav */
  box-shadow: 
    0 0 10px var(--neon-secondary), /* Yellow glow for nav */
    0 0 20px var(--neon-secondary),
    inset 0 0 10px rgba(255, 255, 0, 0.1);
  width: 100%;
  display: flex; /* Default desktop display */
  height: 50px; /* Fixed height for calculation */
}

.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  height: 100%;
}

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

.nav-link:hover {
  color: var(--neon-primary); /* Green hover */
  text-shadow: 0 0 5px var(--neon-primary);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 25px;
  cursor: pointer;
  position: relative;
  z-index: 1002; /* Above logo on mobile */
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 5px var(--neon-accent); /* Neon glow for hamburger */
}

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

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

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

.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  justify-content: center;
  gap: 10px;
  padding: 10px 15px;
  background: linear-gradient(135deg, var(--neon-dark-bg-2), var(--neon-dark-bg-3));
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic glow for mobile buttons */
  box-shadow: 
    0 0 8px var(--neon-primary),
    0 0 15px var(--neon-primary),
    inset 0 0 8px rgba(0, 255, 0, 0.1);
  height: 50px; /* Fixed height for calculation */
}

.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; /* Below mobile menu, above content */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

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

/* Footer Section */
.site-footer {
  background: #1a1a1a; /* Regular dark background, no neon */
  color: #cccccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

.footer-top-section,
.footer-middle-section,
.footer-bottom-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-top-section {
  padding-bottom: 30px;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.footer-col h4 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: bold;
}

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

.footer-description {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.payment-icons,
.game-providers-icons,
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px; /* Consistent gap for all icon sections */
  width: 100%;
}

.payment-icons img,
.game-providers-icons img,
.social-media-icons img {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

.footer-middle-section {
  padding: 20px 20px 30px;
  border-top: 1px solid #333333;
  border-bottom: 1px solid #333333;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-providers-section,
.social-media-section {
  width: 100%;
}

.footer-bottom-section {
  padding-top: 20px;
  text-align: center;
}

.footer-bottom-section .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.copyright-info {
  margin: 0;
  flex-grow: 1;
  text-align: left;
}

.footer-legal-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
  justify-content: flex-end;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Marquee Mobile */
  .marquee-section {
    height: 40px; /* Smaller height on mobile */
  }
  .marquee-container {
    padding: 0px 10px;
    gap: 10px;
  }
  .marquee-icon {
    width: 20px;
    height: 20px;
  }
  .marquee-icon-emoji {
    font-size: 14px;
  }
  .marquee-text {
    font-size: 13px;
  }
  .marquee-separator {
    font-size: 13px;
    margin: 0 8px;
  }
  .marquee-content {
    gap: 15px;
    animation: marquee-scroll 25s linear infinite;
    line-height: 20px;
  }

  /* Header Mobile */
  .site-header {
    min-height: auto;
    top: var(--marquee-height, 40px); /* Adjust top for smaller marquee */
  }
  .header-top {
    height: 60px; /* Fixed height for calculation */
    padding: 0 15px; /* Adjust padding */
    justify-content: space-between; /* Ensure space between hamburger and logo */
  }
  .header-container {
    padding: 0; /* Remove container padding as header-top has it */
    width: 100%;
    max-width: none; /* Ensure full width */
    justify-content: space-between; /* Keep space-between for hamburger and logo */
  }
  .hamburger-menu {
    display: flex; /* Show on mobile */
    margin-right: 0; /* Remove any explicit right margin */
  }
  .logo {
    flex: 1 !important; /* Allow logo to take up available space */
    display: flex !important; /* Make logo itself a flex container */
    justify-content: center !important; /* Center its content (the text "TRANG CACUOC UY TIN") */
    align-items: center !important;
    font-size: 22px; /* Adjust font size */
  }
  .desktop-nav-buttons {
    display: none; /* Hide on mobile */
  }
  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    flex-wrap: nowrap; /* Prevent wrapping */
    height: 50px; /* Fixed height for calculation */
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    text-align: center;
  }
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below header and mobile buttons */
    left: 0;
    width: 250px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background: linear-gradient(135deg, var(--neon-dark-bg-3), var(--neon-dark-bg-1));
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Slide out */
    transition: transform 0.3s ease-in-out;
    border: none; /* Remove borders from desktop */
    animation: none; /* No animation for mobile nav */
    z-index: 1000; /* Ensure it's above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }
  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    height: auto; /* Auto height for content */
  }
  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 15px;
  }
  .nav-link:last-child {
    border-bottom: none;
  }
  .mobile-menu-overlay {
    top: var(--header-offset); /* Position below header and mobile buttons */
    height: calc(100% - var(--header-offset));
  }

  /* Footer Mobile */
  .site-footer {
    padding: 30px 0 15px;
  }
  .footer-container {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 25px;
  }
  .footer-bottom-section .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .copyright-info {
    text-align: center;
    width: 100%;
  }
  .footer-legal-nav {
    justify-content: center;
    width: 100%;
  }

  /* Mobile 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
