/* =====================================================================
   GE M · TOP SERVER: TOP RANKING FAMILY — OBT Landing (THEME v1 · Mockup D)
   Theme: Royal Crimson — ดำ · แดง · ทอง (ราชวังย้อนยุค) · asset ที่ assets/img/theme/
   ที่มาแต่ละ section: Hero = A Throne Hall · Rewards = B Royal Gallery ·
   Ranking = C Crimson Heraldry · Events = สไตล์ B + layout wireframe · Media = C
   ---------------------------------------------------------------------
   โครงสร้างไฟล์
   01 Tokens · 02 Base · 03 Utilities · 04 Components (ph, gfx-text,
   plate, btn, frame) · 05 Nav/Menu · 06 Preloader · 07 Hero · 08 Marquee
   09 Section head · 10 Rewards · 11 Events/Steps · 12 Register form
   13 Login items · 14 Ranking · 15 News slider · 16 Footer
   17 Floating UI · 18 WF notes · 19 Responsive · 20 Reduced motion
   ---------------------------------------------------------------------
   ⚑ 9-SLICE: ทุกกรอบ/ปุ่ม/ป้าย ใช้ border-image ผ่าน CSS variables
     (--b-img, --p-img, --f-img) → ตอนทำธีมจริงแค่สลับไฟล์รูป + ค่า slice
   ===================================================================== */

/* ---------- 01 TOKENS ---------- */
:root {
  --bg: #0b0708;              /* ดำอมแดง */
  --paper: #160c0d;           /* พื้นกล่อง/แผง */
  --ink: #f3e6c8;             /* ตัวอักษรครีม */
  --ink-2: #dccaa5;
  --muted: #a8977a;
  --line: rgba(212, 174, 92, .38);
  --line-2: rgba(212, 174, 92, .16);
  --ph-bg: #1c1213;
  --ph-line: rgba(212, 174, 92, .18);

  --gold: #d4ae5c;
  --gold-hi: #f6e2a4;
  --gold-lo: #8a6a2f;
  --crimson: #8e121b;
  --crimson-2: #5a0a10;
  --crimson-hi: #c2272d;
  --gold-text: linear-gradient(180deg, #fff6d2 0%, #f5d98a 28%, #d3a347 52%, #f7df98 74%, #b07f2e 100%);

  --tier-1: #e2bb62;   /* GOLD */
  --tier-2: #c9ccd3;   /* SILVER */
  --tier-3: #c98552;   /* BRONZE */

  --dark: #070405;
  --dark-2: #120a0b;

  --font-display: "Kanit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-serif: "Cinzel", "Kanit", Georgia, serif;
  --font-body: "IBM Plex Sans Thai", "Kanit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1240px;
  --container-wide: 1920px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* 9-slice / 3-slice assets (theme) — ค่า slice อยู่คู่กับ component ในหัวข้อ 04
     ไฟล์ wireframe เดิม (svg) ยังอยู่ที่ assets/img/ui/ ถ้าต้องการสลับกลับ */
  --img-btn-primary: url("../img/theme/btn-primary.webp");   /* 947×128 · cap 78 */
  --img-btn-ghost: url("../img/theme/btn-ghost.webp");       /* 947×128 · cap 78 */
  --img-plate: url("../img/theme/plate-gold.webp");          /* 848×80  · cap 39 */
  --img-plate-dark: url("../img/theme/plate-dark.webp");     /* 828×80  · cap 39 */
  --img-frame: url("../img/theme/frame-panel.webp");         /* 480×480 · slice 75 */
  --img-frame-light: url("../img/theme/frame-panel.webp");
  --img-frame-item: url("../img/theme/frame-item.webp");     /* 400×400 · slice 67 */
  --img-frame-media: url("../img/theme/frame-media.webp");   /* 558×240 · slice 63 66 */
  --img-flourish: url("../img/theme/flourish-l.webp");
  --img-flourish-r: url("../img/theme/flourish-r.webp");
  --img-emblem: url("../img/theme/wax-seal.webp");
  --img-damask: url("../img/theme/tex-damask.webp");
}

/* ---------- 02 BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-loading, body.menu-open { overflow: hidden; }
img, svg, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--line-2); padding: 1px 5px; }
::selection { background: var(--crimson); color: var(--gold-hi); }
:focus-visible { outline: 2px dashed var(--gold); outline-offset: 4px; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--dark); padding: 10px 16px; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- 03 UTILITIES ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--container-wide); }
/* bootstrap-like utilities used by the copied official footer */
.container-xl { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: 12px; }
.text-center { text-align: center; }
.d-block { display: block; }
.mx-auto { margin-inline: auto; }
.mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* =====================================================================
   04 COMPONENTS
   ===================================================================== */

/* --- Image placeholder (wireframe) ---------------------------------- */
.ph {
  --ph-ink: #5f5f5a;
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background:
    linear-gradient(to top right, transparent calc(50% - .7px), var(--ph-line) calc(50% - .7px), var(--ph-line) calc(50% + .7px), transparent calc(50% + .7px)),
    linear-gradient(to bottom right, transparent calc(50% - .7px), var(--ph-line) calc(50% - .7px), var(--ph-line) calc(50% + .7px), transparent calc(50% + .7px)),
    var(--ph-bg);
  outline: 1px dashed rgba(17, 17, 17, .32);
  outline-offset: -1px;
}
.ph::after {
  content: attr(data-label) "\A" attr(data-size);
  content: attr(data-label) "\A" attr(data-size) / "";
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 12px);
  padding: 4px 8px;
  font: 500 11px/1.45 var(--font-mono);
  letter-spacing: .03em;
  text-align: center;
  white-space: pre-wrap;
  color: var(--ph-ink);
  background: var(--ph-bg);
  pointer-events: none;
}
.ph::before {
  /* shimmer sweep — ให้ความรู้สึก "รอรูปจริง" */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: ph-shimmer 3.6s var(--ease-in-out) infinite;
  pointer-events: none;
}
@keyframes ph-shimmer { 0%, 30% { transform: translateX(-100%); } 75%, 100% { transform: translateX(100%); } }

.ph--logo { width: 132px; height: 46px; }
.ph--logo::after { font-size: 10px; padding: 2px 6px; }
.ph--shield { aspect-ratio: 6 / 7; clip-path: polygon(50% 0, 100% 12%, 100% 62%, 50% 100%, 0 62%, 0 12%); }
.ph--wing { aspect-ratio: 5 / 3; }
.ph--wing::after { font-size: 9px; padding: 1px 4px; }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--icon { aspect-ratio: 1; border-radius: 50%; }
.ph--icon::after { font-size: 10px; }
.ph--banner { aspect-ratio: 2 / 1; }
.ph--ghost {
  --ph-bg: transparent;
  --ph-line: rgba(17, 17, 17, .07);
  outline-color: rgba(17, 17, 17, .14);
}
.ph--ghost::before { display: none; }
.ph--ghost::after { left: 14px; top: auto; bottom: 14px; transform: none; text-align: left; background: rgba(245, 245, 242, .8); color: #8a8a85; }
.ph--dark { --ph-bg: #1c1c1c; --ph-line: rgba(255, 255, 255, .12); --ph-ink: #9a9a96; outline-color: rgba(255, 255, 255, .25); }
.ph--dark::before { background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .08) 50%, transparent 65%); }

/* --- Text graphic (section titles) ----------------------------------
   ตัวจริงจะเป็นรูป title-*.webp แต่ wireframe ใช้ text + effect:
   ::before = เส้นขอบ/เงา (stroke + extrude) · ::after = fill โลหะ + glint
   ------------------------------------------------------------------- */
/* ธีมจริง: section title เป็นรูป .sec-title__img (+ glint ที่ .sec-title) — .gfx-text คงไว้เป็น fallback สีทอง */
.gfx-text {
  --gfx-fill: var(--gold-text);
  --gfx-stroke: #2a1506;
  --gfx-extrude: #1a0b04;
  --gfx-glint: rgba(255, 250, 225, .95);
  --gfx-stroke-w: .15em;
  position: relative;
  display: inline-block;
  color: transparent;
  isolation: isolate;
}
.gfx-text::before,
.gfx-text::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute; inset: 0;
  pointer-events: none;
}
.gfx-text::before {
  z-index: -1;
  color: var(--gfx-stroke);
  -webkit-text-stroke: var(--gfx-stroke-w) var(--gfx-stroke);
  filter: drop-shadow(0 .07em 0 var(--gfx-extrude)) drop-shadow(0 .2em .22em rgba(0, 0, 0, .22));
}
.gfx-text::after {
  background-image:
    linear-gradient(100deg, transparent 42%, var(--gfx-glint) 50%, transparent 58%),
    var(--gfx-fill);
  background-repeat: no-repeat;
  background-size: 260% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: glint 6s ease-in-out infinite;
}
@keyframes glint {
  0%, 55% { background-position: 160% 0, 0 0; }
  85%, 100% { background-position: -60% 0, 0 0; }
}
/* Glint sweep บนรูป text graphic: แสงวิ่งผ่านเฉพาะตัวอักษร (mask ด้วยรูปเดียวกัน)
   ประกาศ url ในไฟล์นี้ (ไม่ใช่ inline style) เพื่อให้ path อิงไฟล์ CSS เหมือนกันทุกเบราว์เซอร์ */
