/* =========================================================
   Yulgang 21st Anniversary — Theme C "Fireworks Carnival" v0.2
   งานเฉลิมฉลองยามค่ำคืน · ดำ ส้ม แดง ม่วง น้ำเงิน
   กรอบทุกชิ้นเป็น 9-slice (border-image) · Title = กรอบเปล่า + ตัวหนังสือแยกรูป
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --night-900: #12050f;
  --night-800: #1d0816;
  --night-700: #2a0b1f;
  --plum-700: #3a1236;
  --plum-600: #4f1a45;
  --crimson-800: #5c0a10;
  --crimson-700: #7d0d12;
  --crimson-600: #a3141b;
  --red-500: #d62a22;
  --orange-400: #ff8a2a;
  --gold-200: #ffe7a6;
  --gold-300: #ffd977;
  --gold-400: #f5bd45;
  --gold-500: #d99a24;
  --cream-50: #fff8e8;
  --cream-100: #fbeed3;
  --cream-200: #f3dcb0;
  --ink-cream: #4a1a10;          /* ตัวหนังสือบนพื้นครีม */
  --ink-cream-soft: #7a3a24;
  --violet-400: #a46bff;
  --blue-500: #3a5bd9;

  --header-h: 76px;
  --ease: cubic-bezier(.22, .8, .2, 1);

  --font-th: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Kanit', 'Noto Sans Thai', sans-serif;
  --font-display: 'Cinzel', 'Kanit', serif;
}

/* ---------- 2. Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-th);
  color: var(--cream-100);
  background-color: var(--night-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
body.is-loading { overflow: hidden; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-ui); font-weight: 700; }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
::selection { background: var(--gold-400); color: var(--night-900); }
:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 3px; }

section[id] { scroll-margin-top: 40px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 10000;
  padding: .6rem 1rem; border-radius: 8px;
  background: var(--gold-400); color: var(--night-900); font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 16px; color: var(--night-900); }

/* ฉากหลังทั้งหน้า: เมืองกลางคืนเบลอ + ไล่สี (อยู่ใต้ WebGL) */
.page-backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 120, 40, .16), transparent 70%),
    linear-gradient(180deg, rgba(18, 5, 15, .25), rgba(18, 5, 15, .8)),
    url(../img/bg/page-backdrop.webp) center / cover no-repeat;
}

/* ---------- 3. 9-slice frames (border-image) ----------
   .fr::before = พื้นด้านใน (เริ่มที่ขอบในของแถบกรอบ --fi)
   .fr::after  = กรอบ 9-slice วางทับด้านบน (มุมลายเมฆไม่ถูกพื้นทับ) */
.fr { position: relative; isolation: isolate; }
.fr::before {
  content: ""; position: absolute; inset: var(--fi); z-index: -1;
  background: var(--fill, transparent);
  border-radius: var(--fr-r, 3px);
  pointer-events: none;
}
.fr::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-style: solid; border-color: transparent; border-width: var(--bw);
  border-image-source: var(--fr-img);
  border-image-slice: var(--fr-slice);
  border-image-width: var(--bw);
  border-image-repeat: round;
  pointer-events: none;
}
.fr--panel {
  --fr-img: url(../img/ui/frame-panel.webp); --fr-slice: 189;
  --bw: 78px; --fi: 29px;
  --fill:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(circle at 12% 88%, rgba(214, 42, 34, .07), transparent 40%),
    linear-gradient(180deg, #fff6e2, #f4dfb6);
}
.fr--card {
  --fr-img: url(../img/ui/frame-card.webp); --fr-slice: 126;
  --bw: 44px; --fi: 16px;
  --fill: linear-gradient(180deg, var(--plum-600), var(--night-700));
}
.fr--banner {
  --fr-img: url(../img/ui/frame-banner.webp); --fr-slice: 261;
  --bw: 86px; --fi: 40px;
  --fill: var(--night-800);
}

/* ---------- 4. Title bar (3-slice) + ตัวหนังสือแยกเลเยอร์ ---------- */
.title-bar {
  --h: 92px;
  /* frame-title.webp: หัวท้ายจากภาพต้นฉบับจริงทั้ง 2 ข้าง กว้าง 330 / สูง 220 รวมช่วงแถบตรงที่ไล่เข้ากับตรงกลาง → รอยต่อเนียน
     --cap  = ความกว้างหัวท้ายที่วาด (border-image-width)
     --side = ระยะกันลายเมฆ+ดาว ไม่ให้ตัวหนังสือทับ (border-width) — เล็กกว่า --cap ได้ ตัวหนังสือจะทับช่วงแถบตรงของหัวท้าย */
  --cap: calc(var(--h) * 1.5);
  --side: calc(var(--h) * 1.25);
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--h); max-width: 100%; min-width: calc(var(--cap) * 2 + 20px);
  margin: 0;
  padding: 0 calc(var(--h) * .45);   /* เว้นช่องหายใจระหว่างตัวหนังสือกับลายหัวท้าย */
  border-style: solid; border-color: transparent; border-width: 0 var(--side);
  border-image: url(../img/ui/frame-title.webp) 0 330 fill / 0 var(--cap) stretch;
  filter: drop-shadow(0 10px 16px rgba(40, 0, 8, .45));
}
.title-bar__text {
  display: block;
  /* titles/*.webp ทุกไฟล์สูงเท่ากัน (เส้นฐานตรงกัน) → ตัวอักษรขนาดเท่ากันทุกหัวข้อ · ส่วนหัว/หางสระล้นแถบได้นิดหน่อย */
  height: calc(var(--h) * 1.02); width: auto; max-width: 100%;
  margin-top: calc(var(--h) * -.06);
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(60, 0, 0, .55));
}

/* ---------- 5. Buttons (3-slice) ---------- */
.btn-c {
  --h: 54px;
  /* btn-primary.webp: หัวท้ายจากภาพต้นฉบับ กว้าง 291 / สูง 200 · --cap = ที่วาด, --side = ระยะกันลายเมฆ+ขอบโค้ง (ดูหมายเหตุที่ .title-bar) */
  --cap: calc(var(--h) * 1.455);
  --side: calc(var(--h) * .9);
  --img: url(../img/ui/btn-primary.webp); --slice: 291;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: var(--h);
  min-width: calc(var(--cap) * 2 + 1rem);
  padding: 0 .3rem;
  border-style: solid; border-color: transparent; border-width: 0 var(--side);
  border-image-source: var(--img);
  border-image-slice: 0 var(--slice) fill;
  border-image-width: 0 var(--cap);
  border-image-repeat: stretch;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--h) * .32); line-height: 1.1;
  color: #fff3d6;
  text-shadow: 0 2px 0 rgba(90, 0, 0, .55);
  white-space: nowrap;
  transition: transform .3s var(--ease), filter .3s;
}
.btn-c i { font-size: 1.15em; }
.btn-c span { display: flex; flex-direction: column; align-items: flex-start; }
.btn-c small { margin-top: 2px; font-size: .62em; font-weight: 500; opacity: .85; }
.btn-c:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.12) drop-shadow(0 8px 14px rgba(255, 140, 40, .4)); }
.btn-c--plum { --img: url(../img/ui/btn-secondary.webp); --slice: 224; --cap: calc(var(--h) * 1.4); --side: calc(var(--h) * .62); }   /* หัวท้าย 224 / สูง 160 */
.btn-c--sm { --h: 46px; }
.btn-c--lg { --h: 62px; }
.btn-c--xl { --h: 78px; font-size: 1.3rem; }
.btn-more i { transition: transform .3s var(--ease); }
.btn-more:hover i { transform: translateX(4px); }

/* ---------- 6. Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, var(--plum-700), var(--night-900) 70%);
  animation: loader-failsafe 0s 6s forwards;   /* ถ้า JS โหลดไม่ขึ้น ไม่ให้บังหน้า */
}
@keyframes loader-failsafe { to { visibility: hidden; opacity: 0; pointer-events: none; } }
.loader__inner { text-align: center; }
.loader__num {
  display: inline-flex; align-items: flex-start;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(84px, 14vw, 168px); line-height: .9; letter-spacing: -.03em;
  padding: .14em .06em 0;   /* background-clip: text ระบายสีแค่ในกล่อง — เว้นที่ให้ "st" ที่ยกสูงไม่ถูกตัด */
  background: linear-gradient(180deg, var(--gold-200), var(--gold-400) 55%, var(--orange-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 140, 40, .45));
}
.loader__num sup { top: .25em; margin-left: .06em; font-size: .3em; letter-spacing: 0; }
.loader__bar { width: 220px; height: 3px; margin: 26px auto 14px; border-radius: 3px; background: rgba(255, 217, 119, .2); overflow: hidden; }
.loader__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange-400), var(--gold-300)); transform: scaleX(0); transform-origin: left; }
.loader__txt { margin: 0; font-size: 13px; letter-spacing: .12em; color: var(--gold-300); }

