/* ==========================================================================
   SLOT SITE TEMPLATE — โครงสร้างสไตล์เว็บสล็อต (ธีมนีออนเขียว-ทอง)
   แก้ตัวแปรสีที่ :root ที่เดียว เปลี่ยนธีมได้ทั้งเว็บ
   ========================================================================== */

:root {
  /* --- พื้นหลัง --- */
  --bg:            #050d0a;
  --bg-2:          #011c12;
  --card:          #0a2018;
  --card-2:        #0d2b1f;
  --line:          rgba(0, 255, 160, .18);

  /* --- สีแบรนด์ --- */
  --neon:          #00ffa0;
  --cyan:          #19faeb;
  --gold:          #ffc800;
  --gold-2:        #fad15f;
  --danger:        #ff4500;

  /* --- ตัวอักษร --- */
  --text:          #eafff6;
  --text-dim:      #8fae a2;
  --text-dim:      #8faea2;

  /* --- ระยะ / มุม --- */
  --radius:        14px;
  --radius-sm:     10px;
  --wrap:          1180px;
  --gap:           20px;

  /* --- เงา --- */
  --glow:          0 0 18px rgba(0, 255, 160, .35);
  --glow-gold:     0 0 18px rgba(255, 200, 0, .35);
  --shadow:        0 10px 30px rgba(0, 0, 0, .5);

  --font: "Kanit", "Noto Sans Thai", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0,255,160,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--neon); text-decoration: none; }
a:hover { color: var(--cyan); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==========================================================================
   1. HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(1, 28, 18, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* 3 คอลัมน์: โลโก้ซ้าย | เมนูกึ่งกลางหน้าจริง | ปุ่มขวา
   คอลัมน์ซ้าย-ขวากว้างเท่ากัน (1fr) เมนูจึงอยู่กลางเสมอ ไม่ว่าโลโก้จะยาวแค่ไหน */
.site-header .wrap {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--gap);
  min-height: 68px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 30px; letter-spacing: .5px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 200, 0, .35);
}
.logo img { height: 40px; width: auto; }

.nav { justify-self: center; display: flex; gap: 6px; }
.nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--text); font-weight: 500; font-size: 15px;
  transition: .2s;
}
.nav a:hover,
.nav a[aria-current="page"] { background: rgba(0,255,160,.12); color: var(--neon); }

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

/* ปุ่มเมนูรวมทุกหน้า — ซ่อนบนเดสก์ท็อป โผล่เฉพาะจอ <=768px (กฎอยู่ท้ายไฟล์) */
.nav-toggle {
  display: none;
  background: transparent; color: var(--gold);
  border: 1px solid rgba(255, 200, 0, .38); border-radius: 10px;
  font-size: 22px; line-height: 1; padding: 8px 12px;
  cursor: pointer; transition: .2s;
}
.nav-toggle:hover { border-color: var(--gold); box-shadow: var(--glow-gold); }
.nav-toggle[aria-expanded="true"] { background: rgba(255, 200, 0, .14); border-color: var(--gold); }


/* ==========================================================================
   2. ปุ่ม
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border: 0; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary { background: linear-gradient(135deg, var(--neon), var(--cyan)); color: #04231a; box-shadow: var(--glow); }
.btn-gold    { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2b1d00; box-shadow: var(--glow-gold); }
.btn-ghost   { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-lg      { padding: 15px 34px; font-size: 17px; }
.btn-block   { width: 100%; }

/* ==========================================================================
   3. HERO
   ========================================================================== */
.hero { padding: 46px 0 34px; text-align: center; }
.hero .badge {
  display: inline-block; margin-bottom: 16px;
  padding: 6px 18px; border-radius: 999px;
  background: rgba(255,200,0,.12); border: 1px solid rgba(255,200,0,.35);
  color: var(--gold); font-size: 14px; font-weight: 600;
}
.hero h1 {
  margin: 0 0 18px; font-size: clamp(26px, 5vw, 44px); line-height: 1.35; font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--neon) 60%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { max-width: 820px; margin: 0 auto 26px; color: var(--text-dim); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-banner { margin-top: 30px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
/* แบนเนอร์ที่วางไว้บนสุด — ก่อน H1 (ชิดใต้เมนูเลย) */
.hero-with-banner { padding-top: 0; }
.hero-banner-top  { margin-top: 10px; margin-bottom: 26px; }

/* ==========================================================================
   4. SECTION ทั่วไป
   ========================================================================== */
.section { padding: 44px 0; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { margin: 0 0 10px; font-size: clamp(21px, 3.4vw, 30px); font-weight: 800; color: var(--text); }
.section-head p  { margin: 0 auto; max-width: 760px; color: var(--text-dim); }

/* บล็อกข้อความล้วน ไม่มีรูปประกอบ — ใช้กับหัวข้อที่เป็นเนื้อหาอย่างเดียว */
.prose { max-width: 860px; margin-inline: auto; }
.prose p { margin: 0 0 16px; color: var(--text-dim); line-height: 1.95; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--neon); font-weight: 700; }

/* ลิงก์ที่แทรกอยู่ในเนื้อความ — ขีดเส้นใต้ให้เห็นว่ากดได้ */
.section-head p a,
.feature-body p a,
.prose p a,
.hero p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* บล็อกเนื้อหาสลับซ้าย-ขวา (รูป + ข้อความ) */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center;
  padding: 30px 0;
}
.feature.reverse .feature-media { order: 2; }
.feature-media img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* กรอบรูปแบบการ์ด — ใช้กับรูปที่ไม่อยากให้ทะลุขอบจอบนมือถือ (เช่น รูปไลน์หน้าติดต่อ) */
.feature-media.framed {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.feature-media.framed img { border: 0; border-radius: 0; box-shadow: none; width: 100%; }
.feature-body h2 { margin: 0 0 12px; font-size: clamp(20px, 3vw, 27px); font-weight: 800; }
.feature-body h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: var(--gold); }
.feature-body p  { margin: 0 0 14px; color: var(--text-dim); }
.feature-body strong { color: var(--neon); font-weight: 700; }

/* ==========================================================================
   5. กริดค่ายเกม
   ========================================================================== */
.game-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.game-card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center;
  transition: .2s;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--neon); box-shadow: var(--glow); }
