/* =====================================================================
   duduangfree.buzz — Design System  (ธีม: Cyber-Imperial ม่วง · ทอง)
   โทน: ดำอมม่วง · ม่วงนีออน · ทองโฮโลแกรม · กรอบ HUD · ประกายไฟ
   หมายเหตุ: คงชื่อ class/ตัวแปรเดิมไว้ทั้งหมด (--purple* ถูก map เป็นโทนม่วง (ตัวแปร --red* เก็บชื่อเดิมไว้แต่ค่าเป็นม่วง))
   คู่มือ: docs/DESIGN.md
   ===================================================================== */
:root {
  /* ---------- พื้นหลัง ---------- */
  --bg:        #07030f;
  --bg-2:      #0e0618;
  --bg-3:      #150a24;
  --bg-4:      #1e0d33;
  --surface:   rgba(168,85,247, 0.045);
  --surface-2: rgba(180,110,250, 0.085);
  --glass:     rgba(16,8,30, 0.62);
  --border:    rgba(176,100,248, 0.20);
  --border-2:  rgba(247, 197, 72, 0.34);

  /* ---------- แดงนีออน (ชื่อใหม่) ---------- */
  --red:       #a855f7;
  --red-2:     #c4a1ff;
  --red-3:     #7e22ce;
  --crimson:   #4c1d95;
  --red-dim:   #2a1048;
  --red-glow:  rgba(168,85,247, 0.38);

  /* ---------- ชื่อเดิม (map เป็นแดง เพื่อให้หน้าเดิมเปลี่ยนสีอัตโนมัติ) ---------- */
  --purple:    var(--red);
  --purple-2:  var(--red-2);
  --purple-3:  var(--red-3);
  --purple-dim:var(--red-dim);

  /* ---------- ทองโฮโลแกรม ---------- */
  --gold:      #f7c548;
  --gold-2:    #ffe39a;
  --gold-3:    #b8862b;
  --gold-glow: rgba(247, 197, 72, 0.26);
  --holo: linear-gradient(110deg, #b8862b 0%, #ffe39a 16%, #fff7dc 24%, #f7c548 38%, #ff9f43 52%, #ffe39a 68%, #f7c548 82%, #b8862b 100%);
  --holo-red: linear-gradient(110deg, #7e22ce 0%, #c4a1ff 30%, #e9dcff 45%, #a855f7 60%, #ff9f43 80%, #7e22ce 100%);

  /* ---------- สีเสริม ---------- */
  --ember:     #ff9f43;
  --cyan:      #4fe3ff;
  --silver:    #d6cfe2;
  --silver-2:  #9d96ab;

  --text:      #f4effb;
  --text-2:    #c8bcdc;
  --text-3:    #8b7fa6;

  --success:   #5fd99a;
  --warn:      #ffb347;
  --danger:    #ff6b6b;
  --info:      #5cc8ff;

  /* ---------- รูปทรง / เงา ---------- */
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 24px 60px -24px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border);
  --shadow-gold: 0 0 42px -10px var(--gold-glow);
  --shadow-red:  0 0 42px -8px var(--red-glow);

  /* ---------- ฟอนต์ ---------- */
  --font-head:  'Kanit', 'Noto Sans Thai', system-ui, sans-serif;
  --font-body:  'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
  --font-latin: 'Orbitron', 'Rajdhani', 'Kanit', system-ui, sans-serif;

  --max: 1120px;
  --gutter: 20px;
  --header-h: 66px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
/* ชั้นพื้นหลัง: แสงแดง/ทอง + scanline บางๆ */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    radial-gradient(900px 620px at 12% -12%, rgba(168,85,247, 0.26), transparent 62%),
    radial-gradient(700px 520px at 92% 6%, rgba(247, 197, 72, 0.13), transparent 60%),
    radial-gradient(900px 700px at 50% 115%, rgba(76,29,149, 0.45), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
}
/* ชั้นพื้นหลัง: grid perspective ด้านล่าง */
body::after {
  content: '';
  position: fixed; left: -50%; right: -50%; bottom: -10vh; height: 55vh; z-index: -2; pointer-events: none;
  background:
    linear-gradient(rgba(168,85,247, 0.22) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(168,85,247, 0.16) 1px, transparent 1px) 0 0 / 64px 64px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 75%);
          mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 75%);
  opacity: .55;
  animation: gridMove 6s linear infinite;
}
@keyframes gridMove { to { background-position: 0 64px, 0 64px; } }
/* canvas ประกายไฟ (core.js สร้างให้) — คง #starfield ไว้เผื่อหน้าเก่า */
#starfield, #embers { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
/* แสงตามเมาส์ (เฉพาะ desktop) */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%;
  pointer-events: none; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle, rgba(168,85,247, 0.13), rgba(247, 197, 72, 0.05) 40%, transparent 68%);
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; line-height: 1.25; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 2.7vw, 1.95rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold); }
img, svg { max-width: 100%; }
button { font-family: inherit; }
small, .muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.gold { color: var(--gold); }
.purple, .red { color: var(--red-2); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.latin { font-family: var(--font-latin); letter-spacing: .06em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0; }
.section.container, .page-hero.container, .hero.container { padding-left: var(--gutter); padding-right: var(--gutter); }
.section-title { text-align: center; margin-bottom: 28px; }
.section-title h2 { margin-bottom: .3em; }
.section-title p { color: var(--text-2); max-width: 640px; margin: 0 auto; }
.section-title .kicker { display: block; margin-bottom: 6px; }

/* ---------- Ornaments ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
}
.eyebrow::before, .eyebrow::after { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--red)); box-shadow: 0 0 6px var(--red); }
.eyebrow::after { background: linear-gradient(90deg, var(--red), transparent); }
/* ป้าย latin เล็ก (ใช้คู่หัวข้อ เช่น // DAILY FORTUNE) */
.kicker { font-family: var(--font-latin); font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; color: var(--red-2); text-shadow: 0 0 10px var(--red-glow); }
.divider { height: 1px; margin: 28px auto; width: min(320px, 60%); position: relative;
  background: linear-gradient(90deg, transparent, var(--red-3), var(--gold), var(--red-3), transparent); opacity: .85; }
.divider::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.gradient-text, .holo-text {
  background: var(--holo); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: holoShift 7s linear infinite;
}
.holo-text { filter: drop-shadow(0 0 14px rgba(247, 197, 72, .28)); animation-duration: 4.5s; }
.holo-red { background: var(--holo-red); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: holoShift 5s linear infinite; }
@keyframes holoShift { to { background-position: -220% 0; } }
.neon-text { color: #f1e9ff; text-shadow: 0 0 4px #fff, 0 0 12px var(--red), 0 0 28px var(--red), 0 0 46px var(--red-3); }
.neon-gold { color: #fff6dc; text-shadow: 0 0 4px #fff, 0 0 12px var(--gold), 0 0 30px var(--ember); }

/* Glitch: <h1 class="glitch" data-text="ข้อความเดียวกัน">ข้อความเดียวกัน</h1> */
.glitch { position: relative; }
span.glitch { display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  background: none; -webkit-text-fill-color: currentColor; opacity: .85;
}
.glitch::before { color: var(--red); animation: glitchA 4.2s infinite steps(1); clip-path: inset(0 0 100% 0); }
.glitch::after  { color: var(--cyan); animation: glitchB 4.2s infinite steps(1); clip-path: inset(100% 0 0 0); mix-blend-mode: screen; }
@keyframes glitchA {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  89% { clip-path: inset(10% 0 62% 0); transform: translate(-3px, -1px); }
  91% { clip-path: inset(48% 0 22% 0); transform: translate(3px, 1px); }
  93% { clip-path: inset(72% 0 6% 0); transform: translate(-2px, 0); }
  95% { clip-path: inset(30% 0 50% 0); transform: translate(2px, -1px); }
}
@keyframes glitchB {
  0%, 88%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  90% { clip-path: inset(60% 0 18% 0); transform: translate(3px, 1px); }
  92% { clip-path: inset(15% 0 70% 0); transform: translate(-3px, 0); }
  94% { clip-path: inset(40% 0 40% 0); transform: translate(2px, 1px); }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
/* ใช้ pseudo ทำ blur เพื่อไม่ให้ header เป็น containing block ของ drawer (position:fixed) */
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(7,3,15, 0.74);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--red) 25%, var(--gold) 50%, var(--red) 75%, transparent);
  box-shadow: 0 0 12px var(--red-glow); opacity: .8;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: var(--header-h); }
.nav.nav-wide { max-width: 1280px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-latin); font-size: 1.02rem; font-weight: 700; letter-spacing: .04em; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand .brand-mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 0 10px var(--red-glow)); transition: transform .5s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand span { background: var(--holo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: holoShift 7s linear infinite; }
.brand span b { font-weight: 700; background: none; -webkit-text-fill-color: var(--red); color: var(--red); text-shadow: 0 0 10px var(--red-glow); }
.nav-drawer { display: flex; align-items: center; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  font-family: var(--font-head); font-weight: 400; font-size: .9rem; white-space: nowrap;
  transition: color .2s, background .2s, text-shadow .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--gold-2); background: rgba(168,85,247, 0.10); text-shadow: 0 0 10px var(--gold-glow); }