.gfx-img { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.gfx-img--hero { --gfx: url("../img/theme/title-hero.webp"); }
.gfx-img--rewards { --gfx: url("../img/theme/title-rewards.webp"); }
.gfx-img--ranking { --gfx: url("../img/theme/title-ranking.webp"); }
.gfx-img--events { --gfx: url("../img/theme/title-events.webp"); }
.gfx-img--media { --gfx: url("../img/theme/title-media.webp"); }
.gfx-img--login { --gfx: url("../img/theme/title-login.webp"); }
.gfx-img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 42%, rgba(255, 251, 230, .95) 50%, transparent 58%) no-repeat;
  background-size: 260% 100%;
  background-position: 160% 0;
  -webkit-mask: var(--gfx) center / 100% 100% no-repeat;
  mask: var(--gfx) center / 100% 100% no-repeat;
  animation: glint-img 6s ease-in-out infinite;
}
.sec-title .gfx-img::after { animation-delay: .8s; }
@keyframes glint-img { 0%, 55% { background-position: 160% 0; } 85%, 100% { background-position: -60% 0; } }
.gfx-text--dark {
  --gfx-fill: linear-gradient(180deg, #3b3b3b 0%, #121212 46%, #4a4a4a 52%, #0a0a0a 100%);
  --gfx-stroke: #fff;
  --gfx-extrude: #7a7a76;
  --gfx-glint: rgba(255, 255, 255, .7);
}

/* --- Plate / ribbon tag (3-slice) ----------------------------------- */
.plate {
  --p-h: 32px;
  --p-cap: calc(var(--p-h) * .4875);       /* 39 / 80 */
  --p-img: var(--img-plate);
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--p-h);
  padding: 0 .2em;
  border-style: solid;
  border-width: 0 var(--p-cap);
  border-image: var(--p-img) 0 39 fill / 0 var(--p-cap) stretch;
  font: 700 13px/1 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #2b1406;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .45);
  white-space: nowrap;
}
.plate--dark { --p-img: var(--img-plate-dark); color: var(--gold-hi); text-shadow: 0 1px 2px #000; }
.plate--lg { --p-h: 42px; font-size: 15px; letter-spacing: .28em; }
.plate--sm { --p-h: 26px; font-size: 11px; }

/* --- CTA buttons (3-slice border-image + real text) ----------------- */
.btn {
  --b-h: 52px;
  --b-cap: calc(var(--b-h) * .6094);       /* 78 / 128 */
  --b-img: var(--img-btn-primary);
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: var(--b-h);
  padding: 0 .5em;
  border-style: solid;
  border-width: 0 var(--b-cap);
  border-image: var(--b-img) 0 78 fill / 0 var(--b-cap) stretch;
  font: 600 16px/1.2 var(--font-display);
  letter-spacing: .02em;
  color: var(--gold-hi);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;            /* sheen ถูกตัดให้อยู่ในช่วงกลาง (middle slice) */
  transition: filter .3s, translate .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn > span { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4em; }
.btn::after {
  /* sheen sweep */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 190, .32) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform .8s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.btn:hover::after, .btn:focus-visible::after { transform: translateX(110%); }
.btn:hover, .btn:focus-visible { filter: drop-shadow(0 8px 18px rgba(194, 39, 45, .45)) brightness(1.08); translate: 0 -2px; }
.btn:active { translate: 0 1px; filter: none; }
.btn--ghost { --b-img: var(--img-btn-ghost); color: var(--gold-hi); }
.btn--ghost:hover, .btn--ghost:focus-visible { filter: drop-shadow(0 8px 18px rgba(212, 174, 92, .3)) brightness(1.12); }
.btn--ghost::after { background: linear-gradient(110deg, transparent 38%, rgba(246, 226, 164, .18) 50%, transparent 62%); }
.btn--lg { --b-h: clamp(54px, 4vw, 64px); font-size: clamp(15px, .45vw + 11px, 19px); padding: 0 .7em; }
.btn--sm { --b-h: 40px; font-size: 14px; padding: 0 .3em; }
.btn--block { display: flex; width: 100%; }
/* ปุ่ม "ตรวจสอบอันดับ" ใต้โพเดียม — ใหญ่ขึ้นตาม feedback */
.rewards .sec-actions .btn { --b-h: clamp(62px, 4.6vw, 74px); font-size: clamp(17px, .5vw + 12px, 22px); padding: 0 1.1em; }
.btn--lg.btn--primary::after { animation: btn-auto-sheen 4.5s var(--ease-in-out) infinite; }
@keyframes btn-auto-sheen { 0%, 70% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
.btn .ext { font-style: normal; transition: transform .3s var(--ease); }
.btn:hover .ext { transform: translate(2px, -2px); }

.btn__spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(246, 226, 164, .35);
  border-top-color: var(--gold-hi);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn > .btn__spinner { display: none !important; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label { opacity: .6; }
.btn.is-busy > .btn__spinner { display: inline-block !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { font-size: 14px; text-decoration: underline; text-underline-offset: 4px; color: var(--muted); }
.link-btn:hover { color: var(--gold-hi); }

/* --- Frame (9-slice overlay) ---------------------------------------- */
.frame {
  --f-w: 40px;              /* ความหนาที่แสดงผล (= ขนาดมุมลาย) */
  --f-off: 10px;            /* กรอบล้นออกนอกกล่อง */
  --f-slice: 75;            /* ค่า slice ของไฟล์รูป (frame-panel 480×480) */
  --f-img: var(--img-frame);
  position: relative;
}
.frame::before {
  content: "";
  position: absolute;
  inset: calc(var(--f-off) * -1);
  border: var(--f-w) solid transparent;
  border-image: var(--f-img) var(--f-slice) / var(--f-w) stretch;
  pointer-events: none;
  z-index: 3;
}
.frame--sm { --f-img: var(--img-frame-item); --f-slice: 67; --f-w: 30px; --f-off: 0px; }
/* พื้นแผงมืดมาตรฐาน (ใช้คู่กับ .frame) */
.panel-dark {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(142, 18, 27, .22), transparent 60%),
    linear-gradient(180deg, rgba(26, 14, 15, .94), rgba(12, 7, 8, .96));
  box-shadow: inset 0 0 0 1px rgba(212, 174, 92, .12), 0 30px 60px -30px rgba(0, 0, 0, .8);
}

/* =====================================================================
   05 NAV + MOBILE MENU
   ===================================================================== */
.site-nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  transition: transform .55s var(--ease), background-color .35s, box-shadow .35s;
}
.site-nav {
  background: linear-gradient(180deg, rgba(7, 4, 5, .78), rgba(7, 4, 5, 0));
}
.site-nav.is-scrolled {
  background: rgba(10, 6, 7, .88);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(212, 174, 92, .35), 0 10px 30px -10px rgba(0, 0, 0, .8);
}
.site-nav.is-hidden { transform: translateY(-105%); }
.site-nav__inner { display: flex; align-items: center; gap: 20px; height: 100%; max-width: var(--container-wide); }
.site-nav__logo { flex: 0 0 auto; display: block; }
.site-nav__logo-img { width: auto; height: calc(var(--nav-h) - 18px); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
.site-nav__menu { display: flex; gap: 2px; margin-left: clamp(8px, 1.8vw, 28px); }   /* เมนูชิดซ้ายถัดจากโลโก้ */
.site-nav__menu a {
  position: relative;
  padding: 8px 14px;
  font: 500 15px/1 var(--font-display);
  color: var(--ink-2);
  transition: color .25s;
}
.site-nav__menu a::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.site-nav__menu a:hover, .site-nav__menu a.is-active { color: var(--gold-hi); }
.site-nav__menu a:hover::after, .site-nav__menu a.is-active::after { transform: scaleX(1); transform-origin: left; }
.site-nav__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; margin-left: auto; }   /* ปุ่มชิดขวา: เข้าสู่เว็บไซต์ + ร่วมกิจกรรม */
.site-nav__cta, .site-nav__web { flex: 0 0 auto; }
.mobile-menu__web { align-self: flex-start; margin: -14px 0 -14px -6px; }
.site-nav__cta::after { animation: btn-auto-sheen 4.5s var(--ease-in-out) 1.5s infinite; }

.burger {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  z-index: 70;
}
.burger span { display: block; width: 24px; height: 2px; background: var(--gold); transition: transform .45s var(--ease), opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; justify-content: center; gap: 40px;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(142, 18, 27, .35), transparent 70%),
    linear-gradient(rgba(11, 7, 8, .86), rgba(11, 7, 8, .94)),
    var(--img-damask) 0 0 / 320px 320px,
    var(--bg);
  clip-path: circle(0% at calc(100% - 38px) 36px);
  visibility: hidden;
  transition: clip-path .7s var(--ease-in-out), visibility 0s .7s;
}
.mobile-menu.is-open { clip-path: circle(150% at calc(100% - 38px) 36px); visibility: visible; transition: clip-path .7s var(--ease-in-out), visibility 0s; }
.mobile-menu__crest { display: block; width: 92px; height: auto; margin: 0 auto -16px; filter: drop-shadow(0 0 20px rgba(255, 190, 100, .35)); }
.mobile-menu__nav { display: grid; gap: 4px; }
.mobile-menu__nav a {
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font: 700 clamp(28px, 8vw, 44px)/1.15 var(--font-display);
  color: var(--gold-hi);
}
.mobile-menu__nav small { font: 700 13px var(--font-serif); color: var(--gold); }
.mobile-menu__stores { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================================
   06 PRELOADER
   ===================================================================== */
.preloader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: none; }
.preloader__panel { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--dark); }
.preloader__panel--top { top: 0; }
.preloader__panel--bottom { bottom: 0; }
.preloader__inner { position: relative; z-index: 1; text-align: center; color: var(--ink); padding: 0 24px; }
.preloader__eyebrow { font: 700 11px var(--font-serif); letter-spacing: .4em; color: var(--gold); }
.preloader__title {
  margin: 10px 0 22px; font: 800 clamp(30px, 6vw, 64px)/1.05 var(--font-serif); letter-spacing: .04em;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2a1506);
}
.preloader__crown {
  display: block; width: 74px; height: auto; margin: 0 auto 14px;
  filter: drop-shadow(0 0 18px rgba(255, 190, 100, .45));
  animation: float-y 2.6s ease-in-out infinite;
}
.preloader__bar { position: relative; width: min(320px, 70vw); height: 2px; margin: 0 auto; background: rgba(212, 174, 92, .18); }
.preloader__bar > span { overflow: hidden; }
/* ประกายที่หัวแถบ (JS ขยับ left ตาม %) */
.preloader__spark {
  position: absolute; left: 0; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  background: url("../img/theme/glint.webp") center / contain no-repeat;
  animation: flare-spin 2.4s linear infinite;
}
.preloader__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transform: scaleX(0); transform-origin: left; }
.preloader__count { margin-top: 12px; font: 700 12px var(--font-serif); color: var(--gold); }
.no-js .preloader, .preloader.is-done { display: none; }

/* =====================================================================
   07 HERO
   ===================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 28px) 0 clamp(88px, 9vw, 120px);
  overflow: hidden;
  background: var(--dark);
}
.gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  /* fade ล่างเชื่อม marquee */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none; z-index: 1;
}
/* เงาซ้ายให้อ่านข้อความออก + เงาขวาหลังวิดีโอ */
.hero__veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 4, 5, .88) 0%, rgba(7, 4, 5, .62) 26%, rgba(7, 4, 5, .08) 46%, rgba(7, 4, 5, .12) 70%, rgba(7, 4, 5, .55) 100%),
    linear-gradient(180deg, rgba(7, 4, 5, .55) 0%, rgba(7, 4, 5, 0) 20%);
}
.hero__bgword { display: none; }
.hero__kv { position: absolute; inset: 0; pointer-events: none; }
.hero__kv-layer { position: absolute; will-change: transform; }
.hero__kv-layer--back { inset: -3%; }
.hero__kv-layer--back picture, .hero__kv-layer--back img { display: block; width: 100%; height: 100%; }
.hero__kv-layer--back img { object-fit: cover; object-position: 64% 42%; }   /* นิ่ง (ไม่มี Ken Burns) */
/* god rays ทองจาก WebGL (พื้นดำ) — blend แบบ screen ทับฉาก */
.gl-canvas--screen { mix-blend-mode: screen; opacity: .8; pointer-events: none; }

.hero__grid {
  position: relative; z-index: 3;
  display: grid;
  /* ข้อความ (ซ้าย) | วิดีโอใหญ่ครึ่งขวา — ตามโครง wireframe */
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(28px, 3.6vw, 72px);
  max-width: var(--container-wide);
}
/* ตัวละคร 5 ตัว (art ลูกค้า → วาดใหม่เต็มตัวด้วย Higgsfield) ยืนเป็นกลุ่มชิดขวาล่างของ hero
   หลัง→หน้า: Nolette / Retiff · Echella / Canabel · Ganazu (กลาง)
   .hero__char = จุดยืน (GSAP ทำ entrance — ไม่มี CSS translate) · img = จัดกึ่งกลางด้วย transform + หายใจเบา ๆ ด้วย scale */
