/* =====================================================================
   เลขชะตา.com — app.css (ไฟล์เดียวทั้งเว็บ, mobile-first)
   สีหลัก: กรมท่า #142A46 · ทอง #D4AF37 · พื้นหลังเนื้อหา #EAF5FF · การ์ด #FFFFFF
   อนิเมชันเบา: ใช้ transform/opacity เท่านั้น ไม่มี canvas loop
   ===================================================================== */
:root {
  --navy: #142A46;
  --navy-d: #0c1b30;
  --navy-l: #20406a;
  --navy-soft: #2d4f7c;
  --gold: #D4AF37;
  --gold-l: #ecd27a;
  --gold-d: #a8862a;
  --gold-bg: #fbf5e1;
  --sky: #EAF5FF;
  --sky-2: #d9ebfb;
  --white: #FFFFFF;
  --ink: #142A46;
  --text: #2a3b52;
  --muted: #61748e;
  --line: #d5e4f3;
  --line-2: #e6eff8;
  --ok: #1f9d6a;
  --ok-bg: #e5f6ee;
  --hot: #d2453b;
  --cold: #3a7bd5;

  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 42, 70, .06), 0 8px 24px -12px rgba(20, 42, 70, .22);
  --shadow-lg: 0 2px 4px rgba(20, 42, 70, .06), 0 22px 48px -20px rgba(20, 42, 70, .38);
  --serif: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --sans: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 64px;
  --top-h: 58px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0; min-height: 100vh; background: var(--sky); color: var(--text);
  font: 400 16px/1.7 var(--sans); overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
a { color: var(--navy-l); text-decoration: none; }
a:hover { color: var(--gold-d); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.35; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 4.6vw, 1.75rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(212, 175, 55, .6); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------------
   แถบบน + เมนู
   --------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  background: rgba(20, 42, 70, .97); color: #fff;
  border-bottom: 1px solid rgba(212, 175, 55, .25);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.topbar .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; flex: none; }
.brand:hover { color: #fff; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.28rem; line-height: 1; color: var(--gold-l); letter-spacing: .01em; }
.brand-name small { font-family: var(--sans); font-weight: 500; font-size: .66rem; color: rgba(255, 255, 255, .7); letter-spacing: .04em; margin-left: 1px; }
.brand-sub { display: block; font-size: .68rem; color: rgba(255, 255, 255, .62); margin-top: 3px; letter-spacing: .02em; }
.mainnav { display: none; }
.draw-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  background: rgba(212, 175, 55, .14); border: 1px solid rgba(212, 175, 55, .4); color: var(--gold-l); font-size: .78rem;
}
.draw-chip:hover { color: #fff; }
.draw-chip b { font-family: var(--serif); font-weight: 700; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px -12px rgba(20, 42, 70, .3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .68rem; font-weight: 500; line-height: 1.1; text-align: center; padding: 0 2px;
}
.tabbar svg { width: 23px; height: 23px; transition: transform .25s var(--ease); }
.tabbar a.active { color: var(--navy); }
.tabbar a.active svg { color: var(--gold-d); transform: translateY(-1px) scale(1.06); }
.tabbar a.active::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px;
  border-radius: 0 0 4px 4px; background: var(--gold);
}

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  :root { --top-h: 68px; }
  .mainnav { display: flex; gap: 2px; }
  .mainnav a {
    position: relative; padding: 8px 14px; border-radius: 10px; color: rgba(255, 255, 255, .82); font-size: .95rem; font-weight: 500;
    transition: color .2s, background .2s;
  }
  .mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
  .mainnav a.active { color: var(--gold-l); }
  .mainnav a.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--gold); border-radius: 2px; }
  .brand svg { width: 40px; height: 40px; }
  .brand-name { font-size: 1.45rem; }
}

