:root {
  --bg: #05050c;
  --bg-deep: #000000;
  --bg-glow: #0b0a1a;
  --surface: #0f0f18;
  --surface-2: #0e4e7d;
  --primary: #0095ff;
  --primary-deep: #0855c4;
  --gold: #fcc201;
  --gold-soft: #ffe138;
  --gold-mid: #ffbb38;
  --join: #b80000;
  --join-deep: #7e0000;
  --text: #ffffff;
  --muted: #aaaaaa;
  --dark: #252525;
  --border: rgba(255, 255, 255, 0.08);
  --site: min(1600px, 98%);
  --pad-x: clamp(5px, calc(1vw - 1px), 11px);
  --font: "Noto Sans Thai", "Segoe UI", sans-serif;
  --btm-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: #000;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.72) 45%, rgba(0, 0, 0, 0.85) 100%),
    url("assets/images/site-bg.png");
  background-attachment: fixed;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--btm-h) + 12px);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

.wrap {
  margin: 0 auto;
  max-width: var(--site);
  padding: 0 var(--pad-x);
  width: 100%;
}

/* ===== HEADER ===== */
.site-header {
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 120;
}

.header-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--site);
  padding: 8px var(--pad-x);
}

.brand-logo {
  height: 42px;
  width: auto;
}

.auth-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  align-items: center;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-width: 108px;
  padding: 9px 14px;
  transition: filter 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.06); }

.btn-login {
  background: transparent;
  border: 1.5px solid #fcc201;
  border-radius: 999px;
  box-shadow: none;
  color: #fcc201;
}

.btn-login:hover {
  background: rgba(252, 194, 1, 0.12);
  filter: none;
}

.btn-join {
  background: linear-gradient(90deg, #ffe566 0%, #fcc201 45%, #c88404 100%);
  border: 1.5px solid transparent;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(252, 194, 1, 0.35);
  color: #111;
}

.btn-join:hover {
  filter: brightness(1.05);
}

.menu-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(0, 149, 255, 0.45);
  border-radius: 6px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  gap: 5px;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.menu-toggle span {
  background: var(--gold);
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: transform 0.2s, opacity 0.2s;
  width: 18px;
}

.site-header.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop text/icon nav under header */
.main-nav {
  background: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.main-nav-inner {
  display: flex;
  gap: 2px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--site);
  padding: 6px var(--pad-x) 8px;
}

.main-nav a {
  align-items: center;
  color: #ddd;
  display: flex;
  flex: 1;
  flex-direction: column;
  font-size: 0.68rem;
  font-weight: 700;
  gap: 4px;
  min-width: 64px;
  padding: 4px 4px 2px;
  text-align: center;
  transition: color 0.15s;
}

.main-nav a img {
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--gold);
}

/* ===== BANNER ===== */
.banner {
  background: transparent;
  margin: 0 auto;
  max-width: var(--site);
  padding: 0 var(--pad-x);
  position: relative;
  width: 100%;
}

.banner-slider {
  position: relative;
  width: 100%;
}

.banner-track {
  aspect-ratio: 21 / 8;
  background: #05050c;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.banner-slide {
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity 0.45s ease;
  visibility: hidden;
  width: 100%;
}

.banner-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.banner-slide a {
  display: block;
  height: 100%;
  width: 100%;
}

.banner-slide img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.banner-desktop { display: block; }
.banner-mobile { display: none; }

.banner-dots {
  bottom: 10px;
  display: flex;
  gap: 6px;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 2;
}

.banner-dots button {
  background: rgba(136, 136, 136, 0.55);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  height: 6px;
  padding: 0;
  width: 6px;
}

.banner-dots button.active {
  background: var(--gold);
  width: 16px;
}

/* ===== ANNOUNCEMENT ===== */
.announce {
  background: transparent;
  color: var(--gold);
  overflow: hidden;
}

.announce-inner {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 0 auto;
  max-width: var(--site);
  padding: 8px var(--pad-x);
}