.hero__cast {
  position: absolute; z-index: 2; pointer-events: none;
  right: max(0px, calc((100vw - 1760px) / 2)); bottom: 0;
  width: min(64vw, calc((100svh - var(--nav-h) - 40px) * 1.25), 1200px);
  aspect-ratio: 1.25;
}
.hero__cast::before {   /* แสงทองหลังกลุ่ม */
  content: ""; position: absolute; left: 6%; right: 6%; top: 0; bottom: 4%;
  background: radial-gradient(48% 52% at 50% 52%, rgba(255, 190, 110, .3), rgba(255, 150, 70, .1) 45%, transparent 72%);
}
.hero__cast::after {    /* จางลงที่ขอบล่าง (ตัวละครถูกตัดช่วงต้นขาแบบภาพโฆษณา) */
  content: ""; position: absolute; z-index: 5; left: -12%; right: -12%; bottom: 0; height: 24%;
  background: linear-gradient(to bottom, rgba(11, 7, 8, 0), rgba(11, 7, 8, .85) 62%, var(--bg));
}
.hero__char { position: absolute; z-index: var(--z, 1); left: var(--x); bottom: var(--b, 0%); width: 0; height: var(--h); }
.hero__char img {
  position: absolute; left: 0; bottom: 0; height: 100%; width: auto; max-width: none;
  transform: translateX(-50%); transform-origin: 50% 100%;
  filter: var(--f, brightness(1)) drop-shadow(0 16px 22px rgba(0, 0, 0, .55));
}
/* กลุ่มก้อนใหญ่: หญิง 3 คนแถวหน้า (Echella · Ganazu กลาง · Canabel) · ชาย 2 คนยืนด้านหลังในช่องระหว่างหญิง (หัวสูงกว่า) */
.hero__char--nolette { --x: 39%; --h: 128%; --b: -31%; --z: 1; --f: brightness(.72) saturate(.9); }
.hero__char--retiff  { --x: 61%; --h: 129%; --b: -31%; --z: 1; --f: brightness(.72) saturate(.9); }
.hero__char--echella { --x: 27%; --h: 139%; --b: -58%; --z: 2; --f: brightness(.94); }
.hero__char--canabel { --x: 73%; --h: 139%; --b: -57%; --z: 2; --f: brightness(.94); }
.hero__char--ganazu  { --x: 50%; --h: 148%; --b: -66%; --z: 3; --f: brightness(1.02) drop-shadow(0 0 26px rgba(255, 180, 90, .22)); }
.hero__copy { display: flex; flex-direction: column; align-items: flex-start; }
.hero__eyebrow { margin-bottom: clamp(10px, 1.2vw, 18px); }
.hero__title { margin: 0; line-height: 0; }
/* ขนาดกำหนดที่ span (.gfx-img--hero) — รูปเต็ม span เสมอ ไม่งั้น span กว้างกว่ารูป แล้วแสงแวววาว (mask ของ span) ไม่ทับตัวอักษร */
.gfx-img--hero { width: min(100%, 560px); }
.hero__title-img {
  width: 100%; height: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .75));
}
.hero__text { margin-top: clamp(12px, 1.4vw, 20px); }
.hero__lead { font: 700 clamp(20px, 1.7vw, 30px)/1.3 var(--font-display); color: var(--ink); text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
/* ชิงรางวัลรวมมูลค่ากว่า + ตัวเลขเงินรางวัลตัวใหญ่ (ทองเงา) */
.hero__prize { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 10px; }
.hero__prize-label { font: 600 clamp(17px, 1.35vw, 23px)/1.3 var(--font-display); color: var(--ink-2); text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
.hero__prize-amount {
  display: inline-flex; align-items: baseline; gap: .2em;
  font: 900 clamp(46px, 5.2vw, 96px)/1.05 var(--font-serif);
  letter-spacing: .01em;
  filter: drop-shadow(0 3px 0 #3a1c08) drop-shadow(0 12px 20px rgba(0, 0, 0, .7));
}
.hero__prize-amount > * {
  display: inline-block;
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__prize-amount small { font: 800 .46em/1 var(--font-display); letter-spacing: 0; }
.hero__sub {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px; font: 600 clamp(16px, 1.2vw, 20px)/1.4 var(--font-display); color: var(--gold-hi);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
.hero__sub::before, .hero__sub::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hero__sub::after { transform: scaleX(-1); }

.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__stores { margin-top: clamp(20px, 2vw, 30px); }

/* Badge ดาวน์โหลด = รูปทางการจากลูกค้า (resource/client/OBT_Badge_1_1.png → badge-googleplay / badge-appstore / badge-pc.webp) */
.dl-badge {
  --d-h: 50px;
  display: inline-block; flex: 0 0 auto; height: var(--d-h); line-height: 0;
  border-radius: calc(var(--d-h) * .16);
  transition: translate .25s var(--ease), filter .25s;
  -webkit-tap-highlight-color: transparent;
}
.dl-badge img { display: block; height: 100%; width: auto; max-width: none; }
.dl-badge:hover, .dl-badge:focus-visible { translate: 0 -3px; filter: drop-shadow(0 0 1px var(--gold-hi)) drop-shadow(0 8px 14px rgba(212, 174, 92, .35)); }
.dl-badge:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
span.dl-badge { cursor: pointer; }   /* ปุ่ม COMING SOON = <span role="button"> (GA4: ไม่นับ cta_click จนกว่าจะเปลี่ยนเป็น <a>) */
.dl-badge--sm { --d-h: 44px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px 6px; margin-top: clamp(18px, 1.8vw, 26px); margin-left: -6px; }

.yt { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #161616; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt__ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 8%;
  background:
    linear-gradient(to top right, transparent calc(50% - .6px), rgba(255, 255, 255, .08) calc(50% - .6px), rgba(255, 255, 255, .08) calc(50% + .6px), transparent calc(50% + .6px)),
    linear-gradient(to bottom right, transparent calc(50% - .6px), rgba(255, 255, 255, .08) calc(50% - .6px), rgba(255, 255, 255, .08) calc(50% + .6px), transparent calc(50% + .6px)),
    radial-gradient(circle at 50% 45%, #2a2a2a, #121212 70%);
  color: rgba(255, 255, 255, .7);
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: .12em;
  text-align: center;
}
.yt__ph small { font-size: 11px; letter-spacing: .04em; color: rgba(255, 255, 255, .45); }
.yt.has-thumb .yt__ph { background-size: cover; background-position: center; }
.yt.has-thumb .yt__ph span, .yt.has-thumb .yt__ph small { display: none; }
.yt__play {
  position: absolute; left: 50%; top: 45%; z-index: 2;
  width: clamp(64px, 6vw, 92px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(142, 18, 27, .7), rgba(20, 8, 9, .7));
  box-shadow: 0 0 24px rgba(212, 174, 92, .35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform .4s var(--ease), background .3s;
}
.yt__play::before, .yt__play::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 1px solid rgba(246, 226, 164, .6);
  animation: ripple 2.4s var(--ease) infinite;
}
.yt__play::after { animation-delay: 1.2s; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.yt__play:hover { transform: translate(-50%, -50%) scale(1.08); background: radial-gradient(circle, rgba(194, 39, 45, .85), rgba(40, 10, 12, .8)); }
.yt__icon { width: 0; height: 0; margin-left: 6px; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent var(--gold-hi); }
.yt.is-playing .yt__play, .yt.is-playing .yt__ph { display: none; }
/* สไลด์วิดีโอใน Media (ย้ายจาก hero) — กล่องสัดส่วนเดียวกับแบนเนอร์ 1024×500 · iframe 16:9 อยู่กลาง */
.banner--video .yt { aspect-ratio: 1024 / 500; background: #050303; }
.banner--video .yt iframe { left: 50%; width: calc(100% * 500 / 1024 * 16 / 9); translate: -50% 0; }
.banner--video .yt__play { top: 50%; }
.banner__cap {
  position: absolute; left: 4%; bottom: 8%; z-index: 2; margin: 0;
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: rgba(8, 4, 5, .72); border: 1px solid rgba(212, 174, 92, .45);
  font: 700 11px var(--font-serif); letter-spacing: .3em; color: var(--gold-hi);
  pointer-events: none;
}
.banner__cap .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crimson-hi); box-shadow: 0 0 8px var(--crimson-hi); animation: blink 1.6s steps(2) infinite; }
.yt.is-playing .banner__cap { display: none; }
@keyframes blink { 50% { opacity: .15; } }

.scroll-cue {
  position: absolute; left: max(28px, calc((100vw - var(--container-wide)) / 2 + 28px)); right: auto; bottom: 48px; z-index: 3;   /* marquee ทับขอบล่าง hero 28px → ยกขึ้นพ้นแถบ */
  width: max-content; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 700 10px var(--font-serif); letter-spacing: .4em; color: var(--gold);
}
.scroll-cue__line { position: relative; width: 1px; height: 46px; background: var(--line); overflow: hidden; }
.scroll-cue__line::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 50%;
  background: var(--gold-hi);
  animation: cue 1.8s var(--ease-in-out) infinite;
}
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(200%); } }

/* =====================================================================
   08 MARQUEE
   ===================================================================== */
/* แถบผ้ากำมะหยี่แดงเข้ม + ขอบทองคู่ (ขอบบน/ล่าง = ::before/::after) */
.marquee {
  position: relative; z-index: 4;
  margin-top: -28px;
  padding: 15px 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 18%, transparent 82%, rgba(0, 0, 0, .55)),
    linear-gradient(180deg, #3a060b 0%, #6b0d15 30%, #7c111a 50%, #6b0d15 70%, #3a060b 100%);
  color: var(--gold-hi);
  overflow-x: clip;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), 0 18px 30px -14px rgba(0, 0, 0, .9);
}
/* ขอบทองคู่: เส้นหนาเงาโลหะ + ร่องมืด + เส้นบาง · ปลายซ้าย/ขวาหรี่ลง */
.marquee::before, .marquee::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7px; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 6, 6, .55), transparent 20%, transparent 80%, rgba(20, 6, 6, .55)),
    linear-gradient(180deg, #fff0bf 0, #e4bb68 1px, #b8893c 2.5px, #6e4c1d 3.5px, #1e0709 3.5px, #1e0709 4.5px, #d5a653 4.5px, #8f6a2e 7px);
}
.marquee::before { top: 0; }
.marquee::after { bottom: 0; transform: scaleY(-1); }
.marquee__track {
  display: flex; align-items: center;
  width: max-content;
  font: 700 clamp(15px, 1.5vw, 22px)/1.2 var(--font-serif);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform;
}
.marquee__track > span:lang(th), .marquee__track > span { font-family: var(--font-serif), var(--font-display); }
.marquee__track > * { flex: 0 0 auto; margin-right: 36px; }
/* ตัวอักษรไล่ทอง — ห้ามใช้ text-shadow กับ background-clip:text (เงาจะทับสีทองจนหม่น) → ใช้ filter drop-shadow แทน */
.marquee__track span {
  background: linear-gradient(180deg, #fff8dc 0%, #f8e2a0 38%, #e2b85f 62%, #c99a45 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0 rgba(38, 4, 8, .95)) drop-shadow(0 0 8px rgba(0, 0, 0, .35));
}
/* ตัวคั่น ◆ → เพชรทองเล็ก ๆ */
.marquee__track i {
  width: 9px; height: 9px; font-size: 0; color: transparent;
  rotate: 45deg;
  background: linear-gradient(135deg, #fff3c4, #d9ac55 55%, #8a6128);
  box-shadow: 0 0 0 1px rgba(38, 4, 8, .8), 0 0 10px rgba(255, 210, 130, .55);
}

/* =====================================================================
   09 SECTION HEAD
   ===================================================================== */
.section { position: relative; padding: clamp(84px, 10vw, 150px) 0; }
.sec-head { text-align: center; margin: 0 auto clamp(44px, 5.5vw, 80px); max-width: 1200px; }
.sec-head__eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font: 700 12px var(--font-serif);
  letter-spacing: .42em;
  color: var(--gold);
}
.sec-head__eyebrow::before, .sec-head__eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
/* Section title (แบบ A ทุกหัวข้อ): รูปตัวอักษรทอง + เส้น flourish ซ้าย/ขวา + glint */
.sec-title {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  margin: 12px 0 14px;
  line-height: 0;
}
.sec-title__img {
  display: block;
  width: auto; height: clamp(34px, 4.2vw, 66px); max-width: min(78vw, 980px);
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7));
}
.sec-title--th .sec-title__img { height: clamp(36px, 4.4vw, 70px); }
#mediaTitle .sec-title__img { height: clamp(40px, 5vw, 84px); }
.sec-title { --fl: 1; }
.sec-title::before, .sec-title::after {
  content: "";
  flex: 0 0 clamp(54px, 9vw, 170px);
  aspect-ratio: 480 / 56;
  background: var(--img-flourish) center / contain no-repeat;
  transform-origin: right center;
  transform: scaleX(var(--fl));
  opacity: var(--fl);
}
.sec-title::after { background-image: var(--img-flourish-r); transform-origin: left center; }
.sec-head__sub { font-size: clamp(16px, 1.25vw, 20px); color: var(--ink-2); text-wrap: balance; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.sec-head__sub .hl { padding: 0 .2em; color: var(--gold-hi); font-weight: 700; white-space: nowrap; }
.sec-head--dark .sec-head__sub { color: var(--ink-2); }
.sec-actions { display: flex; justify-content: center; margin-top: clamp(40px, 5vw, 64px); }


/* =====================================================================
   10 REWARDS
   ===================================================================== */
/* Royal Gallery: ห้องจัดแสดง + spotlight (ภาพ bg-rewards) */
.rewards {
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(11, 7, 8, 0) 14%, rgba(11, 7, 8, 0) 80%, var(--bg) 100%),
    url("../img/theme/bg-rewards.webp") center top / cover no-repeat,
    var(--bg);
  overflow: hidden;
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.16fr 1fr;
  grid-template-areas: "silver gold bronze";
  align-items: end;
  gap: clamp(10px, 2.4vw, 36px);
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 40px;
}
.podium__col { --tone: var(--tier-2); display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.podium__col--gold { grid-area: gold; --tone: var(--tier-1); }
.podium__col--silver { grid-area: silver; }
.podium__col--bronze { grid-area: bronze; --tone: var(--tier-3); }

/* ปีกลอยเหนือแท่น */
.podium__visual { position: relative; width: 86%; margin-bottom: 6px; z-index: 1; }
/* แผงเงินรางวัล / ข้อความ / แท่น อยู่เหนือปีก → แสง flare หมุนอยู่ด้านหลัง อ่านตัวเลขง่าย */
.podium__info, .podium__desc, .podium__base { position: relative; z-index: 2; }
.podium__col--gold .podium__visual { width: 100%; padding-top: clamp(40px, 4.6vw, 64px); }
/* .podium__wingbox = เป้าหมาย GSAP (กางปีก) · img = ลอย + กระพือ (CSS translate/scale คนละ property) */
.podium__wingbox { position: relative; display: block; }
.podium__wing {
  position: relative; display: block; width: 100%; height: auto;
  animation: float-y 4s ease-in-out infinite, wing-flap 3.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
}
@keyframes wing-flap { 0%, 100% { scale: 1 1; } 50% { scale: 1.045 .985; } }
.podium__col--silver .podium__wing { animation-delay: -1.3s, -.6s; }
.podium__col--bronze .podium__wing { animation-delay: -2.6s, -1.9s; }
/* Lens flare หลังปีก (flare-*.webp = แสงบนพื้นโปร่ง alpha ตามความสว่าง)
   ::before starburst หมุนช้า + หายใจ · ::after starburst ชั้นในหมุนสวน · พื้นหลัง = เส้นแสง anamorphic + glow
   จัดกึ่งกลางด้วย margin (% อิงความกว้าง) ไม่ใช้ transform — GSAP ทำ scale ตัวนี้ตอนเปิดฉาก */
.podium__aura {
  --flare: url("../img/theme/flare-gold.webp");
  --aw: 175%;
  position: absolute; left: 50%; top: 48%; z-index: -1;
  width: var(--aw); aspect-ratio: 1; margin: calc(var(--aw) / -2) 0 0 calc(var(--aw) / -2);
  background:
    url("../img/theme/flare-streak.webp") center / 112% 7% no-repeat,
    radial-gradient(circle, rgba(255, 206, 120, .34), rgba(255, 170, 80, .1) 30%, transparent 54%);
  pointer-events: none;
  animation: aura-shimmer 5.5s ease-in-out infinite;
}
.podium__aura::before, .podium__aura::after { content: ""; position: absolute; inset: 0; background: var(--flare) center / contain no-repeat; }
.podium__aura::before { animation: flare-spin 80s linear infinite, flare-breathe 4.6s ease-in-out infinite; }
.podium__aura::after { inset: 16%; opacity: .55; animation: flare-spin 52s linear infinite reverse; }
.podium__aura--gold { --aw: 196%; }
.podium__aura--silver { --flare: url("../img/theme/flare-silver.webp"); filter: saturate(.35) brightness(1.08); }
.podium__aura--bronze { --aw: 160%; filter: hue-rotate(-16deg) saturate(1.3) brightness(.86); }
@keyframes flare-spin { to { rotate: 360deg; } }
@keyframes flare-breathe { 0%, 100% { scale: .93; opacity: .78; } 50% { scale: 1.06; opacity: 1; } }
@keyframes aura-shimmer { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
/* มงกุฎ: จัดกึ่งกลางด้วย margin auto (ไม่ใช้ translate — GSAP จะรวม translate เข้า transform แล้วเลื่อนซ้ำ)
   span = เป้าหมาย GSAP (ฉากเปิด) · img ข้างใน = ลอยขึ้นลง (CSS) */
.podium__crown {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  width: clamp(60px, 6.4vw, 92px); margin-inline: auto;
  pointer-events: none;
}
.podium__crown img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 18px rgba(255, 200, 100, .35));
  animation: float-y 3.2s ease-in-out infinite;
}
@keyframes float-y { 50% { translate: 0 -8px; } }