.nav-links a.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--red), var(--gold)); box-shadow: 0 0 8px var(--red); }
.nav-links .nav-ico, .nav-links .nav-en, .nav-links .nav-num { display: none; }
.nav-tag { font-family: var(--font-latin); font-size: .52rem; font-weight: 700; letter-spacing: .08em; line-height: 1; padding: 3px 4px 2px; border-radius: 4px;
  color: #fff; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.nav-tag.gold { color: #2a1a03; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.drawer-head, .drawer-foot { display: none; }
.nav-toggle, .nav-close {
  display: none; position: relative; background: rgba(168,85,247, .06); border: 1px solid var(--border); color: var(--text);
  width: 44px; height: 44px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle:hover, .nav-close:hover { border-color: var(--red); box-shadow: var(--shadow-red); }
.nav-backdrop { display: none; }
@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1; background: rgba(4,1,10, .62); opacity: 0; pointer-events: none; transition: opacity .3s;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .nav-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 2; width: min(340px, 88vw);
    flex-direction: column; align-items: stretch; overflow-y: auto; overscroll-behavior: contain;
    background:
      repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px),
      radial-gradient(400px 300px at 100% 0, rgba(168,85,247, .22), transparent 70%),
      linear-gradient(180deg, #130a26, #07030f);
    border-left: 1px solid var(--border); box-shadow: -30px 0 60px -20px rgba(0,0,0,.9), -1px 0 0 rgba(168,85,247,.25);
    transform: translateX(105%); visibility: hidden; transition: transform .38s var(--ease-out), visibility 0s .38s;
  }
  .nav-drawer.open { transform: none; visibility: visible; transition: transform .38s var(--ease-out), visibility 0s; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; height: var(--header-h); border-bottom: 1px solid var(--border); }
  .drawer-head .kicker { font-size: .62rem; }
  .nav-close { display: inline-flex; }
  .nav-links { flex-direction: column; gap: 4px; padding: 14px 12px; }
  .nav-links a { padding: 12px 12px; font-size: 1.02rem; border: 1px solid transparent; border-radius: 10px; gap: 12px; color: var(--text); }
  .nav-links a:hover { border-color: var(--border); }
  .nav-links a.active { border-color: rgba(168,85,247, .45); background: linear-gradient(90deg, rgba(168,85,247,.16), transparent); }
  .nav-links a.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .nav-links .nav-num { display: inline; font-family: var(--font-latin); font-size: .62rem; color: var(--text-3); width: 18px; }
  .nav-links .nav-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(247,197,72,.12)); border: 1px solid var(--border); }
  .nav-links .nav-txt { flex: 1; }
  .nav-links .nav-en { display: inline; font-family: var(--font-latin); font-size: .56rem; letter-spacing: .14em; color: var(--text-3); }
  .drawer-foot { display: block; margin-top: auto; padding: 16px 20px 26px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-3); }
  .drawer-foot a { color: var(--text-2); }
  /* อนิเมชันรายการเมนูไหลเข้า */
  .nav-drawer.open .nav-links li { animation: drawerIn .42s var(--ease-out) both; }
  .nav-drawer.open .nav-links li:nth-child(2) { animation-delay: .03s; } .nav-drawer.open .nav-links li:nth-child(3) { animation-delay: .06s; }
  .nav-drawer.open .nav-links li:nth-child(4) { animation-delay: .09s; } .nav-drawer.open .nav-links li:nth-child(5) { animation-delay: .12s; }
  .nav-drawer.open .nav-links li:nth-child(6) { animation-delay: .15s; } .nav-drawer.open .nav-links li:nth-child(7) { animation-delay: .18s; }
  .nav-drawer.open .nav-links li:nth-child(8) { animation-delay: .21s; } .nav-drawer.open .nav-links li:nth-child(9) { animation-delay: .24s; }
}
@keyframes drawerIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 400px) { .brand { font-size: .9rem; } .brand .brand-mark { width: 32px; height: 32px; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; position: relative; }
.hero h1 { margin: 14px 0 12px; }
.hero p.lead { color: var(--text-2); font-size: 1.1rem; max-width: 620px; margin: 0 auto 26px; }
.hero-ring {
  width: 120px; height: 120px; margin: 0 auto 8px; position: relative;
  filter: drop-shadow(0 0 24px var(--red-glow)) drop-shadow(0 0 12px var(--gold-glow));
}
.hero-ring svg { width: 100%; height: 100%; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-hero { padding: 40px 0 24px; text-align: center; position: relative; }
.page-hero h1 { margin: 10px 0 8px; }
.page-hero p { color: var(--text-2); max-width: 640px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-head); font-weight: 500; font-size: 1rem; line-height: 1; text-decoration: none;
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
/* แสงวาบกวาดผ่านปุ่มตอน hover */
.btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg); transition: left .6s var(--ease-out);
}
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold, .btn-holo {
  color: #2a1503; background: var(--holo); background-size: 200% 100%; background-position: 0 0;
  box-shadow: 0 10px 28px -10px rgba(247, 197, 72, .75), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-gold:hover, .btn-holo:hover { color: #1a0d02; background-position: 100% 0; box-shadow: 0 14px 34px -8px rgba(247, 197, 72, .9), 0 0 0 1px rgba(255, 227, 154, .6); transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: rgba(168,85,247, .05); border-color: var(--border); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(168,85,247, .12); border-color: var(--border-2); color: var(--gold-2); }
.btn-purple, .btn-red {
  color: #fff; background: linear-gradient(135deg, var(--red-2), var(--red) 50%, var(--red-3));
  box-shadow: 0 10px 28px -10px var(--red), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-purple:hover, .btn-red:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 34px -8px var(--red), 0 0 0 1px rgba(196,161,255, .7); }
/* ปุ่มนีออน: ขอบแดงเรืองแสง hover แล้วเติมสี */
.neon-btn {
  color: #ece1ff; background: rgba(168,85,247, .06); border: 1px solid var(--red);
  box-shadow: 0 0 14px -2px var(--red-glow), inset 0 0 14px -4px var(--red-glow);
  text-shadow: 0 0 8px var(--red);
}
.neon-btn:hover { color: #fff; background: var(--red); box-shadow: 0 0 26px var(--red), 0 0 60px -10px var(--red); transform: translateY(-1px); }
.neon-btn.gold { color: var(--gold-2); border-color: var(--gold); text-shadow: 0 0 8px var(--gold-glow); box-shadow: 0 0 14px -2px var(--gold-glow), inset 0 0 14px -4px var(--gold-glow); background: rgba(247, 197, 72, .05); }
.neon-btn.gold:hover { color: #2a1503; background: var(--gold); text-shadow: none; box-shadow: 0 0 26px var(--gold), 0 0 60px -10px var(--ember); }
/* ปุ่มเต้นเรียกความสนใจ */
.btn.pulse { animation: btnPulse 2.2s ease-in-out infinite; }
@keyframes btnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247, .55); } 50% { box-shadow: 0 0 0 12px rgba(168,85,247, 0); } }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-lg { padding: 15px 30px; font-size: 1.08rem; }
.btn-xl { padding: 18px 38px; font-size: 1.2rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(172,92,248, .06), rgba(255, 255, 255, .015) 60%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.card-gold { border-color: var(--border-2); box-shadow: var(--shadow), var(--shadow-gold); }
.card-gold::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(247, 197, 72, .10), transparent 40%, transparent 60%, rgba(168,85,247, .10));
}
.card-red { border-color: rgba(168,85,247, .45); box-shadow: var(--shadow), var(--shadow-red); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3, .card-head h2 { margin: 0; }
.card + .card { margin-top: 18px; }
.card-sm { padding: 18px; border-radius: var(--radius-sm); }
@media (max-width: 640px) {
  /* มือถือ: ปิด blur ลดภาระ GPU */
  .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(160deg, rgba(30,14,56, .92), rgba(14,6,24, .9)); }
  .card { padding: 20px; }
}

