/* ==========================================================================
   BK8 Thai VIP — SEO Landing Page
   Theme: Navy Blue / Gold Yellow / Black
   ========================================================================== */

:root {
  --navy-900: #050d22;
  --navy-800: #0a1a3c;
  --navy-700: #10265a;
  --navy-600: #17357c;
  --blue-500: #2563eb;
  --blue-400: #3b82f6;

  --gold-500: #f5b301;
  --gold-400: #ffc927;
  --gold-300: #ffdd6b;

  --black: #05070d;
  --ink-900: #0d1220;
  --ink-700: #1b2438;

  --text: #e9eefb;
  --text-dim: #a9b6d4;
  --text-dark: #0b1020;

  --border: rgba(255, 255, 255, 0.09);
  --border-gold: rgba(245, 179, 1, 0.35);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 46px -18px rgba(0, 0, 0, 0.85);
  --shadow-gold: 0 14px 34px -14px rgba(245, 179, 1, 0.55);
  --gradient-gold: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  --gradient-navy: linear-gradient(160deg, var(--navy-800), var(--black));
  --container: 1180px;
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: "Kanit", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(37, 99, 235, 0.28), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(245, 179, 1, 0.16), transparent 60%),
    var(--black);
  color: var(--text);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-400); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-300); }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--gold-500); color: var(--text-dark); padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--gradient-gold); color: var(--text-dark); box-shadow: var(--shadow-gold); }
.btn-primary:hover { transform: translateY(-2px); color: var(--text-dark); }
.btn-outline { border-color: var(--border-gold); color: var(--gold-400); background: rgba(245, 179, 1, .06); }
.btn-outline:hover { background: rgba(245, 179, 1, .14); transform: translateY(-2px); }
.btn-ghost { color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold-400); color: var(--gold-400); }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 13, 34, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled { background: rgba(5, 7, 13, .95); box-shadow: 0 12px 30px -20px #000; }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; }
.brand-logo img { height: 34px; width: auto; }
.brand-text { font-size: 1.15rem; letter-spacing: .5px; }
.brand-text em { color: var(--gold-400); font-style: normal; font-size: .72em; letter-spacing: 2px; }

.main-nav { margin-inline-start: auto; display: flex; gap: 6px; }
.main-nav a {
  color: var(--text-dim); font-size: .92rem; padding: 8px 14px; border-radius: 999px;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--gold-400); background: rgba(245, 179, 1, .1); }

.header-cta { display: flex; gap: 8px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 10px;
  width: 42px; height: 40px; padding: 9px 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--gold-400); border-radius: 2px; margin: 3px 0; transition: .25s; }

/* ---------- Hero ---------- */
.hero { padding: 58px 0 44px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 40%; height: 420px;
  background: radial-gradient(closest-side, rgba(37, 99, 235, .35), transparent);
  filter: blur(20px); pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 42px; align-items: center; position: relative; z-index: 1; }

.eyebrow {
  display: inline-block; font-size: .82rem; letter-spacing: 1px; color: var(--gold-400);
  border: 1px solid var(--border-gold); padding: 5px 14px; border-radius: 999px;
  background: rgba(245, 179, 1, .07); margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.35; font-weight: 800;
  background: linear-gradient(100deg, #fff 20%, var(--gold-300) 75%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.author-byline { color: var(--text-dim); font-size: .88rem; margin: 12px 0 16px; }
.hero-copy p { color: var(--text-dim); margin-bottom: 12px; }
.hero-copy strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 26px; }

.hero-stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hero-stats li {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 8px; text-align: center;
}
.hero-stats strong { display: block; color: var(--gold-400); font-size: 1.18rem; line-height: 1.3; }
.hero-stats span { font-size: .78rem; color: var(--text-dim); }

/* ---------- Image slots (ตำแหน่งวางรูป) ---------- */
.img-slot { margin: 0; position: relative; }
.img-slot img {
  width: 100%; border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold); box-shadow: var(--shadow);
  background: linear-gradient(140deg, var(--navy-700), var(--black));
  object-fit: cover;
}
.img-slot figcaption {
  margin-top: 8px; font-size: .76rem; color: var(--text-dim); text-align: center; opacity: .75;
}
/* placeholder state when image file is missing */
.img-slot img.is-missing {
  min-height: 220px;
  background:
    repeating-linear-gradient(45deg, rgba(245,179,1,.07) 0 12px, transparent 12px 24px),
    linear-gradient(140deg, var(--navy-700), var(--black));
  border-style: dashed;
}
.hero-img img { aspect-ratio: 3 / 2; }

