/* =====================================================================
   เล่าเรื่องโชค.com — Design System (Mystic Luxury: ม่วงเข้ม · ทอง · ครีม)
   ทุกหน้าใช้ไฟล์นี้ไฟล์เดียว + CSS เฉพาะหน้าใส่ใน <style> ของหน้านั้นได้
   ===================================================================== */
:root {
  /* พื้นหลัง */
  --bg:        #12081f;
  --bg-2:      #1b0d31;
  --bg-3:      #261443;
  --surface:   rgba(255, 244, 222, 0.045);
  --surface-2: rgba(255, 244, 222, 0.08);
  --surface-3: rgba(255, 244, 222, 0.12);
  --line:      rgba(227, 194, 122, 0.18);
  --line-2:    rgba(227, 194, 122, 0.38);
  --line-soft: rgba(201, 179, 240, 0.14);

  /* ทอง */
  --gold:      #e3c27a;
  --gold-2:    #f5dfa6;
  --gold-3:    #b88a3e;
  --gold-grad: linear-gradient(135deg, #fbe7b0 0%, #e3c27a 42%, #b88a3e 100%);
  --gold-text: linear-gradient(180deg, #fff1c9 0%, #f0d08a 45%, #c99a48 100%);
  --gold-glow: rgba(227, 194, 122, 0.28);

  /* ม่วง */
  --purple:    #9067c6;
  --purple-2:  #b996ec;
  --purple-3:  #5d3a96;
  --plum:      #3a1d63;
  --lav:       #d9c8f5;

  /* ครีม (การ์ดสว่าง) */
  --cream:     #fbf3e0;
  --cream-2:   #f3e6c8;
  --ink:       #2a1640;
  --ink-2:     #5b4a72;
  --ink-3:     #8a7b9e;

  /* ตัวอักษร */
  --text:      #f6eedd;
  --text-2:    #cfc2e2;
  --text-3:    #9d90b8;

  /* สถานะ */
  --good:      #7fd8a4;
  --warn:      #f2b46b;
  --bad:       #f08a8a;
  --love:      #f48fb1;
  --work:      #8fb8ff;
  --money:     #f5d06f;
  --health:    #8fe3b7;

  --radius-lg: 28px;
  --radius:    20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow:    0 24px 60px -24px rgba(0, 0, 0, .75);
  --shadow-sm: 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-gold: 0 0 0 1px var(--line-2), 0 18px 50px -20px rgba(227, 194, 122, .35);

  --font-head: 'Noto Serif Thai', 'Prompt', serif;
  --font-body: 'Prompt', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;

  --header-h: 64px;
  --tabbar-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@property --val { syntax: '<number>'; inherits: true; initial-value: 0; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(144, 103, 198, .32), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(93, 58, 150, .35), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(184, 138, 62, .12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 960px) { body { padding-bottom: 0; } }
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff3cf; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.35; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(1.9rem, 5.6vw, 3.3rem); }
h2 { font-size: clamp(1.35rem, 3.6vw, 2rem); }
h3 { font-size: clamp(1.08rem, 2.4vw, 1.3rem); }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
::selection { background: rgba(227, 194, 122, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#starfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .9; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }
.narrow { max-width: 820px; }
main { display: block; }

.gold-text {
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gold);
}
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.glyph { font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Symbols', serif; font-variant-emoji: text; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 8, 31, .72);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 0 10px rgba(227, 194, 122, .35)); }
.brand .brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand .brand-name b { font-weight: 700; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand .brand-name small { font-family: var(--font-body); font-weight: 300; font-size: .62rem; letter-spacing: .14em; color: var(--text-3); }

.nav-main { display: none; margin-left: 18px; gap: 2px; align-items: center; }
.nav-main > .nav-item { position: relative; }
.nav-main > .nav-item > a {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px;
  color: var(--text-2); font-weight: 400; font-size: .94rem; transition: background .2s, color .2s;
}
.nav-main > .nav-item > a:hover, .nav-main > .nav-item:focus-within > a { color: var(--text); background: var(--surface-2); }
.nav-main > .nav-item > a.active { color: var(--gold-2); background: rgba(227, 194, 122, .1); box-shadow: inset 0 0 0 1px var(--line); }
.nav-main .caret { width: 10px; height: 10px; opacity: .6; }
.mega {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, 8px);
  min-width: 300px; padding: 10px; border-radius: var(--radius);
  background: linear-gradient(180deg, #24123f, #1a0c2f); border: 1px solid var(--line);
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .22s var(--ease); z-index: 60;
}
.mega::before { content: ''; position: absolute; inset: -10px 0 auto; height: 12px; }
.nav-item:hover .mega, .nav-item:focus-within .mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.mega.wide { min-width: 560px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.mega a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text-2); font-size: .92rem; line-height: 1.35; }
.mega a:hover { background: var(--surface-2); color: var(--text); }
.mega a .mi { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(227, 194, 122, .1); color: var(--gold); }
.mega a .mi svg { width: 16px; height: 16px; }
.mega .mega-title { grid-column: 1 / -1; padding: 6px 12px 4px; font-size: .74rem; letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text); transition: .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--gold-2); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: grid; }
@media (min-width: 960px) {
  .nav-main { display: flex; }
  .menu-btn { display: none; }
}
@media (max-width: 520px) { .header-actions .btn-gold { width: 42px; height: 42px; padding: 0; gap: 0; } .header-actions .btn-gold span { display: none; } .header-actions .btn-gold svg { width: 20px; height: 20px; } }
@media (max-width: 359px) { .brand .brand-name small { display: none; } }

/* ---------- Drawer (มือถือ) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(6, 2, 12, .6); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: .25s; z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 380px); z-index: 91;
  background: linear-gradient(180deg, #22103b, #150a27); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .32s var(--ease); display: flex; flex-direction: column;
}
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-open .drawer { transform: none; }
.drawer-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.drawer-body { overflow-y: auto; padding: 10px 12px 30px; flex: 1; overscroll-behavior: contain; }
.drawer details { border-bottom: 1px solid var(--line-soft); }
.drawer summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 8px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 1.02rem;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary .mi { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(227, 194, 122, .1); color: var(--gold); flex: none; }
.drawer summary .mi svg { width: 18px; height: 18px; }
.drawer summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; opacity: .6; }
.drawer details[open] summary .chev { transform: rotate(180deg); }
.drawer .sub { display: grid; gap: 2px; padding: 0 4px 12px 52px; }
.drawer .sub a { padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: .94rem; }
.drawer .sub a:hover, .drawer .sub a.active { background: var(--surface-2); color: var(--gold-2); }
.drawer .home-link { display: flex; align-items: center; gap: 12px; padding: 13px 8px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-family: var(--font-head); font-weight: 600; }

/* ---------- Bottom tab bar (มือถือ) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(20, 9, 35, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: .7rem; font-weight: 400; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--gold-2); }
.tabbar a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold-grad); }
@media (min-width: 960px) { .tabbar { display: none; } }

/* ---------- Search overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(8, 3, 16, .82); backdrop-filter: blur(8px); display: none; padding: 70px 16px 20px; overflow-y: auto; }
.search-overlay.open { display: block; animation: fadeIn .2s; }
.search-box { max-width: 680px; margin: 0 auto; }
.search-input-wrap { position: relative; }
.search-input-wrap svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); }
.search-input-wrap input {
  width: 100%; height: 58px; border-radius: 999px; border: 0; padding: 0 56px 0 52px;
  background: var(--cream); color: var(--ink); font-size: 1.05rem; box-shadow: var(--shadow-gold);
}
.search-input-wrap input::placeholder { color: var(--ink-3); }
.search-close { position: absolute; top: 14px; right: 16px; }
.search-results { margin-top: 18px; display: grid; gap: 8px; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--text); }
.search-results a:hover, .search-results a.kb { border-color: var(--line-2); background: var(--surface-2); }
.search-results a .mi { width: 36px; height: 36px; border-radius: 50%; background: rgba(227, 194, 122, .1); color: var(--gold); display: grid; place-items: center; flex: none; }
.search-results a .mi svg { width: 18px; height: 18px; }
.search-results a small { display: block; color: var(--text-3); font-size: .8rem; }
.search-hint { color: var(--text-3); font-size: .88rem; margin-top: 14px; text-align: center; }
.search-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 70px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(27, 13, 49, .4), rgba(10, 4, 18, .9)); padding: 44px 0 30px; color: var(--text-3); font-size: .9rem; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.foot-grid .foot-brand { grid-column: 1 / -1; }
.foot-grid h4 { font-family: var(--font-head); color: var(--gold-2); font-size: .98rem; margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--text-2); }
.foot-grid a:hover { color: var(--gold-2); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.6fr repeat(5, 1fr); } .foot-grid .foot-brand { grid-column: auto; } }
.foot-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .82rem; }

/* ---------- Page hero ---------- */
.page-hero { position: relative; padding-top: 30px; padding-bottom: 18px; text-align: center; }
.page-hero h1 { margin-bottom: .2em; }
.page-hero .lead { color: var(--text-2); max-width: 640px; margin: 0 auto; font-size: 1.02rem; }
.page-hero .hero-icon { width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: radial-gradient(circle at 30% 25%, rgba(245, 223, 166, .25), rgba(93, 58, 150, .35) 60%, rgba(18, 8, 31, .4)); box-shadow: 0 0 0 1px var(--line-2), 0 0 40px -6px var(--gold-glow); }
.page-hero .hero-icon svg { width: 36px; height: 36px; }
.page-hero .date-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; color: var(--gold-2); }
@media (min-width: 720px) { .page-hero { padding-top: 48px; padding-bottom: 26px; } }

.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: .82rem; color: var(--text-3); margin-bottom: 14px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--gold-2); }
.crumbs span.sep { opacity: .5; }