/* ---------- 7. WebGL world ---------- */
.world {
  position: fixed; inset: 0; z-index: 1;
  display: block; width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.world.is-ready { opacity: 1; }
body.webgl-off .world { opacity: 0; }

/* ---------- 8. Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  background: linear-gradient(180deg, rgba(18, 5, 15, .72), rgba(18, 5, 15, 0));   /* ตอนอยู่บนสุด: เงาบาง ๆ ให้เมนูอ่านออกบนพลุ */
  transition: transform .5s var(--ease);
}
/* พื้นหลังเบลอใส่ที่ ::before — ถ้าใส่ backdrop-filter ที่ header เอง
   offcanvas (position: fixed) ข้างในจะถูกจำกัดความสูงเท่า header */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(29, 8, 22, .94), rgba(42, 11, 31, .86));
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(245, 189, 69, .35), 0 10px 30px rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .35s;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header .navbar { height: var(--header-h); padding: 0; }

.navbar-brand { padding: 0; margin-right: 1.5rem; }
.navbar-brand img { height: 54px; width: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.site-header .nav-link {
  position: relative;
  padding: .5rem .9rem !important;
  font-family: var(--font-ui); font-weight: 500; font-size: 1.02rem;
  color: var(--cream-100);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.site-header .nav-link::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .15rem;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}
.site-header .nav-link:hover,
.site-header .nav-link.active { color: var(--gold-300); }
.site-header .nav-link:hover::after,
.site-header .nav-link.active::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: .4rem; }
/* ลิงก์ข้อความเปล่า (ไม่มีกรอบปุ่ม) ข้างปุ่มดาวน์โหลด */
.nav-web {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .6rem;
  font-family: var(--font-ui); font-weight: 500; font-size: 1.02rem; white-space: nowrap;
  color: var(--cream-100);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
  transition: color .25s;
}
.nav-web:hover, .nav-web:focus-visible { color: var(--gold-300); }
.navbar-toggler {
  display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0;
  border: 1.5px solid var(--gold-400); border-radius: 12px;
  background: rgba(29, 8, 22, .6);
  font-size: 1.6rem; color: var(--gold-300);
}
.navbar-toggler:focus { box-shadow: none; }
.offcanvas { color: var(--cream-100); }
.offcanvas-title { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; margin: 0; color: var(--gold-300); }

/* ---------- 9. Hero ---------- */
.hero {
  position: relative;              /* ห้ามใส่ z-index/transform: ให้ BG อยู่หลัง canvas และเนื้อหาอยู่หน้า canvas */
  display: flex; align-items: center;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--header-h) + 16px) 0 150px;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: -48px; z-index: 0; }
.hero__bg-inner { position: relative; width: 100%; height: 100%; }
.hero__bg-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero__bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 45%;
  opacity: 0; transition: opacity .8s ease;
  pointer-events: none;
}
.hero__bg-video.is-playing { opacity: 1; }
/* ขอบล่าง hero ละลายเข้า .page-backdrop ด้วย mask (ไม่ไล่เป็นสีทึบ → ไม่มีรอยต่อกับ section ถัดไป)
   .hero__bg ยื่นเกินขอบ 48px จึงเริ่มโปร่งที่ 48px */
.hero__bg {
  -webkit-mask-image: linear-gradient(to top, transparent 48px, #000 280px);
  mask-image: linear-gradient(to top, transparent 48px, #000 280px);
}
.hero__chars, .hero__fg {
  -webkit-mask-image: linear-gradient(to top, transparent, #000 120px);
  mask-image: linear-gradient(to top, transparent, #000 120px);
}

.hero__mid { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero__mid-item { position: absolute; }
.hero__mid-item img { display: block; width: 100%; height: auto; }
.hero__mid-item--l { left: 2%; top: -3%; width: clamp(54px, 4.6vw, 92px); filter: drop-shadow(0 0 18px rgba(255, 120, 40, .55)); }

.hero__chars { position: absolute; z-index: 3; right: 0; bottom: 0; width: 60%; height: calc(100% - var(--header-h)); pointer-events: none; }
.hero__char { position: absolute; }
.hero__char-inner img { display: block; width: 100%; height: auto; }
.hero__char--a { right: 1%; bottom: 7%; width: 37%; filter: drop-shadow(0 0 30px rgba(140, 120, 255, .35)); }     /* หญิง: ขวา/หลัง */
.hero__char--b { right: 28%; bottom: 1%; width: 64%; filter: drop-shadow(0 0 34px rgba(255, 150, 60, .4)); }      /* ชาย: หน้า */

.hero__fg { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; z-index: 5; pointer-events: none; }
.hero__fg-inner { position: absolute; inset: 0; }
.hero__fg-item { position: absolute; bottom: -3%; }
.hero__fg-item img { display: block; width: 100%; height: auto; }
.hero__fg-item--l { left: -4%; width: clamp(220px, 22vw, 440px); }
.hero__fg-item--r { right: -3%; width: clamp(170px, 16vw, 320px); }
.hero__fg-item--bear-l { left: 4%; bottom: 1%; width: clamp(96px, 8.5vw, 168px); }   /* ชิดซ้ายบนกองของขวัญ ไม่อยู่หลังปุ่ม CTA */
.hero__fg-item--bear-r { right: 13%; bottom: 2%; width: clamp(100px, 9vw, 176px); }

.hero__content { position: relative; z-index: 6; }
.hero__copy { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 560px; margin: 0 auto; }
/* backdrop หลังโลโก้ + ข้อความ + ปุ่ม: มืดลงและเบลอนิด ๆ ดันฉากหลังให้ถอยไป ชุด copy จะเด่นขึ้น */
.hero__copy::before {
  content: ""; position: absolute; inset: -8% -30% -22%; z-index: -1;
  background:
    radial-gradient(ellipse 48% 26% at 50% 74%, rgba(14, 3, 11, .88), rgba(14, 3, 11, .62) 55%, rgba(14, 3, 11, 0)),   /* เน้นช่วงข้อความ + ปุ่ม */
    radial-gradient(closest-side, rgba(14, 3, 11, .8), rgba(14, 3, 11, .62) 50%, rgba(14, 3, 11, .3) 80%, rgba(14, 3, 11, 0));
  -webkit-backdrop-filter: blur(6px) saturate(.85); backdrop-filter: blur(6px) saturate(.85);
  -webkit-mask-image: radial-gradient(closest-side, #000 66%, transparent);
  mask-image: radial-gradient(closest-side, #000 66%, transparent);
  pointer-events: none;
}

.hero-logo { display: flex; flex-direction: column; align-items: center; width: min(100%, 540px); margin: 0 0 1.1rem; }
.hero-logo__main { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .55)); }

/* CTA หลัก: ปุ่มเรืองแสง ให้ลอยเด่นบน backdrop ของ .hero__copy */
.hero__cta { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem .5rem; width: 100%; max-width: 520px; }
.hero__cta .btn-c { width: 100%; min-width: 0; }
.hero__cta .btn-c--plum {
  color: var(--gold-200);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .65)) drop-shadow(0 0 12px rgba(255, 190, 90, .5));
}
.hero__cta-main {
  --h: 86px;
  grid-column: 1 / -1;
  font-size: 1.45rem;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)) drop-shadow(0 0 16px rgba(255, 170, 60, .55));
}
.hero__cta-main::after {    /* แสงวิ่งผ่านเฉพาะในแคปซูลแดง (ไม่ทับลายเมฆ) */
  content: ""; position: absolute;
  top: 19%; bottom: 17%; left: calc(var(--h) * .64 - var(--side)); right: calc(var(--h) * .64 - var(--side));
  border-radius: 999px;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 248, 220, .55) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  animation: cta-shine 3.6s ease-in-out infinite 1.2s;
  pointer-events: none;
}
@keyframes cta-shine { 0% { background-position: 160% 0; } 45%, 100% { background-position: -60% 0; } }

/* xl: คอลัมน์ copy กว้าง 6/12 → ขยายโลโก้ + ปุ่มตาม */
@media (min-width: 1200px) {
  .hero__copy { max-width: 660px; }
  /* รูปโลโก้มีขอบใสบน ~9% ล่าง ~3% ของความกว้าง → margin ติดลบกินขอบใส ส่วนที่เห็นจริงสูง ≈ .82 × กว้าง
     จอเตี้ย: ย่อตามความสูงจอ ให้ปุ่มทั้ง 3 ยังอยู่ในจอแรก (290px ≈ ปุ่ม + ระยะห่าง + ขอบบนล่าง) */
  .hero-logo { width: min(100%, calc((100svh - var(--header-h) - 290px) / .82)); margin-bottom: .5rem; }
  .hero-logo__main { margin: -9% 0 -3%; }
  .hero { padding-bottom: 90px; }
  .hero__fg-item--bear-l { left: calc(50% + 70px); }   /* ปุ่มกว้างขึ้นจนทับหมีซ้าย → ย้ายไปขวาของปุ่มเลื่อนลง */
  .hero__cta { max-width: 620px; gap: .8rem .6rem; }
  .hero__cta-main { --h: 98px; font-size: 1.6rem; }
  .hero__cta .btn-c--plum { --h: 72px; font-size: 1.15rem; }
}

.hero__scroll {
  position: absolute; left: 0; right: 0; bottom: 20px; z-index: 6;
  width: max-content; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; color: var(--gold-300);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}