/* แผงดำกรอบทอง: ป้ายอันดับ + เงินรางวัล + ชื่อ */
.podium__info {
  --f-w: 26px; --f-off: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 92%;
  padding: 0 10px clamp(12px, 1.4vw, 18px);
  background: linear-gradient(180deg, rgba(20, 11, 12, .94), rgba(8, 5, 6, .96));
  box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .9);
}
.podium__info > .plate { margin-top: -14px; position: relative; z-index: 4; }
.podium__amount {
  margin-top: 8px; white-space: nowrap;
  font: 800 clamp(24px, 2.8vw, 42px)/1.05 var(--font-serif);
  filter: drop-shadow(0 2px 0 #2a1506);
}
.podium__amount > * { background: linear-gradient(180deg, #fff, var(--tone) 55%, color-mix(in srgb, var(--tone) 60%, #000)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.podium__col--gold .podium__amount > * { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; }
.podium__amount small { font: 700 .5em/1 var(--font-display); }
.podium__col--gold .podium__amount { font-size: clamp(30px, 3.8vw, 58px); }
.podium__name { font: 700 clamp(12px, 1.05vw, 16px)/1.2 var(--font-serif); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); }
/* เงินรางวัล + ชื่อปีก (ป้ายทองเหลือง) */
.podium__desc { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0 -4px; position: relative; z-index: 3; }
.podium__desc small { font-size: 12.5px; color: var(--muted); }
.podium__desc .plate { --p-h: 30px; font-size: clamp(11px, .9vw, 13px); letter-spacing: .06em; text-transform: none; }

/* แท่นกำมะหยี่ + เลขอันดับในพวงหรีด
   ตำแหน่งพวงหรีดวัดจากรูป: pedestal-tall ศูนย์กลางวง (50.5%, 45%) · pedestal-low (49.8%, 45%)
   ใช้สัดส่วนจริงของรูป (ไม่ยืด) — ความสูงต่างกันตามความกว้างคอลัมน์ + แท่นอันดับ 3 เป็นแบบเตี้ย */
.podium__base {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 365;
  container-type: inline-size;
  background: url("../img/theme/pedestal-tall.webp") center bottom / 100% 100% no-repeat;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .7));
}
.podium__col--silver .podium__base { width: 94%; }
.podium__col--bronze .podium__base { aspect-ratio: 760 / 252; background-image: url("../img/theme/pedestal-low.webp"); }
/* กล่องเต็มแท่น สูง 90% → จุดกึ่งกลาง = 45% ของความสูง (ตรงวงพวงหรีด) */
.podium__num {
  position: absolute; left: 1%; right: 0; top: 0; height: 90%;
  display: grid; place-items: center;
  font: 900 15cqw/1 var(--font-serif);
  padding-top: .04em;
}
.podium__col--bronze .podium__num { left: 0; font-size: 10cqw; }
.podium__num b {
  display: block; font-weight: 900;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .85)) drop-shadow(0 0 10px rgba(255, 200, 100, .35));
}

/* Rank 4–20 — แถบทองเหลือง (3-slice plate-gold) ใต้โพเดียม */
.podium-more {
  --p-h: clamp(64px, 6vw, 80px);
  --p-cap: calc(var(--p-h) * .4875);
  display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px);
  width: fit-content; max-width: 100%;
  min-height: var(--p-h);
  margin: clamp(30px, 3.4vw, 48px) auto 0;
  padding: 0 clamp(8px, 1.6vw, 24px);
  border-style: solid; border-width: 0 var(--p-cap);
  border-image: var(--img-plate) 0 39 fill / 0 var(--p-cap) stretch;
  color: #2b1406;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .7));
}
.podium-more__rank { flex: 0 0 auto; font: 800 clamp(15px, 1.4vw, 20px)/1 var(--font-serif); letter-spacing: .06em; }
.podium-more__wing { flex: 0 0 auto; width: clamp(64px, 6vw, 88px); height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.podium-more__text { display: flex; flex-direction: column; min-width: 0; }
.podium-more__text small { font-size: 12.5px; color: #5a3a14; }
.podium-more__text b { font: 800 clamp(15px, 1.4vw, 20px)/1.2 var(--font-serif); letter-spacing: .02em; }
.podium-more { position: relative; }
.podium-more__shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.podium-more__shine::before {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -40%; width: 22%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 240, .55) 50%, transparent);
  transform: skewX(-18deg); animation: glass-sweep 5.2s ease-in-out 2s infinite;
}

/* =====================================================================
   11 EVENTS / STEPS
   ===================================================================== */
/* Royal Gallery: ผนังผ้าดามัสก์แดงเลือดหมู + เสาทองขอบซ้าย/ขวา */
.events {
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(11, 7, 8, .2) 9%, rgba(11, 7, 8, .25) 90%, var(--bg) 100%),
    radial-gradient(70% 50% at 50% 30%, rgba(255, 160, 80, .08), transparent 70%),
    linear-gradient(90deg, rgba(5, 3, 4, .85) 0%, rgba(5, 3, 4, 0) 18%, rgba(5, 3, 4, 0) 82%, rgba(5, 3, 4, .85) 100%),
    var(--img-damask) center top / 384px 384px,
    #3a0b10;
  overflow: hidden;
}
/* เสาหินอ่อนดำหัวเสาทองสูงตลอด section (pillar.webp 240×1198 · vertical 3-slice: หัวเสา 190 / ฐาน 175 ไม่ยืด, ลำเสายืด)
   กว้างตามพื้นที่ว่างข้างเนื้อหา (container 1160px) · ซ่อนเมื่อจอแคบกว่า 1240px */
.events::before, .events::after {
  --pw: clamp(46px, calc((100vw - 1160px) / 2 - 22px), 104px);
  content: ""; position: absolute; top: clamp(40px, 4vw, 70px); bottom: clamp(40px, 4vw, 70px); z-index: 0;
  width: var(--pw);
  border-style: solid; border-color: transparent;
  border-width: calc(var(--pw) * .7917) 0 calc(var(--pw) * .7292) 0;
  border-image: url("../img/theme/pillar.webp") 190 0 175 0 fill stretch;
  filter: drop-shadow(0 0 24px rgba(255, 180, 90, .16)) drop-shadow(0 18px 24px rgba(0, 0, 0, .7));
  pointer-events: none;
}
.events::before { left: clamp(6px, 1.2vw, 28px); }
.events::after { right: clamp(6px, 1.2vw, 28px); }
@media (max-width: 1239.98px) { .events::before, .events::after { display: none; } }
.steps { position: relative; display: grid; gap: clamp(64px, 8vw, 120px); max-width: 1160px; margin: 0 auto; }
.steps__line {
  position: absolute; left: 50%; top: 36px; bottom: 36px;
  width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(212, 174, 92, .35) 0 6px, transparent 6px 12px);
}
.steps__line i { position: absolute; inset: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold), var(--gold-lo)); box-shadow: 0 0 10px rgba(246, 226, 164, .5); transform: scaleY(0); transform-origin: top; }
/* ประกายวิ่งตามเส้น timeline (GSAP scrub ขยับ top) */
.steps__spark {
  position: absolute; left: 50%; top: 0; z-index: 3;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  background: url("../img/theme/glint.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(255, 214, 140, .95));
  animation: flare-spin 3.2s linear infinite;
  pointer-events: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
  grid-template-areas: "body marker media";
  column-gap: clamp(22px, 4vw, 60px);
  align-items: center;
}
.step--reverse { grid-template-areas: "media marker body"; }
.step__body { grid-area: body; text-align: right; }
.step--reverse .step__body { text-align: left; }
.step__media { grid-area: media; --f-off: 10px; --f-w: 34px; background: #000; line-height: 0; box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .9); }
/* ---------- ฉากรางวัล STEP 1 (กำมะหยี่) / STEP 2 (ตู้กระจก) — แยกชิ้นเพื่อทำอนิเมชัน ----------
   ตำแหน่ง .prize (--x / --w / --b เป็น % ของฉาก 1440×816) คำนวณจาก design/theme-src/export2.py */
.prize-stage { position: relative; aspect-ratio: 1440 / 816; overflow: hidden; isolation: isolate; background: #12070a; }
.prize-stage__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prize { position: absolute; left: var(--x); bottom: var(--b); width: var(--w); z-index: 2; line-height: 0; }
.prize img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .6));
  animation: prize-float 4.4s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.prize::before {      /* เงาตกกระทบ (ยุบ/จางตามจังหวะลอย) */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -3%; height: 9%; z-index: -1;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent);
  animation: prize-shadow 4.4s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes prize-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5%; } }
@keyframes prize-shadow { 0%, 100% { scale: 1; opacity: .9; } 50% { scale: .8; opacity: .5; } }
.prize-stage--velvet .prize img { filter: drop-shadow(0 0 14px rgba(255, 190, 90, .35)) drop-shadow(0 10px 12px rgba(0, 0, 0, .6)); }
.prize--ipad { --x: 11.63%; --w: 18.40%; --b: 25%; }
.prize--watch { --x: 26.53%; --w: 17.78%; --b: 25%; }
.prize--airpods { --x: 44.03%; --w: 11.93%; --b: 25%; }   /* AirPods 4 (ภาพจากลูกค้า 387×520) · กึ่งกลางเดิม 50% */
.prize--headphones { --x: 58.09%; --w: 12.99%; --b: 25%; }
.prize--powerbank { --x: 74.10%; --w: 10.14%; --b: 25%; }
/* STEP 1 (Pre Register Rewards): ไอเทมวางเป็นกอง (ซ้อน 3 ใบ) ไม่ทับกัน
   ล่างกลาง = ตั๋วสุ่มปีก + ตั๋วสุ่มสัตว์ (ใหญ่) · บนกลาง = VIS / Reset / Persuasion (เล็ก เรียงแถว) */
.prize--wing       { --x: 21%;   --w: 24%; --b: 5%;  z-index: 3; }
.prize--pet        { --x: 55%;   --w: 24%; --b: 5%;  z-index: 3; }
.prize--vis        { --x: 27%;   --w: 12%; --b: 57%; z-index: 2; }
.prize--reset      { --x: 44%;   --w: 12%; --b: 57%; z-index: 2; }
.prize--persuasion { --x: 61%;   --w: 12%; --b: 57%; z-index: 2; }
.prize--pile > img:not(.prize__pile) { position: relative; z-index: 1; }
.prize__pile { position: absolute; left: 0; bottom: 0; z-index: 0; }
.prize-stage--velvet .prize__pile { filter: brightness(.68) saturate(.9) drop-shadow(0 8px 10px rgba(0, 0, 0, .65)); }
.prize__pile--a { transform: translate(-14%, -4%) rotate(-10deg); }
.prize__pile--b { transform: translate(13%, -6%) rotate(8deg); }
/* สปอตไลต์กลางฉากกำมะหยี่ */
.prize-stage__beam {
  position: absolute; left: 28%; width: 44%; top: -6%; height: 94%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 214, 150, .5), rgba(255, 190, 110, .14) 62%, transparent);
  clip-path: polygon(43% 0, 57% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen; filter: blur(7px);
  animation: beam-flicker 5s ease-in-out infinite;
}
/* ลำแสงจากไฟ 3 ดวงในตู้กระจก */
.prize-stage__beams { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.prize-stage__beams i {
  position: absolute; top: 21%; height: 58%; width: 21%; left: calc(var(--bx) - 10.5%);
  background: linear-gradient(180deg, rgba(255, 228, 172, .55), rgba(255, 200, 120, .12) 70%, transparent);
  clip-path: polygon(41% 0, 59% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen; filter: blur(5px);
  animation: beam-flicker 4.2s ease-in-out infinite;
}
.prize-stage__beams i:nth-child(1) { --bx: 26.4%; animation-delay: -1.1s; }
.prize-stage__beams i:nth-child(2) { --bx: 50%; }
.prize-stage__beams i:nth-child(3) { --bx: 73.6%; animation-delay: -2.4s; }
@keyframes beam-flicker { 0%, 100% { opacity: .72; } 42% { opacity: 1; } 58% { opacity: .82; } 70% { opacity: .95; } }
/* flare ที่ไฟกลางเพดานตู้ */
.prize-stage__flare {
  position: absolute; left: 34%; width: 32%; aspect-ratio: 1; top: 23%; margin-top: -16%; z-index: 3; pointer-events: none;
  background: url("../img/theme/flare-gold.webp") center / contain no-repeat;
  mix-blend-mode: screen; opacity: .9;
  animation: flare-spin 40s linear infinite, flare-breathe 3.4s ease-in-out infinite;
}
/* กระจกหน้าตู้: เงาสะท้อนนิ่ง + แสงกวาดผ่านเป็นระยะ */
.prize-stage__glass {
  position: absolute; left: 4.5%; right: 4.5%; top: 16%; bottom: 17.5%; z-index: 3; overflow: hidden; pointer-events: none;
  background: linear-gradient(115deg, transparent 8%, rgba(255, 255, 255, .07) 9%, rgba(255, 255, 255, .07) 14%, transparent 15%, transparent 61%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .05) 64%, transparent 65%);
}
.prize-stage__glass::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: -40%; width: 26%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 228, .34) 50%, transparent);
  transform: skewX(-16deg); mix-blend-mode: screen;
  animation: glass-sweep 6s ease-in-out 1.5s infinite;
}
@keyframes glass-sweep { 0%, 50% { left: -40%; } 100% { left: 125%; } }
/* ประกายวิบวับ (JS ใส่ <i class="glint"> ตามจุด) — glint.webp เป็นแสงบนพื้นโปร่ง */
.prize-stage__fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.glint {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1;
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: url("../img/theme/glint.webp") center / contain no-repeat;
  opacity: 0; pointer-events: none; mix-blend-mode: screen;
  animation: twinkle var(--t, 2.8s) ease-in-out var(--dl, 0s) infinite;
}
@keyframes twinkle {
  0%, 56%, 100% { opacity: 0; scale: .2; rotate: 0deg; }
  70% { opacity: 1; scale: 1; rotate: 35deg; }
  84% { opacity: .5; scale: .65; rotate: 55deg; }
}
/* ฝุ่นทองลอยขึ้นในฉาก (2 ชั้นความเร็วต่างกัน · background เลื่อนเป็นรอบพอดีจำนวน tile → วนไม่สะดุด) */
.prize-stage__fx::before, .prize-stage__fx::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 28%, rgba(255, 222, 150, .95), transparent),
    radial-gradient(1.1px 1.1px at 58% 68%, rgba(255, 210, 140, .85), transparent),
    radial-gradient(2.2px 2.2px at 82% 18%, rgba(255, 232, 175, .75), transparent),
    radial-gradient(1.3px 1.3px at 38% 86%, rgba(255, 200, 120, .85), transparent),
    radial-gradient(1.8px 1.8px at 92% 58%, rgba(255, 226, 160, .8), transparent);
}
.prize-stage__fx::before { background-size: 180px 160px; animation: dust-rise-a 13s linear infinite; }
.prize-stage__fx::after { background-size: 260px 230px; opacity: .55; animation: dust-rise-b 21s linear infinite; }
@keyframes dust-rise-a { from { background-position: 0 0; } to { background-position: 0 -320px; } }
@keyframes dust-rise-b { from { background-position: 0 0; } to { background-position: 0 -460px; } }
/* GRAND PRIZE: ป้ายเรืองแสง + ออร่าทองรอบกรอบเป็นจังหวะ */
.step--2 .step__media-tag { animation: tag-glow 2.8s ease-in-out infinite; }
.step--2 .step__media { animation: prize-aura 3.2s ease-in-out infinite; }
@keyframes prize-aura {
  0%, 100% { box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .9), 0 0 0 rgba(255, 190, 90, 0); }
  50% { box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .9), 0 0 70px rgba(255, 190, 90, .38); }
}
@keyframes tag-glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 100, 0)); } 50% { filter: drop-shadow(0 0 12px rgba(255, 200, 100, .75)); } }
.step__media-tag { position: absolute; left: 50%; bottom: -14px; translate: -50% 0; z-index: 4; --p-h: 30px; font-size: 11.5px; line-height: 1; }
.step__marker {
  grid-area: marker;
  position: relative; z-index: 2;
  justify-self: center;
  width: 76px; height: 76px;
  display: grid; place-items: center;
}
.step__marker::before {
  content: ""; position: absolute; inset: -10px;
  background: url("../img/theme/step-diamond.webp") center / contain no-repeat;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .7)) drop-shadow(0 0 14px rgba(246, 210, 140, .25));
}
.step__marker span {
  position: relative; font: 900 30px/1 var(--font-serif);
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .9));
}
.step__label { margin-bottom: 12px; }
.step__title {
  font: 700 clamp(26px, 2.8vw, 42px)/1.25 var(--font-display); text-wrap: balance;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .85));
}
.step__desc { margin-top: 8px; font-size: clamp(17px, 1.3vw, 21px); color: var(--ink-2); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }

