:root {
  --deepblue: #000f35;
  --darkblue: #01050f;
  --lightblue: #003bd1;
  --gold: #fce87a;
  --darkgold: #B8860B;
  --white: #FFFFFF;
  --text: #F5F5F5;
  

}
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;600;700&display=swap');


* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans Thai', sans-serif;
  background-image: url('./../images/hero-bg.jpg');
  background-size: full;
  background-position: center;
  background-repeat: repeat;
  color: var(--text);
  line-height: 1.6;
}
.container { width: 90%; max-width: 1200px; margin: 0 auto; }


/* Header */
.site-header {
  position: sticky; /* or fixed if you want always-on-top */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0,0,0,0.8); /* พื้นหลังสีดำ 80% */
  color: var(--text);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  border-bottom: 1px solid var(--darkgold);
  /* AC789T: add backdrop blur for modern look */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 0.5rem 0; /* เปลี่ยนเป็น 0.5rem 0 เพื่อให้ .container จัดการ padding ด้านข้าง */
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-header .logo img { height: 40px; }
.main-nav {
  display: flex;
  align-items: center;
}
.main-nav ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  background: transparent;
  margin: 0;
  padding: 0;
  transition: max-height 0.3s, opacity 0.3s;
  max-height: none;
  opacity: 1;
  pointer-events: auto;
}
.main-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.main-nav a:hover { color: var(--gold); background: rgba(252,232,122,0.08);}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  /* ไม่ต้อง margin-left: auto; */
}

/* Hamburger toggle for mobile */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 110;
  background: none;
  border: none;
  padding: 0;
  margin-left: 0; /* ไม่ต้อง margin-left:auto; */
  margin-right: 0; /* ชิดขวาสุด */
}
.menu-toggle span {
  height: 4px;
  width: 100%;
  background: var(--gold);
  margin: 4px 0;
  border-radius: 2px;
  display: block;
  transition: 0.3s;
}

/* ปรับ header-content ให้เหมือน container จริงๆ */
.header-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  justify-content: flex-start; /* ใช้ flex-start เพื่อควบคุมตำแหน่ง hamburger ด้วย margin-left:auto */
}

/* .header-left เฉพาะโลโก้ */
.header-left {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}

/* .main-nav อยู่ตรงกลาง */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  margin-left: 2rem;
  margin-right: 2rem;
}

/* Hamburger อยู่ขวาสุดใน header-content */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 110;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto; /* ดัน hamburger ไปขวาสุด */
}

/* Desktop: ซ่อนปุ่มใน .mobile-actions */
.main-nav .mobile-actions {
  display: none;
}

/* Responsive: ซ้อนกันในแนวตั้งเมื่อจอเล็ก */
@media (max-width: 1024px) {
  .header-content {
    justify-content: flex-start; /* สำคัญ: ใช้ flex-start + margin-left:auto ที่ .menu-toggle */
    gap: 0;
  }
  .header-left {
    flex: 0 1 auto;
  }
  .main-nav {
    display: none;
    margin-left: 0;
    margin-right: 0;
  }
  .main-nav.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.95);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 99;
    padding: 1rem 0;
    animation: dropdownFade 0.2s;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-height: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transition: none;
  }
  .menu-toggle {
    display: flex;
    margin-left: auto; /* ดัน hamburger ไปขวาสุดใน header-content */
  }
  .header-actions,
  .header-right {
    display: none;
  }
  .main-nav .mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    align-items: stretch;
  }
}

/* Hamburger dropdown animation */
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-10px);}
  to { opacity: 1; transform: translateY(0);}
}

/* Buttons */
.btn {
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  transition: 0.3s;
  border: none;
  background: linear-gradient(90deg, #fce87a 0%, #B8860B 100%);
  color: var(--deepblue);
  box-shadow: 0 2px 8px rgba(13,27,61,0.08);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none; /* ป้องกัน underline */
}
.btn:hover {
  background: linear-gradient(90deg, #B8860B 0%, #fce87a 100%);
  color: var(--deepblue);
  box-shadow: 0 4px 16px rgba(13,27,61,0.12);
  text-decoration: none; /* ป้องกัน underline */
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none; /* ป้องกัน underline */
}
.btn-outline:hover {
  background: linear-gradient(90deg, #fce87a 0%, #B8860B 100%);
  color: var(--deepblue);
  border-color: var(--gold);
  text-decoration: none; /* ป้องกัน underline */
}
/* Hero */
.hero {
  width: 100%;
  overflow: hidden;
}

.hero .slider {
  display: flex;
  width: 100%;
  position: relative;
  will-change: transform;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero .slide {
  flex: 0 0 100%;
  width: 100%;
}

.hero .slide img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

@media screen and (max-width: 768px) {
  .hero .slide img {
    width: 100%; /* ปรับความสูงของภาพในมือถือ */
    object-fit: contain; /* ปรับให้ภาพเต็มพื้นที่ */
  }
  
}

/* Intro */
.intro {
    padding: 2rem;
    text-align: center;
    min-height: 40vh;
    border-top: 2px solid var(--darkgold);
    border-bottom: 2px solid var(--darkgold);
    background: var(--darkblue);
}

.intro h1 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #fce87a;
}

.stat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem 0;
}
.stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(252, 232, 122, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 59, 209, 0.3),
                0 0 40px rgba(0, 59, 209, 0.1);
    border-color: var(--lightblue);
}

/* Game Tabs Gallery */
.game-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 2rem 10rem;
  background: rgba(4, 9, 27, 0.397);
  border-radius: 12px;
  width: 100%;
}