.mouse { position: relative; width: 26px; height: 40px; border: 2px solid currentColor; border-radius: 14px; }
.mouse i {
  position: absolute; left: 50%; top: 7px;
  width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: currentColor;
  animation: mouse-wheel 1.6s infinite;
}
@keyframes mouse-wheel {
  0% { opacity: 0; transform: translateY(-3px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ---------- 10. Sections ---------- */
.sec { position: relative; z-index: 2; padding: clamp(48px, 6vw, 96px) 0; }
.sec-panel { padding: calc(var(--bw) - 10px) calc(var(--bw) - 14px) calc(var(--bw) - 6px); color: var(--ink-cream); }
.sec-head { max-width: 980px; margin: 0 auto clamp(26px, 3.6vw, 48px); text-align: center; }
.sec-kicker {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  margin-bottom: 1.15rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: .78rem; letter-spacing: .32em;
  color: var(--gold-300);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.sec-kicker::before,
.sec-kicker::after { content: ""; width: 42px; height: 1.5px; background: linear-gradient(90deg, transparent, currentColor); }
.sec-kicker::after { transform: scaleX(-1); }
.sec-panel .sec-kicker { color: var(--crimson-600); text-shadow: none; }
.sec-sub { margin: 1.5rem auto 0; max-width: 780px; font-size: clamp(1rem, 1.25vw, 1.12rem); line-height: 1.8; color: var(--cream-100); text-shadow: 0 2px 10px rgba(0, 0, 0, .55); text-wrap: balance; }
.sec-panel .sec-sub { color: var(--ink-cream-soft); text-shadow: none; }
.sec-actions { display: flex; justify-content: center; margin-top: clamp(26px, 3.4vw, 42px); }
.sec-actions--start { justify-content: flex-start; margin-top: 26px; }
.sec-sub--wide { max-width: 920px; }

/* ---------- 11. Overview ---------- */
.ov-card {
  display: flex; flex-direction: column;
  height: 100%;
  padding: var(--fi);
  color: var(--cream-50);
  transition: transform .4s var(--ease), filter .4s;
}
.ov-card:hover { color: var(--cream-50); transform: translateY(-6px); filter: drop-shadow(0 18px 22px rgba(120, 20, 10, .35)); }
.ov-card__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.ov-card__tag {
  position: absolute; top: calc(var(--fi) + 10px); left: calc(var(--fi) + 10px); z-index: 4;
  padding: .22rem .6rem; border-radius: 6px;
  border: 1px solid var(--gold-400);
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-display); font-weight: 700; font-size: .7rem; letter-spacing: .12em;
  color: var(--gold-200);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.ov-card__body { display: flex; flex-direction: column; gap: .1rem; padding: .8rem .55rem .55rem; }
.ov-card__body b { font-family: var(--font-ui); font-weight: 700; font-size: 1.1rem; color: var(--gold-300); }
.ov-card__body small { font-size: .85rem; line-height: 1.5; color: var(--cream-100); opacity: .85; }

/* ---------- 12. 01 Necklace ---------- */
/* ระยะ title → sub → แบนเนอร์ → ปุ่ม แน่นกว่า section อื่น (Highlights ใช้ระยะหัวเดียวกัน) */
.sec-necklace .sec-head,
.sec-highlights .sec-head { margin-bottom: clamp(10px, 1.2vw, 18px); }
.sec-necklace .sec-sub,
.sec-highlights .sec-sub { margin-top: .4rem; }
.sec-necklace .sec-actions { margin-top: clamp(8px, 1vw, 14px); }
.necklace-frame { max-width: 1120px; margin: 0 auto; padding: var(--fi); }
.necklace-frame__inner { position: relative; overflow: hidden; border-radius: 3px; }
.necklace-frame__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
/* ข้อความวางบนท้องฟ้าว่างด้านขวาของแบนเนอร์ (ตำแหน่ง % ตามภาพ 16:9 จึงย่อตามแบนเนอร์) */
.necklace-frame__text { position: absolute; left: 59.5%; top: 29%; z-index: 1; width: 26.7%; height: auto; pointer-events: none; }
.shine {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 240, 200, .55) 50%, transparent 65%);
  opacity: 0;
}

/* ---------- 13. 02 New character ---------- */
.hl-card { position: sticky; top: calc(var(--header-h) + 16px); text-align: center; }
.hl-card__tag {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem 1.1rem; border-radius: 999px;
  border: 1.5px solid var(--gold-400);
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-ui); font-weight: 600; font-size: .95rem;
  color: var(--gold-200);
  box-shadow: 0 6px 14px rgba(120, 10, 10, .3);
}
.hl-card__title { margin: .8rem 0 1rem; font-size: clamp(1.35rem, 2vw, 1.75rem); color: var(--crimson-600); }
.hl-card__stage { padding: var(--fi); }
.hl-card__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.hl-card__badge {
  position: absolute; top: 8%; right: 5%; z-index: 4;
  display: grid; place-items: center;
  width: 96px; aspect-ratio: 360 / 337;
  background: url(../img/ui/medallion.webp) center / contain no-repeat;
  font-family: var(--font-display); font-weight: 900; font-size: 2rem;
  color: var(--gold-200);
  text-shadow: 0 2px 0 #5a0000, 0 0 12px rgba(255, 180, 80, .6);
}
.hl-card__desc { max-width: 420px; margin: 1.1rem auto 0; line-height: 1.75; color: var(--ink-cream-soft); }

.road { position: relative; display: flex; flex-direction: column; gap: 16px; padding-left: 112px; }
.road__track { position: absolute; left: 50px; top: 60px; bottom: 60px; width: 6px; border-radius: 6px; background: rgba(163, 20, 27, .16); overflow: hidden; }
.road__fill {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--gold-300), var(--orange-400), var(--red-500));
  box-shadow: 0 0 12px var(--orange-400);
  transform: scaleY(0); transform-origin: top;
}
.tier { position: relative; }
.tier__node {
  position: absolute; left: -112px; top: 12px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 106px; aspect-ratio: 360 / 337;
  background: url(../img/ui/medallion.webp) center / contain no-repeat;
  color: var(--gold-200);
  filter: grayscale(.85) brightness(.82);
  transition: filter .5s, transform .5s var(--ease);
}
.tier__node small { font-family: var(--font-ui); font-size: .72rem; font-weight: 600; letter-spacing: .08em; line-height: 1; }
.tier__node b { font-family: var(--font-display); font-size: 1.65rem; font-weight: 900; line-height: 1.05; text-shadow: 0 2px 0 #5a0000; }
.tier--final .tier__node b { font-size: 1.35rem; }
.tier__lvup {
  position: absolute; left: 50%; bottom: calc(100% - 2px);
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--gold-400);
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--gold-200); white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px) scale(.8);
  transition: opacity .4s, transform .5s var(--ease);
}
.tier.is-reached .tier__node { filter: none; transform: scale(1.05); }
.tier.is-reached .tier__lvup { opacity: 1; transform: translate(-50%, 0) scale(1); }