/* step 3 (stack) */
.step--stack {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "marker" "body" "items" "actions";
  justify-items: center;
  row-gap: 22px;
}
.step--stack .step__body { text-align: center; }
.step__title--en { background: none; filter: none; line-height: 0; }
.step__title-img { display: inline-block; width: auto; height: clamp(44px, 5.4vw, 84px); max-width: 90vw; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .8)); }
/* "รับไอเทมทุกวัน!!" = ป้ายทองเหลือง (plate-gold 3-slice) */
.step__desc--hot {
  --p-h: clamp(40px, 3.6vw, 52px);
  --p-cap: calc(var(--p-h) * .4875);
  display: inline-flex; align-items: center;
  min-height: var(--p-h);
  margin-top: 14px;
  padding: 0 .3em;
  border-style: solid; border-width: 0 var(--p-cap);
  border-image: var(--img-plate) 0 39 fill / 0 var(--p-cap) stretch;
  color: #2b1406; text-shadow: 0 1px 0 rgba(255, 240, 200, .45);
  font: 800 clamp(18px, 1.8vw, 26px)/1.2 var(--font-display);
}
.step__actions { grid-area: actions; margin-top: 18px; }
/* step 3: ปิดเส้น timeline ใต้ title / items / ปุ่ม */
.step--stack .step__body,
.step--stack .login-items,
.step--stack .step__actions { position: relative; z-index: 1; }
.step--stack .step__body { padding: 8px 24px; background: radial-gradient(closest-side, rgba(40, 8, 12, .95), rgba(40, 8, 12, 0)); }

/* =====================================================================
   12 REGISTER FORM
   ===================================================================== */
.register {
  --f-w: 40px;
  --f-off: 12px;
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative; z-index: 2;
  margin-top: clamp(56px, 6vw, 88px);
  padding: clamp(44px, 5vw, 68px) clamp(18px, 5vw, 76px) clamp(36px, 4vw, 56px);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(142, 18, 27, .28), transparent 70%),
    linear-gradient(180deg, rgba(22, 12, 13, .96), rgba(9, 5, 6, .97));
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .95);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.register__head { text-align: center; max-width: 640px; margin: 0 auto clamp(28px, 3vw, 40px); }
/* ตราราชวงศ์คร่อมขอบบนของแผงฟอร์ม (ใช้ margin ลบ ไม่ใช้ transform) */
.register__crest {
  display: block; width: clamp(92px, 9vw, 128px); height: auto;
  margin: calc(clamp(44px, 5vw, 68px) * -1 - clamp(46px, 4.6vw, 70px)) auto 10px;
  position: relative; z-index: 5;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .75)) drop-shadow(0 0 22px rgba(255, 190, 100, .3));
  animation: crest-glow 3.6s ease-in-out infinite;
}
@keyframes crest-glow {
  0%, 100% { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .75)) drop-shadow(0 0 16px rgba(255, 190, 100, .2)); }
  50% { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .75)) drop-shadow(0 0 30px rgba(255, 200, 110, .55)); }
}
/* แผงฟอร์ม: ขอบทองเรืองเมื่อกำลังกรอก */
.register { transition: box-shadow .5s var(--ease); }
/* หมายเหตุใต้ฟอร์ม STEP 2 (ใช้สไตล์ .rank-note) */
.step__note { grid-column: 1 / -1; grid-row: 3; max-width: 760px; position: relative; z-index: 2; }
.register:focus-within { box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .95), 0 0 60px rgba(255, 190, 100, .18); }
.register__title {
  margin-top: 14px; font: 700 clamp(24px, 2.4vw, 34px)/1.3 var(--font-display);
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.register__desc { margin-top: 8px; font-size: 15px; color: var(--muted); }
.register__form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 26px; max-width: 780px; margin: 0 auto; }
.field { position: relative; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__input {
  width: 100%; height: 58px;
  padding: 22px 16px 6px;
  border: 1.5px solid rgba(212, 174, 92, .38);
  border-radius: 0;
  background: rgba(5, 3, 3, .72);
  font: 500 16px var(--font-body);
  color: var(--ink);
  outline: none;
  transition: border-color .25s, background-color .25s, box-shadow .25s;
  -webkit-appearance: none;
  appearance: none;
}
.field__input:hover { border-color: rgba(212, 174, 92, .65); }
.field__input:focus { border-color: var(--gold); background: rgba(14, 8, 9, .9); box-shadow: 0 0 0 3px rgba(212, 174, 92, .14); }
.field__label {
  position: absolute; left: 17px; top: 18px;
  font-size: 16px; line-height: 1.4;
  color: var(--muted);
  transform-origin: left top;
  transition: transform .3s var(--ease), color .25s;
  pointer-events: none;
}
.field__label em { font-style: normal; color: var(--crimson-hi); }
.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label { transform: translateY(-11px) scale(.74); color: var(--gold); font-weight: 600; }
.field__line {
  position: absolute; left: 0; right: 0; top: 56px; height: 2px;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi), var(--gold-lo));
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
  pointer-events: none;
}
.field__input:focus ~ .field__line { transform: scaleX(1); }
.field__hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field__error { display: block; font-size: 13px; font-weight: 600; color: #ff8a80; }
.field__error:not(:empty) { margin-top: 6px; }
.field__error:not(:empty)::before { content: "⚠ "; }
.field.is-invalid .field__input {
  border: 2px solid var(--crimson-hi);
  background: linear-gradient(rgba(194, 39, 45, .12), rgba(194, 39, 45, .12)), rgba(5, 3, 3, .72);
}
.field.is-invalid .field__hint { display: none; }
.field.is-shake { animation: shake .45s var(--ease); }

/* email = [ชื่อ][@][โดเมน dropdown] (ตามหน้า gemobile) */
.email-row { position: relative; display: flex; align-items: stretch; }
.email-row__local { position: relative; flex: 1 1 auto; min-width: 0; }
.email-row__local .field__input { border-right-width: 0; }
.email-row__local .field__input::placeholder { color: transparent; transition: color .2s; }
.email-row__local .field__input:focus::placeholder { color: rgba(168, 151, 122, .6); }
.email-row__at {
  flex: 0 0 34px;
  display: grid; place-items: center;
  padding-top: 14px;
  border-block: 1.5px solid rgba(212, 174, 92, .38);
  background: rgba(212, 174, 92, .12);
  font: 700 17px/1 var(--font-display);
  color: var(--gold);
  transition: border-color .25s;
}
.email-row__domain { position: relative; flex: 0 0 47%; min-width: 0; }
.email-row__domain .field__input { border-left-width: 0; }
.field__select {
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d4ae5c' stroke-width='1.8'/%3E%3C/svg%3E") right 14px center / 12px 8px no-repeat;
  padding: 16px 36px 0 14px;
  cursor: pointer;
  text-overflow: ellipsis;
  background: var(--chevron), rgba(5, 3, 3, .72);
}
.field__select:focus { background: var(--chevron), rgba(14, 8, 9, .9); }
.field.is-invalid .field__select { background: var(--chevron), linear-gradient(rgba(194, 39, 45, .12), rgba(194, 39, 45, .12)), rgba(5, 3, 3, .72); }
.field__select:invalid { color: var(--muted); }
.field__select option, .field__select optgroup { color: #f3e6c8; background: #1a0f10; }
.field__label--static { left: 15px; top: 18px; transform: translateY(-11px) scale(.74); color: var(--gold); font-weight: 600; }
.email-row:hover .field__input, .email-row:hover .email-row__at { border-color: rgba(212, 174, 92, .65); }
.email-row:focus-within .field__input,
.email-row:focus-within .email-row__at { border-color: var(--gold); }
.email-row .field__line { top: auto; bottom: 0; }
.email-row:focus-within .field__line { transform: scaleX(1); }
.field.is-invalid .email-row__at { border-block: 2px solid var(--crimson-hi); }
.field--email.is-invalid .email-row__local .field__input { border-right-width: 0; }
.field--email.is-invalid .email-row__domain .field__input { border-left-width: 0; }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14.5px; line-height: 1.55; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--gold);
  background: rgba(5, 3, 3, .8);
  display: grid; place-items: center;
  transition: background .2s;
}
.check__box::after {
  content: ""; width: 6px; height: 11px; margin-top: -3px;
  border: solid #2b1406; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .3s var(--ease);
}
.check input:checked + .check__box { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px dashed var(--gold); outline-offset: 3px; }
.check__text { color: var(--ink-2); }
.check__text em { font-style: normal; font-weight: 700; color: var(--crimson-hi); }
.field--check.is-invalid .check__box { border-color: var(--crimson-hi); border-width: 2px; }
/* ลิงก์เงื่อนไข / นโยบาย (ชุดเดียวกับหน้า pre-register) */
.check__text a { color: var(--gold); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.check__text a:hover { color: var(--gold-hi); }
.register__submit { margin-top: 6px; }
/* error จาก API ที่ไม่ผูกกับช่องใด */
.register__alert {
  padding: 12px 16px;
  border: 1.5px solid var(--crimson-hi);
  background: rgba(194, 39, 45, .14);
  font-size: 14.5px; font-weight: 600; line-height: 1.55; color: #ffb4ad;
}
.register__alert::before { content: "⚠ "; }
/* ยืนยัน OTP (เมื่อ event ตั้งให้ยืนยันตัวตน) */
.register__otp { text-align: center; padding: 10px 0; }
.register__otp .register__desc { margin-bottom: 26px; }
.register__otp-form { max-width: 420px; text-align: left; }
.register__otp-form .field__input { letter-spacing: .3em; font-weight: 700; }
.register__otp-actions { text-align: center; }

.register__success { text-align: center; padding: 10px 0; }
/* ลงทะเบียนสำเร็จ: ตราราชวงศ์ + เครื่องหมายถูกสีทองกลางโล่ (ศูนย์กลางโล่บนรูป ≈ 49.6%, 58%) */
.register__check {
  position: relative; width: clamp(120px, 12vw, 150px); aspect-ratio: 360 / 395; margin: 0 auto 12px;
  background: url("../img/theme/crest.webp") center / contain no-repeat;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .7)) drop-shadow(0 0 26px rgba(255, 200, 110, .4));
}
.register__check svg { position: absolute; left: 29.6%; top: 39.7%; width: 40%; height: auto; aspect-ratio: 1; }
.register__check circle { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 152; stroke-dashoffset: 152; }
.register__check path { stroke: var(--gold-hi); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.register__success.is-in circle { animation: draw .8s var(--ease) forwards; }
.register__success.is-in path { animation: draw .5s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.register__success-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 26px; }

/* =====================================================================
   13 LOGIN ITEMS
   ===================================================================== */
.login-items {
  grid-area: items;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 28px);
  width: 100%;
  max-width: 1060px;
  margin-top: 18px;
  perspective: 900px;
}
.item-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 18px 24px;
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(255, 180, 90, .14), transparent 70%),
    linear-gradient(180deg, rgba(60, 12, 18, .92), rgba(16, 7, 8, .96));
  text-align: center;
  transform-style: preserve-3d;
  transition: box-shadow .4s;
  box-shadow: 0 20px 34px -22px rgba(0, 0, 0, .9);
}
.item-card:hover { box-shadow: 0 26px 40px -20px rgba(0, 0, 0, .95), 0 0 30px rgba(212, 174, 92, .18); }
.item-card__day {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font: 700 13px var(--font-display); letter-spacing: .04em; color: var(--gold-hi); white-space: nowrap;   /* หัวข้อ "วันที่ N" (ภาษาไทย ไม่ถ่างตัวอักษร) */
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}
.item-card__icon { position: relative; z-index: 1; display: block; width: 70%; max-width: 160px; height: auto; margin: 4px auto 14px; transform: translateZ(30px); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .7)); }
/* ไอคอนลอย (wrapper — img ยังเป็นเป้าหมาย GSAP) + วงทองหมุน + flare หลังไอคอน */
.item-card { container-type: inline-size; overflow: visible; }
.item-card__float { display: block; width: 100%; position: relative; z-index: 1; animation: float-y 3.8s ease-in-out infinite; }   /* width 100% — ไม่งั้น flex หดตามรูป lazy (0px) → การ์ดยืดทีหลัง */
.item-card:nth-child(2) .item-card__float { animation-delay: -1s; }
.item-card:nth-child(3) .item-card__float { animation-delay: -2s; }
.item-card:nth-child(4) .item-card__float { animation-delay: -2.9s; }
.item-card__halo {
  --s: min(70cqw, 160px);           /* = ขนาดไอคอน (cqw วัดจาก content box ของการ์ด = width 70% ของไอคอน) */
  position: absolute; left: 0; right: 0; margin-inline: auto; z-index: 0;
  width: calc(var(--s) * 1.32); aspect-ratio: 1; top: calc(44px - var(--s) * .16);
  pointer-events: none;
}
.item-card__halo::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/theme/halo-ring.webp") center / contain no-repeat;
  opacity: .9; animation: flare-spin 40s linear infinite;
}
.item-card__halo::after {
  content: ""; position: absolute; inset: -30%;
  background: url("../img/theme/flare-gold.webp") center / contain no-repeat;
  opacity: .45; animation: flare-spin 28s linear infinite reverse, flare-breathe 3.8s ease-in-out infinite;
}
/* แสงกวาดตอนชี้การ์ด */
.item-card__shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.item-card__shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 205, .35) 50%, transparent);
  transform: skewX(-16deg);
}
.item-card:hover .item-card__shine::before { animation: banner-shine 1.1s ease-out; }
.item-card:hover { translate: 0 -6px; }
.item-card { transition: box-shadow .4s, translate .4s var(--ease); }
.item-card__name { font: 600 clamp(14px, 1.15vw, 17px)/1.35 var(--font-display); color: var(--ink); min-height: 2.7em; display: flex; align-items: center; }
.item-card__qty { margin-top: 4px; font: 600 13px var(--font-display); color: var(--gold); }

