/* =========================================================
   GameZone TH - style.css (v2)
   ธีมหลัก: น้ำเงินเกมมิ่ง | ธีมรอง: ดำ
   - ตัวอักษรทุกคู่สีผ่านคอนทราสต์ WCAG AA
   - พื้นหลังเป็น SVG ขนาดเล็ก (โหลดเร็ว ไม่กระทบ Core Web Vitals)
   - ใช้ร่วมกับ Bootstrap 5.3 (ไฟล์นี้โหลดหลัง Bootstrap)
   ========================================================= */

/* ---------- 1. ตัวแปรสี ---------- */
:root {
  --brand: #1d4ed8;          /* เขียวหลัก: ตัวอักษรขาวบนพื้นนี้ ~6.6:1 */
  --brand-dark: #1e3a8a;
  --brand-darker: #172554;
  --brand-light: #60a5fa;    /* เขียวอ่อน ใช้บนพื้นดำเท่านั้น */
  --brand-soft: #eff6ff;     /* พื้นเขียวจาง ใช้กับตัวอักษรเข้ม */
  --brand-soft-2: #dbeafe;
  --black: #0d0f0e;
  --black-2: #161a18;
  --text: #1c211e;
  --muted: #47504a;          /* เทาเข้ม อ่านชัดบนพื้นขาว ~8:1 */
  --white: #ffffff;
  --gold: #8a6400;           /* ดาวรีวิว (อ่านชัดบนพื้นขาว) */

  --radius: 1rem;
  --radius-lg: 1.4rem;
  --shadow-sm: 0 2px 10px rgba(13, 15, 14, .06);
  --shadow: 0 8px 28px rgba(13, 15, 14, .09);
  --shadow-lg: 0 18px 44px rgba(13, 15, 14, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* ให้ Bootstrap ใช้สีแบรนด์ */
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 29, 78, 216;
  --bs-link-hover-color: var(--brand-dark);
  --bs-link-hover-color-rgb: 30, 58, 138;
  --bs-success: var(--brand);
  --bs-success-rgb: 29, 78, 216;
  --bs-body-font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- 2. พื้นฐาน ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--bs-body-font-family);
  font-weight: 300;
  color: var(--text);
  line-height: 1.85;
  font-size: 1.05rem;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--black); line-height: 1.4; letter-spacing: -.005em; }