/* ---------- HUD (กรอบมุม) ---------- */
/* .hud = เพิ่มมุม HUD ให้ element ใดๆ (ใช้ ::after) | .hud-card = การ์ดแบบ HUD เต็มรูปแบบ */
.hud, .hud-card { --hud-c: var(--red); --hud-s: 16px; position: relative; }
.hud.gold, .hud-card.gold { --hud-c: var(--gold); }
.hud::after, .hud-card::after {
  content: ''; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(var(--hud-c), var(--hud-c)) left top / var(--hud-s) 2px,
    linear-gradient(var(--hud-c), var(--hud-c)) left top / 2px var(--hud-s),
    linear-gradient(var(--hud-c), var(--hud-c)) right top / var(--hud-s) 2px,
    linear-gradient(var(--hud-c), var(--hud-c)) right top / 2px var(--hud-s),
    linear-gradient(var(--hud-c), var(--hud-c)) left bottom / var(--hud-s) 2px,
    linear-gradient(var(--hud-c), var(--hud-c)) left bottom / 2px var(--hud-s),
    linear-gradient(var(--hud-c), var(--hud-c)) right bottom / var(--hud-s) 2px,
    linear-gradient(var(--hud-c), var(--hud-c)) right bottom / 2px var(--hud-s);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px var(--hud-c));
}
.hud-card {
  padding: 24px; border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(168,85,247, .08), transparent 40%),
    var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), inset 0 0 40px -20px rgba(168,85,247, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
/* เส้นแสงบนขอบบน */
.hud-card::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--hud-c), transparent); box-shadow: 0 0 10px var(--hud-c);
}
.hud-label {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-family: var(--font-latin); font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--red-2);
}
.hud-label::before { content: ''; width: 6px; height: 6px; background: var(--red); box-shadow: 0 0 8px var(--red); transform: rotate(45deg); }
.hud-card.gold .hud-label { color: var(--gold); } .hud-card.gold .hud-label::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
@media (max-width: 640px) { .hud-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(180deg, rgba(44,18,84, .9), rgba(11,5,22, .94)); padding: 20px; } }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid > * { min-width: 0; }
@media (max-width: 960px) { .grid-4, .grid-6 { grid-template-columns: repeat(3, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .grid-6 { grid-template-columns: repeat(2, 1fr); } }

/* Feature tiles (หน้าแรก) */
.feature {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 22px; min-height: 200px; color: var(--text); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(168,85,247, .55); box-shadow: var(--shadow), var(--shadow-red); color: var(--text); }
.feature .icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem;
  background: linear-gradient(135deg, rgba(168,85,247, .34), rgba(247, 197, 72, .16)); border: 1px solid var(--border); color: var(--gold-2);
  box-shadow: inset 0 0 18px -6px var(--red);
}
.feature h3 { margin: 4px 0 0; }
.feature p { margin: 0; color: var(--text-2); font-size: .95rem; flex: 1; }
.feature .go { color: var(--gold); font-family: var(--font-head); font-size: .9rem; }
.feature:hover .go { text-shadow: 0 0 10px var(--gold-glow); }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-head); font-size: .9rem; color: var(--text-2); }
.input, .select, select, input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=tel], textarea {
  width: 100%; padding: 12px 14px; color: var(--text); font: inherit; font-size: 1rem;
  background: rgba(6,2,12, .6); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none; -webkit-appearance: none;
}
select, .select { background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select option { background: var(--bg-3); color: var(--text); }
.input:focus, select:focus, input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(168,85,247, .18), 0 0 18px -4px var(--red-glow); }
input::-webkit-calendar-picker-indicator { filter: invert(.75) sepia(1) saturate(4) hue-rotate(-20deg); cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.help { font-size: .85rem; color: var(--text-3); }

/* Segmented / Tabs */
.tabs { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; background: rgba(6,2,12, .6); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
.tabs button {
  border: 0; background: none; color: var(--text-2); padding: 8px 18px; border-radius: 9px; cursor: pointer;
  font-family: var(--font-head); font-size: .95rem; transition: background .2s, color .2s, box-shadow .2s;
}
.tabs button.active { background: linear-gradient(135deg, var(--red-2), var(--red) 55%, var(--red-3)); color: #fff; font-weight: 500; box-shadow: 0 0 16px -2px var(--red-glow); }
.tabs button:hover:not(.active) { color: var(--text); background: var(--surface-2); }

/* Chips / Badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-family: var(--font-head);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip-gold { border-color: var(--border-2); color: var(--gold-2); background: rgba(247, 197, 72, .08); }
.chip-purple, .chip-red { border-color: rgba(168,85,247, .45); color: var(--red-2); background: rgba(168,85,247, .12); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* ป้าย latin สั้นๆ: <span class="badge">NEW</span> */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 3px; border-radius: 4px; line-height: 1.2;
  font-family: var(--font-latin); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red-2); border: 1px solid rgba(168,85,247, .5); background: rgba(168,85,247, .1);
}
.badge-red { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 0 12px var(--red-glow); }
.badge-gold { color: #2a1503; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow); }
.badge-ghost { color: var(--text-2); border-color: var(--border); background: transparent; }
.badge-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ---------- Zodiac tiles ---------- */
.zodiac-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 900px) { .zodiac-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .zodiac-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.zodiac-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px; text-align: center; cursor: pointer; min-width: 0;
  background: linear-gradient(180deg, rgba(168,85,247, .06), rgba(255, 255, 255, .015)); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2);
  transition: transform .2s, border-color .2s, background .2s, color .2s, box-shadow .2s;
}
.zodiac-tile .glyph { font-size: 1.7rem; line-height: 1; color: var(--gold-2); font-family: 'Noto Sans Symbols', 'Segoe UI Symbol', serif; text-shadow: 0 0 12px var(--gold-glow); }
.zodiac-tile .name { font-family: var(--font-head); font-size: .95rem; color: var(--text); }
.zodiac-tile .dates { font-size: .72rem; color: var(--text-3); }
.zodiac-tile:hover { transform: translateY(-3px); border-color: rgba(168,85,247, .5); background: rgba(168,85,247, .1); box-shadow: 0 0 22px -8px var(--red); }
.zodiac-tile.active { border-color: var(--gold); background: linear-gradient(180deg, rgba(247, 197, 72, .16), rgba(168,85,247, .1)); box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold); }
.zodiac-tile.active .glyph { color: #fff6dc; text-shadow: 0 0 14px var(--gold), 0 0 26px var(--ember); }

/* ---------- Score ring (gauge) ---------- */
@property --val { syntax: '<number>'; inherits: false; initial-value: 0; }
.gauge { --val: 0; --col: var(--gold); position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--col) calc(var(--val) * 1%), rgba(255, 255, 255, .07) 0); transition: --val .9s var(--ease-out);
  box-shadow: 0 0 26px -8px var(--col);
}
.gauge::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, var(--bg-4), var(--bg-2) 70%); box-shadow: inset 0 0 14px rgba(0, 0, 0, .7); }
/* วงขีด HUD รอบนอก */
.gauge::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(247, 197, 72, .4) 0 1.2deg, transparent 1.2deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px));
          mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px));
}
.gauge .val { position: relative; font-family: var(--font-latin); font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.1; text-align: center; }
.gauge .val small { display: block; font-size: .55rem; color: var(--text-3); margin-top: 2px; font-weight: 500; letter-spacing: .08em; }
.gauge-sm { width: 72px; height: 72px; } .gauge-sm .val { font-size: 1.02rem; } .gauge-sm::before { inset: 6px; }
.gauge-lg { width: 132px; height: 132px; } .gauge-lg .val { font-size: 2rem; } .gauge-lg::before { inset: 9px; }
.gauge-lg .val small { font-size: .66rem; }
.aspect-card { text-align: center; padding: 18px 14px; }
.aspect-card .aspect-name { font-family: var(--font-head); margin: 10px 0 2px; color: var(--text); }
.aspect-card .aspect-band { font-size: .82rem; color: var(--text-3); }
.aspect-card .aspect-text { text-align: left; margin-top: 12px; font-size: .95rem; color: var(--text-2); }