/* =====================================================================
   14 RANKING (dark)
   ===================================================================== */
/* Crimson Heraldry: โถงอัศวิน + ธงแขวน (ภาพ bg-ranking) + god rays ทอง (WebGL, blend screen) */
.ranking {
  position: relative; color: var(--ink); overflow: hidden;
  background:
    linear-gradient(180deg, var(--bg) 0, rgba(11, 7, 8, 0) 140px),
    linear-gradient(180deg, rgba(7, 4, 5, 0) 0, rgba(7, 4, 5, 0) min(44vw, 820px), var(--dark) min(56vw, 1060px)),
    url("../img/theme/bg-ranking.webp") center top / max(100%, 1200px) auto no-repeat,
    var(--dark);
}
.ranking .gl-canvas { mix-blend-mode: screen; opacity: .85; }
.ranking__top {
  position: relative;
  display: flex; align-items: center;
  padding: clamp(90px, 8vw, 130px) 0 clamp(30px, 4vw, 56px);
}
.ranking__top > .container { position: relative; z-index: 2; }

.top3 {
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  grid-template-areas: "r2 r1 r3";
  align-items: start;
  gap: clamp(16px, 3vw, 48px);
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 64px;
}
/* ธงแขวนแดงขอบทอง (rank-banner 600×1088) — ข้อความเป็น text จริงวางบนผ้า
   .top-card        = ตัวการ์ด (GSAP ฉากเปิด)
   .top-card__swing = ผืนธง: แกว่งจากคาน (CSS rotate) + ผืนผ้า WebGL <canvas.top-card__cloth> (fx-cloth.js)
                      ถ้า WebGL ใช้ไม่ได้ → แสดงรูปธงนิ่งจาก background */
.top-card { position: relative; min-width: 0; transform-origin: 50% 0; }
.top-card__swing {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  aspect-ratio: 760 / 950;
  padding: 36% 14% 0;            /* ธงทรงกว้าง (ผ้ากว้าง ~83% ของรูป · ขอบทองด้านใน ~12%) · บน 36% = ใต้ตราครั่ง */
  text-align: center;
  background: url("../img/theme/rank-banner.webp") center top / 100% 100% no-repeat;
  filter: drop-shadow(0 30px 30px rgba(0, 0, 0, .75));
  transform-origin: 50% 3.5%;
  animation: banner-swing 5.2s ease-in-out infinite;
}
.top-card__swing.has-cloth { background: none; }
.top-card__cloth { position: absolute; left: -7%; top: 0; width: 114%; max-width: none; height: 103%; z-index: 0; pointer-events: none; }   /* max-width:none — reset canvas{max-width:100%} ทำให้ผ้าแคบ+เยื้องซ้าย ข้อความเลยดูไม่ตรงกลาง */
.top-card__label, .top-card__name, .top-card__cp, .top-card__bar { position: relative; z-index: 1; }
.top-card[data-rank="2"] .top-card__swing { animation-duration: 5.9s; animation-delay: -1.7s; }
.top-card[data-rank="3"] .top-card__swing { animation-duration: 5.5s; animation-delay: -3.3s; }
@keyframes banner-swing { 0%, 100% { rotate: -.35deg; } 50% { rotate: .35deg; } }
.top-card[data-rank="1"] { grid-area: r1; }
.top-card[data-rank="2"] { grid-area: r2; margin-top: clamp(40px, 5vw, 76px); }
.top-card[data-rank="3"] { grid-area: r3; margin-top: clamp(40px, 5vw, 76px); }
/* แสงหลังธง (กึ่งกลางที่ตราครั่ง) — ไม่ใช้ translate เพราะ GSAP ทำ scale ตัวนี้ */
.top-card__halo {
  position: absolute; left: -25%; top: -35%;
  width: 150%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 200, 110, .28), transparent 60%);
  pointer-events: none; z-index: -1;
}
.top-card[data-rank="1"] .top-card__halo { background: radial-gradient(circle, rgba(255, 210, 120, .45), transparent 62%); }
/* ตราครั่งแดง + เลขอันดับ */
.top-card__emblem {
  position: absolute; left: 0; right: 0; top: 7%; z-index: 4;
  width: 27%; aspect-ratio: 280 / 271; margin-inline: auto;
  display: grid; place-items: center;
  background: var(--img-emblem) center / contain no-repeat;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6));
}
.top-card__emblem b {
  font: 900 clamp(24px, 2.6vw, 40px)/1 var(--font-serif);
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .8));
}
.top-card__label { margin-top: 0; font: 700 clamp(10px, .85vw, 12px) var(--font-serif); letter-spacing: .3em; color: var(--gold); }
.top-card__name {
  margin: 6px 0 12px;
  font: 800 clamp(17px, 1.85vw, 29px)/1.15 var(--font-serif);
  color: var(--gold-hi);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 18px rgba(255, 200, 110, .25);
  overflow-wrap: anywhere;
}
.top-card[data-rank="1"] .top-card__name { font-size: clamp(21px, 2.4vw, 38px); }
.top-card__cp { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding-top: 12px; border-top: 1px solid rgba(212, 174, 92, .35); }
.top-card__cp span { font: 600 clamp(12px, 1vw, 15px) var(--font-display); letter-spacing: .08em; color: var(--ink-2); }
.top-card__cp b {
  font: 800 clamp(19px, 2.05vw, 32px)/1.1 var(--font-serif); font-variant-numeric: tabular-nums;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .7));
}
.top-card[data-rank="1"] .top-card__cp b { font-size: clamp(23px, 2.6vw, 41px); }
.top-card__bar { width: 72%; height: 2px; margin-top: 14px; background: rgba(212, 174, 92, .18); overflow: hidden; }
.top-card__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transform-origin: left; }