.announce-icon {
  align-items: center;
  background: transparent;
  border-radius: 4px;
  color: var(--gold);
  display: flex;
  flex-shrink: 0;
  font-size: 0.85rem;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.announce-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.announce-text {
  animation: marquee 28s linear infinite;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  width: max-content;
}

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

/* ===== MOBILE LOGIN / JOIN (FAW style) ===== */
.login-join {
  display: none;
  width: 100%;
}

.login-join a {
  align-items: center;
  display: flex;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 800;
  height: 44px;
  justify-content: center;
}

.login-join .lj-login {
  background: transparent;
  border: 1.5px solid #fcc201;
  color: #fcc201;
}

.login-join .lj-join {
  background: linear-gradient(90deg, #ffe566 0%, #fcc201 45%, #c88404 100%);
  box-shadow: 0 4px 14px rgba(252, 194, 1, 0.35);
  color: #111;
}

/* ===== CATEGORY BANNERS 600×300 ===== */
.cat-banners {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin: 14px auto 0;
  max-width: var(--site);
  padding: 0 var(--pad-x);
  width: 100%;
}

.cat-banner {
  border-radius: 10px;
  display: block;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cat-banner:hover {
  box-shadow: 0 8px 22px rgba(0, 149, 255, 0.28);
  transform: translateY(-2px);
}

.cat-banner img {
  aspect-ratio: 600 / 300;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/* ===== SECTION ===== */
.section {
  margin: 0 auto;
  max-width: var(--site);
  padding: 18px var(--pad-x) 0;
}

.section-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head-left {
  align-items: center;
  display: flex;
  gap: 8px;
}

.section-head-left img {
  height: 28px;
  width: 28px;
}

.section-head h2 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.section-head a {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-shot {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

.section-shot img {
  display: block;
  height: auto;
  width: 100%;
}

.game-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, 1fr);
}

.game-card {
  background: rgba(15, 37, 54, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.game-card:hover {
  box-shadow: 0 8px 20px rgba(0, 149, 255, 0.2);
  transform: translateY(-2px);
}

.game-thumb {
  aspect-ratio: 1;
  background: #0a1620;
  overflow: hidden;
  position: relative;
}

.game-thumb > img:not(.game-badge-hot) {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.game-badge-hot {
  height: auto;
  left: 4px;
  position: absolute;
  top: 4px;
  width: clamp(28px, 22%, 40px);
  z-index: 1;
}

.game-badge {
  background: linear-gradient(90deg, #ff0137, #ff6a00);
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 800;
  left: 5px;
  padding: 2px 5px;
  position: absolute;
  top: 5px;
}

.game-meta {
  padding: 8px;
}

.game-meta p {
  font-size: 0.74rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-meta small {
  color: var(--muted);
  font-size: 0.66rem;
}

.casino-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, 1fr);
}

.casino-card {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s;
}

.casino-card:hover { transform: translateY(-2px); }

.casino-card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
}

.casino-card span {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  bottom: 0;
  font-size: 0.72rem;
  font-weight: 800;
  left: 0;
  padding: 18px 8px 8px;
  position: absolute;
  right: 0;
  text-align: center;
}

/* Promo */
.promo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.promo-card {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(252, 194, 1, 0.25);
  border-radius: 10px;
  padding: 16px;
}

.promo-card h3 {
  color: var(--gold);
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.promo-card p {
  color: #dddddd;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.promo-card .btn {
  background: linear-gradient(90deg, #ffe566 0%, #fcc201 45%, #c88404 100%);
  border: 0;
  border-radius: 999px;
  color: #111;
  min-width: 0;
  padding: 8px 12px;
}

/* App download row */
.app-row {
  align-items: center;
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(252, 194, 1, 0.25);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  grid-template-columns: 80px 1fr;
  margin-top: 18px;
  padding: 16px;
}

.app-row img.app-icon {
  border-radius: 16px;
  height: 72px;
  width: 72px;
}

.app-row h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 4px;
}

.app-row p {
  color: #c8d9e8;
  font-size: 0.82rem;
}

.app-row .app-art {
  display: none;
}

/* Info feature strip */
.info-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
}

.info-item {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}

.info-item img {
  height: 40px;
  margin: 0 auto 8px;
  width: 40px;
}

.info-item strong {
  color: var(--gold);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.info-item span {
  color: var(--muted);
  font-size: 0.72rem;
}

/* Article — match faw99.cc SEO block */
.article {
  background: transparent;
  border: none;
  border-radius: 0;
  margin-top: 22px;
  padding: clamp(12px, 2.5vw, 20px) 0;
}

.article h1,
.article h2,
.article h3 {
  color: #fcc201;
  font-weight: 700;
  line-height: 1.35;
}

.article h1 {
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  margin-bottom: 16px;
  text-align: center;
}

.article h2 {
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  margin: 28px 0 12px;
  text-align: left;
}

.article h3 {
  font-size: 0.98rem;
  margin: 18px 0 8px;
}

.article p {
  color: #aaaaaa;
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.article a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.article a:hover { color: inherit; }

/* Footer — match ss kedua (faw99.cc) */
.site-footer {
  margin: 28px auto 0;
  max-width: var(--site);
  padding: 0 var(--pad-x) 28px;
  text-align: left;
}

.footer-nav {
  align-items: center;
  border-image: linear-gradient(to left, transparent 1%, #f8dd7b 50%, transparent 100%) 100% 0 100% 0 / 1px 0 1px 0 stretch;
  border-bottom: 1px solid;
  border-top: 1px solid;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  margin: 0 auto 18px;
  padding: 12px 8px;
}

.footer-nav a {
  color: #fcc201;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.footer-nav a:hover { color: #ffe138; }

.footer-cols {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 auto;
  padding: 4px 0 16px;
}

.footer-col {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 0;
  padding: 0 14px;
}

.footer-col:first-child {
  border-left: none;
  padding-left: 0;
}

.footer-col strong {
  color: #fcc201;
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-col a {
  color: #aaaaaa;
  display: block;
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

.footer-col a:hover { color: #fcc201; }

.footer-divider {
  background: linear-gradient(to left, transparent 1%, #f8dd7b 50%, transparent 100%);
  height: 1px;
  margin: 8px 0 14px;
  width: 100%;
}

.footer-copy {
  color: #aaaaaa;
  font-size: 0.78rem;
  text-align: center;
}

.footer-copy strong { color: #fcc201; }

/* Bottom nav — FAW mobile style */
.btm-nav {
  background: #1a1a1a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  left: 0;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  right: 0;
  z-index: 200;
}

.btm-nav a {
  align-items: center;
  color: #b8b8b8;
  display: flex;
  flex-direction: column;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 2px;
  justify-content: center;
  padding: 4px 2px;
  text-align: center;
}

.btm-nav a.active,
.btm-nav a:hover { color: var(--gold); }

.btm-nav .ico {
  font-size: 1.15rem;
  height: 24px;
  line-height: 24px;
}

.btm-nav .center {
  margin-top: -14px;
}

.btm-nav .center img {
  background: #111;
  border: 2px solid var(--gold);
  border-radius: 50%;
  height: 46px;
  object-fit: contain;
  padding: 5px;
  width: 46px;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .game-grid,
  .casino-grid { grid-template-columns: repeat(3, 1fr); }
  .promo-grid { grid-template-columns: 1fr; }
  .info-strip { grid-template-columns: repeat(2, 1fr); }
  .login-join { display: flex; }
  .header-row .auth-btns { display: none; }
  .menu-toggle { display: flex; }
  .banner-track { aspect-ratio: 16 / 9; }
  .banner-desktop { display: none; }
  .banner-mobile { display: block; }
  .cat-banners { grid-template-columns: repeat(2, 1fr); }
  .pay-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pay-chip { font-size: 0.68rem; padding: 8px 6px; }
  .footer-cols {
    gap: 16px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-col {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 8px 0 0;
  }
  .footer-col:nth-child(-n+2) { border-top: none; padding-top: 0; }
  .footer-nav {
    gap: 8px 14px;
    justify-content: flex-start;
  }
  .footer-nav a { font-size: 0.8rem; }

  .header-row {
    position: relative;
  }

  .main-nav {
    background: #050d14;
    border-bottom: 1px solid var(--border);
    display: none;
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }

  .site-header.is-open .main-nav {
    display: block;
  }

  .main-nav-inner {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
    justify-content: stretch;
    padding: 10px var(--pad-x) 14px;
  }

  .main-nav a {
    background: rgba(15, 37, 54, 0.85);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-direction: row;
    font-size: 0.9rem;
    gap: 12px;
    justify-content: flex-start;
    min-width: 0;
    padding: 12px 14px;
    text-align: left;
  }

  .main-nav a img {
    height: 28px;
    width: 28px;
  }
}

@media (max-width: 640px) {
  .brand-logo { height: 34px; }
  .game-grid,
  .casino-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head h2 { font-size: 0.95rem; }
  .app-row { grid-template-columns: 64px 1fr; }
  .app-row img.app-icon { height: 56px; width: 56px; }
  .cat-banners {
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
  }
  .pay-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pay-chip { font-size: 0.62rem; }
}

@media (min-width: 981px) {
  .btm-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ===== SUB PAGES ===== */
.sub-page {
  background: rgba(10, 22, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 18px auto 0;
  max-width: var(--site);
  padding: clamp(18px, 3vw, 32px);
  width: calc(100% - 2 * var(--pad-x));
}

.sub-page h1 {
  color: var(--gold);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.sub-page h2 {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 800;
  margin: 22px 0 8px;
}

.sub-page p,
.sub-page li {
  color: #c8d4de;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.sub-page ul {
  margin: 0 0 12px 1.1rem;
}

.sub-page a {
  color: var(--primary);
  font-weight: 700;
}

.sub-page a:hover { color: var(--gold); }