/* ---------- Section ---------- */
.section { padding-top: 26px; padding-bottom: 26px; }
@media (min-width: 720px) { .section { padding-top: 38px; padding-bottom: 38px; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--text-3); font-size: .9rem; margin: 2px 0 0; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; white-space: nowrap; color: var(--gold); font-weight: 400; }
.see-all svg { width: 16px; height: 16px; transition: transform .2s; }
.see-all:hover svg { transform: translateX(3px); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 30px 0; border: 0; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); margin: 6px 0 14px; }
.ornament::before, .ornament::after { content: ''; height: 1px; width: 60px; background: linear-gradient(90deg, transparent, var(--gold-3)); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 14px; height: 14px; }

/* ---------- Cards ---------- */
.card {
  position: relative; border-radius: var(--radius); padding: 20px;
  background: linear-gradient(160deg, rgba(58, 29, 99, .55), rgba(27, 13, 49, .7));
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) { .card { padding: 26px; } }
.card.glow { box-shadow: var(--shadow-gold); }
.card.flat { background: var(--surface); box-shadow: none; border-color: var(--line-soft); }
.card h3 { margin-bottom: .35em; }
.card-light {
  border-radius: var(--radius-lg); padding: 20px; color: var(--ink);
  background: linear-gradient(180deg, #fffaf0, var(--cream)); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(184, 138, 62, .25);
}
.card-light h2, .card-light h3 { color: var(--ink); }
.card-light .muted { color: var(--ink-2); }
.card-light .dim { color: var(--ink-3); }
.card-light a { color: #8a5a12; }
.card-light .see-all { color: #8a5a12; }
@media (min-width: 720px) { .card-light { padding: 28px; } }

.link-card { display: block; color: var(--text); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.link-card:hover { color: var(--text); transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-gold); }

.grid { display: grid; gap: 14px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

/* ---------- Icon tiles (แบบเมนูกลมในรูป) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 640px) { .tile-grid { gap: 14px; } }
@media (min-width: 900px) { .tile-grid.cols-8 { grid-template-columns: repeat(8, 1fr); } .tile-grid.cols-6 { grid-template-columns: repeat(6, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 12px 4px 10px; border-radius: 18px; color: var(--text);
  background: linear-gradient(180deg, rgba(58, 29, 99, .55), rgba(27, 13, 49, .55));
  border: 1px solid var(--line-soft); transition: transform .25s var(--ease), border-color .25s, background .25s;
  font-size: .82rem; line-height: 1.3; font-weight: 400;
}
.tile:hover { color: var(--text); transform: translateY(-3px); border-color: var(--line-2); background: linear-gradient(180deg, rgba(78, 41, 130, .6), rgba(37, 18, 66, .6)); }
.tile .ti {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-2);
  background: radial-gradient(circle at 32% 26%, rgba(255, 236, 186, .28), rgba(144, 103, 198, .28) 55%, rgba(18, 8, 31, .5));
  box-shadow: inset 0 0 0 1.5px rgba(227, 194, 122, .55), 0 6px 18px -6px rgba(227, 194, 122, .35);
}
.tile .ti svg { width: 26px; height: 26px; }
.tile .ti .glyph { font-size: 1.6rem; line-height: 1; }
@media (min-width: 640px) { .tile { font-size: .9rem; } .tile .ti { width: 62px; height: 62px; } }
.tile.is-active { border-color: var(--gold); background: linear-gradient(180deg, rgba(227, 194, 122, .2), rgba(58, 29, 99, .5)); }

/* ---------- Zodiac circle (แบบแถวราศีในรูป) ---------- */
.zodiac-row { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.zodiac-row::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .zodiac-row { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); grid-auto-columns: auto; overflow: visible; } }
.zodiac-chip { scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: inherit; padding: 6px 0; border-radius: 16px; transition: transform .2s; }
.zodiac-chip:hover { transform: translateY(-3px); color: inherit; }
.zodiac-chip .zc {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.9rem; line-height: 1; color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 45%), var(--zc, linear-gradient(135deg, #b996ec, #5d3a96));
  box-shadow: 0 8px 20px -8px rgba(42, 22, 64, .55), inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.zodiac-chip b { font-weight: 500; font-size: .92rem; line-height: 1.2; }
.zodiac-chip small { font-size: .7rem; opacity: .7; line-height: 1.2; }
.zodiac-chip.is-active .zc { box-shadow: 0 0 0 3px var(--gold), 0 8px 24px -6px var(--gold-glow); }
.z-fire  { --zc: linear-gradient(135deg, #ffb37a, #e0603a); }
.z-earth { --zc: linear-gradient(135deg, #a8d98a, #4f9a5a); }
.z-air   { --zc: linear-gradient(135deg, #d6b8ff, #8a5bd6); }
.z-water { --zc: linear-gradient(135deg, #8fd0ff, #3f78d0); }

/* ---------- Chips / pills (ตัวเลือก) ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; justify-content: center; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text-2); font-size: .9rem; font-weight: 400;
  transition: .2s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line); background: var(--surface-2); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-selected="true"] { color: var(--ink); background: var(--gold-grad); border-color: transparent; font-weight: 500; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--gold)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .2); }

/* วันเกิด 7 วัน (สีประจำวัน) */
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 520px) { .day-grid { grid-template-columns: repeat(4, 1fr); } }
.day-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text); font-size: .84rem; line-height: 1.2; transition: .2s;
}
.day-btn:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-2px); }
.day-btn .dd { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3), 0 6px 16px -6px var(--c); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.day-btn.is-active { border-color: var(--gold); background: rgba(227, 194, 122, .12); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.center { margin: 0 auto; width: max-content; }
.tabs button, .tabs a { flex: none; border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; color: var(--text-2); font-size: .92rem; white-space: nowrap; transition: .2s; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .is-active, .tabs [aria-selected="true"] { background: var(--gold-grad); color: var(--ink); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font-weight: 400; font-size: .96rem; transition: .2s var(--ease); white-space: nowrap; text-align: center;
}
.btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--line-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn-gold { background: var(--gold-grad); color: #2a1640; border: 0; font-weight: 500; box-shadow: 0 10px 26px -10px rgba(227, 194, 122, .6), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { color: #2a1640; filter: brightness(1.06); background: var(--gold-grad); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 14px; font-size: .86rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 14px;
  background: rgba(255, 244, 222, .06); border: 1px solid var(--line); color: var(--text); font-size: 1rem; transition: .2s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); background: rgba(255, 244, 222, .09); box-shadow: 0 0 0 4px rgba(227, 194, 122, .12); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e3c27a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.select option { background: #1b0d31; color: var(--text); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
input[type="date"].input, input[type="time"].input { color-scheme: dark; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Score ring / bars ---------- */
.ring {
  --size: 120px; --col: var(--gold); --track: rgba(255, 244, 222, .1);
  width: var(--size); height: var(--size); border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--col) calc(var(--val) * 1%), var(--track) 0);
  transition: --val 1.2s var(--ease);
  display: grid; place-items: center;
}
.ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #2d1750, #160a28); box-shadow: inset 0 0 0 1px var(--line-soft); }
.ring > * { position: relative; }
.ring .val { font-family: var(--font-head); font-weight: 700; font-size: calc(var(--size) * .27); line-height: 1; color: var(--text); }
.ring .val small { font-size: .45em; color: var(--text-3); font-weight: 400; margin-left: 1px; }
.ring .lbl { position: absolute; bottom: 22%; font-size: calc(var(--size) * .1); color: var(--text-3); }
.ring.sm { --size: 74px; }
.ring.sm::before { inset: 6px; }
.ring.lg { --size: 164px; }
.card-light .ring::before { background: radial-gradient(circle at 50% 30%, #fffaf0, #f3e6c8); box-shadow: inset 0 0 0 1px rgba(184, 138, 62, .3); }
.card-light .ring { --track: rgba(42, 22, 64, .1); }
.card-light .ring .val { color: var(--ink); }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; font-size: .9rem; }
.bar-row .bl { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.bar-row .bl svg { width: 16px; height: 16px; color: var(--col, var(--gold)); }
.bar-row .bv { text-align: right; font-weight: 500; color: var(--text); }
.bar { height: 9px; border-radius: 99px; background: rgba(255, 244, 222, .09); overflow: hidden; }
.bar > i { display: block; height: 100%; width: calc(var(--val) * 1%); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--col, var(--gold)) 55%, transparent), var(--col, var(--gold))); transition: --val 1.2s var(--ease); box-shadow: 0 0 12px -2px var(--col, var(--gold)); }
.card-light .bar { background: rgba(42, 22, 64, .08); }
.card-light .bar-row .bl, .card-light .bar-row .bv { color: var(--ink-2); }

.stars { color: var(--gold); letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: rgba(255, 244, 222, .18); }
.card-light .stars .off { color: rgba(42, 22, 64, .15); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 500; background: rgba(227, 194, 122, .14); color: var(--gold-2); border: 1px solid var(--line); line-height: 1.6; }
.badge.good { background: rgba(127, 216, 164, .14); color: var(--good); border-color: rgba(127, 216, 164, .3); }
.badge.warn { background: rgba(242, 180, 107, .14); color: var(--warn); border-color: rgba(242, 180, 107, .3); }
.badge.bad { background: rgba(240, 138, 138, .14); color: var(--bad); border-color: rgba(240, 138, 138, .3); }
.badge.purple { background: rgba(185, 150, 236, .16); color: var(--lav); border-color: rgba(185, 150, 236, .3); }
.badge.new { background: var(--gold-grad); color: var(--ink); border: 0; }

/* ---------- Reading (บทความคำทำนาย) ---------- */
.reading { font-size: 1.02rem; line-height: 1.9; color: var(--text); }
.reading p { margin-bottom: 1.05em; }
.reading h3 { color: var(--gold-2); margin-top: 1.3em; display: flex; align-items: center; gap: 8px; }
.reading h3 svg { width: 20px; height: 20px; }
.reading .quote { border-left: 3px solid var(--gold); padding: 6px 0 6px 16px; color: var(--text-2); font-style: italic; margin: 0 0 1em; }

.topic-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .topic-cards { grid-template-columns: 1fr 1fr; } }
.topic-card { border-radius: var(--radius); padding: 18px; background: var(--surface); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.topic-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--col, var(--gold)); }
.topic-card .th { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.topic-card .th .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--col, var(--gold)) 18%, transparent); color: var(--col, var(--gold)); flex: none; }
.topic-card .th .ic svg { width: 18px; height: 18px; }
.topic-card .th h3 { margin: 0; font-size: 1.05rem; }
.topic-card .th .score { margin-left: auto; font-family: var(--font-head); font-weight: 700; color: var(--col, var(--gold)); }
.topic-card p { margin: 0; color: var(--text-2); font-size: .95rem; line-height: 1.75; }

/* ---------- Lucky: swatch / number ---------- */
.swatch { display: flex; align-items: center; gap: 12px; }
.swatch .sw { width: 46px; height: 46px; border-radius: 50%; flex: none; background: var(--c); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25), 0 8px 20px -8px var(--c); }
.swatch b { display: block; font-weight: 500; }
.swatch small { color: var(--text-3); font-size: .8rem; }
.num-ball {
  width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; color: var(--ink);
  background: radial-gradient(circle at 32% 26%, #fff6d8, #f0d08a 45%, #b88a3e);
  box-shadow: 0 10px 24px -10px rgba(227, 194, 122, .7), inset 0 -3px 6px rgba(120, 80, 20, .35);
}
.num-ball.sm { width: 42px; height: 42px; font-size: 1.1rem; }
.num-ball.lg { width: 74px; height: 74px; font-size: 2rem; }
.num-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Misc blocks ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(185, 150, 236, .1); border: 1px solid rgba(185, 150, 236, .25); color: var(--text-2); font-size: .92rem; }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--lav); margin-top: 3px; }
.notice.gold { background: rgba(227, 194, 122, .08); border-color: var(--line); }
.notice.gold svg { color: var(--gold); }
.empty { text-align: center; padding: 34px 16px; color: var(--text-3); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--gold-3); }
.kv { display: grid; gap: 8px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: .93rem; }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--text-3); }
.kv b { font-weight: 500; text-align: right; }
.list-links { display: grid; gap: 8px; }
.list-links a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--text); transition: .2s; }
.list-links a:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateX(3px); }
.list-links a .chev { margin-left: auto; width: 16px; height: 16px; color: var(--gold); opacity: .7; }