/* สถานะโหลดอันดับ (RankingBoardAPI): loading / error / empty — แทนที่ธง Top 3 ชั่วคราว */
.rank-status {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: clamp(220px, 30vw, 420px);
  padding: 32px 16px;
  text-align: center; font-size: 16px; line-height: 1.6; color: var(--ink-2);
}
.rank-status--loading::before {
  content: ""; width: 36px; height: 36px;
  border: 3px solid rgba(212, 174, 92, .25); border-top-color: var(--gold); border-radius: 50%;
  animation: spin 1s linear infinite;
}
.rank-tables .rank-status { min-height: 0; padding: 18px 8px; }
.rank-note { margin: 18px auto 0; text-align: center; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.rank-note b { color: var(--gold-hi); font-weight: 700; }
.ranking__list { position: relative; z-index: 2; padding: 0 0 clamp(80px, 9vw, 130px); }
.rank-head {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 22px;
  font: 700 15px var(--font-display); letter-spacing: .08em; color: var(--gold-hi);
}
.rank-head { white-space: nowrap; }
/* หัวตาราง = ป้ายทองเหลือง + เส้น flourish สองข้าง */
.rank-head span {
  --p-h: 38px; --p-cap: calc(var(--p-h) * .4875);
  display: inline-flex; align-items: center; min-height: var(--p-h); padding: 0 .4em;
  border-style: solid; border-width: 0 var(--p-cap);
  border-image: var(--img-plate) 0 39 fill / 0 var(--p-cap) stretch;
  color: #2b1406; text-shadow: 0 1px 0 rgba(255, 240, 200, .45); font: 800 15px/1 var(--font-display); letter-spacing: .04em;
}
.rank-head::before, .rank-head::after {
  content: ""; flex: 0 1 170px; min-width: 40px; aspect-ratio: 480 / 56; height: auto;
  background: var(--img-flourish) center / contain no-repeat;
}
.rank-head::after { background-image: var(--img-flourish-r); }
/* กล่องตารางกรอบทอง 9-slice (class frame ใน HTML) */
.rank-tables {
  --f-w: 34px; --f-off: 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(20px, 3vw, 44px); max-width: 1100px; margin: 0 auto;
  padding: clamp(22px, 2.6vw, 36px) clamp(18px, 2.6vw, 38px);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(142, 18, 27, .3), transparent 70%),
    linear-gradient(180deg, rgba(22, 10, 12, .92), rgba(8, 4, 5, .95));
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95);
}
.rank-table {
  width: 100%; align-self: start; border-collapse: collapse; font-size: 14.5px;
  background: linear-gradient(180deg, rgba(48, 10, 14, .55), rgba(14, 6, 7, .4));
  box-shadow: 0 0 0 1px rgba(212, 174, 92, .35);
}
.rank-table th {
  padding: 11px 12px;
  font: 600 12px var(--font-display); letter-spacing: .1em; text-transform: uppercase; text-align: left;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(142, 18, 27, .55), rgba(90, 10, 16, .4));
  border-bottom: 1px solid rgba(212, 174, 92, .55);
}
.rank-table td { padding: 9px 12px; border-bottom: 1px solid rgba(212, 174, 92, .12); color: var(--ink); }
.rank-table tbody tr { transition: background-color .25s; }
.rank-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .025); }
.rank-table tbody tr:hover { background: linear-gradient(90deg, rgba(194, 39, 45, .32), rgba(212, 174, 92, .14) 50%, rgba(194, 39, 45, .32)); }
.rank-table tbody tr:hover .t-name { color: var(--gold-hi); }
.rank-table tbody tr:hover .rank-pill { filter: brightness(1.25) saturate(1.1); }
.rank-table .t-rank { width: 70px; }
.rank-table .t-cp { text-align: right; }
.rank-table .t-name { font: 600 15px var(--font-display); overflow-wrap: anywhere; }
.rank-table .num { font-family: var(--font-serif); font-weight: 700; color: var(--gold-hi); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* เลขอันดับในโล่เล็ก (ขอบทอง = ชั้นนอก, แดง = ::before ซ้อนด้านใน) */
.rank-pill {
  position: relative; isolation: isolate;
  display: inline-grid; place-items: center;
  width: 30px; height: 34px; padding-bottom: 4px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  color: var(--gold-hi);
  font: 800 13px/1 var(--font-serif);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%);
  transition: filter .25s;
}
.rank-pill::before {
  content: ""; position: absolute; inset: 2px 2px 3px; z-index: -1;
  background: linear-gradient(180deg, #b0161f, #5a0a10);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%);
}

/* =====================================================================
   15 NEWS SLIDER (Owl Carousel 2 — custom coverflow)
   ===================================================================== */
/* Crimson Heraldry: พื้นดำ + ม่านแดงมุมบน + แสงทองกลาง */
.news {
  background:
    url("../img/theme/curtain-l.webp") left top / var(--curtain, 260px) auto no-repeat,
    url("../img/theme/curtain-r.webp") right top / var(--curtain, 260px) auto no-repeat,
    radial-gradient(60% 50% at 50% 55%, rgba(212, 140, 60, .14), transparent 70%),
    radial-gradient(30% 40% at 0% 0%, rgba(142, 18, 27, .45), transparent 70%),
    radial-gradient(30% 40% at 100% 0%, rgba(142, 18, 27, .45), transparent 70%),
    var(--img-damask) center top / 384px 384px,
    linear-gradient(180deg, var(--bg), #060304 60%, var(--bg));
  background-blend-mode: normal, normal, normal, normal, normal, soft-light, normal;
  overflow: hidden;
}
.news::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-lo), var(--gold-hi), var(--gold-lo), transparent);
  opacity: .7;
}
.news__stage { position: relative; max-width: 1680px; margin: 0 auto; }
.news-slider .owl-stage-outer { overflow: visible; padding: 10px 0 30px; }
.news-slider .owl-item {
  opacity: 0;
  transform: scale(.7);
  z-index: 1;
  transition: transform .9s var(--ease), opacity .9s var(--ease), filter .9s var(--ease);
  filter: grayscale(.6) brightness(.55) sepia(.3);
}
.news-slider .owl-item.is-prev { transform: translateX(24%) scale(.82); opacity: .8; z-index: 2; cursor: pointer; }
.news-slider .owl-item.is-next { transform: translateX(-24%) scale(.82); opacity: .8; z-index: 2; cursor: pointer; }
.news-slider .owl-item.is-center { transform: none; opacity: 1; z-index: 3; filter: none; }
.news-slider .owl-item.is-prev .banner, .news-slider .owl-item.is-next .banner { pointer-events: none; }
.banner { display: block; position: relative; box-shadow: 0 36px 60px -30px rgba(0, 0, 0, .9); background: #000; }
.banner { margin: 0; }
.banner img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 500; object-fit: cover; }
/* กรอบทองเหลี่ยมแบบตราประจำตระกูล (frame-media 9-slice) — แสดงที่สไลด์กลาง */
.banner::after {
  content: ""; position: absolute; inset: -10px;
  border: 30px solid transparent;
  border-image: var(--img-frame-media) 63 66 / 30px 32px stretch;
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}
.owl-item.is-center .banner::after { opacity: 1; }
.owl-item.is-center .banner { box-shadow: 0 0 50px rgba(212, 140, 60, .25), 0 36px 60px -30px rgba(0, 0, 0, .9); }
/* แสงกวาดผ่านแบนเนอร์ทุกครั้งที่สไลด์ขึ้นมาเป็นตัวกลาง (JS ใส่ .banner__shine) */
.banner__shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.banner__shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -45%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 205, .5) 50%, transparent);
  transform: skewX(-18deg);
}
.owl-item.is-center .banner__shine::before { animation: banner-shine 1.5s .35s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes banner-shine { from { left: -45%; } to { left: 135%; } }

/* ปุ่มซ้าย/ขวาชิดขอบแบนเนอร์ที่ active — --sp ต้องตรงกับ stagePadding ใน main.js (initSlider)
   ปุ่มคร่อมขอบกรอบ ~30% ของตัวปุ่ม */
.news-slider { --sp: 36px; --ab: 44px; }
@media (min-width: 576px) { .news-slider { --sp: 84px; } }
@media (min-width: 768px) { .news-slider { --ab: clamp(48px, 4.2vw, 60px); } }
@media (min-width: 992px) { .news-slider { --sp: 200px; } }
@media (min-width: 1400px) { .news-slider { --sp: 300px; } }
.news-slider .owl-nav {
  position: absolute; left: 0; right: 0; top: 50%;
  display: flex; justify-content: space-between;
  padding: 0 max(4px, calc(var(--sp) - var(--ab) * .7));
  transform: translateY(calc(-50% - 10px));
  pointer-events: none;
  z-index: 5;
}
.news-slider .owl-nav button.owl-prev,
.news-slider .owl-nav button.owl-next {
  pointer-events: auto;
  position: relative;
  width: var(--ab); aspect-ratio: 1;
  display: grid; place-items: center;
  color: #fff;
  transition: transform .35s var(--ease), color .3s;
}
/* ปุ่มกลมทองขอบ + ลูกศร (btn-arrow.webp) — prev ใช้รูปเดียวกันกลับด้าน */
.news-slider .owl-nav button::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/theme/btn-arrow.webp") center / contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7));
  transition: transform .5s var(--ease), filter .3s;
}
.news-slider .owl-nav button.owl-prev::before { transform: scaleX(-1); }
.news-slider .owl-nav button:hover::before { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)) brightness(1.2); }
.news-slider .owl-nav button.owl-next:hover::before { transform: translateX(3px); }
.news-slider .owl-nav button.owl-prev:hover::before { transform: scaleX(-1) translateX(3px); }
.news-slider .owl-nav button svg { display: none; }
.news-slider .owl-nav button.owl-prev:active { transform: translateX(-3px); }
.news-slider .owl-nav button.owl-next:active { transform: translateX(3px); }

.news-slider .owl-dots { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; }
.news-slider .owl-dots button.owl-dot { padding: 10px 0; }
.news-slider .owl-dots button.owl-dot span {
  display: block; width: 10px; height: 10px;
  background: rgba(212, 174, 92, .25);
  box-shadow: inset 0 0 0 1px rgba(212, 174, 92, .6);
  transform: rotate(45deg);
  transition: width .5s var(--ease), background .3s;
}
.news-slider .owl-dots button.owl-dot:hover span { background: rgba(212, 174, 92, .55); }
.news-slider .owl-dots button.owl-dot.active span { background: linear-gradient(135deg, var(--gold-hi), var(--crimson-hi)); box-shadow: 0 0 10px rgba(246, 210, 140, .6); }

/* =====================================================================
   16 FOOTER (official GE M footer)
   ===================================================================== */
.gemth-footer { position: relative; background: #050303; border-top: 1px solid rgba(212, 174, 92, .35); padding: 34px 16px 30px; }
.gemth-footer__ci p { margin-top: 16px; font-size: 12.5px; line-height: 1.7; letter-spacing: .02em; color: rgba(243, 230, 200, .5); }

/* =====================================================================
   16b FX — เอฟเฟกต์รวม (fx-embers.js · title flash · hero flash)
   ===================================================================== */
/* ประกายไฟ/ฝุ่นทองทั้งหน้า (WebGL) — อยู่เหนือเนื้อหาแต่ใต้ nav/แถบลอย, blend แบบ screen */
.fx-embers { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 35; pointer-events: none; mix-blend-mode: screen; }
/* เส้นแสง anamorphic วาบหลังหัวข้อตอนเลื่อนมาถึง (GSAP) — แทรกเป็นลูกตัวแรกของ .sec-title / .hero__title */
.sec-title__flash, .hero__flash {
  position: absolute; left: -12%; right: -12%; top: 50%; height: 96px; margin-top: -48px; z-index: 0;
  background: url("../img/theme/flare-streak.webp") center / 100% 100% no-repeat;
  opacity: 0; pointer-events: none;
}
.hero__title { position: relative; }
.hero__flash { left: -20%; right: -30%; height: 120px; margin-top: -60px; }
/* ประกายทองแตกกระจาย (burst ใน main.js) — ชั้นลอยพิกัดเอกสาร */
.fx-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 37; pointer-events: none; }
.fx-spark { position: absolute; background: url("../img/theme/glint.webp") center / contain no-repeat; pointer-events: none; mix-blend-mode: screen; }
/* เส้นคั่นทองมงกุฎกลาง คร่อมรอยต่อ section (JS แทรกก่อน #ranking / #events / #media) */
.sec-divider { position: relative; z-index: 6; height: 0; pointer-events: none; }
.sec-divider::before {
  content: ""; position: absolute; left: 0; right: 0; margin-inline: auto;
  width: min(880px, 86vw); aspect-ratio: 1200 / 170; top: calc(min(880px, 86vw) * -.0708);
  background: url("../img/theme/divider.webp") center / contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .8)) drop-shadow(0 0 18px rgba(255, 190, 100, .25));
}
.sec-divider::after {   /* ประกายที่มงกุฎกลาง */
  content: ""; position: absolute; left: 0; right: 0; margin-inline: auto; width: 70px; height: 70px; top: -48px;
  background: url("../img/theme/glint.webp") center / contain no-repeat;
  animation: twinkle 3.4s ease-in-out infinite;
}
/* ม่านกำมะหยี่มุมบนซ้าย/ขวาของ section Media */
.news { --curtain: clamp(150px, 22vw, 340px); }

/* =====================================================================
   17 FLOATING UI
   ===================================================================== */
.scroll-progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson-hi), var(--gold), var(--gold-hi)); transform: scaleX(0); transform-origin: left; }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  color: #fff;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .35s, transform .45s var(--ease), visibility 0s .45s, bottom .6s var(--ease);
}
.to-top { color: var(--gold-hi); }
.to-top::before { content: ""; position: absolute; inset: 7px; background: linear-gradient(135deg, #a8151f, #4a080d); transform: rotate(45deg); box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(7, 4, 5, .9), 0 8px 16px rgba(0, 0, 0, .6); transition: transform .5s var(--ease); }
.to-top svg { position: relative; width: 20px; height: 20px; }
.to-top:hover::before { transform: rotate(225deg); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .35s, transform .45s var(--ease), visibility 0s, bottom .6s var(--ease); }


.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  background: linear-gradient(180deg, #1c0f10, #0b0607); color: var(--gold-hi);
  border: 1px solid rgba(212, 174, 92, .6);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .7);
  font: 500 14.5px/1.4 var(--font-body);
  text-align: center;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .5s var(--ease), opacity .3s, bottom .6s var(--ease);
  pointer-events: none;
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; }

/* =====================================================================
   17b FLOATING DOWNLOAD BAR — โผล่เมื่อ store badge ใน hero เลื่อนพ้นจอ
   asset: frame-dlbar (9-slice) · dlbar-crest · dlbar-char (alpha) · btn-store (3-slice)
   ===================================================================== */
:root {
  --dlbar-h: 0px;   /* JS วัดความสูงจริง → ใช้ดันปุ่มลอย/footer */
  --img-frame-dlbar: url("../img/theme/frame-panel.webp");   /* slice 75 */
  --img-btn-store: url("../img/theme/btn-store.webp");       /* 759×112 · cap 24 */
  --img-btn-store-pc: url("../img/theme/btn-store-pc.webp"); /* 762×112 · cap 24 */
}
.dlbar {
  position: fixed; left: 50%; z-index: 42;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(1180px, calc(100% - 32px));
  translate: -50% 0;
  transform: translateY(calc(100% + 60px));
  opacity: 0;
  visibility: hidden;
  transition: transform .8s var(--ease), opacity .45s, visibility 0s .8s;
}
.dlbar.is-show { transform: none; opacity: 1; visibility: visible; transition: transform .8s var(--ease), opacity .45s, visibility 0s; }
.dlbar__panel {
  --f-img: var(--img-frame-dlbar);
  --f-slice: 75;
  --f-w: 26px;
  --f-off: 0px;
  position: relative;
  display: flex; align-items: center; gap: clamp(14px, 2.2vw, 32px);
  min-height: 92px;
  padding: 14px clamp(18px, 2.4vw, 30px) 14px clamp(166px, 16vw, 220px);
  color: #fff;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .35));
}
.dlbar__bg {
  position: absolute; inset: 5px; z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 160% at 12% 0%, rgba(142, 18, 27, .75) 0%, rgba(40, 8, 12, .9) 45%, #0b0607 80%),
    var(--img-damask) 0 0 / 220px 220px;
}
.dlbar__bg::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 220, 160, .08), transparent 40%);
}
.dlbar__bg::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 220, 150, .14), transparent);
  animation: dlbar-shine 5.5s var(--ease-in-out) infinite;
}
@keyframes dlbar-shine { 0%, 50% { transform: translateX(0); } 100% { transform: translateX(360%); } }
.dlbar__crest {
  position: absolute; left: 0; right: 0; top: -26px; z-index: 4;
  width: 46px; height: auto; margin-inline: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 12px rgba(255, 200, 110, .35));
}
/* chibi เต็มตัว ยืนอยู่หน้ากรอบ (z-index สูงกว่า overlay 9-slice ของ .frame ที่ z 3)
   span = เป้าหมาย GSAP · img = ลอยขึ้นลง (CSS) */