/* Bars */
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red-3), var(--red), var(--gold)); width: 0; transition: width .9s var(--ease-out); box-shadow: 0 0 10px var(--red-glow); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 12px; margin: 10px 0; font-size: .95rem; }
.bar-row .num { text-align: right; font-family: var(--font-latin); font-size: .85rem; color: var(--gold-2); }

/* Stars rating */
.stars { color: var(--gold); letter-spacing: 2px; font-size: 1rem; text-shadow: 0 0 8px var(--gold-glow); }
.stars .off { color: rgba(255, 255, 255, .16); text-shadow: none; }

/* Reading text */
.reading { font-size: 1.05rem; line-height: 1.85; }
.reading p { margin-bottom: .9em; }
.reading .lead { font-size: 1.12rem; color: var(--text); }
.callout { padding: 14px 18px; border-left: 3px solid var(--gold); background: linear-gradient(90deg, rgba(247, 197, 72, .09), rgba(247, 197, 72, .02)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 14px 0; }
.callout.purple, .callout.red { border-color: var(--red); background: linear-gradient(90deg, rgba(168,85,247, .14), rgba(168,85,247, .03)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .95rem; }
.kv dt { color: var(--text-3); font-family: var(--font-head); font-weight: 400; }
.kv dd { margin: 0; min-width: 0; }
.info-tile { padding: 14px 16px; background: linear-gradient(180deg, rgba(168,85,247, .06), rgba(255, 255, 255, .015)); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.info-tile .lbl { font-size: .78rem; color: var(--text-3); font-family: var(--font-head); letter-spacing: .04em; }
.info-tile .big { font-family: var(--font-head); font-size: 1.35rem; color: var(--gold-2); text-shadow: 0 0 12px var(--gold-glow); }
.info-tile .sub { font-size: .85rem; color: var(--text-2); }

/* Color swatch */
.swatch { display: inline-flex; align-items: center; gap: 8px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); box-shadow: 0 0 10px currentColor; display: inline-block; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--red-2); font-family: var(--font-head); font-weight: 400; font-size: .85rem; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(168,85,247, .05); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Result area */
.result { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: fadeUp .5s ease both; }
.stagger > *:nth-child(2) { animation-delay: .08s; } .stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .24s; } .stagger > *:nth-child(5) { animation-delay: .32s; }
.stagger > *:nth-child(6) { animation-delay: .40s; } .stagger > *:nth-child(7) { animation-delay: .48s; }
.stagger > *:nth-child(8) { animation-delay: .56s; }
/* แสดงเมื่อเลื่อนมาถึง (core.js ใส่ class .in ให้ / DD.reveal(root) สำหรับเนื้อหาที่เติมทีหลัง) */
.dd-reveal-on .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
.dd-reveal-on .reveal { transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0s); }
.dd-reveal-on .reveal.zoom:not(.in) { transform: scale(.94); }
/* ผลลัพธ์โผล่แบบ "ถอดรหัส" */
.pop-in { animation: popIn .55s var(--ease-out) both; }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85); filter: blur(6px); } 60% { opacity: 1; transform: scale(1.04); filter: blur(0); } 100% { transform: none; } }
.shake { animation: shake .5s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Loader / Spinner */
.loader { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--red); border-right-color: var(--gold); animation: spin 1s linear infinite; vertical-align: middle; }
/* วงหมุนแบบ HUD 2 ชั้น: <div class="spinner"></div> */
.spinner { position: relative; width: 64px; height: 64px; display: inline-block; vertical-align: middle; }
.spinner::before, .spinner::after { content: ''; position: absolute; border-radius: 50%; border: 2px solid transparent; }
.spinner::before { inset: 0; border-top-color: var(--red); border-left-color: var(--red); filter: drop-shadow(0 0 6px var(--red)); animation: spin 1s linear infinite; }
.spinner::after { inset: 10px; border-bottom-color: var(--gold); border-right-color: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); animation: spin 1.4s linear infinite reverse; }