.tier__card {
  --fill: linear-gradient(180deg, #fffaf0, #f7e4bf);
  padding: calc(var(--fi) + 10px) calc(var(--fi) + 12px) calc(var(--fi) + 8px);
  transition: filter .5s;
}
.tier.is-reached .tier__card { filter: drop-shadow(0 12px 18px rgba(160, 40, 10, .25)); }
.tier__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tier__head h3 { margin: 0; font-size: 1.12rem; color: var(--ink-cream); }
.tier__head em { font-style: normal; color: var(--crimson-600); }
.tier__count {
  flex-shrink: 0;
  padding: .2rem .65rem; border-radius: 999px;
  background: rgba(163, 20, 27, .1); border: 1px solid rgba(163, 20, 27, .35);
  font-family: var(--font-ui); font-size: .74rem; font-weight: 500;
  color: var(--crimson-600);
}

.tier__items { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 10px; margin: 0; padding: 0; list-style: none; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.item__slot {
  position: relative;
  display: grid; place-items: center;
  width: 100%; max-width: 84px; aspect-ratio: 270 / 300;
  background: url(../img/ui/slot.webp) center / 100% 100% no-repeat;
}
.item__slot img { display: block; width: 72%; height: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.item__qty {
  position: absolute; right: 4%; bottom: 7%; z-index: 2;
  padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--gold-400);
  background: var(--crimson-700);
  font: 600 11px/1.5 var(--font-ui);
  color: var(--gold-200);
}
.item__name { font-size: .8rem; font-weight: 600; line-height: 1.35; color: var(--ink-cream); }
.item__name small { display: block; margin-top: 2px; font-size: .68rem; font-weight: 600; color: var(--crimson-600); }
.item--special .item__slot { filter: drop-shadow(0 0 6px rgba(255, 170, 60, .75)); }

/* อุปกรณ์ +7 ครบชุด (ใต้ hl-card) */
.gear {
  --fill: linear-gradient(180deg, #fffaf0, #f7e4bf);
  display: flex; align-items: center; gap: 14px;
  margin-top: 1.1rem; padding: calc(var(--fi) + 6px) calc(var(--fi) + 10px);
  text-align: left;
}
.gear__card { flex: 0 0 34%; margin: 0; text-align: center; }
.gear__card img {
  display: block; width: 100%; height: auto;
  -webkit-mask: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask: radial-gradient(closest-side, #000 62%, transparent 100%);
}
.gear__card figcaption { margin-top: -4px; font-size: .78rem; font-weight: 700; color: var(--crimson-600); }
.gear__body { flex: 1; min-width: 0; }
.gear__title { margin: 0 0 10px; font-size: 1.05rem; color: var(--ink-cream); }
.gear__items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }

/* ---------- 14. 03 Costume ---------- */
.costume-stage { max-width: 560px; aspect-ratio: 4 / 5; margin: 0 auto; padding: var(--fi); }
@media (min-width: 992px) { .costume-stage { margin-right: 0; } }   /* ชิดขวาเข้าหาขั้นตอน ไม่ให้มีช่องว่างกลาง */
.costume-stage__view { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 3px; }
.costume-stage__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.costume-stage__rays {
  position: absolute; inset: -20%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 230, 170, .12) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 58%);
  mask: radial-gradient(circle, #000 12%, transparent 58%);
  mix-blend-mode: screen;
}
.costume-stage__halo {
  position: absolute; top: 9%; left: 50%;
  width: 76%; aspect-ratio: 1; margin-left: -38%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 217, 119, .55);
  box-shadow: inset 0 0 50px rgba(140, 160, 255, .35), 0 0 30px rgba(140, 160, 255, .25);
}
.costume-stage__halo--inner { top: 16%; width: 60%; margin-left: -30%; border: 3px dotted rgba(255, 217, 119, .5); box-shadow: none; }
.costume-stage__figure { position: absolute; top: 4%; bottom: 11%; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; }
.costume-stage__float { position: relative; height: 100%; aspect-ratio: 690 / 1006; }
.costume-stage__look { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.costume-stage__look.is-active { opacity: 1; visibility: visible; }
.costume-stage__look img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 24px rgba(120, 150, 255, .55)); }
.costume-stage__sparks { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.costume-stage__sparks i { position: absolute; bottom: 14%; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 8px #ffd977; opacity: 0; }

.look-toggle {
  position: absolute; top: calc(var(--fi) + 12px); left: calc(var(--fi) + 12px); z-index: 5;
  display: inline-flex; padding: 4px;
  border: 1.5px solid var(--gold-400); border-radius: 999px;
  background: rgba(29, 8, 22, .75);
}
.look-toggle button {
  padding: .3rem 1rem;
  border: 0; border-radius: 999px;
  background: transparent;
  font-family: var(--font-ui); font-weight: 600; font-size: .9rem;
  color: var(--gold-200);
  transition: background-color .3s, color .3s;
}
.look-toggle button.is-active { background: linear-gradient(180deg, var(--red-500), var(--crimson-700)); color: #fff; }

.costume-stage__plate {
  position: absolute; left: 50%; bottom: -18px; z-index: 5;
  min-width: 260px;
  padding: 12px 26px 12px;
  border: 1.5px solid var(--gold-400); border-radius: 16px;
  background: linear-gradient(180deg, var(--red-500), var(--crimson-800));
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 12px 24px rgba(60, 0, 8, .45);
}
.costume-stage__plate h3 { margin: 0; font-size: 1.35rem; color: var(--gold-200); }
.costume-stage__plate p { margin: 2px 0 0; font-size: .88rem; color: var(--cream-100); }
.stamp {
  position: absolute; top: -20px; right: -22px;
  padding: .3rem .75rem;
  border: 2px solid var(--gold-300); border-radius: 8px;
  background: linear-gradient(180deg, var(--plum-600), var(--night-700));
  font-family: var(--font-display); font-weight: 900; font-size: .85rem; letter-spacing: .14em;
  color: var(--gold-300);
  transform: rotate(8deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

.quest__title { display: flex; flex-direction: column; margin-bottom: 1.2rem; font-size: clamp(1.35rem, 2vw, 1.6rem); color: var(--crimson-600); }
.quest__title small { margin-bottom: .3rem; font-family: var(--font-display); font-weight: 700; font-size: .74rem; letter-spacing: .3em; color: var(--ink-cream-soft); }
.quest__steps { position: relative; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.quest__steps::before { content: ""; position: absolute; left: 30px; top: 40px; bottom: 40px; border-left: 3px dotted rgba(163, 20, 27, .4); }
.qstep { position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 0 10px; align-items: start; }
.qstep__no {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 62px; aspect-ratio: 360 / 337; margin-top: 14px;
  background: url(../img/ui/medallion.webp) center / contain no-repeat;
  font-family: var(--font-display); font-weight: 900; font-size: 1.35rem;
  color: var(--gold-200);
  text-shadow: 0 2px 0 #5a0000;
}
.qstep__card {
  --fill: linear-gradient(180deg, #fffaf0, #f7e4bf);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: calc(var(--fi) + 8px) calc(var(--fi) + 10px);
}
.qstep__body h4 { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.45; color: var(--ink-cream); }
.qstep__body p { margin: 0; font-size: .86rem; line-height: 1.6; color: var(--ink-cream-soft); }
.qstep__items { display: flex; align-items: flex-start; gap: 4px; flex-shrink: 0; }
.qitem { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; margin: 0; text-align: center; }
.qitem .item__slot { max-width: 62px; }
.qitem figcaption { font-size: .7rem; font-weight: 600; line-height: 1.3; color: var(--ink-cream); }
.qitem__npc {
  display: block; width: 66px; height: 66px; overflow: hidden;
  border: 2px solid var(--gold-400); border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ffe2a8, #c9472a);
  box-shadow: 0 4px 10px rgba(120, 30, 10, .3);
}
.qitem__npc img { display: block; width: 100%; height: auto; margin-top: 6%; }
.qitem__craft {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px dashed var(--crimson-600);
  font-size: 1.4rem; color: var(--crimson-600);
}
.qstep__arrow { margin-top: 22px; font-size: 1.1rem; color: var(--crimson-600); }
.qstep--final .qstep__card { --fill: linear-gradient(180deg, #fff1cf, #f3cf8a); }

/* ---------- 15. 04 Activities — ผังเมืองฉลอง (isometric) ----------
   ทุกเลเยอร์วางด้วย % ของรูปเกาะ (--x / --y) และกำหนดขนาดด้วย cqw (% ของความกว้างแผนที่)
   → ย่อขยายพร้อมกันทั้งชุด ไม่ต้องคำนวณใหม่ทุกขนาดจอ */
.act-map {
  position: relative;
  container-type: inline-size;
  margin: 5% auto 0;   /* เว้นที่ให้ป้ายของหมุดที่อยู่ขอบบนเกาะ */
}
.act-map::before {   /* แสงอุ่นใต้เกาะ */
  content: ""; position: absolute; inset: 6% 4% -4%; z-index: -1;
  background: radial-gradient(ellipse 50% 46% at 50% 55%, rgba(255, 120, 40, .32), rgba(178, 40, 90, .14) 55%, transparent 75%);
  pointer-events: none;
}
.act-map__base { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }

.act-map__bear {
  position: absolute; left: var(--x); top: var(--y); z-index: 2;
  width: var(--w); height: auto;
  translate: -50% -100%;   /* แยกจาก transform → GSAP ขยับ/สเกลได้โดยไม่ทับตำแหน่ง */
  filter: drop-shadow(0 6px 6px rgba(60, 0, 20, .45));
  pointer-events: none;
}

.act-spot {
  --pin: 4.6cqw;
  position: absolute; left: var(--x); top: var(--y); z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  translate: -50% -100%;   /* แยกจาก transform → GSAP ขยับ/สเกลได้โดยไม่ทับตำแหน่ง */
  color: var(--cream-50);
}
.act-spot:hover, .act-spot:focus-visible { z-index: 5; color: var(--cream-50); }
.act-spot--info { cursor: default; }   /* หมุดที่ไม่มีลิงก์ (hover ดู tooltip อย่างเดียว) */
.act-spot__pin {
  display: block; width: var(--pin); height: auto;
  filter: drop-shadow(0 6px 8px rgba(40, 0, 10, .55));
}
/* ป้าย + หมุด: hover ยกทั้งชุดที่ตัวห่อนี้ (GSAP ไม่แตะ) — ตัวป้าย / หมุดข้างในเป็นของ GSAP (เข้าฉาก + ลอย) */
.act-spot__stack {
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 100%;
  transition: translate .35s var(--ease), scale .35s var(--ease);
}
.act-spot:hover .act-spot__stack, .act-spot:focus-visible .act-spot__stack { translate: 0 -.6cqw; scale: 1.08; }
.act-spot::after {   /* วงแสงเต้นที่ปลายหมุด */
  content: ""; position: absolute; left: 50%; top: 100%; z-index: -1;
  width: calc(var(--pin) * 1.4); aspect-ratio: 2.4;
  border: 2px solid rgba(255, 214, 120, .9); border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spot-ring 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes spot-ring { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.4); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }

/* ริบบิ้นเปล่า 3-slice (ribbon-label.webp: หัวท้าย 155 / สูง 160) + รูปตัวหนังสือ */
.act-spot__label {
  --rh: 3.6cqw;
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--rh); margin-bottom: -.35cqw;
  border-style: solid; border-color: transparent;
  border-width: 0 calc(var(--rh) * .78);
  border-image: url(../img/ui/ribbon-label.webp) 0 155 fill / 0 calc(var(--rh) * .97) stretch;
  filter: drop-shadow(0 5px 7px rgba(40, 0, 10, .55));
  transition: filter .35s;
}
.act-spot__label img { display: block; width: calc(var(--lw) * .0165cqw); height: auto; margin-top: -.2cqw; }
.act-spot:hover .act-spot__label, .act-spot:focus-visible .act-spot__label {
  filter: drop-shadow(0 5px 7px rgba(40, 0, 10, .55)) drop-shadow(0 0 12px rgba(255, 200, 90, .8));
}
.act-spot:focus-visible { outline: none; }
.act-spot:focus-visible .act-spot__label { outline: 2px solid var(--gold-300); outline-offset: 4px; }

/* รายละเอียดเมื่อชี้ / โฟกัส: การ์ดเล็กใต้ปลายหมุด */
.act-spot__tip {
  position: absolute; left: 50%; top: calc(100% + 10px);
  width: max-content; max-width: 270px;
  text-wrap: balance;
  padding: .7rem .95rem .75rem; border-radius: 12px;
  border: 1.5px solid var(--gold-400);
  background: linear-gradient(180deg, rgba(91, 26, 74, .97), rgba(29, 8, 22, .97));
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
  font-size: .86rem; line-height: 1.5; text-align: center; color: var(--cream-100);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  pointer-events: none;
}
.act-spot__tip b { display: block; font-family: var(--font-ui); font-size: 1rem; color: var(--gold-300); }
.act-spot__tip em { display: block; margin-top: .35rem; font-style: normal; font-weight: 600; font-size: .8rem; color: var(--gold-200); }
.act-spot:hover .act-spot__tip, .act-spot:focus-visible .act-spot__tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* รายการใต้แผนที่ (มือถือ / แท็บเล็ต) */
.act-list { display: none; margin: 28px 0 0; padding: 0; list-style: none; }
.act-list li + li { margin-top: 10px; }
@media (min-width: 576px) {   /* แท็บเล็ต: 2 คอลัมน์ */
  .act-list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .act-list li + li { margin-top: 0; }
}
.act-list__item { display: flex; align-items: center; gap: 12px; padding: calc(var(--fi) + 4px) calc(var(--fi) + 8px); color: var(--cream-100); }
.act-list__item:hover { color: var(--cream-50); }
.act-list__item--info:hover { color: var(--cream-100); }   /* ไม่ใช่ลิงก์ → ไม่เปลี่ยนสีตอนชี้ */
.act-list__pin { flex-shrink: 0; width: 38px; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.act-list__body { flex: 1; min-width: 0; }
.act-list__body img { display: block; width: min(100%, calc(var(--lw) * .2px)); height: auto; }
.act-list__body small { display: block; margin-top: 4px; font-size: .84rem; line-height: 1.45; opacity: .85; }
.act-list__go { flex-shrink: 0; font-size: 1.2rem; color: var(--gold-300); }

/* ---------- 16. 05 Highlights — Owl Carousel 2 (custom) ---------- */
.sec-highlights { overflow: hidden; }
.hl-carousel {
  --slide-w: min(880px, 62vw);
  --side-scale: .8;
  --side-shift: 26%;              /* ดึงสไลด์ข้างเข้าหากลาง → ซ้อนหลังเล็กน้อย */
  position: relative;
}
.hl-carousel .owl-carousel { width: var(--slide-w); margin: 0 auto; }
.hl-carousel .owl-stage-outer { overflow: visible; }
.hl-carousel .owl-item {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(.6);
  transition: transform .8s var(--ease), opacity .8s var(--ease), filter .8s var(--ease);
}
.hl-carousel .owl-item.center { z-index: 3; opacity: 1; transform: none; pointer-events: auto; }
.hl-carousel .owl-item.is-prev,
.hl-carousel .owl-item.is-next { z-index: 2; opacity: 1; pointer-events: auto; cursor: pointer; filter: brightness(.6) saturate(.8); }
.hl-carousel .owl-item.is-prev { transform: translateX(var(--side-shift)) scale(var(--side-scale)); }
.hl-carousel .owl-item.is-next { transform: translateX(calc(var(--side-shift) * -1)) scale(var(--side-scale)); }
.hl-carousel .owl-item.is-prev2 { transform: translateX(calc(var(--side-shift) * 3)) scale(.6); }
.hl-carousel .owl-item.is-next2 { transform: translateX(calc(var(--side-shift) * -3)) scale(.6); }

.hl-slide { display: block; padding: var(--fi); }
/* เหลือสไลด์เดียว (main.js ใส่ .is-single) → ไม่ต้องมีลูกศร / จุด / ตัวนับ และไม่โชว์สำเนาของสไลด์เดียวกันด้านข้าง */
.hl-carousel.is-single .owl-item:not(.center) { visibility: hidden; }
.hl-carousel.is-single .hl-nav,
.hl-carousel.is-single .owl-dots,
.hl-carousel.is-single .hl-caption { display: none; }

/* สัดส่วนเท่าภาพปกข่าว WordPress (1200×628) → ภาพปกไม่ถูกครอป · placeholder สูงเท่ากัน หน้าไม่กระโดดตอนภาพมา */
.hl-slide img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 628; object-fit: cover; border-radius: 3px; }
.hl-slide .ph { aspect-ratio: 1200 / 628; }
/* สไลด์ 04 ตารางไลฟ์ (ภาพ 1200×800 ใส่ในกรอบ 1200×628) → เลื่อนจุดครอปขึ้นเล็กน้อย ให้หัว "LIVE SCHEDULE" และปฏิทินครบทุกแถว */
.hl-slide img.hl-slide__img--calendar { object-position: 50% 45%; }
.owl-item.center .hl-slide { filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .55)); }

/* Placeholder รอภาพจริง (.ph) · ป้ายข้างในสร้างจาก data-ph / data-size / data-type (main.js §1) · ป้ายมุม = data-status */
.ph {
  position: relative;
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(255, 217, 119, .07) 0 16px, transparent 16px 32px),
    radial-gradient(ellipse at 50% 40%, var(--plum-600), var(--night-800) 75%);
  outline: 2px dashed rgba(255, 217, 119, .5); outline-offset: -14px;
  color: var(--gold-200);
}
.ph[data-status]::before {
  content: attr(data-status);
  position: absolute; top: 24px; left: 24px;
  padding: .3em .9em;
  border-radius: 999px;
  background: var(--red-500);
  font-family: var(--font-ui); font-weight: 700; font-size: clamp(.72rem, 1.3vw, .95rem);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6);
}
.ph__label { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1rem; text-align: center; }
.ph__label .bi { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1; color: var(--gold-300); opacity: .75; }
.ph__label b { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.05rem, 2.6vw, 2rem); letter-spacing: .16em; color: var(--gold-300); }
.ph__label em { max-width: 30ch; font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: clamp(.9rem, 1.8vw, 1.3rem); line-height: 1.4; color: var(--cream-50); text-wrap: balance; }
.ph__label small { font-family: var(--font-ui); font-size: clamp(.78rem, 1.4vw, 1.05rem); color: var(--cream-200); opacity: .85; }

.hl-carousel .owl-dots { display: flex; justify-content: center; gap: 4px; margin-top: 24px; }
.hl-carousel .owl-dot { padding: 6px !important; border: 0 !important; background: none !important; }
.hl-carousel .owl-dot span { display: block; width: 10px; height: 10px; border-radius: 999px; background: rgba(255, 217, 119, .35); transition: width .45s var(--ease), background-color .45s; }
.hl-carousel .owl-dot.active span { width: 34px; background: linear-gradient(90deg, var(--orange-400), var(--gold-300)); }
.hl-carousel .owl-dot:focus-visible { outline: 2px solid var(--gold-300); border-radius: 8px; }

.hl-nav {
  position: absolute; top: 0; left: 50%; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  width: var(--slide-w); height: calc(var(--slide-w) * 9 / 16 + 40px);
  transform: translateX(-50%);
  pointer-events: none;
}
.hl-nav__btn {
  width: 70px; aspect-ratio: 220 / 198; margin: 0 -40px;
  border: 0; padding: 0;
  background: url(../img/ui/arrow-prev.webp) center / contain no-repeat;
  pointer-events: auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5));
  transition: transform .3s var(--ease), filter .3s;
}
.hl-nav__btn--next { background-image: url(../img/ui/arrow-next.webp); }
.hl-nav__btn:hover { transform: scale(1.1); filter: brightness(1.15) drop-shadow(0 8px 16px rgba(255, 140, 40, .5)); }

.hl-caption {
  display: flex; align-items: baseline; justify-content: center; gap: .5rem;
  margin: 12px 0 0;
  font-family: var(--font-ui); font-size: .85rem;
  color: var(--cream-100);
}
.hl-caption b { color: var(--gold-300); font-size: 1rem; }

/* ---------- 17. Join (closing CTA) ---------- */
.join__title { margin: .2rem 0 .8rem; }
.join__title img { display: block; width: min(100%, 560px); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(120, 20, 10, .35)); }
.join__text { max-width: 540px; margin: 0 auto 1.4rem; font-size: 1.05rem; line-height: 1.8; color: var(--ink-cream-soft); text-wrap: balance; }
/* ปุ่มเรียงแบบเดียวกับ hero: ปุ่มหลักเต็มแถว + ปุ่มรอง 2 ปุ่ม */
.join__cta { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .4rem; max-width: 480px; margin: 0 auto; }
.join__cta .btn-c { width: 100%; min-width: 0; }
.join__cta-main { grid-column: 1 / -1; }
.join__mascots { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 20px rgba(120, 20, 10, .3)); }
@media (min-width: 992px) {
  .join__title img, .join__text, .join__cta { margin-left: 0; }
}