/* การ์ดบริการแบบภาพในรูป (พื้นหลังไล่สี + ไอคอนใหญ่) */
.service-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 190px; padding: 14px;
  border-radius: 20px; overflow: hidden; color: var(--text); isolation: isolate;
  background: var(--bg-img, linear-gradient(160deg, #6b3fa8, #2a1450));
  border: 1px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s;
}
.service-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(18, 8, 31, .9)); }
.service-card .art { position: absolute; inset: 0 0 auto; height: 72%; z-index: -2; display: grid; place-items: center; color: rgba(255, 241, 201, .95); }
.service-card .art svg { width: 46%; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
.service-card h3 { margin: 0; font-size: 1.05rem; }
.service-card p { margin: 2px 0 0; font-size: .8rem; color: var(--text-2); line-height: 1.4; }
.service-card:hover { color: var(--text); transform: translateY(-4px); box-shadow: var(--shadow-gold); }
.svc-love  { --bg-img: radial-gradient(circle at 50% 30%, #ff8fb8, #a2306b 55%, #3b0f2c); }
.svc-money { --bg-img: radial-gradient(circle at 50% 30%, #ffd986, #a66d1b 55%, #3b2309); }
.svc-work  { --bg-img: radial-gradient(circle at 50% 30%, #9cc0ff, #3a55a8 55%, #141d45); }
.svc-tarot { --bg-img: radial-gradient(circle at 50% 30%, #c9a2ff, #6236a8 55%, #22103f); }
.svc-dream { --bg-img: radial-gradient(circle at 50% 30%, #8fd8ff, #3f4fb0 55%, #160f3d); }
.svc-health{ --bg-img: radial-gradient(circle at 50% 30%, #9ff0c4, #2f8a68 55%, #0e2c25); }
.svc-game  { --bg-img: radial-gradient(circle at 50% 30%, #ffb38a, #b0473a 55%, #3a1213); }

/* แถบ CTA สมัคร/บันทึกดวงของฉัน */
.cta-band { position: relative; overflow: hidden; text-align: center; border-radius: var(--radius-lg); padding: 30px 20px; background: radial-gradient(600px 220px at 50% 0%, rgba(227, 194, 122, .25), transparent 70%), linear-gradient(160deg, #3d1f6b, #1c0d33); border: 1px solid var(--line-2); box-shadow: var(--shadow-gold); }
.cta-band h2 { margin-bottom: .2em; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 96; background: rgba(8, 3, 16, .75); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; animation: fadeIn .2s; }
.modal { width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; border-radius: var(--radius-lg); padding: 24px; background: linear-gradient(180deg, #2a1548, #170b2a); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: popIn .3s var(--ease); position: relative; }
.modal .modal-x { position: absolute; top: 12px; right: 12px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--cream); color: var(--ink); padding: 10px 20px; border-radius: 999px; font-size: .92rem; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* share row */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.fade-in { animation: popIn .45s var(--ease) both; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 18px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print { .site-header, .tabbar, .site-footer, #starfield, .share-row { display: none !important; } body { background: #fff; color: #000; } }

/* ---------- ขนาดไอคอนมาตรฐานในองค์ประกอบกลาง ---------- */
.page-hero .date-pill svg, .chip svg, .badge svg { width: 16px; height: 16px; flex: none; }
.btn-sm svg { width: 16px; height: 16px; }
.card h3 > svg, .card-light h3 > svg, .section-head h2 > svg { width: 20px; height: 20px; flex: none; }
.empty svg { display: block; }