.img-slot-inline img.is-missing { border: 1px dashed var(--border-gold); border-radius: 8px; min-height: 34px; min-width: 90px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { border-block: 1px solid var(--border); background: rgba(255,255,255,.02); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; margin: 0; font-size: .85rem; color: var(--text-dim); }
.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: var(--gold-500); }

/* ---------- Gallery ---------- */
.gallery { padding: 46px 0 10px; }
.gallery-title { font-size: 1.35rem; margin-bottom: 18px; color: var(--text); }
.gallery-title::after { content: ""; display: block; width: 64px; height: 3px; background: var(--gradient-gold); border-radius: 3px; margin-top: 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.gallery-grid .img-slot img { aspect-ratio: 1 / 1; transition: transform .25s ease, box-shadow .25s ease; }
.gallery-grid .img-slot:hover img { transform: translateY(-6px); box-shadow: var(--shadow-gold); }
.gallery-grid figcaption { font-size: .7rem; }
.gallery-grid .img-slot img.is-missing { min-height: 0; }

/* ---------- TOC ---------- */
.toc { padding: 40px 0 10px; }
.toc .container {
  background: linear-gradient(180deg, rgba(37,99,235,.14), rgba(5,7,13,.5));
  border: 1px solid var(--border-gold); border-radius: var(--radius-lg); padding: 22px 26px;
}
.toc h2 { font-size: 1.15rem; color: var(--gold-400); margin-bottom: 12px; }
.toc ol { columns: 2; column-gap: 34px; padding-inline-start: 20px; margin: 0; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--text-dim); font-size: .92rem; }
.toc a:hover { color: var(--gold-400); }

/* ---------- Article sections ---------- */
.article { padding: 26px 0 60px; display: grid; gap: 26px; }

.content-section {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow);
}
.section-inner { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.content-section.img-right .section-inner { grid-template-columns: 1fr 380px; }
.content-section.img-right .img-slot { order: 2; }
.content-section .img-slot { position: sticky; top: calc(var(--header-h) + 20px); }
.content-section .img-slot img { aspect-ratio: 8 / 5; }

.section-body h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.5; color: #fff; margin-bottom: 6px;
  padding-inline-start: 14px; border-inline-start: 4px solid var(--gold-500);
}
.section-body h3 {
  font-size: 1.08rem; color: var(--gold-400); margin: 22px 0 8px;
}
.section-body p { margin-bottom: 12px; color: var(--text-dim); }
.section-body strong { color: var(--text); }
.section-body ul, .section-body ol { margin: 0 0 14px; padding-inline-start: 22px; color: var(--text-dim); }
.section-body li { margin-bottom: 6px; }
.section-body li::marker { color: var(--gold-500); }
.section-body hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.section-body a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; background: rgba(5,7,13,.55); }
thead th {
  background: var(--gradient-gold); color: var(--text-dark); font-weight: 700;
  text-align: start; padding: 11px 14px; white-space: nowrap;
}
tbody td { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-dim); vertical-align: top; }
tbody tr:nth-child(even) { background: rgba(37,99,235,.08); }
tbody tr:hover { background: rgba(245,179,1,.08); }

/* ---------- FAQ (built by script.js) ---------- */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px;
  background: rgba(5,7,13,.5); overflow: hidden;
}
.faq-q {
  width: 100%; text-align: start; background: none; border: 0; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 14px 46px 14px 16px; position: relative; line-height: 1.6;
}
.faq-q::after {
  content: "+"; position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%);
  color: var(--gold-400); font-size: 1.3rem; transition: transform .2s ease;
}
.faq-item.is-open .faq-q::after { content: "−"; }
.faq-item.is-open .faq-q { color: var(--gold-400); }
.faq-a { display: none; padding: 0 16px 14px; color: var(--text-dim); }
.faq-item.is-open .faq-a { display: block; animation: fadeIn .25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--gradient-navy); padding: 44px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer-grid h3 { color: var(--gold-400); font-size: 1rem; margin-bottom: 10px; }
.footer-grid p { color: var(--text-dim); font-size: .9rem; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 6px; color: var(--text-dim); font-size: .9rem; }
.footer-brand { font-size: 1.3rem; margin-bottom: 10px; }
.footer-badges { margin-top: 14px; max-width: 360px; }
.footer-bottom {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  color: var(--text-dim); font-size: .82rem;
}