/* Share/actions bar */
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }

/* ---------- Marquee / Ticker ---------- */
/* <div class="marquee"><div class="marquee-track"><span>…</span><span>…</span></div></div>
   ใส่เนื้อหาซ้ำ 2 ชุดใน track เพื่อให้วนต่อเนื่อง (หรือใช้ DD.marquee(el)) */
.marquee { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: marquee var(--speed, 30s) linear infinite; }
.marquee-track > * { flex: none; white-space: nowrap; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }
.ticker { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(6,2,12, .7); overflow: hidden; font-size: .92rem; }
.ticker-label { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-family: var(--font-latin); font-size: .66rem; font-weight: 700; letter-spacing: .18em;
  color: #fff; background: linear-gradient(135deg, var(--red), var(--red-3)); box-shadow: 0 0 18px var(--red-glow); }
.ticker .marquee { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px 0; }
.ticker .marquee-track span::before { content: '◆'; color: var(--gold); margin-right: 12px; font-size: .7em; vertical-align: middle; }

/* ---------- Orb (ลูกแก้วเรืองแสง) ---------- */
.orb {
  --orb-size: 160px; width: var(--orb-size); height: var(--orb-size); border-radius: 50%; position: relative; margin: 0 auto; display: grid; place-items: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 18%),
    radial-gradient(circle at 50% 55%, #b97cf9, #7e22ce 45%, #3b1275 78%, #0f0620);
  box-shadow: 0 0 40px var(--red-glow), 0 0 90px -10px var(--red), inset 0 -16px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .12);
  animation: orbPulse 3.4s ease-in-out infinite;
}
.orb.gold { background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .65), transparent 18%), radial-gradient(circle at 50% 55%, #ffe39a, #f7c548 40%, #a8701c 75%, #3a2006); box-shadow: 0 0 40px var(--gold-glow), 0 0 90px -10px var(--gold), inset 0 -16px 40px rgba(0, 0, 0, .45); }
.orb > * { position: relative; font-family: var(--font-latin); font-weight: 900; font-size: calc(var(--orb-size) * .32); color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.orb::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 1px dashed rgba(247, 197, 72, .45); animation: spin 22s linear infinite; }
@keyframes orbPulse { 50% { transform: translateY(-6px); box-shadow: 0 0 55px var(--red-glow), 0 0 120px -10px var(--red), inset 0 -16px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .12); } }