.game-card span { display: block; margin-top: 8px; font-size: 13px; color: var(--text-dim); }

/* ==========================================================================
   6. การ์ดโปรโมชั่น
   ========================================================================== */
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.promo-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: .2s;
}
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }
.promo-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.promo-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.promo-card p  { margin: 0; font-size: 14px; color: var(--text-dim); flex: 1; }

/* ==========================================================================
   7. สลิปถอนเงิน
   ========================================================================== */
.slip-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-inline: auto;          /* จัดกลุ่มรูปให้อยู่กึ่งกลางเสมอ */
  justify-items: stretch;
}
.slip-grid img {
  width: 100%;                  /* บังคับให้รูปเต็มความกว้างช่อง ไม่หดเล็ก */
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}

/* ==========================================================================
   7.5 แถบไอคอนธนาคาร — ตัดไอคอนแยกไฟล์ แล้วมนมุมด้วย CSS
   ========================================================================== */
/* เรียงแนวนอนแถวเดียวเสมอ ไม่ตกบรรทัด — ไอคอนย่อ/ขยายตามความกว้างจอ */
.bank-row {
  display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;
  gap: clamp(6px, 1.4vw, 16px);
}
.bank-row img {
  flex: 0 0 auto;
  width: clamp(38px, 11vw, 86px); height: auto; aspect-ratio: 1 / 1;
  border-radius: 22%; border: 1px solid var(--line);
  transition: transform .18s;
}
.bank-row img:hover { transform: translateY(-3px); }

/* ==========================================================================
   8. แถบตาราง / ตัวเลขน่าเชื่อถือ
   ========================================================================== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.stat b { display: block; font-size: 24px; color: var(--gold); }
.stat span { font-size: 13px; color: var(--text-dim); }

/* ==========================================================================
   9. FAQ (accordion — ใช้ <details>)
   ========================================================================== */
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
/* คำถามเป็น <h3> จริงเพื่อให้ AI/บอทตัดก้อน Q-A ได้ แต่คุมหน้าตาให้เหมือนเดิม */
.faq summary h3 { display: inline; margin: 0; font: inherit; color: inherit; }
.faq summary::after { content: "+"; float: inline-end; color: var(--neon); font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--text-dim); }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 40px; padding: 36px 0 100px;
  background: var(--bg-2); border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer h4 { margin: 0 0 12px; font-size: 16px; color: var(--gold); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 8px; font-size: 14px; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--neon); }
.copyright {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  text-align: center; font-size: 13px; color: var(--text-dim);
}

/* ==========================================================================
   11. แถบเมนูล่างมือถือ (sticky footer bar 5 ปุ่ม)
   ========================================================================== */
.mobile-bar {
  display: none;
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  background: rgba(1, 28, 18, .97);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-bar ul { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; }
.mobile-bar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; font-size: 11px; color: var(--text);
}
.mobile-bar img { width: 26px; height: 26px; object-fit: contain; }
/* ไอคอนวาดด้วย SVG ในโค้ด — รับสีจากตัวอักษร จึงเปลี่ยนธีมแล้วเปลี่ยนตาม */
.mobile-bar svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.mobile-bar .is-main a { color: var(--gold); }
.mobile-bar .is-main img { width: 34px; height: 34px; }
.mobile-bar .is-main svg { width: 30px; height: 30px; stroke-width: 1.9; }

/* ==========================================================================
   11.5 ป๊อปอัพไลน์ — ลอยติดขวาจอ เลื่อนหน้าก็ตามไปด้วย
   ========================================================================== */