strong, b { font-weight: 500; }
p { margin-bottom: 1.1rem; }
a { color: var(--brand); text-underline-offset: 3px; transition: color .2s var(--ease); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
::selection { background: var(--brand); color: #fff; }

:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; top: 0; left: 0; z-index: 2000; background: var(--brand); color: #fff; padding: .6rem 1rem; border-radius: 0 0 .5rem 0; }

.text-success { color: var(--brand) !important; }
.text-bg-success { background-color: var(--brand) !important; color: #fff !important; }
.text-body-secondary { color: var(--muted) !important; }

/* ---------- 3. Topbar ---------- */
.topbar { background: var(--black); color: #e6e6e6; font-size: .88rem; padding: .4rem 0; border-bottom: 1px solid rgba(96, 165, 250, .12); }
.topbar a { color: var(--brand-light); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .bi { margin-right: .25rem; }

/* ---------- 4. Header / Navbar ---------- */
.site-header {
  background: rgba(22, 26, 24, .96);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 2px 18px rgba(0, 0, 0, .28);
  border-bottom: 3px solid var(--brand);
}
.site-header .navbar { padding-top: .7rem; padding-bottom: .7rem; }
.navbar-brand { font-size: 1.5rem; font-weight: 700; color: #fff !important; letter-spacing: .01em; }
.navbar-brand .bi { color: var(--brand-light); margin-right: .2rem; }
.text-brand-light { color: var(--brand-light); }
.navbar-dark .nav-link {
  color: #eeeeee;
  font-weight: 400;
  padding: .5rem .85rem !important;
  border-radius: .55rem;
  position: relative;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.navbar-dark .nav-link:hover { color: #fff; background: rgba(96, 165, 250, .1); }
.navbar-dark .nav-link.active { color: var(--brand-light); }
@media (min-width: 992px) {
  .navbar-dark .nav-link.active::after {
    content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .15rem;
    height: 2px; border-radius: 2px; background: var(--brand-light);
  }
}
.navbar-toggler { border-color: rgba(255, 255, 255, .35); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .4); }
@media (max-width: 991.98px) {
  .navbar-collapse { padding: .8rem 0 .4rem; }
  .navbar-dark .nav-link { padding: .6rem .5rem !important; }
}

/* ---------- 5. ปุ่ม ---------- */
.btn { font-weight: 500; border-radius: .75rem; padding: .6rem 1.25rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.08rem; }
.btn-sm { padding: .4rem .9rem; }
.btn .bi { margin-right: .3rem; }
.btn-brand {
  background: linear-gradient(135deg, #2563eb 0%, var(--brand) 55%, var(--brand-dark) 100%);
  color: #fff; border: 0;
  box-shadow: 0 6px 18px rgba(29, 78, 216, .35);
}
.btn-brand:hover, .btn-brand:focus { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(29, 78, 216, .45); background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); }
.btn-brand:active { transform: translateY(0); }
.btn-outline-light-brand { border: 2px solid rgba(255, 255, 255, .85); color: #fff; background: rgba(255, 255, 255, .04); }
.btn-outline-light-brand:hover, .btn-outline-light-brand:focus { background: #fff; color: var(--black); border-color: #fff; transform: translateY(-2px); }
.btn-light { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-light:hover { transform: translateY(-2px); }

/* ---------- 6. Hero (หน้าแรก) ---------- */
.hero {
  position: relative;
  color: #fff;
  padding: 5.5rem 0 6rem;
  background-color: var(--black);
  /* ชั้นบน: ไล่เฉดเพื่อให้ตัวอักษรอ่านชัด | ชั้นล่าง: ภาพเมือง SVG */
  background-image:
    linear-gradient(90deg, rgba(5, 8, 7, .92) 0%, rgba(5, 8, 7, .72) 45%, rgba(5, 8, 7, .25) 100%),
    radial-gradient(circle at 80% 20%, rgba(37,99,235,0.28), transparent 55%);
  background-size: cover, cover;
  background-position: center, center bottom;
  background-repeat: no-repeat;
  overflow: hidden;
  isolation: isolate;
}
.hero::after { /* เส้นโค้งด้านล่างให้ต่อกับ section ถัดไปอย่างนุ่มนวล */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px; z-index: -1;
  background: #fff;
  -webkit-mask: radial-gradient(120% 48px at 50% 100%, #000 98%, transparent 100%);
  mask: radial-gradient(120% 48px at 50% 100%, #000 98%, transparent 100%);
}
.hero h1 { color: #fff; font-size: clamp(1.85rem, 4.2vw, 3.1rem); font-weight: 700; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero p { color: #eaf3ed; font-size: 1.14rem; max-width: 40rem; }
.hero .badge-soft {
  background: rgba(96, 165, 250, .14); color: #e9fff2;
  border: 1px solid rgba(96, 165, 250, .45);
  font-weight: 400; font-size: .92rem; letter-spacing: .01em;
}
.hero .img-frame { box-shadow: 0 24px 60px rgba(0, 0, 0, .45); border: 4px solid rgba(255, 255, 255, .12); transform: rotate(-1deg); }
@media (prefers-reduced-motion: no-preference) {
  .hero .col-lg-6:first-child > * { animation: fadeUp .7s var(--ease) both; }
  .hero .col-lg-6:first-child > *:nth-child(2) { animation-delay: .08s; }
  .hero .col-lg-6:first-child > *:nth-child(3) { animation-delay: .16s; }
  .hero .col-lg-6:first-child > *:nth-child(4) { animation-delay: .24s; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 7. Page hero (หน้าอื่น) ---------- */
.page-hero {
  position: relative;
  color: #fff;
  padding: 3.8rem 0 3.4rem;
  background-color: var(--black);
  background-image:
    linear-gradient(90deg, rgba(5, 8, 7, .85) 0%, rgba(5, 8, 7, .45) 60%, rgba(5, 8, 7, .15) 100%),
    radial-gradient(circle at 85% 30%, rgba(37,99,235,0.25), transparent 55%);
  background-size: cover;
  background-position: center;
}
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
.page-hero p { color: #e6f0ea; font-size: 1.08rem; }
.page-hero .breadcrumb { background: rgba(255, 255, 255, .08); display: inline-flex; padding: .3rem .9rem; border-radius: 2rem; font-size: .92rem; }
.page-hero .breadcrumb-item, .page-hero .breadcrumb-item a { color: #e6f0ea; text-decoration: none; }
.page-hero .breadcrumb-item a:hover { color: #fff; text-decoration: underline; }
.page-hero .breadcrumb-item.active { color: var(--brand-light); }
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: #c3cec7; }

/* ---------- 8. กรอบรูป (กัน CLS + มีภาพสำรองเมื่อยังไม่ใส่รูป) ---------- */
.img-frame {
  position: relative;
  background: #dcebe2 linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; display: block; color: transparent; transition: transform .6s var(--ease); }
.img-frame img.is-missing { visibility: hidden; }
.img-frame:hover img { transform: scale(1.03); }
.img-frame.wide { aspect-ratio: 16 / 9; }
.img-frame.square { aspect-ratio: 1 / 1; border-radius: 50%; box-shadow: none; border: 4px solid var(--brand-soft-2); }

/* ---------- 9. Sections ---------- */
.section { padding: 4.5rem 0; position: relative; }
.section-alt {
  background-color: var(--brand-soft);
  background-image: none;
  background-size: 48px 48px;
}
.section-dark {
  background-color: var(--black);
  background-image:
    radial-gradient(800px 300px at 90% 0%, rgba(29, 78, 216, .35), transparent 70%),
    radial-gradient(600px 260px at 0% 100%, rgba(29, 78, 216, .22), transparent 70%);
  color: #e9e9e9;
}
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: #dcdfdd; }
.section-dark .bi { color: var(--brand-light); }
.section-dark .section-title::after { background: var(--brand-light); }

.section-title { position: relative; padding-bottom: .7rem; margin-bottom: 1.7rem; font-weight: 700; }
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
}
.text-center .section-title::after, .section-title.text-center::after { left: 50%; transform: translateX(-50%); }
.lead-muted { color: var(--muted); font-size: 1.08rem; }

/* ---------- 10. เนื้อหายาว ---------- */
.content h2 {
  margin-top: 2.6rem; margin-bottom: 1rem;
  padding: .2rem 0 .2rem .9rem;
  border-left: 5px solid var(--brand);
  font-size: 1.55rem;
}
.content h3 { margin-top: 1.8rem; margin-bottom: .7rem; font-size: 1.25rem; color: var(--brand-dark); }
.content ul, .content ol { padding-left: 1.3rem; }
.content ul li, .content ol li { margin-bottom: .45rem; }
.content ul li::marker { color: var(--brand); }
.content ol li::marker { color: var(--brand); font-weight: 600; }
.content a:not(.btn) { font-weight: 400; text-decoration: underline; text-decoration-color: rgba(29, 78, 216, .35); }
.content a:not(.btn):hover { text-decoration-color: var(--brand); }

/* ---------- 11. การ์ด & กล่อง ---------- */
.card-service {
  border: 1px solid rgba(29, 78, 216, .08);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  height: 100%;
  position: relative;
  overflow: hidden;
}
.card-service::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.card-service:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(29, 78, 216, .2); }
.card-service:hover::before { transform: scaleX(1); }
.card-service h3 { font-size: 1.15rem; }

.icon-circle {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, var(--brand-dark));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.65rem; margin-bottom: 1.1rem;
  box-shadow: 0 8px 18px rgba(29, 78, 216, .3);
  transition: transform .3s var(--ease);
}
.card-service:hover .icon-circle { transform: rotate(-6deg) scale(1.06); }

.feature-box {
  background: #fff;
  border: 1px solid rgba(29, 78, 216, .1);
  border-left: 5px solid var(--brand);
  border-radius: .8rem;
  padding: 1.3rem 1.5rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.feature-box:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-box h2, .feature-box h3 { margin-bottom: .6rem; }

.note-box { background: #fff7df; border: 1px solid #f0dda2; border-left: 5px solid #a37700; padding: 1.1rem 1.4rem; border-radius: .7rem; color: #3a2e00; }
.info-box { background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-left: 5px solid var(--brand); padding: 1.1rem 1.4rem; border-radius: .7rem; color: var(--text); }

/* ---------- 12. ตาราง ---------- */
.table-responsive { border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.4rem; background: #fff; }
.table-brand { margin-bottom: 0; border-color: #d9e6de; }
.table-brand thead th { background: var(--brand); color: #fff; font-weight: 500; border-color: var(--brand-dark); padding: .85rem 1rem; white-space: nowrap; }
.table-brand td, .table-brand th { vertical-align: middle; padding: .8rem 1rem; }
.table-brand tbody tr:nth-child(even) td { background: #f5faf7; }
.table-brand tbody tr:hover td { background: var(--brand-soft); }

/* ---------- 13. Timeline ---------- */
.timeline { list-style: none; padding-left: 0; border-left: 3px solid var(--brand-soft-2); margin-left: .8rem; }
.timeline li { position: relative; padding: 0 0 1.8rem 1.8rem; }
.timeline li::before {
  content: ""; position: absolute; left: -12px; top: .4rem;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; border: 5px solid var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.timeline .year { display: inline-block; font-weight: 600; color: #fff; background: var(--brand); padding: 0 .7rem; border-radius: 2rem; font-size: .92rem; margin-bottom: .3rem; }

/* ---------- 14. Testimonial ---------- */
.testimonial {
  background: #fff; border-radius: var(--radius-lg); padding: 1.7rem;
  height: 100%; box-shadow: var(--shadow); position: relative;
  border: 1px solid rgba(29, 78, 216, .08);
}
.testimonial::before {
  content: "\201C"; position: absolute; right: 1.2rem; top: -.4rem;
  font-size: 5rem; line-height: 1; color: var(--brand-soft-2); font-family: Georgia, serif;
}
.testimonial .stars { color: var(--gold); letter-spacing: .1em; }

/* ---------- 15. FAQ ---------- */
#faqSearch { border: 2px solid var(--brand-soft-2); border-radius: .8rem; padding-left: 1rem; }
#faqSearch:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .18); }
.accordion { --bs-accordion-border-radius: .9rem; --bs-accordion-inner-border-radius: .9rem; }
.accordion-item { border: 1px solid #dbe8e0; margin-bottom: .7rem; border-radius: .9rem !important; overflow: hidden; box-shadow: var(--shadow-sm); }
.accordion-button { font-weight: 500; color: var(--black); padding: 1.05rem 1.3rem; }
.accordion-button:not(.collapsed) { background: var(--brand-soft); color: var(--brand-darker); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .25); }
.accordion-button::after { filter: hue-rotate(80deg) saturate(1.4); }
.accordion-body { padding: 1.1rem 1.3rem 1.3rem; }
#faqNoResult { display: none; }

/* ---------- 16. แผนที่ ---------- */
.map-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; background: #dcebe2 none; box-shadow: var(--shadow); border: 4px solid #fff; }
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 17. CTA ---------- */
.cta {
  position: relative; overflow: hidden;
  background-color: var(--brand);
  background-image:
    
    linear-gradient(135deg, #2563eb 0%, var(--brand) 45%, var(--brand-darker) 100%);
  background-size: cover, cover;
  background-position: center;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 3.2rem 2rem;
  box-shadow: 0 20px 50px rgba(29, 78, 216, .3);
}
.cta h2 { color: #fff; font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta p { color: #eef8f2; font-size: 1.1rem; max-width: 40rem; margin-left: auto; margin-right: auto; }
.cta .text-dark { color: var(--black) !important; }

/* ---------- 18. Footer ---------- */
.site-footer {
  background-color: var(--black);
  background-image: radial-gradient(900px 260px at 100% 0%, rgba(29, 78, 216, .28), transparent 70%);
  color: #d9d9d9; font-size: .97rem;
  border-top: 4px solid var(--brand);
}
.site-footer p { color: #d2d6d3; }
.site-footer a { color: var(--brand-light); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-title { color: #fff; font-weight: 600; font-size: 1.15rem; margin-bottom: 1rem; position: relative; padding-bottom: .5rem; }
.footer-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; border-radius: 3px; background: var(--brand-light); }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { display: inline-block; transition: transform .2s var(--ease), color .2s var(--ease); }
.footer-links a::before { content: "›"; margin-right: .45rem; color: var(--brand-light); }
.footer-links a:hover { transform: translateX(3px); }
.site-footer address { line-height: 2; font-style: normal; }
.site-footer address .bi { color: var(--brand-light); margin-right: .3rem; }
.footer-bottom { background: #050606; color: #c9c9c9; font-size: .9rem; }

/* ---------- 19. ปุ่มกลับขึ้นบน ---------- */
.back-to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 1000;
  width: 48px; height: 48px; border-radius: 14px; border: 0;
  background: linear-gradient(135deg, #2563eb, var(--brand-dark)); color: #fff; font-size: 1.3rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- 20. Responsive ---------- */
main { overflow-x: clip; } /* กันเลื่อนแนวนอนบนมือถือ */
@media (max-width: 991.98px) {
  .hero { padding: 4rem 0 4.5rem; }
  .hero .img-frame { transform: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
  .row.g-5 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 2rem; } /* ลดระยะห่างคอลัมน์ ไม่ให้ล้นจอ */
}
@media (max-width: 767.98px) {
  body { font-size: 1rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 3.2rem 0 3.8rem; background-image: linear-gradient(180deg, rgba(5, 8, 7, .88), rgba(5, 8, 7, .7)), radial-gradient(circle at 80% 20%, rgba(37,99,235,0.28), transparent 55%); }
  .page-hero { padding: 2.8rem 0 2.6rem; }
  .content h2 { font-size: 1.35rem; }
  .cta { padding: 2.4rem 1.3rem; }
  .table-brand thead th { white-space: normal; }
}

/* ---------- 21. ลดการเคลื่อนไหว (การเข้าถึง) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 22. พิมพ์ ---------- */
@media print {
  .topbar, .site-header, .back-to-top, .cta, .map-wrap { display: none !important; }
  .hero h1, .page-hero h1, .page-hero p { color: #000; text-shadow: none; }
  .site-footer { background: none; color: #000; border: 0; }
  .site-footer a { color: #000; }
}

/* ---------- Mobile-Only Offer Block ---------- */
.mobile-only {
  display: none;
  background-color: #050508;
}
.mobile-only img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 767.98px) {
  .mobile-only {
    display: block;
  }
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}