/* ---------- Scan (แถบสแกนเลื่อนผ่าน) ---------- */
.scan { position: relative; overflow: hidden; }
.scan::before {
  content: ''; position: absolute; left: 0; right: 0; top: -40%; height: 40%; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(168,85,247, .14) 70%, rgba(196,161,255, .5) 98%, transparent);
  animation: scanMove 3.2s linear infinite;
}
@keyframes scanMove { to { top: 110%; } }
/* พื้นหลัง grid แบบ HUD สำหรับกล่อง */
.grid-bg { background-image: linear-gradient(rgba(168,85,247, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(168,85,247, .08) 1px, transparent 1px); background-size: 24px 24px; }

/* ---------- Lantern (โคมแดง) ---------- */
/* <div class="lantern"><span>福</span></div>  — เพิ่ม .sm / .lg และ style="--delay:.5s" ได้ */
.lantern {
  --l-w: 64px; position: relative; width: var(--l-w); height: calc(var(--l-w) * 1.15); margin: calc(var(--l-w) * .45) auto calc(var(--l-w) * .55);
  border-radius: 46% 46% 46% 46% / 50% 50% 50% 50%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 2px, transparent 2px calc(var(--l-w) / 6)),
    radial-gradient(circle at 50% 45%, #c084fc, #a855f7 45%, #4c1d95 90%);
  box-shadow: 0 0 30px var(--red-glow), 0 0 70px -10px var(--ember), inset 0 0 18px rgba(255, 200, 120, .35);
  display: grid; place-items: center; transform-origin: 50% calc(var(--l-w) * -.45);
  animation: lanternSwing 4s ease-in-out infinite; animation-delay: var(--delay, 0s);
}
.lantern::before { /* ฝาบน + เชือก */
  content: ''; position: absolute; left: 22%; right: 22%; top: -8%; height: 10%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-3), var(--gold-2), var(--gold-3));
  box-shadow: 0 calc(var(--l-w) * 1.12) 0 var(--gold-3);
}
.lantern::after { /* พู่ห้อย */
  content: ''; position: absolute; left: 50%; top: 104%; width: 6px; height: calc(var(--l-w) * .45); transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold), var(--red) 30%, var(--red-3)); border-radius: 0 0 4px 4px;
}
.lantern > span { font-family: var(--font-head); font-weight: 600; font-size: calc(var(--l-w) * .36); color: var(--gold-2); text-shadow: 0 0 8px rgba(255, 220, 140, .9); }
.lantern.sm { --l-w: 40px; } .lantern.lg { --l-w: 96px; }
@keyframes lanternSwing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---------- Coin (เหรียญทอง) ---------- */
/* <div class="coin"><span>888</span></div> + .spin ให้หมุน */
.coin {
  --c-size: 72px; width: var(--c-size); height: var(--c-size); border-radius: 50%; display: inline-grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f7c548 38%, #b8862b 72%, #7a5414);
  box-shadow: 0 0 0 3px #8a5e16, 0 0 0 5px rgba(255, 227, 154, .5), 0 0 26px var(--gold-glow), inset 0 -4px 10px rgba(0, 0, 0, .35);
}
.coin::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgba(90, 55, 8, .55); }
.coin > span { position: relative; font-family: var(--font-latin); font-weight: 900; font-size: calc(var(--c-size) * .28); color: #5a3708; text-shadow: 0 1px 0 rgba(255, 245, 210, .7); }
.coin.hole > span { display: none; }
.coin.hole::after { content: ''; width: 24%; height: 24%; background: var(--bg); box-shadow: inset 0 0 0 2px #8a5e16; }
.coin.spin { animation: coinSpin 2.6s linear infinite; }
@keyframes coinSpin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* ---------- Seal (ตราประทับแดง) ---------- */
.seal { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; transform: rotate(-12deg);
  border: 3px double var(--red); color: var(--red); font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.1; text-align: center;
  text-shadow: 0 0 8px var(--red-glow); box-shadow: 0 0 18px -4px var(--red-glow), inset 0 0 14px -6px var(--red); background: rgba(168,85,247, .06); }
.seal.stamp { animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp { from { transform: rotate(-12deg) scale(2.2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }

/* ---------- Digit boxes / Slot reel (ตัวเลขหวย) ---------- */
/* <div class="digits"><span>4</span><span>8</span></div> */
.digits { display: inline-flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.digits > span {
  display: grid; place-items: center; min-width: 1.4em; padding: .12em .18em; border-radius: 8px;
  font-family: var(--font-latin); font-weight: 900; font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; color: var(--gold-2);
  background: linear-gradient(180deg, rgba(168,85,247, .18), rgba(6,2,12, .85) 55%); border: 1px solid var(--border-2);
  text-shadow: 0 0 14px var(--gold-glow), 0 0 30px rgba(255, 159, 67, .35); box-shadow: inset 0 0 20px -8px var(--red), 0 8px 24px -12px #000;
}
.digits.sm > span { font-size: 1.4rem; border-radius: 6px; }
/* วงล้อสล็อต: <div class="slot"><div class="slot-reel"></div><div class="slot-reel"></div></div> แล้ว DD.slotReel(reel, '7') */
.slot { display: inline-flex; gap: 8px; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, #1d0f36, #09040f); border: 1px solid var(--border-2);
  box-shadow: 0 0 30px -8px var(--red-glow), inset 0 0 20px rgba(0, 0, 0, .8); }
.slot-reel { --slot-h: 72px; position: relative; width: calc(var(--slot-h) * .78); height: var(--slot-h); overflow: hidden; border-radius: 8px;
  background: linear-gradient(180deg, #0f0720, #2a1450 50%, #0f0720); border: 1px solid rgba(247, 197, 72, .25); }
.slot-reel::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent 30%, transparent 70%, rgba(0, 0, 0, .75)); }
.slot-strip { display: flex; flex-direction: column; will-change: transform; }
.slot-strip > span { height: var(--slot-h); display: grid; place-items: center; flex: none;
  font-family: var(--font-latin); font-weight: 900; font-size: calc(var(--slot-h) * .58); color: var(--gold-2); text-shadow: 0 0 12px var(--gold-glow); }
.slot-reel.done { border-color: var(--gold); box-shadow: 0 0 18px -2px var(--gold-glow); }
@media (max-width: 420px) { .slot-reel { --slot-h: 58px; } }

/* ---------- Stat (ตัวเลขใหญ่ + ป้าย) ---------- */
.stat { text-align: center; }
.stat .stat-num { display: block; font-family: var(--font-latin); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.4rem); color: var(--gold-2); text-shadow: 0 0 14px var(--gold-glow); line-height: 1.1; }
.stat .stat-lbl { font-size: .82rem; color: var(--text-3); }

/* ---------- Do / Don't list ---------- */
.list-do, .list-dont { list-style: none; margin: 0; padding: 0; }
.list-do li, .list-dont li { position: relative; padding: 6px 0 6px 28px; border-bottom: 1px dashed rgba(255, 255, 255, .06); }
.list-do li:last-child, .list-dont li:last-child { border-bottom: 0; }
.list-do li::before, .list-dont li::before { position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; }
.list-do li::before { content: '✓'; color: #0a1a10; background: var(--success); box-shadow: 0 0 10px rgba(95, 217, 154, .45); }
.list-dont li::before { content: '✕'; color: #fff; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }

/* Footer */
.site-footer { position: relative; margin-top: 60px; padding: 40px 0 44px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .9rem; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(76,29,149, .18)); }
.site-footer::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--red), var(--gold), var(--red), transparent); box-shadow: 0 0 12px var(--red-glow); }
.site-footer .brand { justify-content: center; font-size: 1.05rem; }
.site-footer .foot-tag { margin: 6px 0 0; font-family: var(--font-latin); font-size: .62rem; letter-spacing: .3em; color: var(--red-2); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 16px auto 16px; max-width: 760px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--gold); text-shadow: 0 0 10px var(--gold-glow); }
.site-footer .foot-note { max-width: 640px; margin: 0 auto 6px; }
.site-footer .foot-copy { font-family: var(--font-latin); font-size: .66rem; letter-spacing: .14em; color: var(--text-3); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  background: linear-gradient(135deg, #1d0f36, #0e0719); border: 1px solid rgba(168,85,247, .55); color: var(--text); padding: 10px 18px; border-radius: 10px; font-family: var(--font-head); font-size: .95rem;
  transition: all .3s; z-index: 100; box-shadow: var(--shadow), 0 0 24px -6px var(--red-glow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* confetti canvas (DD.confetti) */
.dd-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* typewriter caret */
.tw-caret::after { content: '▌'; margin-left: 2px; color: var(--red); animation: blink .8s steps(2, start) infinite; }

/* มือถือ: ลดเอฟเฟกต์หนักๆ */
@media (max-width: 640px) {
  body::after { animation: none; opacity: .4; }
  .site-header::before { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .glitch::before, .glitch::after { display: none; }
  .cursor-glow { display: none; }
}
::selection { background: rgba(168,85,247, .45); color: #fff; }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--red-3), var(--crimson)); border-radius: 10px; } ::-webkit-scrollbar-track { background: var(--bg); }