.side-popup {
  position: fixed;              /* ยึดกับหน้าจอ ไม่ใช่กับเนื้อหา จึงเลื่อนตามตลอด */
  z-index: 65;
  right: 14px; left: auto;      /* ฝั่งขวา */
  top: 50%; transform: translateY(-50%);
  width: clamp(96px, 11vw, 160px);
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .6);
  animation: popupIn .45s ease-out both;
}
.side-popup video { display: block; width: 100%; height: auto; border-radius: 12px; }

/* ปุ่มปิด — เหลื่อมออกมาทางขวาบน */
.side-popup-close {
  position: absolute; top: -10px; right: -8px; left: auto; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #2b1d00;
  border: 2px solid var(--bg);
  font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  transition: .18s;
}
.side-popup-close:hover { transform: scale(1.12); filter: brightness(1.08); }

@keyframes popupIn { from { opacity: 0; transform: translate(28px, -50%); } to { opacity: 1; transform: translateY(-50%); } }

@media (max-width: 768px) {
  /* จอเล็ก ย้ายลงมุมขวาล่าง ให้พ้นแถบเมนูล่าง */
  .side-popup {
    top: auto; bottom: 84px; right: 10px; left: auto;
    transform: none; width: 86px;
  }
  .side-popup-close { width: 26px; height: 26px; font-size: 16px; top: -9px; right: -6px; left: auto; }
  @keyframes popupIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
}

/* ==========================================================================
   12. ฟอร์ม (สมัคร / เข้าสู่ระบบ / ติดต่อ)
   ========================================================================== */
.form-wrap {
  max-width: 460px; margin: 44px auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.form-wrap h1 { margin: 0 0 6px; font-size: 24px; text-align: center; }
.form-wrap .hint { margin: 0 0 22px; text-align: center; font-size: 14px; color: var(--text-dim); }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--neon); box-shadow: var(--glow);
}
.form-foot { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-dim); }

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .slip-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-bar { display: block; }

  /* --- หัวเว็บบนมือถือ: ☰ ซ้ายสุด / โลโก้ / ปุ่มขวา / เมนูกางลงมาเต็มแถว --- */
  .site-header .wrap { display: flex; flex-wrap: wrap; gap: 10px; }
  .nav-toggle { order: 0; display: block; }
  .logo       { order: 1; font-size: 24px; }
  .header-cta { order: 2; margin-inline-start: auto; }
  .header-cta .btn-ghost { display: none; }   /* เข้าสู่ระบบมีในแถบล่างแล้ว ตัดออกกันหัวเว็บแน่น */

  .nav.is-open {
    order: 4; display: flex; flex-direction: column; gap: 4px;
    width: 100%; padding: 8px 0 12px;
    border-top: 1px solid var(--line);
  }
  .nav.is-open a { padding: 13px 14px; border-radius: 10px; font-size: 16px; }
  .feature { grid-template-columns: 1fr; gap: 16px; }
  .feature.reverse .feature-media { order: 0; }
  .promo-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }

  /* --- บีบระยะแนวตั้งบนมือถือ ไม่ให้รูปห่างกันเกินไป --- */
  .section       { padding: 20px 0; }
  .feature       { padding: 0; }            /* เดิม 30px บน-ล่าง ซ้อนกับ .section */
  .section-head  { margin-bottom: 18px; }
  .hero          { padding: 24px 0 22px; }
  .hero-banner   { margin-top: 18px; }
  .hero-banner-top { margin-top: 4px; margin-bottom: 18px; }
  .hero h1       { margin-bottom: 14px; }
  .hero p        { margin-bottom: 20px; }
  .feature-body h2 { margin-bottom: 8px; }
  .feature-body p  { margin-bottom: 10px; }
  /* ปุ่มในบล็อกเนื้อหา — จัดกึ่งกลางบนมือถือ (เดสก์ท็อปยังชิดซ้ายตามข้อความ) */
  .feature-body .btn { display: flex; width: fit-content; margin: 4px auto 0; }
  .site-footer   { margin-top: 24px; padding: 26px 0 92px; }

  /* --- รูปใหญ่ทะลุขอบจอบนมือถือ (แบนเนอร์ Hero + รูปประกอบ H2) ---
     .wrap มี padding ข้างละ 16px จึงถอยด้วย margin ติดลบเท่ากันให้ชนขอบพอดี */
  .hero-banner,
  .feature-media {
    margin-inline: -16px;
    border-radius: 0;
    border-inline-width: 0;
  }
  .hero-banner img,
  .feature-media img {
    width: 100%;
    border-radius: 0;
    border-inline-width: 0;
  }

  /* ยกเว้นรูปที่ใส่กรอบไว้ — คงกรอบมนและไม่ทะลุขอบจอ */
  .feature-media.framed {
    margin-inline: 0;
    border-radius: var(--radius);
    border-inline-width: 1px;
  }
}

@media (max-width: 420px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .slip-grid { grid-template-columns: repeat(2, 1fr); }
}