.game-tabs h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gold);
  text-align: center;
  width: 100%;
}

/* Tabs */
.tab-navigation {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  justify-content: center;
  width: 100%;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
  font-size: 1rem;
  font-weight: 600;
}

.tab-button.active,
.tab-button:hover {
  background: var(--darkblue);
  color: var(--gold);
}

.tab-content {
  width: 100%;
}

.tab-panel {
  display: none;
  animation: fadeInTab 0.3s;
  width: 100%;
}

.tab-panel.active {
  display: block;
}

.tab-content-inner {
  width: 100%;
  padding: 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
}

.game-card {
  overflow: hidden;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .game-tabs {
    padding: 1rem 2rem;
  }
}
@media (max-width: 900px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-tabs {
    padding: 1rem 1rem;
  }
}
@media (max-width: 600px) {
  .game-tabs {
    padding: 1rem 0.25rem;
  }
  .tab-navigation {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem;
  }
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

.articles {
  display: block;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem 4vw;
  background: rgba(4, 9, 27, 0.45);
  border-bottom: 2px solid var(--darkgold);
  width: 100%;
  box-shadow: 0 4px 32px rgba(0,15,53,0.08);
}

.articles h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--gold);
  text-align: center;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: linear-gradient(135deg, rgba(0, 1, 3, 0.98) 70%, rgba(0,59,209,0.08) 100%);
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,59,209,0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid rgba(252,232,122,0.09);
  position: relative;
}

.article-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 32px rgba(25, 40, 78, 0.973), 0 2px 16px rgba(252,232,122,0.08);
}

.article-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
  background: #01050f;
}

.article-card h2 {
  color: var(--text);
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600; 
  text-align: center;
}

.article-card a {
  text-decoration: none !important;
  color: inherit;
}

.article-card-meta {
  font-size: 0.95rem;
  color: #b2b8c6;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.article-card-desc {
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  flex: 1 1 auto;
  opacity: 0.96;
  text-align: center ;
  padding: 0 1.5rem;
}

.article-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.article-card .btn {
  padding: 0.4rem 1.2rem;
  font-size: 1rem;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .articles {
    padding: 1.5rem 1rem;
    gap: 1.25rem;
  }
  .article-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .article-card img {
    object-fit: cover; /* ปรับให้ภาพเต็มพื้นที่ */
  }
}
@media (max-width: 600px) {
  .articles {
    grid-template-columns: repeat(2, 1fr);
    padding: 1rem 1rem;
    gap: 1rem;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-card-content {
    padding: 1rem;
  }
}

.why-choose-us {
  padding: 2rem;
  text-align: center;
  border-top: 2px solid var(--darkgold);
  background-color: #010716;
}

.cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.site-footer {
  background: linear-gradient(135deg, rgba(0, 1, 3, 0.98) 70%, rgba(0,59,209,0.08) 100%);
  color: var(--text);
  padding: 2.5rem 1rem 1.5rem 1rem;
  text-align: center;
  border-top: 2px solid var(--darkgold);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 32px rgba(0,15,53,0.10);
  font-size: 1.1rem;
  position: relative;
  
}
.site-footer .footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer .footer-logo {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
}

.site-footer .footer-logo img {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.site-footer .footer-links {
  flex: 2 1 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.site-footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer .footer-links a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.site-footer .footer-links a:hover {
  color: var(--white);
  background: rgba(252,232,122,0.10);
}

.site-footer .footer-social {
  flex: 1 1 120px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.site-footer .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--darkblue);
  color: var(--gold);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.site-footer .footer-social a:hover {
  background: var(--gold);
  color: var(--deepblue);
  transform: translateY(-2px) scale(1.08);
}

.site-footer .footer-bottom {
  margin-top: 2rem;
  font-size: 0.98rem;
  color: #1b1f2b;
  opacity: 0.85;
  border-top: 1px solid rgba(252,232,122,0.08);
  padding-top: 1rem;
}

.custom-footer-bottom {
  background: linear-gradient(90deg, #fce87a 0%, #534622 100%);
  text-align: center;
  padding: 1.2rem 0 0.7rem 0;
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.5px;
  width: 100vw;
  max-width: 100vw;
  left: 0;
  position: relative;
  box-sizing: border-box;
  z-index: 1;
}

.site-footer .footer-bottom a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

@media (max-width: 900px) {
  .site-footer .footer-content {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }
  .site-footer .footer-logo,
  .site-footer .footer-social {
    justify-content: center;
  }
  .site-footer .footer-links {
    justify-content: center;
    gap: 1.5rem;
  }
}