.dlbar__char {
  position: absolute; z-index: 6;
  left: clamp(20px, 2.2vw, 40px); bottom: 2px;
  width: clamp(128px, 11vw, 168px); line-height: 0;     /* ลิซซี่ท่าเชิญชวน (กว้างกว่าเดิม) */
  pointer-events: none;
}
.dlbar__char img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .75)) drop-shadow(0 0 16px rgba(255, 190, 100, .2));
  animation: float-y 3.6s ease-in-out infinite;
}
.dlbar__text { position: relative; z-index: 2; flex: 1 1 auto; min-width: 0; }
.dlbar__eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dlbar__live { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1 var(--font-body); color: var(--ink-2); white-space: nowrap; }
.dlbar__live i { width: 8px; height: 8px; border-radius: 50%; background: #5dff8a; animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse { from { box-shadow: 0 0 0 0 rgba(93, 255, 138, .6); } to { box-shadow: 0 0 0 10px rgba(93, 255, 138, 0); } }
.dlbar__title {
  font: 800 clamp(19px, 1.85vw, 28px)/1.2 var(--font-display); letter-spacing: .01em;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8));
}
.dlbar__sub { margin-top: 3px; font-size: clamp(13px, .95vw, 15px); line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlbar__stores { position: relative; z-index: 2; flex: 0 0 auto; display: flex; gap: 10px; }

/* badge ใน floating bar (รูปทางการ) */
.dl-badge--bar { --d-h: 52px; }

/* ปุ่มลอย / toast / footer หลบ bar */
body.dlbar-on .to-top { bottom: calc(var(--dlbar-h) + 14px); }
body.dlbar-on .toast { bottom: calc(var(--dlbar-h) + 18px); }
.gemth-footer { padding-bottom: calc(var(--dlbar-h) + 30px); }


/* =====================================================================
   19 RESPONSIVE
   ===================================================================== */
@media (max-width: 1199.98px) {
  .site-nav__menu a { padding: 8px 10px; font-size: 14px; }
  .site-nav__menu a::after { left: 10px; right: 10px; }
}

@media (max-width: 991.98px) {
  :root { --nav-h: 64px; }
  .site-nav__menu { display: none; }
  .burger { display: flex; }

  /* hero → ข้อความ → (ตัวละครโผล่เหนือ) วิดีโอ */
  .hero { padding-top: calc(var(--nav-h) + 36px); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero__copy { align-items: center; text-align: center; }
  .hero__veil {
    background: linear-gradient(180deg, rgba(7, 4, 5, .55) 0%, rgba(7, 4, 5, .35) 30%, rgba(7, 4, 5, .55) 60%, rgba(7, 4, 5, .8) 100%);
  }
  .hero__kv-layer--back img { object-position: 50% 30%; }
  .gfx-img--hero { width: min(88vw, 520px); }
  .hero__sub { justify-content: center; }
  .hero__cta { justify-content: center; margin-left: 0; }
  .stores { justify-content: center; }
  .hero__cast { position: relative; right: auto; bottom: auto; width: min(100%, 720px); margin: 10px auto 0; overflow: hidden; }
  .scroll-cue { left: 0; right: 0; margin-inline: auto; }

  .hero__prize { align-items: center; }

  .top3 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "r1 r1" "r2 r3"; row-gap: 28px; }
  .top-card[data-rank="2"], .top-card[data-rank="3"] { margin-top: 0; }
  .dlbar__live { display: none; }
  /* 3 ปุ่ม store → bar เป็น 2 แถว (ข้อความ / ปุ่ม) ตั้งแต่ tablet ลงไป */
  .dlbar__panel {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-areas: "char text" "stores stores";
    gap: 10px 14px;
    min-height: 0;
    padding: 14px 16px;
  }
  .dlbar__char { position: relative; grid-area: char; left: auto; bottom: auto; width: 96px; margin: -70px 0 0 8px; align-self: start; }
  .dlbar__text { grid-area: text; align-self: center; }
  .dlbar__stores { grid-area: stores; }
  .dlbar__stores .dl-badge { flex: 0 1 auto; min-width: 0; height: auto; }
  .dlbar__stores .dl-badge img { width: 100%; height: auto; max-height: 48px; }
  .dlbar__stores { justify-content: center; }
  .top-card[data-rank="1"] { width: min(100%, 440px); justify-self: center; }
  /* tablet: ธงกว้างกว่าสัดส่วนจอ → ตัวอักษรอิงขนาดคงที่แทน vw (มือถือ ≤767 กำหนดใหม่ด้านล่าง) */
  .top-card__label { font-size: 11px; }
  .top-card__name { font-size: 22px; }
  .top-card[data-rank="1"] .top-card__name { font-size: 28px; }
  .top-card__cp span { font-size: 13px; }
  .top-card__cp b { font-size: 24px; }
  .top-card[data-rank="1"] .top-card__cp b { font-size: 30px; }
}

@media (max-width: 767.98px) {
  .section { padding: clamp(72px, 16vw, 96px) 0; }
  .sec-title::before, .sec-title::after { flex-basis: 36px; }
  .sec-head__eyebrow { letter-spacing: .24em; font-size: 11px; }
  .sec-head__eyebrow::before, .sec-head__eyebrow::after { width: 18px; }

  /* podium → gold บนสุด, silver/bronze คู่กัน */
  .podium {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "gold gold" "silver bronze";
    row-gap: 48px;
    column-gap: 14px;
  }
  .podium__col--gold { width: min(100%, 360px); justify-self: center; }
  .podium__col--silver, .podium__col--bronze { align-self: end; }
  .podium__visual { width: 84%; }
  .podium__col--gold .podium__visual { width: 86%; }
  .podium__info { width: 100%; --f-w: 20px; }
  .podium__desc .plate { --p-h: 26px; font-size: 10.5px; letter-spacing: .02em; }

  /* Rank 4–20 → กล่องทองเหลืองหลายบรรทัด (3-slice ยืดแนวตั้งไม่ได้) */
  .podium-more {
    flex-wrap: wrap; gap: 6px 14px; padding: 14px 18px;
    border: 1px solid var(--gold-hi); border-image: none; border-radius: 4px;
    background: linear-gradient(180deg, #f6e2a4, #d9b062 45%, #b98a3c);
    box-shadow: inset 0 0 0 3px rgba(90, 58, 20, .35);
  }
  .podium-more__rank { flex-basis: 100%; text-align: center; font-size: 15px; }
  .podium-more__wing { width: 64px; }

  /* steps → เส้นซ้าย */
  .steps { gap: 72px; }
  .steps__line { left: 24px; top: 24px; }
  .step,
  .step--reverse {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas: "marker body" ". media";
    column-gap: 18px;
    row-gap: 24px;
    align-items: start;
  }
  .step__body, .step--reverse .step__body { text-align: left; }
  .step__marker { width: 48px; height: 48px; margin-top: -2px; }
  .step__marker::before { inset: -6px; }
  .step__marker span { font-size: 20px; }
  .step__media { --f-w: 24px; --f-off: 6px; }
  .events::before, .events::after { display: none; }
  .register { grid-row: 3; grid-column: 1 / -1; margin-top: 18px; --f-w: 26px; --f-off: 6px; }
  .step__note { grid-row: 4; margin-top: 4px; font-size: 13px; }
  .register__form { grid-template-columns: 1fr; gap: 20px; }
  .step--stack {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas: "marker body" "items items" "actions actions";
    justify-items: stretch;
  }
  .step--stack .step__body { text-align: left; min-width: 0; padding-inline: 0; }
  .step__title-img { width: 100%; max-width: 340px; height: auto; }
  .step--stack .gfx-img { width: 100%; max-width: 340px; }
  .step__actions { justify-self: center; }
  .login-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
  .item-card { padding: 34px 10px 18px; }
  .item-card__halo { top: calc(38px - var(--s) * .16); }
  .rank-tables { --f-w: 24px; --f-off: 4px; padding: 18px 14px; }
  .rank-head::before, .rank-head::after { flex-basis: 70px; }
  .sec-divider::after { width: 50px; height: 50px; top: -34px; }

  /* ranking: ธงอันดับ 1 บน, 2 / 3 คู่กัน */
  .top3 { padding-top: 40px; column-gap: 12px; }
  .top-card[data-rank="1"] { width: min(100%, 340px); }
  .top-card__swing { padding-inline: 13%; }
  .top-card__name { font-size: clamp(12px, 3.7vw, 19px); letter-spacing: 0; overflow-wrap: break-word; max-width: 100%; }   /* ชื่อจริงจาก API อาจยาว — ตัดบรรทัดเฉพาะคำที่ล้นธง */
  .top-card[data-rank="1"] .top-card__name { font-size: clamp(19px, 5.8vw, 28px); }
  .top-card__cp b { font-size: clamp(14px, 4.3vw, 22px); }
  /* ธงอันดับ 2/3 บนมือถือเล็ก (~170px): ซ่อนป้าย RANK (ตราครั่งบอกอันดับแล้ว) + บีบระยะ ไม่ให้ข้อความลงไปทับมงกุฎล่าง */
  .top-card[data-rank="2"] .top-card__swing, .top-card[data-rank="3"] .top-card__swing { padding-top: 33%; padding-inline: 12%; }
  .top-card[data-rank="2"] .top-card__label, .top-card[data-rank="3"] .top-card__label { display: none; }
  .top-card[data-rank="2"] .top-card__name, .top-card[data-rank="3"] .top-card__name { margin: 2px 0 6px; }
  .top-card[data-rank="2"] .top-card__cp, .top-card[data-rank="3"] .top-card__cp { padding-top: 6px; gap: 2px; }
  .top-card[data-rank="2"] .top-card__cp span, .top-card[data-rank="3"] .top-card__cp span { font-size: 9.5px; }
  .top-card[data-rank="2"] .top-card__bar, .top-card[data-rank="3"] .top-card__bar { margin-top: 8px; }
  .top-card__cp span { font-size: 10.5px; }
  .rank-tables { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rank-table--cont thead { display: none; }
  .rank-table td, .rank-table th { padding: 9px 8px; }
  .rank-table .t-rank { width: 56px; }

  .marquee { margin-top: -20px; padding: 11px 0; }
  .gemth-footer { padding-bottom: calc(var(--dlbar-h) + 72px); }

  .dlbar { width: calc(100% - 16px); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .dlbar__panel {
    --f-w: 16px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-areas: "char text" "stores stores";
    gap: 8px 10px;
    min-height: 0;
    padding: 12px 12px 12px;
  }
  .dlbar__char { position: relative; grid-area: char; left: auto; bottom: auto; width: 78px; margin: -58px 0 0 4px; align-self: start; }
  .dlbar__text { grid-area: text; align-self: center; }
  .dlbar__eyebrow { margin-bottom: 3px; }
  .dlbar__title { font-size: 17px; }
  .dlbar__sub { font-size: 12px; }
  .dlbar__crest { width: 34px; top: -19px; }
  .dlbar__stores { grid-area: stores; gap: 8px; }
  .to-top { right: 10px; bottom: 10px; }
}

@media (max-width: 575.98px) {
  .site-nav__cta { --b-h: 38px; font-size: 13px; }
  .site-nav__web { display: none; }   /* มือถือเล็ก: ย้ายไปอยู่ในเมนู (.mobile-menu__web) */
  .site-nav__logo-img { height: 40px; }
  .hero__stores { gap: 8px; }
  .hero__stores .dl-badge { --d-h: 40px; }
  .hero__cta { flex-direction: column; align-items: center; gap: 8px; }
  .hero__cta .btn { min-width: 260px; }
  .sec-title::before, .sec-title::after { display: none; }
  .sec-title .gfx-img { width: 92vw; }                                   /* ขนาดที่ span (max-width 100%) · รูปเต็ม span */
  .sec-title--th .gfx-img, #mediaTitle .gfx-img { width: 90vw; }
  .sec-title__img, .sec-title--th .sec-title__img, #mediaTitle .sec-title__img { width: 100%; height: auto; max-width: none; }
  .podium__amount { font-size: clamp(20px, 6.4vw, 28px); }
  .podium__col--gold .podium__amount { font-size: clamp(30px, 10vw, 42px); }
  .podium__name { font-size: 11px; letter-spacing: .08em; }
  .register { padding-inline: 16px; }
  .dlbar__eyebrow { display: none; }
  /* 3 badge ในแถวเดียว ย่อตามความกว้าง */
  .dlbar__stores { gap: 6px; }
  /* email: ชื่อ เต็มแถว → [@][โดเมน] แถวล่าง */
  .email-row { flex-wrap: wrap; }
  .email-row__local { flex-basis: 100%; }
  .email-row__local .field__input,
  .field--email.is-invalid .email-row__local .field__input { border-right-width: 1.5px; }
  .field--email.is-invalid .email-row__local .field__input { border-right-width: 2px; }
  .email-row__at { margin-top: -1.5px; border-left: 1.5px solid rgba(212, 174, 92, .38); }
  .field.is-invalid .email-row__at { border-left: 2px solid var(--crimson-hi); }
  .email-row__domain { flex: 1 1 0; margin-top: -1.5px; }
  .item-card__name { font-size: 13.5px; }
  .podium__desc small { font-size: 11px; }
}

@media (max-width: 379.98px) {
  .site-nav__inner { gap: 10px; }
  .site-nav__logo-img { height: 34px; }
  .login-items { gap: 10px; }
  .item-card__day { letter-spacing: .02em; font-size: 12px; }
}

@media (min-width: 1800px) {
  :root { --container: 1360px; }
}

/* =====================================================================
   20 REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .gfx-text::after, .gfx-img::after { animation: none; opacity: 0; }
  .steps__line i { transform: none; }   /* ไม่มี scrub → แสดงเส้นทองเต็มเส้น */
  .steps__spark { display: none; }
}