/* ---------- 18. Footer (ลอกโครงจาก Real Yulgang Classic 1st Anniversary) ---------- */
.footer {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, #170610, #0d0309);
  color: rgba(251, 238, 211, .72);
  padding: 3rem 0 2rem;
  font-size: .86rem;
}
.footer::before {   /* ไล่สีจากฉากหลังเข้าพื้น footer แทนขอบตัด */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
  height: 140px;
  background: linear-gradient(to top, #170610, rgba(23, 6, 16, 0));
  pointer-events: none;
}
.foot-logos { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-bottom: 1rem; }
.foot-logo { height: 42px; width: auto; opacity: .95; }
.foot-ci { height: 34px; width: auto; opacity: .9; }
.foot-head { font-size: .92rem; font-weight: 700; color: var(--gold-300); margin-bottom: .7rem; }
.foot-list { margin: 0; padding: 0; list-style: none; }
.foot-list li { margin-bottom: .35rem; }
.foot-list a:hover, .ci-links a:hover { color: var(--gold-300); }
.socials { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.socials a { display: inline-grid; place-items: center; min-width: 42px; height: 32px; padding: 0 .6rem; border: 1px solid rgba(251, 238, 211, .25); border-radius: 6px; font-size: .72rem; font-weight: 600; transition: border-color .2s var(--ease), color .2s var(--ease); }
.socials a:hover { border-color: var(--gold-400); color: var(--gold-300); }
.ci-text { line-height: 1.7; }
.ci-small { font-size: .75rem; opacity: .72; }
.foot-rule { border-color: rgba(245, 189, 69, .25); margin: 2rem 0 1.2rem; }
body .footer { padding-bottom: 5.5rem; }   /* เว้นที่ให้ dev toolbar */

/* ---------- 19. Floating ad (คอสตูมประจำเดือน) ---------- */
.float-ad { position: fixed; right: 16px; top: 50%; z-index: 90; width: 168px; transform: translateY(-50%); }
.float-ad__inner { position: relative; }
.float-ad__panel { transform-origin: 100% 50%; transition: transform .5s var(--ease), opacity .4s, visibility .5s; }
.float-ad__card { --bw: 34px; --fi: 12px; padding: 22px 14px 14px; text-align: center; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .5)); }
.float-ad__ribbon {
  position: absolute; top: -12px; left: 50%; z-index: 4;
  padding: .26rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--gold-300);
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-ui); font-size: .72rem; font-weight: 600; white-space: nowrap;
  color: var(--gold-200);
  transform: translateX(-50%);
}
.float-ad__close {
  position: absolute; top: -10px; right: -10px; z-index: 5;
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 1.5px solid var(--gold-300); border-radius: 50%;
  background: var(--night-800);
  font-size: .72rem; color: var(--gold-300);
}
.float-ad__link { display: block; }
.float-ad__img {
  display: block; width: 100%; height: auto; aspect-ratio: 665 / 900; object-fit: contain;
  border-radius: 3px;
  background: radial-gradient(circle at 50% 38%, rgba(255, 140, 170, .55), transparent 70%), linear-gradient(180deg, #5b1a4a, #2a0b22);
}
.float-ad__title { display: block; margin-top: 8px; font-family: var(--font-ui); font-size: .95rem; font-weight: 700; line-height: 1.3; color: var(--gold-300); }
.float-ad__month { display: block; margin-top: 2px; font-size: .7rem; line-height: 1.4; color: var(--cream-100); opacity: .8; }
.float-ad__btn {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  margin-top: 8px; padding: .42rem .5rem; border-radius: 10px;
  border: 1px solid var(--gold-400);
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-ui); font-size: .78rem; font-weight: 600;
  color: var(--gold-200);
}
.float-ad__tab {
  position: absolute; top: 50%; right: -16px;
  display: none; align-items: center; gap: .4rem;
  padding: .9rem .45rem;
  border: 1.5px solid var(--gold-400); border-right: 0; border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, var(--red-500), var(--crimson-700));
  font-family: var(--font-ui); font-size: .75rem; font-weight: 600;
  color: var(--gold-200);
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}
/* ดึงสายตา: แสงวิ่งผ่านการ์ดทุก ~5 วิ · ปุ่มเต้นเบา ๆ · ชี้แล้วภาพขยาย · กลีบซากุระปลิวเป็นระยะ (main.js §12a) */
.float-ad__sweep { position: absolute; inset: var(--fi); z-index: 2; border-radius: 3px; overflow: hidden; pointer-events: none; }
.float-ad__sweep::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 55%;
  background: linear-gradient(100deg, transparent 15%, rgba(255, 248, 232, .55) 48%, rgba(255, 231, 166, .25) 56%, transparent 82%);
  mix-blend-mode: screen;
  transform: translateX(-120%) skewX(-18deg);
  animation: floatAdSweep 5s cubic-bezier(.45, 0, .2, 1) 2.5s infinite;
}
@keyframes floatAdSweep {
  0% { transform: translateX(-120%) skewX(-18deg); }
  26%, 100% { transform: translateX(260%) skewX(-18deg); }
}
.float-ad__img { transition: transform .4s var(--ease), filter .4s; }
.float-ad__link:hover .float-ad__img, .float-ad__link:focus-visible .float-ad__img { transform: scale(1.04); filter: brightness(1.08); }
.float-ad__btn { animation: floatAdPulse 2.4s ease-out infinite; transition: background-color .2s, color .2s; }
.float-ad__btn .bi { transition: transform .25s var(--ease); }
.float-ad__link:hover .float-ad__btn { background: linear-gradient(180deg, #ff4a3d, var(--crimson-600)); color: #fff3d6; }
.float-ad__link:hover .float-ad__btn .bi { transform: translateX(3px); }
@keyframes floatAdPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 217, 119, .6); }
  70%, 100% { box-shadow: 0 0 8px 8px rgba(255, 217, 119, 0); }
}
.float-ad__petals { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.float-ad__petals i {
  position: absolute; top: 0; left: 0;
  width: 13px; height: 11px;
  border-radius: 100% 0 100% 35%;
  background: radial-gradient(circle at 30% 30%, #fff1f5, #ffb3cc 55%, #ff7fa8);
  box-shadow: 0 0 6px rgba(255, 150, 190, .5);
  opacity: 0;
}
.float-ad.is-min .float-ad__panel { transform: scale(.4); opacity: 0; visibility: hidden; pointer-events: none; }   /* ย่อเข้าขอบขวา ไม่ล้นจอ */
.float-ad.is-min .float-ad__tab { display: flex; }

/* Popup รายละเอียดคอสตูม: splash art ไม่มีกรอบ (ภาพซ้าย · รายละเอียดขวา) บนหน้าเว็บที่เบลอ
   ชั้น: veil (เบลอ) < stage < กลีบ WebGL < body · ค่าใน CSS = สถานะสุดท้าย (GSAP ทำแค่ทางเข้า) */
.ad-pop {
  --art: min(100dvh, 60vw);   /* ขนาดภาพ splash */
  --ch: min(76dvh, 42vw);     /* ความสูงตัวละคร */
  position: fixed; inset: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--cream-100);
  overflow: hidden;
}
.ad-pop[open] { display: block; }
.ad-pop::backdrop { background: transparent; }
.ad-pop__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 30% 50%, rgba(255, 95, 150, .2), transparent 70%),
    linear-gradient(90deg, rgba(18, 5, 15, .5), rgba(29, 8, 22, .8) 58%, rgba(18, 5, 15, .9));
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}
.ad-pop__petals { position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.ad-pop__layout { position: relative; height: 100%; display: grid; grid-template-columns: 56fr 44fr; align-items: center; }

.ad-pop__stage { position: relative; z-index: 1; height: 100%; }
.ad-pop__art, .ad-pop__glow, .ad-pop__rays, .ad-pop__flash { position: absolute; inset: 0; margin: auto; pointer-events: none; }
.ad-pop__art { width: var(--art); height: var(--art); max-width: none; }
.ad-pop__glow {   /* แสงชมพูทองเติมช่องกลางภาพ */
  width: calc(var(--art) * .62); height: calc(var(--art) * .62); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 168, .55), rgba(255, 120, 168, .3) 45%, transparent 70%);
}
.ad-pop__rays {
  width: calc(var(--art) * 1.1); height: calc(var(--art) * 1.1); border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 217, 119, .14) 0deg 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 66%);
  mask: radial-gradient(circle, #000 15%, transparent 66%);
}
.ad-pop__chars {
  position: absolute; inset: 5dvh 0 0; margin: auto; height: var(--ch);
  display: flex; justify-content: center; align-items: flex-end;
  pointer-events: none;
}
.ad-pop__char { display: block; width: auto; height: 100%; filter: drop-shadow(0 18px 30px rgba(40, 0, 20, .55)); }
.ad-pop__char + .ad-pop__char { margin-left: calc(var(--ch) * -.06); }
.ad-pop__flash {
  width: calc(var(--art) * .7); height: calc(var(--art) * .7); border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255, 231, 166, .7) 30%, transparent 65%);
  opacity: 0; mix-blend-mode: screen;
}