/* ---------------------------------------------------------------------
   Hero (พื้นกรมท่า)
   --------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(212, 175, 55, .22), transparent 55%),
    radial-gradient(90% 70% at -10% 110%, rgba(64, 120, 190, .35), transparent 60%),
    linear-gradient(170deg, var(--navy) 0%, var(--navy-d) 100%);
  padding: 30px 0 64px;
}
.hero::after { /* ขอบโค้งลงพื้นฟ้า */
  content: ''; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 40px;
  background: var(--sky); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { color: #fff; margin-bottom: .25em; }
.hero h1 .gold, .gold-text {
  background: linear-gradient(100deg, var(--gold-d) 0%, var(--gold-l) 30%, #fff6d6 45%, var(--gold-l) 60%, var(--gold) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
.hero p.lead { color: rgba(255, 255, 255, .8); font-size: 1.02rem; max-width: 34em; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: .8rem; letter-spacing: .08em; color: var(--gold-l); font-weight: 500;
}
.kicker::before { content: ''; width: 22px; height: 1px; background: var(--gold); }
.hero-ring {
  position: absolute; z-index: 1; right: -120px; top: -70px; width: 380px; height: 380px; opacity: .22;
  color: var(--gold); pointer-events: none; animation: spin 140s linear infinite;
}
.stars i {
  position: absolute; z-index: 1; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, .6); opacity: .2; animation: twinkle 4s ease-in-out infinite;
}
.page-hero { padding: 22px 0 54px; }
.page-hero h1 { font-size: clamp(1.55rem, 5.4vw, 2.2rem); }
.page-hero p.lead { margin-bottom: 0; }
@media (min-width: 760px) {
  .hero { padding: 54px 0 96px; }
  .hero::after { height: 60px; }
  .hero-ring { right: 2%; top: -40px; width: 520px; height: 520px; }
  .page-hero { padding: 40px 0 76px; }
}

/* ---------------------------------------------------------------------
   Section / Card
   --------------------------------------------------------------------- */
main { display: block; }
.section { padding: 10px 0 26px; }
.section + .section { padding-top: 6px; }
.lift { margin-top: -38px; position: relative; z-index: 3; }
@media (min-width: 760px) { .lift { margin-top: -62px; } .section { padding-bottom: 38px; } }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 14px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; flex-basis: 100%; }
.eyebrow { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .08em; color: var(--gold-d); margin-bottom: 2px; }
.card {
  position: relative; background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 18px; border: 1px solid rgba(213, 228, 243, .7);
}
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h3 { margin: 0; }
.ic {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sky); color: var(--navy);
}
.ic svg { width: 20px; height: 20px; }
.ic.gold { background: var(--gold-bg); color: var(--gold-d); }
.card-navy { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-d) 100%); color: rgba(255, 255, 255, .85); border-color: rgba(212, 175, 55, .3); }
.card-navy h2, .card-navy h3 { color: #fff; }
.card-navy .muted { color: rgba(255, 255, 255, .62); }
.grid { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .card { padding: 24px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-23 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* ป้ายแยก "คำทำนาย" กับ "ข้อมูลจริง" */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; line-height: 1.4;
}
.tag svg { width: 14px; height: 14px; }
.tag-predict { background: var(--gold-bg); color: #8a6b12; border: 1px dashed rgba(168, 134, 42, .6); }
.tag-real { background: var(--ok-bg); color: #13724c; border: 1px solid rgba(31, 157, 106, .35); }
.tag-navy { background: var(--navy); color: var(--gold-l); }
.tag-soft { background: var(--sky); color: var(--navy-l); }
.zone-predict { border-top: 4px solid var(--gold); }
.zone-real { border-top: 4px solid var(--ok); }

/* ---------------------------------------------------------------------
   ปุ่ม / ฟอร์ม / ชิป
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; line-height: 1; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-gold { background: linear-gradient(135deg, #f0d77f, var(--gold) 55%, var(--gold-d)); color: var(--navy-d); box-shadow: 0 6px 18px -8px rgba(168, 134, 42, .8); }
.btn-gold:hover { color: var(--navy-d); box-shadow: 0 10px 24px -8px rgba(168, 134, 42, .9); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-l); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--navy); }
.btn-ghost:hover { border-color: var(--gold); color: var(--navy); }
.btn-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .86rem; font-weight: 500; color: var(--navy); }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23142A46' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.input:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 175, 55, .18); }
.input.big { font-family: var(--serif); font-size: 1.4rem; letter-spacing: .12em; text-align: center; }
.form-row { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-d); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap-ok { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 15px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); color: var(--navy); font-size: .92rem; font-weight: 500;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.chip:active { transform: scale(.96); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.chip.on, .chip[aria-selected=true], .chip[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.card-navy .chip { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); color: #fff; }
.card-navy .chip.on, .card-navy .chip[aria-selected=true] { background: var(--gold); border-color: var(--gold); color: var(--navy-d); }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--sky-2); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--navy-l);
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-selected=true] { background: #fff; color: var(--navy); box-shadow: 0 2px 8px -3px rgba(20, 42, 70, .35); }

/* ---------------------------------------------------------------------
   ลูกเลข (หัวใจของเว็บ)
   --------------------------------------------------------------------- */
.balls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.balls.center { justify-content: center; }
.ball {
  --s: 46px;
  min-width: var(--s); height: var(--s); padding: 0 calc(var(--s) * .22); border-radius: 999px;
  display: inline-grid; place-items: center; position: relative;
  font: 700 calc(var(--s) * .44)/1 var(--serif); color: var(--navy); letter-spacing: .03em;
  background: radial-gradient(circle at 32% 26%, #fff 0%, #fff 34%, #eaf2fb 100%);
  box-shadow: inset 0 -3px 0 rgba(20, 42, 70, .08), 0 3px 10px -4px rgba(20, 42, 70, .35), 0 0 0 1.5px var(--line);
}
.ball.gold {
  color: var(--navy-d);
  background: radial-gradient(circle at 32% 26%, #fff8dc 0%, #f3dc8a 28%, var(--gold) 66%, var(--gold-d) 100%);
  box-shadow: inset 0 -3px 0 rgba(120, 90, 10, .25), 0 6px 16px -6px rgba(168, 134, 42, .9), 0 0 0 1.5px rgba(255, 240, 190, .7);
}
.ball.navy { color: var(--gold-l); background: radial-gradient(circle at 32% 26%, #35598a 0%, var(--navy) 60%, var(--navy-d) 100%); box-shadow: 0 4px 12px -5px rgba(12, 27, 48, .7), 0 0 0 1.5px rgba(212, 175, 55, .45); }
.ball.lg { --s: 62px; }
.ball.xl { --s: 78px; }
.ball.sm { --s: 36px; }
.ball.xs { --s: 28px; }
.card-navy .ball:not(.gold):not(.navy) { box-shadow: 0 3px 10px -4px rgba(0, 0, 0, .5); }
.pop .ball { animation: pop .55s var(--ease) both; }
.pop .ball:nth-child(2) { animation-delay: .07s; } .pop .ball:nth-child(3) { animation-delay: .14s; }
.pop .ball:nth-child(4) { animation-delay: .21s; } .pop .ball:nth-child(5) { animation-delay: .28s; }
.pop .ball:nth-child(6) { animation-delay: .35s; } .pop .ball:nth-child(7) { animation-delay: .42s; }
.pop .ball:nth-child(8) { animation-delay: .49s; } .pop .ball:nth-child(n+9) { animation-delay: .56s; }

.lek-set { display: grid; gap: 12px; }
.lek-row { display: grid; gap: 6px; }
.lek-row > .lbl { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.card-navy .lek-row > .lbl { color: rgba(255, 255, 255, .6); }
.lek-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: var(--r); background: linear-gradient(135deg, #fffaf0, var(--gold-bg)); border: 1px solid rgba(212, 175, 55, .35); }
.lek-inline .lbl { font-family: var(--serif); font-weight: 700; color: var(--gold-d); font-size: .95rem; margin-right: 2px; display: inline-flex; align-items: center; gap: 6px; }
.lek-inline .lbl svg { width: 18px; height: 18px; }
.lek-inline .why { flex-basis: 100%; font-size: .8rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------------
   กระดานเลข + นับถอยหลัง
   --------------------------------------------------------------------- */
.board { text-align: center; overflow: hidden; }
.board::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(70% 50% at 50% 0%, rgba(212, 175, 55, .2), transparent 70%);
}
.board > * { position: relative; }
.board-title { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; margin: 6px 0 0; }
.board-date { color: rgba(255, 255, 255, .7); font-size: .9rem; margin-bottom: 14px; }
.board-group { padding: 12px 0; border-top: 1px dashed rgba(255, 255, 255, .14); }
.board-group:first-of-type { border-top: 0; }
.board-group .lbl { font-size: .82rem; letter-spacing: .04em; color: rgba(255, 255, 255, .65); margin-bottom: 8px; }
.board-note { font-size: .8rem; color: rgba(255, 255, 255, .55); margin: 10px 0 0; }
.board-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.countdown { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.cd-box { min-width: 58px; padding: 8px 6px 6px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.cd-box b { display: block; font: 700 1.5rem/1 var(--serif); color: #fff; font-variant-numeric: tabular-nums; }
.cd-box small { font-size: .7rem; color: rgba(255, 255, 255, .6); }
.card:not(.card-navy) .cd-box { background: var(--sky); border-color: var(--line); }
.card:not(.card-navy) .cd-box b { color: var(--navy); }
.card:not(.card-navy) .cd-box small { color: var(--muted); }
.skeleton { display: inline-block; min-width: 46px; height: 46px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.card:not(.card-navy) .skeleton { background-image: linear-gradient(90deg, var(--line-2), #f6fafe, var(--line-2)); }

/* ---------------------------------------------------------------------
   แถบดวง 7 วันเกิด / ราศี
   --------------------------------------------------------------------- */
.daystrip { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 10px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
.daystrip::-webkit-scrollbar { display: none; }
.daycard {
  scroll-snap-align: start; display: grid; gap: 8px; padding: 14px; border-radius: var(--r); background: #fff; color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.daycard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.daycard::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c, var(--gold)); }
.daycard .dname { font-family: var(--serif); font-weight: 700; color: var(--navy); font-size: 1.02rem; display: flex; align-items: center; gap: 7px; }
.daycard .dname .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.daycard .lvl { font-size: .78rem; color: var(--muted); }
.daycard .balls { gap: 4px; flex-wrap: nowrap; }
.daycard .ball.sm { --s: 31px; }
.daycard.me { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, .35), var(--shadow); }
.daycard.me::after { content: 'วันเกิดคุณ'; position: absolute; top: 10px; right: 10px; font-size: .62rem; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--gold-bg); color: var(--gold-d); }
@media (min-width: 960px) { .daystrip { grid-auto-flow: row; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 4px 0 12px; } }

.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-d), var(--gold)); transition: width 1s var(--ease); }
.meter.ok > i { background: linear-gradient(90deg, #2bb47d, #64d3a3); }
.meter.mid > i { background: linear-gradient(90deg, var(--gold-d), var(--gold-l)); }
.meter.low > i { background: linear-gradient(90deg, #d97a5a, #f0a37f); }
.scores { display: grid; gap: 12px; }
.score-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; font-size: .92rem; }
.score-row b { font-family: var(--serif); color: var(--navy); text-align: right; }
.big-score { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; --c: var(--gold); width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); transition: --p 1s; position: relative; }
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.ring span { position: relative; font: 700 1.6rem/1 var(--serif); color: var(--navy); }
.ring span small { font-size: .7rem; color: var(--muted); font-family: var(--sans); font-weight: 500; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv > div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--sky); }
.kv dt, .kv .k { font-size: .76rem; color: var(--muted); }
.kv dd, .kv .v { margin: 0; font-weight: 600; color: var(--navy); font-size: .95rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); vertical-align: middle; }
.prose p { color: var(--text); }
.prose p:last-child { margin-bottom: 0; }
.aspect { padding: 14px; border-radius: var(--r); background: var(--sky); }
.aspect h4 { font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.aspect h4 small { font-family: var(--sans); font-weight: 600; font-size: .78rem; color: var(--gold-d); }
.aspect p { font-size: .92rem; margin: 6px 0 0; }
.aspect .tip { color: var(--navy-l); font-size: .86rem; }
.do-dont { display: grid; gap: 10px; }
.do-dont ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.do-dont li { position: relative; padding-left: 26px; font-size: .93rem; }
.do-dont li::before { position: absolute; left: 0; top: 1px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.do-dont .do li::before { content: '✓'; background: var(--ok-bg); color: var(--ok); }
.do-dont .dont li::before { content: '✕'; background: #fdecea; color: var(--hot); }
@media (min-width: 640px) { .do-dont { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------------
   หน้าดูดวงวันนี้
   --------------------------------------------------------------------- */
.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; max-width: 640px; }
.hero-facts > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(212, 175, 55, .22); backdrop-filter: blur(4px); }
.hero-facts .e { grid-row: span 2; font-size: 1.5rem; color: var(--gold-l); line-height: 1; }
.hero-facts b { font-size: .9rem; font-weight: 600; color: #fff; line-height: 1.35; }
.hero-facts small { font-size: .74rem; color: rgba(255, 255, 255, .62); }
@media (min-width: 760px) { .hero-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 760px) { .colors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.color { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm); background: var(--sky); min-width: 0; }
.color .sw { width: 34px; height: 34px; flex: none; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 3px 8px -4px rgba(0, 0, 0, .4); }
.color b { display: block; font-size: .9rem; color: var(--navy); line-height: 1.3; }
.color small { display: block; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.color.bad { background: #fdf1ef; }
.color.bad b { text-decoration: line-through; text-decoration-color: rgba(214, 69, 65, .6); }
.score-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.score-head b { font-family: var(--serif); font-size: 1.25rem; }
.score-head p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.band-ok { color: var(--ok); } .band-mid { color: var(--gold-d); } .band-low { color: var(--hot); }
.do-dont h4 { font-size: .95rem; margin-bottom: 8px; }
.signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .signs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .signs { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.sign { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: var(--r); border: 1px solid var(--line); background: #fff;
  color: var(--text); font: inherit; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.sign:active { transform: scale(.97); }
.sign .g { font-size: 1.6rem; line-height: 1.1; color: var(--gold-d); }
.sign b { font-family: var(--serif); font-size: .95rem; color: var(--navy); }
.sign small { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.sign i { position: absolute; top: 5px; right: 5px; font-style: normal; font-size: .58rem; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--gold-bg); color: var(--gold-d); }
.sign[aria-pressed=true] { background: var(--navy); border-color: var(--navy); box-shadow: 0 8px 18px -10px rgba(20, 42, 70, .8); }
.sign[aria-pressed=true] b { color: #fff; } .sign[aria-pressed=true] small { color: rgba(255, 255, 255, .65); } .sign[aria-pressed=true] .g { color: var(--gold-l); }
.card-navy .lek-row > .lbl, .card-navy .lek-set .muted { color: rgba(255, 255, 255, .7); }

/* ---------------------------------------------------------------------
   หน้าเลขมงคล
   --------------------------------------------------------------------- */
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border-radius: 14px; margin-bottom: 14px; }
.seg-full button { border-radius: 10px; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.panel { animation: rise .3s var(--ease) both; }
.panel > p.small { margin-top: 0; }
.planet-badge { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 1.3rem/1 var(--serif); color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), transparent 45%), var(--c); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c), 0 6px 14px -6px var(--c); }
.numtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .numtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.numtile { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: var(--r); background: var(--sky); text-align: center; }
.numtile small { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.numtile b { font: 700 2rem/1.1 var(--serif); color: var(--navy); }
.numtile span { font-size: .74rem; color: var(--navy-l); }
.numtile.good { background: linear-gradient(160deg, #fffaf0, var(--gold-bg)); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .4); }
.numtile.good b { color: var(--gold-d); }
.numtile.bad { background: #fdf1ef; } .numtile.bad b { color: var(--hot); }
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters span { display: grid; justify-items: center; min-width: 34px; padding: 6px 4px; border-radius: 10px; background: var(--sky); animation: pop .4s var(--ease) both; }
.letters b { font: 600 1.15rem/1.2 var(--serif); color: var(--navy); }
.letters small { font-size: .74rem; color: var(--gold-d); font-weight: 700; }
.letters span.z { opacity: .5; }
.sumline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--navy); color: rgba(255, 255, 255, .75); font-size: .9rem; }
.sumline b { font: 700 1.6rem/1 var(--serif); color: #fff; }
.sumline b.gold { color: var(--gold-l); font-size: 2rem; }
.sumline small { color: rgba(255, 255, 255, .6) !important; }
.pairs { display: flex; flex-wrap: wrap; gap: 6px; }
.pair { display: inline-grid; place-items: center; min-width: 40px; padding: 6px 8px; border-radius: 10px; font: 700 1.05rem/1 var(--serif); background: var(--sky); color: var(--navy-l); animation: pop .35s var(--ease) both; }
.pair.g { background: var(--ok-bg); color: #13724c; box-shadow: inset 0 0 0 1px rgba(31, 157, 106, .35); }
.pair.b { background: #fdecea; color: var(--hot); box-shadow: inset 0 0 0 1px rgba(214, 69, 65, .3); }
.pair.sm { min-width: 0; padding: 3px 7px; font: 600 .72rem/1.2 var(--sans); animation: none; }

/* ---------------------------------------------------------------------
   หน้าแนวทาง
   --------------------------------------------------------------------- */
.jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 18px -16px 0; padding: 0 16px; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 7px 14px; border-radius: 999px; font-size: .84rem; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(212, 175, 55, .3); }
.jump a:hover { background: rgba(212, 175, 55, .2); color: #fff; }
.calendar-day { display: flex; justify-content: center; margin: 0 0 14px; }
.cal { width: 108px; border-radius: 14px; overflow: hidden; text-align: center; background: #fff; box-shadow: 0 10px 22px -12px rgba(20, 42, 70, .55), inset 0 0 0 1px var(--line); animation: pop .5s var(--ease) both; }
.cal .m { display: block; padding: 5px 0; background: var(--hot); color: #fff; font-size: .8rem; font-weight: 600; }
.cal b { display: block; font: 700 2.8rem/1.15 var(--serif); color: var(--navy); }
.cal .w { display: block; padding-bottom: 8px; font-size: .76rem; color: var(--muted); }
.moonline { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px; border-radius: var(--r); background: var(--navy); color: #fff; }
.moonline b { display: block; font: 700 1.25rem/1.3 var(--serif); color: var(--gold-l); }
.moonline small { color: rgba(255, 255, 255, .7); font-size: .8rem; }
.moon { width: 52px; height: 52px; flex: none; border-radius: 50%; background: #2a3d59; position: relative; overflow: hidden; box-shadow: 0 0 18px rgba(247, 227, 161, .35); }
.moon::after { content: ''; position: absolute; top: 0; bottom: 0; width: var(--ill); background: radial-gradient(circle at 40% 40%, #fff8dc, #e9d48c); }
.moon.wax::after { right: 0; border-radius: 50% 0 0 50% / 50%; }
.moon.wan::after { left: 0; border-radius: 0 50% 50% 0 / 50%; }
.grid-days { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.daylek { display: grid; gap: 8px; padding: 14px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); position: relative; overflow: hidden; transition: transform .2s var(--ease); }
.daylek::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.daylek:hover { transform: translateY(-2px); color: var(--text); }
.daylek .dname { font-family: var(--serif); font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.daylek .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.daylek .balls { gap: 5px; flex-wrap: nowrap; }
.daylek .tri { font-size: .82rem; color: var(--muted); }
.daylek .tri b { color: var(--navy); font-family: var(--serif); letter-spacing: .04em; }
@media (min-width: 760px) { .dream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------------
   ผลรางวัล / ตาราง / สถิติ
   --------------------------------------------------------------------- */
.prize-first { text-align: center; padding: 6px 0 12px; }
.prize-first .lbl { font-size: .84rem; color: var(--muted); }
.digits { display: inline-flex; gap: 5px; margin-top: 6px; }
.digits span {
  width: 40px; height: 52px; display: grid; place-items: center; border-radius: 10px;
  font: 700 1.75rem/1 var(--serif); color: var(--navy); background: linear-gradient(180deg, #fff 0%, #eef5fd 100%);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 8px -4px rgba(20, 42, 70, .35);
}
.digits.flip span { animation: flipIn .6s var(--ease) both; }
.digits.flip span:nth-child(2) { animation-delay: .08s; } .digits.flip span:nth-child(3) { animation-delay: .16s; }
.digits.flip span:nth-child(4) { animation-delay: .24s; } .digits.flip span:nth-child(5) { animation-delay: .32s; }
.digits.flip span:nth-child(6) { animation-delay: .4s; }
.prize-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prize-grid > div { padding: 10px 6px; border-radius: var(--r-sm); background: var(--sky); text-align: center; }
.prize-grid .lbl { font-size: .74rem; color: var(--muted); }
.prize-grid .v { font: 700 1.15rem/1.3 var(--serif); color: var(--navy); letter-spacing: .04em; }
.prize-grid .v.l2 { font-size: 1.7rem; color: var(--gold-d); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { font-family: var(--serif); font-weight: 700; color: var(--navy); letter-spacing: .05em; }
.tbl .n.g { color: var(--gold-d); font-size: 1.05rem; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #f6faff; }
.tbl mark { background: var(--gold-bg); color: var(--gold-d); border-radius: 4px; padding: 0 3px; }
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 30px 1fr 38px; gap: 8px; align-items: center; font-size: .86rem; }
.bar .k { font: 700 1rem/1 var(--serif); color: var(--navy); text-align: center; }
.bar .t { height: 14px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar .t i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--navy-l), #5a8fd0); transition: width .9s var(--ease); }
.bar.top .t i { background: linear-gradient(90deg, var(--gold-d), var(--gold-l)); }
.bar .c { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.heat div {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; position: relative;
  font: 700 .82rem/1 var(--serif); color: var(--navy); background: rgba(20, 42, 70, calc(var(--a) * .9 + .04));
}
.heat div.dk { color: #fff; }
.heat div.hit { box-shadow: 0 0 0 2px var(--gold); }
.legend { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.legend i { width: 70px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(20, 42, 70, .06), rgba(20, 42, 70, .94)); }
.hotcold { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hotcold h4 { font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.hotcold .hot h4 { color: var(--hot); }
.hotcold .cold h4 { color: var(--cold); }
.hc-list { display: grid; gap: 6px; }
.hc-list div { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.statline { display: flex; flex-wrap: wrap; gap: 8px; }
.statline span { padding: 6px 12px; border-radius: 999px; background: var(--sky); font-size: .85rem; color: var(--navy-l); }
.statline b { color: var(--navy); font-family: var(--serif); }
.result-box { margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--sky); animation: rise .35s var(--ease) both; }
.result-box.win { background: linear-gradient(135deg, #fffaf0, var(--gold-bg)); border: 1px solid rgba(212, 175, 55, .5); }
.result-box.lose { background: #f4f7fb; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--line); font-size: .88rem; color: var(--muted);
}
.notice svg { flex: none; width: 20px; height: 20px; color: var(--gold-d); margin-top: 2px; }
.notice.real svg { color: var(--ok); }

/* ---------------------------------------------------------------------
   เมนูเครื่องมือ
   --------------------------------------------------------------------- */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tool {
  display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: var(--r); background: #fff; color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(212, 175, 55, .55); color: var(--text); }
.tool b { font-family: var(--serif); color: var(--navy); font-size: 1rem; }
.tool small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
@media (min-width: 760px) { .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tools { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------------
   ทำนายฝัน
   --------------------------------------------------------------------- */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; }
.dream-list { display: grid; gap: 10px; margin-top: 12px; }
.dream {
  display: grid; grid-template-columns: 1fr; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--line); animation: rise .3s var(--ease) both;
}
.dream h4 { font-size: 1rem; margin: 0; }
.dream p { grid-column: 1 / -1; margin: 0; font-size: .88rem; color: var(--muted); }
.dream .balls { gap: 5px; }
@media (min-width: 560px) { .dream { grid-template-columns: 1fr auto; } }
.dream .cat { font-size: .72rem; color: var(--gold-d); font-weight: 600; }

/* ---------------------------------------------------------------------
   ไพ่ทาโรต์
   --------------------------------------------------------------------- */
.deck { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; perspective: 900px; }
@media (min-width: 640px) { .deck { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.tcard { position: relative; aspect-ratio: 2 / 3.3; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .25s var(--ease); }
.tcard:hover:not(:disabled) { transform: translateY(-6px); }
.tcard:disabled { cursor: default; }
.tcard.picked { opacity: .25; transform: scale(.92); }
.tback, .tface {
  position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
}
.tback {
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(212, 175, 55, .0) 31%),
    repeating-linear-gradient(45deg, rgba(212, 175, 55, .16) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, var(--navy-l), var(--navy-d));
  border: 2px solid rgba(212, 175, 55, .55); box-shadow: 0 6px 14px -8px rgba(12, 27, 48, .8);
  display: grid; place-items: center; color: var(--gold);
}
.tback svg { width: 46%; opacity: .9; }
.spread { display: grid; gap: 14px; }
@media (min-width: 760px) { .spread.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .spread.one { max-width: 420px; margin: 0 auto; } }
.slot { display: grid; gap: 10px; justify-items: center; text-align: center; }
.slot .pos { font-size: .8rem; font-weight: 600; letter-spacing: .05em; color: var(--gold-d); }
.tflip { width: 172px; aspect-ratio: 2 / 3.3; perspective: 1000px; }
.tflip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.tflip.open .tflip-in { transform: rotateY(180deg); }
.tflip .tface {
  transform: rotateY(180deg); background: linear-gradient(170deg, #fffdf6, #f6ecd0); border: 2px solid var(--gold);
  display: grid; grid-template-rows: auto 1fr auto; padding: 10px 8px; color: var(--navy); box-shadow: 0 12px 24px -12px rgba(12, 27, 48, .6);
}
.tflip .tface.rev .t-art { transform: rotate(180deg); }
.t-num { font: 700 .82rem/1 var(--serif); color: var(--gold-d); }
.t-art { display: grid; place-items: center; font-size: 3.4rem; line-height: 1; position: relative; }
.t-art::before { content: ''; position: absolute; width: 96px; height: 96px; border-radius: 50%; border: 1px solid rgba(168, 134, 42, .45); background: radial-gradient(circle, rgba(212, 175, 55, .18), transparent 70%); }
.t-art span { position: relative; }
.t-name { font: 700 .9rem/1.3 var(--serif); }
.t-name small { display: block; font: 500 .7rem/1.3 var(--sans); color: var(--muted); }
.reading-card { text-align: left; width: 100%; }
.reading-card h4 { font-size: 1.05rem; margin: 0 0 4px; }
.kw { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
.kw span { font-size: .74rem; padding: 2px 9px; border-radius: 99px; background: var(--sky); color: var(--navy-l); }

/* ---------------------------------------------------------------------
   เซียมซี
   --------------------------------------------------------------------- */
.siamsi { display: grid; justify-items: center; gap: 14px; text-align: center; }
.tube { width: 110px; height: 150px; position: relative; transform-origin: 50% 90%; border: 0; padding: 0; background: none; cursor: pointer; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .45)); }
.tube:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 12px; }
.tube.shake { animation: shake .9s ease-in-out; }
.tube svg { width: 100%; height: 100%; }
.stick-out { animation: stick .7s var(--ease) both; width: 34px; padding: 10px 0 14px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #f6e4ad, #e2c47a);
  color: #8a2b1c; font: 700 1rem/1 var(--serif); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6); margin-bottom: 4px; }
.paper { color: var(--text); text-align: left; }
.paper-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.paper-head h3 { margin: 2px 0 0; color: var(--navy); }
.lv { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--gold-bg); color: var(--gold-d); }
.lv-great { background: #fde9e4; color: #b3261e; } .lv-care { background: #eef1f5; color: var(--muted); }
.poem { display: grid; gap: 2px; padding: 10px 14px; margin-bottom: 10px; border-left: 3px solid var(--gold); background: rgba(255, 255, 255, .6); border-radius: 0 10px 10px 0; font-family: var(--serif); color: var(--navy); font-size: .98rem; }
.siamsi-card { background: radial-gradient(90% 60% at 50% 0%, rgba(212, 175, 55, .18), transparent 70%), linear-gradient(170deg, var(--navy), var(--navy-d)); }
.paper { width: 100%; max-width: 440px; padding: 18px; border-radius: var(--r); background: linear-gradient(180deg, #fffdf5, #fbf3dc); border: 1px solid rgba(212, 175, 55, .5); animation: rise .45s var(--ease) both; }
.paper .no { font: 700 2.2rem/1 var(--serif); color: var(--hot); }

/* ---------------------------------------------------------------------
   ส่วนท้าย + toast
   --------------------------------------------------------------------- */
.footer { background: var(--navy-d); color: rgba(255, 255, 255, .7); padding: 34px 0 26px; margin-top: 20px; font-size: .9rem; }
.footer .brand { margin-bottom: 10px; }
.footer-grid { display: grid; gap: 22px; }
.footer h4 { color: var(--gold-l); font-size: .95rem; margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { color: rgba(255, 255, 255, .78); }
.footer a:hover { color: var(--gold-l); }
.footer .fine { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 22px; padding-top: 16px; font-size: .8rem; color: rgba(255, 255, 255, .5); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-size: .92rem; box-shadow: var(--shadow-lg);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------------------------------------------------------------------
   อนิเมชัน
   --------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.fade-in { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.3) rotate(-90deg); } 70% { opacity: 1; transform: scale(1.08) rotate(6deg); } 100% { transform: none; } }
@keyframes flipIn { from { opacity: 0; transform: rotateX(90deg); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.7); } 50% { opacity: .95; transform: scale(1.15); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 50% { background-position: 0 0; } 100% { background-position: 100% 0; } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-9deg); } 60% { transform: rotate(7deg); } 75% { transform: rotate(-4deg); } }
@keyframes stick { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, .55); } 50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); } }
.pulse { animation: pulse 2.2s ease-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ปุ่มดูเพิ่ม (รายการฝัน) */
.more-row { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 4px; }
.more-row small { opacity: .6; font-weight: 400; margin-left: 4px; }

/* ---------------------------------------------------------------------
   หน้าสถิติหวย
   --------------------------------------------------------------------- */
.prize-more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.prize-more summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .92rem; list-style: none; display: flex; align-items: center; gap: 6px; }
.prize-more summary::-webkit-details-marker { display: none; }
.prize-more summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.prize-more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.pa { margin-top: 12px; animation: rise .3s var(--ease) both; }
.pa-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pa-h b { color: var(--navy); font-size: .92rem; }
.pa-h small { color: var(--muted); font-size: .76rem; }
.pa-n { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 5px; }
.pa-n span { text-align: center; padding: 5px 0; border-radius: 8px; background: var(--sky); font: 600 .9rem/1.2 var(--serif); color: var(--navy); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ck-num { text-align: center; }
.ck-num .digits span { width: 36px; height: 46px; font-size: 1.5rem; }
.ck-win { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .7); color: var(--navy); }
.ck-win b { color: var(--gold-d); }
.ck-win > div > b:first-child { display: block; color: var(--navy); font-family: var(--serif); font-size: 1.05rem; }
.ck-ico { font-size: 2rem; animation: pop .6s var(--ease) both; }
.row-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.row-input .btn { padding-inline: 22px; }
.lk-head { display: flex; align-items: center; gap: 12px; }
.lk-head b { display: block; font-family: var(--serif); color: var(--navy); font-size: 1.1rem; }
.lk-head small { color: var(--muted); font-size: .82rem; }
.lk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lk-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, .75); font-size: .86rem; }
.lk-list b { color: var(--navy); font-weight: 600; text-align: right; }
.heat div { cursor: pointer; transition: transform .15s var(--ease); }
.heat div:hover, .heat div:focus-visible { transform: scale(1.12); z-index: 1; outline: none; box-shadow: 0 0 0 2px var(--gold), 0 6px 14px -6px rgba(20, 42, 70, .5); }
.heat-key { display: inline-flex; align-items: center; gap: 6px; }
.heat-key .hk { width: 12px; height: 12px; border-radius: 4px; box-shadow: 0 0 0 2px var(--gold); }
.hc-list span b { color: var(--navy); }
.tbl td.p3 span + span { margin-left: 8px; }
@media (max-width: 559px) {
  #histTbl th, #histTbl td { padding: 8px 6px; }
  #histTbl td { font-size: .86rem; }
  #histTbl td.p3 span { display: block; margin: 0; }
  #histTbl td.p3 span + span { margin-top: 2px; }
}

/* ---------------------------------------------------------------------
   หน้าไพ่ทาโรต์
   --------------------------------------------------------------------- */
.tarot-setup { margin-bottom: 14px; }
.table-felt { margin-bottom: 14px; overflow: hidden; }
.felt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.felt-head h3 { margin: 0; }
.pick-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.pick-dots i { width: 26px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); transition: background .3s; }
.pick-dots i.on { background: var(--gold); }
.tcard { cursor: pointer; }
.tcard.deal { animation: deal .45s var(--ease) both; animation-delay: calc(var(--i) * 18ms); }
.tcard:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 2px; border-radius: 10px; }
.tcard.picked { opacity: 1; transform: translateY(-10px) scale(.94); }
.tcard.picked .tback { border-color: var(--gold-l); box-shadow: 0 0 0 2px var(--gold), 0 10px 22px -8px rgba(212, 175, 55, .7); }
.deck.done .tcard:not(.picked) { opacity: .35; transform: scale(.95); }
.deck.shuffling .tcard { animation: shuf .38s var(--ease) both; animation-delay: calc(var(--i) * 6ms); }
@keyframes deal { from { opacity: 0; transform: translateY(-18px) rotate(-6deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes shuf { 50% { transform: translateX(calc((12 - var(--i)) * 3px)) rotate(4deg); opacity: .6; } }

.tarot-result { margin-bottom: 14px; }
.spread-row { display: flex; justify-content: center; gap: 12px; margin: 8px 0 16px; }
.spread-row .slot { flex: 0 1 172px; min-width: 0; }
.spread-row .tflip { width: 100%; }
.spread-row .pos { white-space: nowrap; }
@media (max-width: 559px) {
  .spread-row.n3 { gap: 8px; }
  .spread-row.n3 .tface { padding: 7px 5px; }
  .spread-row.n3 .t-art { font-size: 2.1rem; }
  .spread-row.n3 .t-art::before { width: 58px; height: 58px; }
  .spread-row.n3 .t-name { font-size: .74rem; }
  .spread-row.n3 .t-name small { font-size: .6rem; }
}
.tflip .tback { transform: none; }
.readings { display: grid; gap: 12px; }
@media (min-width: 900px) { .tarot-result .readings { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.reading-card { padding: 14px; border-radius: var(--r); background: var(--sky); border: 1px solid var(--line-2); animation: rise .45s var(--ease) both; animation-delay: var(--d, 0s); }
.reading-card p { font-size: .92rem; margin: 0 0 10px; }
.reading-card .advice { padding: 8px 10px; border-left: 3px solid var(--gold); background: #fff; border-radius: 0 8px 8px 0; font-size: .88rem; }
.reading-card .advice b { color: var(--gold-d); }
.reading-card h4 small { font: 500 .74rem/1 var(--sans); color: var(--muted); }
.reading-card .lek-inline { padding: 10px 12px; }
.rc-head { display: flex; gap: 12px; align-items: flex-start; }
.rc-head .pos { display: block; font-size: .74rem; font-weight: 600; color: var(--gold-d); }
.rc-art { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.6rem; background: #fff; box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .5); }
.spread-sum { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: linear-gradient(135deg, #fffaf0, var(--gold-bg)); border: 1px solid rgba(212, 175, 55, .35); }
.spread-sum b { font-family: var(--serif); color: var(--navy); }
.spread-sum p { margin: 4px 0 0; font-size: .9rem; }
.yn { display: grid; justify-items: center; gap: 2px; text-align: center; margin: 0 auto 16px; padding: 14px 18px; border-radius: var(--r); max-width: 360px; animation: rise .5s var(--ease) .6s both; }
.yn small { font-size: .8rem; color: var(--muted); }
.yn b { font: 700 2.2rem/1.2 var(--serif); }
.yn span { font-size: .9rem; }
.yn-yes { background: var(--ok-bg); } .yn-yes b { color: var(--ok); }
.yn-maybe { background: var(--gold-bg); } .yn-maybe b { color: var(--gold-d); }
.yn-no { background: #fdeee8; } .yn-no b { color: #c4532f; }
@media (prefers-reduced-motion: reduce) { .tcard.deal, .deck.shuffling .tcard { animation: none; } }
#topicChips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#topicChips[hidden] { display: none; }
#topicChips .chip { justify-content: center; padding-inline: 4px; }
.reading-card .kw span { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