/* ---------- Floating CTA / back to top ---------- */
.float-cta {
  position: fixed; inset-inline-start: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--gradient-gold); color: var(--text-dark); font-weight: 700;
  padding: 12px 26px; border-radius: 999px; box-shadow: var(--shadow-gold); z-index: 90; display: none;
}
.float-cta:hover { color: var(--text-dark); }

.back-to-top {
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 95;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: var(--navy-700); color: var(--gold-400); border: 1px solid var(--border-gold);
  font-size: 1.2rem; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .section-inner,
  .content-section.img-right .section-inner { grid-template-columns: 1fr; }
  .content-section.img-right .img-slot { order: 0; }
  .content-section .img-slot { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-cta .btn-ghost { display: none; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; inset-inline: 0; top: var(--header-h); flex-direction: column; gap: 0;
    background: rgba(5, 7, 13, .98); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 6px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .toc ol { columns: 1; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .float-cta { display: block; }
  .back-to-top { bottom: 74px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .content-section { padding: 18px 14px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .toc, .float-cta, .back-to-top, .site-footer, .img-slot figcaption { display: none !important; }
  body { background: #fff; color: #000; }
}

.footer-badges img.is-missing { min-height: 64px; }
.brand-logo img.is-missing { min-height: 34px; }

/* ============ Live bets ticker ============ */
.livebets, .recommend { padding: 48px 0; }
.section-title {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--gold, #f5b301);
  margin: 0 0 18px;
}
.lb-tabs {
  display: inline-flex; gap: 6px; padding: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; margin-bottom: 18px; flex-wrap: wrap;
}
.lb-tab {
  border: 0; cursor: pointer; border-radius: 999px;
  padding: 10px 20px; font: inherit; font-weight: 600;
  color: #cfd8ea; background: transparent; transition: .25s;
}
.lb-tab:hover { color: #fff; }
.lb-tab.is-active { background: #0b1a3a; color: #f5b301; box-shadow: 0 0 0 1px rgba(245,179,1,.35); }
.lb-table-wrap {
  background: #08122b; border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px; overflow: hidden;
}
.lb-head, .lb-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr .7fr 1.3fr .7fr 1.3fr;
  align-items: center; gap: 8px; padding: 14px 18px;
}
.lb-head { background: rgba(255,255,255,.04); color: #9fb0cc; font-size: 14px; font-weight: 600; }
.lb-head span:nth-child(n+3), .lb-row span:nth-child(n+3) { text-align: right; }
.lb-body { max-height: 420px; overflow: hidden; }
.lb-row {
  border-top: 1px solid rgba(255,255,255,.06);
  color: #e7eefc; font-size: 15px;
  animation: lbIn .45s ease-out;
}
.lb-row .lb-game { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lb-row .lb-user { color: #9fb0cc; }
.lb-win { color: #34d399; font-weight: 700; }
.lb-lose { color: #ff8080; font-weight: 700; }
.lb-note { color: #8b9ab5; font-size: 13px; margin-top: 10px; }
@keyframes lbIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ============ Recommended games carousel ============ */
.rc-viewport { overflow: hidden; }
.rc-track { display: flex; gap: 18px; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.rc-card {
  flex: 0 0 calc((100% - 54px) / 4);
  background: #08122b; border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px; padding: 12px; transition: transform .25s, border-color .25s;
}
.rc-card:hover { transform: translateY(-6px); border-color: rgba(245,179,1,.5); }
.rc-card h3 { margin: 12px 0 4px; font-size: 17px; color: #fff; }
.rc-card p { margin: 0; color: #9fb0cc; font-size: 14px; }
.rc-card .img-slot img { width: 100%; height: auto; border-radius: 10px; }
.rc-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.rc-dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.25); cursor: pointer; transition: .25s;
}
.rc-dots button.is-active { background: #f5b301; width: 26px; border-radius: 999px; }

@media (max-width: 900px) {
  .rc-card { flex-basis: calc((100% - 18px) / 2); }
  .lb-head, .lb-row { grid-template-columns: 1.4fr .8fr 1.2fr 1.2fr; font-size: 13px; padding: 12px; }
  .lb-head span:nth-child(3), .lb-row span:nth-child(3),
  .lb-head span:nth-child(5), .lb-row span:nth-child(5) { display: none; }
}
@media (max-width: 560px) { .rc-card { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .lb-row { animation: none; }
  .rc-track { transition: none; }
}