.ad-pop__body { position: relative; z-index: 3; max-width: 620px; padding: 40px clamp(20px, 5vw, 96px) 40px 0; }
.ad-pop__kicker { margin: 0 0 .3rem; font-family: var(--font-display); font-weight: 700; font-size: .82rem; letter-spacing: .3em; color: var(--gold-300); text-shadow: 0 1px 3px rgba(18, 5, 15, .9), 0 0 12px rgba(245, 189, 69, .4); }
.ad-pop__title { display: flex; align-items: center; gap: .6rem; margin: 0; font-family: var(--font-ui); font-weight: 800; font-size: clamp(2.4rem, 4.4vw, 4.3rem); line-height: 1.3; }
.ad-pop__title > span {
  padding: .08em 0;   /* เผื่อสระ/วรรณยุกต์ไทย ไม่ให้ background-clip ตัด */
  background: linear-gradient(100deg, #fff8e8 0%, #ffe7a6 28%, #f5bd45 46%, #fff6dc 54%, #ffd977 70%, #d99a24 100%) 100% 0 / 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(90, 20, 10, .6)) drop-shadow(0 0 18px rgba(255, 120, 168, .35));
}
.ad-pop__title .bi { font-size: .45em; color: #ff9cc0; filter: drop-shadow(0 0 8px rgba(255, 143, 184, .8)); }
.ad-pop__flourish { display: block; width: min(100%, 420px); height: 24px; margin: -.3rem 0 .2rem; overflow: visible; }
.ad-pop__flourish path { fill: none; stroke: var(--gold-400); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(245, 189, 69, .8)); }
.ad-pop__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .4rem 0 1.4rem; font-family: var(--font-ui); font-size: 1rem; color: var(--cream-50); }
.ad-pop__meta::before { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-400)); }
.ad-pop__meta small { padding: .1rem .65rem; border: 1px solid rgba(245, 189, 69, .5); border-radius: 99px; font-size: .78rem; color: var(--gold-200); }

