/* =====================================================================
   ดูดวง.store — Design System
   โทน: ม่วงเข้ม · ทอง · เงิน  (มืดนิดหน่อย ขลัง แต่สบายตา)
   ===================================================================== */
:root {
  --bg:        #0e0a1c;
  --bg-2:      #150f2b;
  --bg-3:      #1d1538;
  --surface:   rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border:    rgba(206, 184, 255, 0.14);
  --border-2:  rgba(233, 196, 106, 0.28);

  --purple:    #8b5cf6;
  --purple-2:  #a78bfa;
  --purple-3:  #5b3fb8;
  --purple-dim:#2c2050;

  --gold:      #e9c46a;
  --gold-2:    #f6d98a;
  --gold-3:    #b8892b;
  --gold-glow: rgba(233, 196, 106, 0.22);

  --silver:    #c9ccd6;
  --silver-2:  #9a9db0;

  --text:      #ece9f6;
  --text-2:    #bdb8d0;
  --text-3:    #8d88a6;

  --success:   #6fcf97;
  --warn:      #f2b46b;
  --danger:    #ef7b7b;
  --info:      #7cc4ff;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 20px 50px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  --shadow-gold: 0 0 40px -10px var(--gold-glow);

  --font-head: 'Kanit', 'Noto Sans Thai', system-ui, sans-serif;
  --font-body: 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;

  --max: 1120px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
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;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(233, 196, 106, 0.10), transparent 60%),
    radial-gradient(800px 700px at 50% 110%, rgba(91, 63, 184, 0.25), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
}
#starfield { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: .9; }

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, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
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 { color: var(--purple-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); }

.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; }

/* ---------- 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(--gold)); }
.eyebrow::after { background: linear-gradient(90deg, var(--gold), transparent); }
.divider { height: 1px; margin: 28px auto; width: min(320px, 60%);
  background: linear-gradient(90deg, transparent, var(--gold-3), var(--gold), var(--gold-3), transparent); opacity: .7; }
.gradient-text {
  background: linear-gradient(120deg, var(--gold-2), var(--gold), #d9b45a, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(14, 10, 28, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.25rem; font-weight: 500; color: var(--text); }
.brand .brand-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 10px var(--gold-glow)); }
.brand span { background: linear-gradient(120deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-family: var(--font-head); font-weight: 400; font-size: .92rem;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--gold); background: rgba(233, 196, 106, 0.10); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; padding: 10px var(--gutter) 16px;
    background: rgba(14, 10, 28, 0.96); border-bottom: 1px solid var(--border); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- 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(--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; }
.page-hero h1 { margin: 10px 0 8px; }
.page-hero p { color: var(--text-2); max-width: 640px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; 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 .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold { color: #2a1d05; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); box-shadow: 0 8px 24px -8px rgba(233, 196, 106, .6); }
.btn-gold:hover { color: #1a1203; box-shadow: 0 12px 30px -8px rgba(233, 196, 106, .8); transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--gold-2); }
.btn-purple { color: #fff; background: linear-gradient(135deg, var(--purple-2), var(--purple) 60%, var(--purple-3)); box-shadow: 0 8px 24px -8px rgba(139, 92, 246, .7); }
.btn-purple:hover { transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-lg { padding: 15px 30px; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  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(233,196,106,.08), transparent 40%, transparent 60%, rgba(139,92,246,.08));
}
.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); }

.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); }
@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);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow), var(--shadow-gold); color: var(--text); }
.feature .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem;
  background: linear-gradient(135deg, rgba(139,92,246,.35), rgba(233,196,106,.18)); border: 1px solid var(--border); color: var(--gold-2);
}
.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; }

/* ---------- 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] {
  width: 100%; padding: 12px 14px; color: var(--text); font: inherit; font-size: 1rem;
  background: rgba(10, 6, 24, .55); 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 { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233,196,106,.15); }
input::-webkit-calendar-picker-indicator { filter: invert(.8) sepia(.6) saturate(3) hue-rotate(5deg); cursor: pointer; }
.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; padding: 4px; gap: 4px; background: rgba(10,6,24,.55); border: 1px solid var(--border); border-radius: 999px; }
.tabs button {
  border: 0; background: none; color: var(--text-2); padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-head); font-size: .95rem; transition: background .2s, color .2s;
}
.tabs button.active { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #2a1d05; font-weight: 500; }
.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(233,196,106,.08); }
.chip-purple { border-color: rgba(139,92,246,.4); color: var(--purple-2); background: rgba(139,92,246,.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; }

/* ---------- 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 {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; text-align: center; cursor: pointer;
  background: var(--surface); 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; }
.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: var(--border-2); background: var(--surface-2); }
.zodiac-tile.active { border-color: var(--gold); background: rgba(233,196,106,.10); box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold); }

/* ---------- 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 .8s;
}
.gauge::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg-3); }
.gauge .val { position: relative; font-family: var(--font-head); font-size: 1.5rem; font-weight: 500; color: var(--text); }
.gauge .val small { display: block; font-size: .65rem; color: var(--text-3); margin-top: -4px; font-weight: 400; }
.gauge-sm { width: 72px; height: 72px; } .gauge-sm .val { font-size: 1.15rem; } .gauge-sm::before { inset: 6px; }
.gauge-lg { width: 132px; height: 132px; } .gauge-lg .val { font-size: 2.2rem; } .gauge-lg::before { inset: 9px; }
.gauge-lg .val small { font-size: .78rem; }
.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(--purple), var(--gold)); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.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-head); color: var(--gold-2); }

/* Stars rating */
.stars { color: var(--gold); letter-spacing: 2px; font-size: 1rem; }
.stars .off { color: rgba(255,255,255,.18); }

/* 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: rgba(233,196,106,.06); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 14px 0; }
.callout.purple { border-color: var(--purple-2); background: rgba(139,92,246,.10); }
.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; }
.info-tile { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.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); }
.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(--text-3); font-family: var(--font-head); font-weight: 400; font-size: .85rem; }
.table tr:last-child td { border-bottom: 0; }

/* 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; }

/* Loader */
.loader { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--gold); animation: spin 1s linear infinite; vertical-align: middle; }

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

/* Footer */
.site-footer { margin-top: 60px; padding: 34px 0 40px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .9rem; text-align: center; }
.site-footer .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 8px 0 12px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--gold); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--bg-3); border: 1px solid var(--border-2); color: var(--text); padding: 10px 18px; border-radius: 999px; font-family: var(--font-head); font-size: .95rem;
  transition: all .3s; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
::selection { background: rgba(233,196,106,.35); }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: var(--purple-dim); border-radius: 10px; } ::-webkit-scrollbar-track { background: var(--bg); }