/* แถวราคา: ปลายตัดเฉียง · ขอบทอง = พื้นหลัง li, เนื้อใน = ::before (inset 1px) */
.ad-pop__tiers { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ad-pop__tiers li,
.ad-pop .pop-btn {
  --cut: 16px;
  --hex: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  position: relative; isolation: isolate;
  clip-path: var(--hex);
}
.ad-pop__tiers li::before,
.ad-pop .pop-btn::before { content: ""; position: absolute; inset: 1px; z-index: -1; clip-path: var(--hex); }
.ad-pop__tiers li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 14px;
  padding: 11px 26px 11px 18px;
  background: linear-gradient(90deg, rgba(245, 189, 69, .8), rgba(245, 189, 69, .25) 50%, rgba(245, 189, 69, .8));
}
.ad-pop__tiers li::before { background: linear-gradient(90deg, rgba(42, 11, 31, .94), rgba(29, 8, 22, .88)); }
.ad-pop__badge {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--gold-400);
  background: radial-gradient(circle at 35% 30%, #5b1a4a, #2a0b1f);
  box-shadow: inset 0 0 10px rgba(245, 189, 69, .35), 0 0 0 3px rgba(245, 189, 69, .12);
  font-family: var(--font-display); font-weight: 900; font-size: .95rem; color: var(--gold-200);
}
.ad-pop__tiers b { font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem; color: var(--cream-50); }
.ad-pop__price { grid-column: 3; grid-row: 1 / span 2; font-family: var(--font-ui); font-weight: 700; font-size: 1.7rem; white-space: nowrap; color: var(--gold-200); text-shadow: 0 0 14px rgba(245, 189, 69, .35); }
.ad-pop__price small { font-size: .55em; font-weight: 600; color: var(--gold-400); }
.ad-pop__opt { grid-column: 2; font-size: .78rem; line-height: 1.45; color: var(--cream-100); opacity: .75; }
.ad-pop__tiers li.is-top { background: linear-gradient(90deg, #ffd977, #ff8fb8 50%, #ffd977); }
.ad-pop__tiers li.is-top::before { background: linear-gradient(90deg, rgba(125, 20, 80, .94), rgba(79, 26, 69, .9)); }
.ad-pop__tiers li.is-top::after {   /* แสงวิ่งผ่านแถวแบบ YG */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .2) 50%, transparent 60%) 120% 0 / 250% 100% no-repeat;
  animation: adPopShine 3.4s ease-in-out infinite;
}
.ad-pop__tiers li.is-top .ad-pop__badge { border-color: #ff9cc0; background: radial-gradient(circle at 35% 30%, #a3246a, #4f1a45); color: #fff3d6; }
@keyframes adPopShine { 0%, 45% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

.ad-pop__note { margin: 1rem 0 0; font-size: .82rem; line-height: 1.6; color: var(--cream-100); opacity: .65; }
.ad-pop__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.6rem; }
.pop-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-width: 150px; height: 52px; padding: 0 1.8rem;
  border: 0; border-radius: 0;
  background: linear-gradient(90deg, rgba(245, 189, 69, .65), rgba(245, 189, 69, .25), rgba(245, 189, 69, .65));
  font-family: var(--font-ui); font-weight: 500; font-size: 1rem; letter-spacing: .12em;
  color: var(--cream-100);
  cursor: pointer;
  transition: filter .2s, color .2s;
}
.ad-pop .pop-btn::before { background: rgba(29, 8, 22, .9); transition: background-color .2s; }
.pop-btn:hover, .pop-btn:focus-visible { color: #fff; }
.ad-pop .pop-btn:hover::before, .ad-pop .pop-btn:focus-visible::before { background: rgba(79, 26, 69, .92); }
.pop-btn--primary { min-width: 250px; font-weight: 700; color: var(--night-900); background: linear-gradient(180deg, #fff3c4, #ffd977 42%, #e0a93a); }
.ad-pop .pop-btn--primary::before { display: none; }
.pop-btn--primary:hover, .pop-btn--primary:focus-visible { color: var(--night-900); filter: brightness(1.1) saturate(1.1); }
.pop-btn--primary .bi { transition: transform .25s var(--ease); }
.pop-btn--primary:hover .bi { transform: translateX(4px); }
.ad-pop__x {
  position: absolute; top: 18px; right: 22px; z-index: 4;
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid rgba(255, 243, 214, .35); border-radius: 50%;
  background: rgba(18, 5, 15, .4); color: var(--cream-50); font-size: 1.15rem;
  transition: rotate .3s var(--ease), border-color .2s, background-color .2s;
}
.ad-pop__x:hover, .ad-pop__x:focus-visible { rotate: 90deg; border-color: var(--gold-300); background: rgba(245, 189, 69, .15); }
body.has-pop { overflow: hidden; }

/* desktop จอเตี้ย: บีบระยะในคอลัมน์รายละเอียดให้พอดีความสูง */
@media (min-width: 992px) and (max-height: 760px) {
  .ad-pop__title { font-size: clamp(2rem, 3.6vw, 3.2rem); }
  .ad-pop__meta { margin-bottom: .9rem; }
  .ad-pop__tiers { gap: 8px; }
  .ad-pop__tiers li { padding-block: 7px; }
  .ad-pop__badge { width: 38px; height: 38px; }
  .ad-pop__price { font-size: 1.4rem; }
  .ad-pop__note { margin-top: .7rem; }
  .ad-pop__actions { margin-top: 1rem; }
  .pop-btn { height: 46px; }
}

@media (max-width: 991.98px) {
  .ad-pop { --art: min(122vw, 64dvh); --ch: min(46dvh, 96vw); }
  .ad-pop__layout { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .ad-pop__stage { height: 54dvh; }
  .ad-pop__chars { inset: 3dvh 0 0; }
  .ad-pop__body { max-width: 640px; margin: -1dvh auto 0; padding: 0 16px 28px; }
  .ad-pop__kicker { font-size: .66rem; letter-spacing: .18em; }
  .ad-pop__title { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .ad-pop__meta { margin: .2rem 0 1rem; font-size: .85rem; }
  .ad-pop__meta::before { display: none; }
  .ad-pop__tiers { gap: 8px; }
  .ad-pop__tiers li { --cut: 12px; column-gap: 10px; padding: 9px 18px 9px 12px; }
  .ad-pop__badge { width: 36px; height: 36px; font-size: .78rem; }
  .ad-pop__tiers b { font-size: .92rem; }
  .ad-pop__price { font-size: 1.2rem; }
  .ad-pop__opt { font-size: .72rem; }
  .ad-pop__note { font-size: .74rem; }
  .ad-pop__actions { gap: 10px; margin-top: 1.1rem; }
  .pop-btn { flex: 1 1 0; min-width: 0; height: 46px; padding: 0 .8rem; letter-spacing: .06em; }
  .ad-pop__x { top: 10px; right: 10px; width: 42px; height: 42px; }
}

/* จอที่ขอบข้างไม่พอ (< 1600px) → ทำ ad ให้แคบลง ไม่บังคอนเทนต์มาก */
@media (min-width: 768px) and (max-width: 1599.98px) {
  .float-ad { right: 10px; width: 138px; }
  .float-ad__card { padding: 20px 12px 12px; }
  .float-ad__title { font-size: .84rem; }
  .float-ad__btn { font-size: .72rem; }
}

/* ---------- 19a. Floating YGTC 2026 (มุมขวาล่าง ใต้ floating ad · แบบหน้า halloween) ---------- */
.float-ygtc {
  position: fixed; right: 16px; bottom: 16px; z-index: 91;
  width: 128px;
  animation: ygtc-in .55s cubic-bezier(.2, .7, .2, 1) both .35s;
}
.float-ygtc__link {
  display: block; line-height: 0;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .5));
  transition: transform .3s var(--ease), filter .3s;
}
.float-ygtc__link img { display: block; width: 100%; height: auto; animation: ygtc-float 3.4s ease-in-out infinite 1s; }
.float-ygtc__link:hover,
.float-ygtc__link:focus-visible { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 16px 18px rgba(255, 138, 42, .45)); }
.float-ygtc__close {
  position: absolute; top: 2px; right: -4px; z-index: 1;
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 1.5px solid var(--gold-300); border-radius: 50%;
  background: var(--night-800);
  font-size: .72rem; color: var(--gold-300);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.float-ygtc__close:hover { background: var(--crimson-700); color: #fff; }
body.is-loading .float-ygtc,
body.is-loading .float-ygtc__link img { animation-play-state: paused; }   /* โผล่หลัง loader */
@keyframes ygtc-in {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes ygtc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@media (max-height: 760px) and (min-width: 576px) { .float-ygtc { width: 104px; } }   /* จอเตี้ย: ไม่ให้ชน floating ad ที่อยู่กลางขวา */
@media (max-width: 575.98px) {
  .float-ygtc { width: 80px; right: 8px; bottom: 12px; }
  .float-ygtc__close { width: 22px; height: 22px; top: 8px; right: -2px; font-size: .58rem; }
}

/* ---------- 19b. Popup ข่าวยังไม่เปิด (SweetAlert2 · news.js) ---------- */
.yg-swal.swal2-container { padding: 16px; }
.yg-swal.swal2-backdrop-show { background: rgba(18, 5, 15, .74); backdrop-filter: blur(4px); }
.yg-swal__popup.swal2-popup {
  width: min(440px, 100%);
  padding: 46px 42px 44px;
  border-radius: 0;
  background: transparent;
  color: var(--cream-100);
  font-family: var(--font-th);
}
.yg-swal__img.swal2-image { margin: 0 auto .5rem; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.yg-swal__title.swal2-title {
  padding: 0;
  font-family: var(--font-ui); font-weight: 700; font-size: 1.55rem; line-height: 1.35;
  color: var(--gold-300);
  text-shadow: 0 2px 0 rgba(60, 0, 0, .6);
}
.yg-swal__text.swal2-html-container { margin: .6rem 0 0; padding: 0; font-size: 1rem; line-height: 1.65; color: var(--cream-200); }
.yg-swal__actions.swal2-actions { margin: 1.5rem 0 0; }
.yg-swal__actions .btn-c { min-width: 200px; background: transparent; cursor: pointer; }
@media (max-width: 575.98px) {
  .yg-swal__popup.swal2-popup { padding: 40px 26px 36px; }
  .yg-swal__title.swal2-title { font-size: 1.35rem; }
  .yg-swal__text.swal2-html-container { font-size: .95rem; }
}

/* ---------- 20. Responsive ---------- */
@media (max-width: 1399.98px) {
  .hero__char--b { right: 27%; width: 66%; }
}

@media (max-width: 1199.98px) {
  /* พื้นเมนูใส่เฉพาะตอนเป็น offcanvas — จอ xl ขึ้นไป Bootstrap ล้างแค่ background-color ไม่ล้าง gradient */
  .offcanvas { --bs-offcanvas-width: 340px; background: linear-gradient(180deg, var(--plum-700), var(--night-900)); }
  .offcanvas .navbar-nav { margin-bottom: 1.5rem; }
  .offcanvas .nav-link { padding: .9rem 0 !important; border-bottom: 1px solid rgba(245, 189, 69, .2); font-size: 1.1rem; }
  .offcanvas .nav-link::after { display: none; }
  .nav-cta { flex-direction: column; align-items: stretch; gap: .6rem; }
  .nav-cta .btn-c { width: 100%; }
  .nav-web { justify-content: center; padding: .6rem 0; }
  .fr--panel { --bw: 64px; --fi: 24px; }
}

@media (max-width: 991.98px) {
  /* ตัวละครชิดบนตามความกว้างจอ (หัวอยู่เหนือโลโก้เสมอ) แล้วเว้น padding-top ไว้ให้ → โลโก้ทับแค่ช่วงล่างของตัวละคร */
  .hero { align-items: flex-end; min-height: max(100svh, 720px); padding: calc(var(--header-h) + 42vw) 0 64px; }
  .hero__chars { top: var(--header-h); bottom: auto; left: 0; right: 0; width: 100%; height: 72vw; -webkit-mask-image: none; mask-image: none; }
  .hero__char--a { right: 3%; top: 0; bottom: auto; width: 40%; }
  .hero__char--b { right: auto; left: 0; top: 3vw; bottom: auto; width: 68%; }
  .hero-logo { width: min(100%, 420px); }
  .hero__content::before {
    content: ""; position: absolute; left: -50vw; right: -50vw; bottom: -64px; top: 0; z-index: -1;
    background: linear-gradient(to top, rgba(18, 5, 15, 0), var(--night-900) 64px, var(--night-900) 42%, rgba(18, 5, 15, .6) 78%, rgba(18, 5, 15, 0));
  }
  .hero__fg { height: 24%; }
  .hero__fg-item--bear-l, .hero__fg-item--bear-r { display: none; }
  .hero__scroll { display: none; }

  .hl-card { position: relative; top: 0; max-width: 560px; margin: 0 auto; }
  .road { margin-top: 12px; }
  .costume-stage { max-width: 500px; }

  .hl-carousel { --slide-w: 74vw; --side-shift: 18%; }
  .hl-nav__btn { width: 54px; margin: 0 -24px; }

  /* แผนที่เล็กเกินกว่าจะอ่านป้ายได้ → เหลือหมุดตัวเลข + รายการด้านล่าง */
  .act-spot { --pin: 6.4cqw; }
  .act-spot__label, .act-spot__tip { display: none; }
  .act-list { display: grid; }
}

@media (max-width: 767.98px) {
  :root { --header-h: 64px; }
  .navbar-brand img { height: 44px; }
  .fr--panel { --bw: 44px; --fi: 16px; }
  .fr--card { --bw: 32px; --fi: 12px; }
  .fr--banner { --bw: 50px; --fi: 23px; }
  .sec-panel { padding: 34px 18px 38px; }

  .hero-logo { width: min(86%, 380px); }
  .btn-c--xl { --h: 66px; font-size: 1.12rem; }
  .btn-c--lg { --h: 54px; font-size: .95rem; }

  /* แถบเตี้ยลง → หัวท้ายแคบลง ตัวหนังสือได้พื้นที่กว้างขึ้น (ตัวหนังสือถูกจำกัดด้วยความกว้าง ไม่ใช่ความสูง) */
  .title-bar { --h: 40px; }
  .sec-panel .title-bar { margin: 0 -10px; max-width: calc(100% + 20px); }

  .road { padding-left: 70px; }
  .road__track { left: 30px; }
  .tier__node { left: -70px; top: 10px; width: 64px; }
  .tier__node small { font-size: .56rem; }
  .tier__node b { font-size: 1.05rem; }
  .tier--final .tier__node b { font-size: .9rem; }
  .tier__lvup { display: none; }
  .tier__card { padding: calc(var(--fi) + 8px) calc(var(--fi) + 6px); }
  .tier__head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tier__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .qstep { grid-template-columns: 48px minmax(0, 1fr); }
  .qstep__no { width: 48px; font-size: 1.05rem; }
  .quest__steps::before { left: 23px; }
  .qstep__card { flex-direction: column; align-items: flex-start; }

  .costume-stage__plate { min-width: 220px; padding: 10px 18px; }
  .costume-stage__plate h3 { font-size: 1.15rem; }

  .hl-carousel { --slide-w: 86vw; --side-shift: 14%; }
  .hl-nav__btn { width: 44px; margin: 0 -14px; }

  /* มือถือ: ลอยขวากลางจอตลอด (โชว์ตั้งแต่โหลดหน้าเหมือน desktop) — สูงกว่าปุ่ม CTA ของ Hero ที่อยู่ล่างจอ จึงไม่บังกัน */
  .float-ad { top: 38%; right: 10px; width: 96px; transform: none; }
  .float-ad__card { --bw: 26px; --fi: 9px; padding: 16px 9px 9px; }
  .float-ad__ribbon { font-size: .6rem; padding: .18rem .55rem; }
  .float-ad__month, .float-ad__btn { display: none; }
  .float-ad__title { font-size: .76rem; }
  .float-ad__tab { right: -10px; }
}

@media (max-width: 400px) {
  .hero__cta { gap: .45rem .3rem; }
  .btn-c--lg { font-size: .88rem; }
}

/* ---------- 21. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
