/* ===== Tiệm Tarot Đêm Khuya ===== */
:root {
  --bg: #0b0817;
  --bg-2: #14102a;
  --gold: #e8c874;
  --gold-2: #f5e0a3;
  --purple: #9b7bff;
  --text: #efe9f7;
  --muted: #a99fc7;
  --card-w: clamp(88px, 13vw, 128px);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Nền sao + nebula ---- */
.stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.stars span {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
  opacity: .15;
}
@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(.8); }
  50% { opacity: .9; transform: scale(1.25); }
}
.nebula {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 15% 10%, rgba(155,123,255,.16), transparent 60%),
    radial-gradient(ellipse 55% 40% at 85% 25%, rgba(232,200,116,.10), transparent 60%),
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(76,42,133,.28), transparent 65%),
    var(--bg);
}

/* ---- Header ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 5vw, 56px);
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,8,23,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(232,200,116,.15);
}
.logo { font-family: "Playfair Display", serif; font-size: 1.3rem; font-weight: 700; color: var(--gold-2); }
.logo span { letter-spacing: .5px; }
.site-header nav { display: flex; gap: clamp(10px, 2.5vw, 28px); }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: .92rem;
  transition: color .2s;
}
.site-header nav a:hover { color: var(--gold); }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: clamp(60px, 12vh, 120px) 20px clamp(50px, 9vh, 90px);
}
.hero-kicker {
  color: var(--purple); letter-spacing: 4px; font-size: .8rem;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 900; line-height: 1.05;
  color: var(--gold-2);
  text-shadow: 0 0 40px rgba(232,200,116,.25);
}
.hero h1 em { font-style: italic; color: var(--purple); }
.hero-sub { margin: 22px auto 30px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.disclaimer { margin-top: 26px; font-size: .78rem; color: #6f6694; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  border: none; border-radius: 999px;
  padding: 13px 28px; cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #c9a24e);
  color: #241a05;
  box-shadow: 0 6px 24px rgba(232,200,116,.28);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(232,200,116,.4); }
.btn-ghost {
  background: transparent; color: var(--gold);
  border: 1px solid rgba(232,200,116,.4);
}
.btn-ghost:hover { background: rgba(232,200,116,.08); }
.btn small { display: block; font-weight: 400; font-size: .75rem; opacity: .75; margin-top: 3px; }

/* ---- Sections ---- */
.section {
  max-width: 1060px; margin: 0 auto;
  padding: clamp(44px, 8vh, 80px) 20px;
}
.section-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  color: var(--gold-2); text-align: center;
}
.section-title::after {
  content: "✦ ✦ ✦"; display: block;
  font-size: .8rem; letter-spacing: 10px;
  color: var(--purple); margin-top: 10px;
}
.section-sub { text-align: center; color: var(--muted); margin: 14px 0 34px; }

/* ---- Lá của ngày ---- */
.daily-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 5vw, 56px); flex-wrap: wrap;
}
.daily-info { max-width: 440px; }
.daily-info h3 {
  font-family: "Playfair Display", serif;
  color: var(--gold); font-size: 1.5rem; margin-bottom: 12px;
}
.meaning { color: var(--text); line-height: 1.75; }
.daily-card { cursor: pointer; animation: floaty 5s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* ---- Lá bài Tarot ---- */
.tarot-card {
  width: var(--card-w);
  aspect-ratio: 2 / 3.35;
  perspective: 900px;
  flex: 0 0 auto;
}
.card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.4,.05,.25,1);
}
.tarot-card.flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}
/* ---- Mặt sau: medallion trăng-sao huyền bí ---- */
.card-back {
  background: linear-gradient(160deg, #0b4d5c, #062833);
  border: 1px solid rgba(215,169,74,.5);
  box-shadow: 0 8px 26px rgba(0,0,0,.55), inset 0 0 34px rgba(43,155,152,.3);
  padding: 0;
}
.back-svg { width: 100%; height: 100%; display: block; }

/* ---- Hiệu ứng lật bài theo lá ---- */
.tarot-card.fx-flash { animation: fxflash 1s ease-out; }
@keyframes fxflash {
  0% { filter: none; }
  30% { filter: drop-shadow(0 0 18px var(--fx, #D7A94A)) drop-shadow(0 0 42px var(--fx, #D7A94A)); }
  100% { filter: none; }
}

/* ---- Mặt trước: ảnh thật Rider-Waite-Smith ---- */
.card-front {
  transform: rotateY(180deg);
  background: linear-gradient(170deg, #FFF9EA, #F5E8D1);
  border: 1px solid #d9c9a8;
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  padding: 4px;
  justify-content: flex-start !important;
}
.card-front.reversed-art { transform: rotateY(180deg) rotate(180deg); }

.card-img {
  width: 100%; height: 100%;
  object-fit: fill;
  display: block;
  border-radius: 9px;
}
.rev-chip {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  color: #FFF9EA; background: rgba(228,92,79,.92);
  padding: 2px 6px; border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ---- Chọn trải bài ---- */
.question-box {
  display: flex; gap: 10px; justify-content: center;
  max-width: 560px; margin: 0 auto 26px;
}
#questionInput {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(155,123,255,.35);
  border-radius: 999px; padding: 13px 22px;
  color: var(--text); font-family: inherit; font-size: .95rem;
  outline: none; transition: border .2s;
}
#questionInput:focus { border-color: var(--gold); }
#questionInput::placeholder { color: #6f6694; }

.spread-picker {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.spread-picker .btn { min-width: 190px; }

/* ---- Quạt bài ---- */
.deck-zone { margin-top: 18px; }
.deck-hint { text-align: center; color: var(--muted); margin-bottom: 30px; }
.deck-hint b { color: var(--gold); }
.deck {
  display: flex; justify-content: center;
  padding: 20px 0 70px;
  min-height: 190px;
}
.deck .tarot-card {
  margin: 0 calc(var(--card-w) * -0.32);
  cursor: pointer;
  transition: transform .25s ease;
  transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0));
  transform-origin: 50% 130%;
}
.deck .tarot-card:hover {
  --lift: -26px;
  z-index: 5;
}
.deck .tarot-card:hover .card-back {
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(232,200,116,.35);
}
.deck .tarot-card.chosen {
  --lift: -42px;
  z-index: 6;
}
.deck .tarot-card.chosen .card-back {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--gold), 0 16px 40px rgba(232,200,116,.5);
}

/* ---- Lá đã chọn + lật ---- */
.picked-cards {
  display: flex; justify-content: center;
  gap: clamp(14px, 4vw, 40px);
  flex-wrap: wrap; margin: 10px 0 30px;
}
.picked-cards .tarot-card { cursor: default; }
.reveal-actions { display: flex; gap: 14px; justify-content: center; }

/* ---- Kết quả trải bài ---- */
.reading-result {
  margin-top: 44px;
  display: grid; gap: 22px;
}
.result-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  border-radius: 18px;
  padding: 22px 26px;
  display: flex; gap: 20px; align-items: flex-start;
  animation: rise .5s ease both;
}
.result-card:nth-child(2) { animation-delay: .15s; }
.result-card:nth-child(3) { animation-delay: .3s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-pos {
  font-size: .78rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--purple); font-weight: 600;
}
.result-card h4 {
  font-family: "Playfair Display", serif;
  color: var(--gold); font-size: 1.25rem; margin: 4px 0 8px;
}
.result-card h4 .rev-tag {
  font-family: "Be Vietnam Pro"; font-size: .7rem; font-weight: 500;
  color: #ffb0b0; border: 1px solid rgba(255,176,176,.4);
  border-radius: 99px; padding: 2px 10px; vertical-align: middle; margin-left: 8px;
}
.result-keywords { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.result-icon { font-size: 2.4rem; flex: 0 0 auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.result-icon.reversed { transform: rotate(180deg); }

/* ---- Tử vi ---- */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px; max-width: 780px; margin: 0 auto;
}
.zodiac-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  border-radius: 16px; padding: 16px 10px;
  color: var(--text); font-family: inherit;
  cursor: pointer; text-align: center;
  transition: transform .15s, border .2s, background .2s;
}
.zodiac-btn:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: rgba(232,200,116,.07);
}
.zodiac-btn.active { border-color: var(--gold); background: rgba(232,200,116,.12); }
.z-icon { font-size: 1.8rem; display: block; color: var(--gold); }
.z-name { font-weight: 600; display: block; margin-top: 6px; font-size: .95rem; }
.z-dates { font-size: .72rem; color: var(--muted); display: block; margin-top: 2px; }

.horo-result {
  max-width: 680px; margin: 34px auto 0;
  background: linear-gradient(160deg, rgba(155,123,255,.1), rgba(232,200,116,.05));
  border: 1px solid rgba(232,200,116,.3);
  border-radius: 20px; padding: 28px 30px;
  animation: rise .4s ease both;
}
.horo-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.horo-head .big-icon { font-size: 2rem; }
.horo-head h3 { font-family: "Playfair Display", serif; color: var(--gold-2); font-size: 1.5rem; }
.horo-head .el { color: var(--muted); font-size: .85rem; }
.horo-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px dashed rgba(155,123,255,.25); }
.horo-row .k {
  flex: 0 0 118px; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--purple);
  padding-top: 2px;
}
.horo-row .v { line-height: 1.65; }
.horo-score { margin-top: 6px; color: var(--gold); letter-spacing: 3px; }

/* ---- Footer ---- */
.site-footer {
  text-align: center; padding: 50px 20px 40px;
  color: var(--muted); border-top: 1px solid rgba(155,123,255,.15);
  margin-top: 40px;
}
.site-footer .tiny { font-size: .75rem; color: #6f6694; margin-top: 8px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-header nav a { font-size: .82rem; }
  .result-card { flex-direction: column; }
  .horo-row { flex-direction: column; gap: 4px; }
  .horo-row .k { flex: none; }
  .deck { padding-bottom: 50px; }
}

/* ===== Menu trò chơi ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; max-width: 980px; margin: 0 auto;
}
.game-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 20px; border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  text-decoration: none; color: var(--text);
  transition: transform .18s, border .2s, box-shadow .2s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 30px rgba(232,200,116,.18);
}
.g-icon { font-size: 2rem; }
.g-name { font-family: "Playfair Display", serif; font-size: 1.15rem; color: var(--gold-2); font-weight: 700; }
.g-desc { font-size: .82rem; color: var(--muted); line-height: 1.5; }

/* ===== Hướng dẫn (details) ===== */
.guide {
  max-width: 640px; margin: 0 auto 30px;
  background: rgba(155,123,255,.07);
  border: 1px solid rgba(155,123,255,.3);
  border-radius: 16px; padding: 14px 20px;
}
.guide summary {
  cursor: pointer; font-weight: 600; color: var(--gold);
  list-style: none; text-align: center;
}
.guide summary::before { content: "▸ "; }
.guide[open] summary::before { content: "▾ "; }
.guide ol { margin: 14px 0 0 20px; color: var(--text); line-height: 1.85; font-size: .92rem; }
.guide-note { margin-top: 12px; font-size: .82rem; color: var(--muted); border-top: 1px dashed rgba(155,123,255,.25); padding-top: 10px; }

/* ===== Form chung ===== */
.form-card {
  max-width: 720px; margin: 0 auto 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  border-radius: 18px; padding: 22px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.form-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; width: 100%; }
.form-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .8rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; flex: 1; min-width: 160px;
}
.form-row input, .form-row select, .yesno-controls input {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(155,123,255,.35);
  border-radius: 12px; padding: 12px 16px;
  color: var(--text); font-family: inherit; font-size: .95rem;
  outline: none; transition: border .2s; width: 100%;
}
.form-row input:focus, .form-row select:focus, .yesno-controls input:focus { border-color: var(--gold); }
.form-row select option { background: var(--bg-2); }

/* ===== Nút tiếng & toast & sparkle ===== */
.sound-toggle {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(232,200,116,.35);
  border-radius: 50%; cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--gold-2);
  transition: background .2s, border-color .2s;
}
.sound-toggle:hover { background: rgba(232,200,116,.1); border-color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  background: rgba(20,16,42,.95);
  border: 1px solid var(--gold); color: var(--gold-2);
  padding: 11px 22px; border-radius: 999px;
  font-size: .9rem; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.sparkles span { position: fixed; color: var(--gold); font-size: 15px; will-change: transform, opacity; }

/* ===== Moon chip ===== */
.moon-chip {
  margin-top: 18px; display: inline-block;
  border: 1px solid rgba(155,123,255,.35);
  background: rgba(155,123,255,.08);
  border-radius: 999px; padding: 10px 18px;
  font-size: .85rem; color: var(--text); line-height: 1.5;
}
.moon-chip b { color: var(--gold-2); }

/* ===== Có / Không ===== */
.yesno-box {
  max-width: 640px; margin: 44px auto 0;
  border: 1px dashed rgba(232,200,116,.4);
  border-radius: 18px; padding: 22px 24px; text-align: center;
}
.yesno-title { color: var(--muted); margin-bottom: 16px; }
.yesno-title b { color: var(--gold); }
.yesno-controls { display: flex; gap: 10px; }
.yesno-result { margin-top: 20px; text-align: left; }
.verdict {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 900;
  text-align: center; margin-bottom: 8px;
}
.verdict.yes { color: #7be3a8; }
.verdict.no { color: #ff9d9d; }
.verdict.half { color: var(--gold); font-size: clamp(1.1rem, 3vw, 1.5rem); }
/* Luận giải chi tiết từng lá + kết luận */
.pos-hint { font-size: .85rem; color: var(--muted); font-style: italic; margin-bottom: 8px; }
.read-focus {
  margin-top: 12px; padding: 12px 14px; line-height: 1.7;
  background: rgba(232,200,116,.07); border-left: 3px solid var(--gold); border-radius: 10px;
}
.read-label {
  display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 4px;
}
.read-areas { margin: 12px 0 0 18px; line-height: 1.7; }
.read-areas li { margin-bottom: 4px; }
.read-areas b { color: var(--gold-2); }
.read-adv { margin-top: 10px; color: var(--gold-2); font-style: italic; line-height: 1.6; }
.read-adv svg { width: 14px; height: 14px; vertical-align: -2px; }
.read-long { margin-top: 10px; }
.read-long p { line-height: 1.8; margin: 0 0 12px; text-align: justify; }
.read-long p:last-child {
  margin-bottom: 0; padding: 12px 14px;
  background: rgba(232,200,116,.07); border-left: 3px solid var(--gold); border-radius: 10px;
}
.read-long b { color: var(--gold-2); }
.result-card.conclusion { border: 1px solid rgba(232,200,116,.45); }
.verdict-inline { text-align: left; margin: 4px 0 10px; }
.conclusion p.meaning { margin-bottom: 8px; }
/* Kết luận cuối cùng + phản hồi tự học */
.final-concl {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(160deg, rgba(155,123,255,.12), rgba(232,200,116,.06));
  border: 1px solid rgba(232,200,116,.3);
}
.final-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.final-head > span:first-child { color: var(--gold); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; }
.final-head svg { width: 14px; height: 14px; vertical-align: -2px; }
.final-src { font-size: .78rem; color: var(--muted); font-style: italic; }
.final-src.ai { color: var(--purple); }
.final-src.loading { animation: finalPulse 1.4s ease-in-out infinite; }
@keyframes finalPulse { 50% { opacity: .35; } }
.final-body p.final-answer { font-size: 1.05rem; color: var(--gold-2); font-weight: 600; }
.final-steps { margin: 0 0 12px 1.2em; padding: 0; line-height: 1.7; }
.final-steps li { margin-bottom: 4px; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.fb-q { color: var(--muted); font-size: .9rem; }
.fb-more { margin-top: 10px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-chips .chip { cursor: pointer; font: inherit; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { .final-src.loading { animation: none; } }
.verdict-q { text-align: center; color: var(--muted); font-style: italic; margin-bottom: 14px; }
.verdict-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(255,255,255,.04); border-radius: 14px; padding: 16px;
}

/* ===== Sổ tay bói ===== */
.journal {
  max-width: 640px; margin: 40px auto 0;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(155,123,255,.2);
  border-radius: 16px; padding: 18px 22px;
}
.journal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.journal-head h3 { font-family: "Playfair Display", serif; color: var(--gold-2); font-size: 1.1rem; }
.btn-sm { padding: 7px 16px; font-size: .8rem; }
.journal-list { list-style: none; display: grid; gap: 10px; }
.journal-list li {
  border-top: 1px dashed rgba(155,123,255,.2); padding-top: 10px;
}
.j-meta { font-size: .75rem; color: var(--muted); margin-bottom: 3px; }
.j-cards { font-size: .9rem; color: var(--gold-2); }

/* ===== Kết quả trải bài — story ===== */
.story-result { margin-top: 44px; display: grid; gap: 22px; }
.story-intro .story-plot, .story-plot {
  margin-top: 10px; padding: 12px 16px;
  background: rgba(232,200,116,.07);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  font-size: .95rem; line-height: 1.7;
}
.story-narr { color: var(--purple); font-style: italic; margin-bottom: 8px; }
.game-hero { padding-top: clamp(30px, 6vh, 60px); }

/* ===== Deal-in animation ===== */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(30px) rotate(0deg); }
  to   { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)); }
}

/* ===== Thần số học ===== */
.num-grid {
  display: grid; gap: 18px; margin-top: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.num-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  border-radius: 16px; padding: 20px;
  animation: rise .45s ease both;
}
.num-card:nth-child(2) { animation-delay: .1s; }
.num-card:nth-child(3) { animation-delay: .2s; }
.num-card:nth-child(4) { animation-delay: .3s; }
.num-card:nth-child(5) { animation-delay: .4s; }
.num-card.master { border-color: var(--gold); background: rgba(232,200,116,.06); }
.num-badge {
  flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Playfair Display", serif; font-size: 1.5rem; font-weight: 700; line-height: 1;
  color: #241a05; background: linear-gradient(135deg, var(--gold), #c9a24e);
  box-shadow: 0 4px 18px rgba(232,200,116,.3);
}
.num-card.master .num-badge { background: linear-gradient(135deg, #fff2c8, var(--gold)); }
.num-body h4 { font-family: "Playfair Display", serif; color: var(--gold); font-size: 1.2rem; margin: 3px 0 6px; }
.num-desc { font-size: .8rem; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.num-calc {
  font-size: .75rem; color: #8fd4c2;
  background: rgba(143,212,194,.08);
  border-radius: 8px; padding: 6px 10px; margin: 8px 0;
  font-family: ui-monospace, monospace;
}
.approx { font-size: .68rem; color: var(--muted); border: 1px solid rgba(155,123,255,.4); border-radius: 99px; padding: 1px 8px; vertical-align: middle; }
.num-card.master .approx { color: var(--gold); border-color: var(--gold); }

/* ===== Chiêm tinh ===== */
.astro-head { text-align: center; margin-bottom: 26px; }
.astro-head h3 { font-family: "Playfair Display", serif; color: var(--gold-2); font-size: 1.6rem; margin-bottom: 18px; }
.astro-wheel-wrap { display: flex; justify-content: center; }
.astro-wheel { width: min(340px, 88vw); height: auto; }
.wheel-ring { fill: none; stroke: rgba(232,200,116,.5); stroke-width: 1.4; }
.wheel-ring.thin { stroke: rgba(155,123,255,.35); stroke-width: 1; }
.wheel-spoke { stroke: rgba(155,123,255,.3); stroke-width: .8; }
.wheel-spoke.asc { stroke: var(--gold); stroke-width: 1.6; }
.wheel-glyph {
  font-size: 13px; fill: var(--gold-2);
  text-anchor: middle; dominant-baseline: middle; letter-spacing: 0;
}
.wheel-glyph.asc { fill: var(--gold); }
.wheel-marker { font-size: 15px; text-anchor: middle; dominant-baseline: middle; letter-spacing: 0; }
.wheel-marker.sun { fill: var(--gold); }
.wheel-marker.moon { fill: #cfd8ff; }
.wheel-marker.asc { fill: var(--purple); }

.big-three { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 22px; }
.big3-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(155,123,255,.25);
  border-radius: 16px; padding: 20px;
  animation: rise .45s ease both;
}
.big3-card:nth-child(2) { animation-delay: .12s; }
.big3-card:nth-child(3) { animation-delay: .24s; }
.big3-icon { font-size: 1.8rem; }
.big3-card h4 { font-family: "Playfair Display", serif; color: var(--gold); font-size: 1.35rem; margin: 6px 0; }
.big3-what { font-size: .8rem; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }

/* ===== Ma trận định mệnh ===== */
.matrix-wrap {
  display: flex; gap: clamp(20px, 4vw, 44px);
  align-items: flex-start; justify-content: center;
  flex-wrap: wrap; margin-top: 10px;
}
.matrix-chart { flex: 0 0 min(420px, 92vw); }
.matrix-svg { width: 100%; height: auto; }
.m-line { stroke: rgba(155,123,255,.3); stroke-width: .5; }
.m-node { cursor: pointer; }
.m-node:focus { outline: none; }
.m-node:focus .m-circle, .m-node:hover .m-circle {
  stroke: #fff; stroke-width: .8;
}
.m-circle {
  fill: rgba(20,16,42,.92);
  stroke: var(--purple); stroke-width: .6;
  transition: stroke .2s;
}
.m-circle.core { stroke: var(--gold); }
.m-circle.active { stroke: var(--gold); stroke-width: 1.1; fill: rgba(232,200,116,.15); }
.m-num {
  fill: var(--gold-2); font-size: 5.5px; font-weight: 700;
  text-anchor: middle; dominant-baseline: central;
  letter-spacing: 0;
  pointer-events: none; font-family: "Playfair Display", serif;
}
.matrix-detail { flex: 1 1 300px; max-width: 460px; }
.m-detail-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(232,200,116,.3);
  border-radius: 16px; padding: 20px 22px;
  animation: rise .35s ease both;
}
.m-detail-card h4 { font-family: "Playfair Display", serif; color: var(--gold); font-size: 1.3rem; margin: 5px 0 8px; }
.m-detail-card h4 small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.m-hint { font-size: .8rem; color: var(--purple); margin-bottom: 10px; }

/* ===== Solar Return ===== */
.solar-grid { display: grid; gap: 18px; margin: 20px 0; grid-template-columns: 1fr; }
@media (min-width: 760px) { .solar-grid { grid-template-columns: 1fr 1.2fr; } }
.solar-card { align-items: center; }
.tarot-card.mini { width: calc(var(--card-w) * .82); flex: 0 0 auto; }

/* ===== Compat meter ===== */
.compat-meter {
  height: 30px; border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(232,200,116,.3);
  overflow: hidden; margin-bottom: 6px;
}
.compat-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  color: #241a05; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  animation: fillIn .9s ease both;
}
@keyframes fillIn { from { width: 0; } }
.zodiac-btn.partner { border-color: #ff9dcf; background: rgba(255,157,207,.08); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .stars span, .daily-card { animation: none !important; }
  .tarot-card, .deck .tarot-card { transition: none; }
}

/* ===== Mặt lá Minor: pips & triều thần ===== */
.card-art {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; flex: 1;
}
.pips { font-size: calc(var(--card-w) * .16); line-height: 1.5; letter-spacing: 2px; }
.court-icon { font-size: calc(var(--card-w) * .4); line-height: 1.2; }
.sound-toggle.off { opacity: .55; }

/* ===== Responsive — mobile ===== */
html { -webkit-tap-highlight-color: transparent; }
@media (max-width: 760px) {
  :root { --card-w: clamp(72px, 22vw, 96px); }

  .site-header { padding: 10px 14px; gap: 10px; }
  .logo { font-size: 1.02rem; flex: 0 0 auto; }
  .site-header nav {
    gap: 14px; overflow-x: auto; max-width: 62vw;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { font-size: .8rem; white-space: nowrap; }
  .sound-toggle { width: 32px; height: 32px; font-size: .9rem; flex: 0 0 auto; }
  .nav-toggle { width: 32px; height: 32px; font-size: .9rem; }

  .hero { padding: 56px 18px 40px; }
  .hero h1 { font-size: clamp(2.1rem, 10vw, 3rem); }
  .hero-sub { font-size: .95rem; }
  .section { padding: 46px 14px; }
  .section-title { font-size: clamp(1.55rem, 7vw, 2.1rem); }
  .section-sub { font-size: .92rem; padding: 0 6px; }

  /* Quạt bài: xếp dày hơn cho vừa màn hẹp */
  .deck { padding: 14px 0 56px; overflow: visible; }
  .deck .tarot-card { margin: 0 calc(var(--card-w) * -0.44); }

  .spread-picker { flex-direction: column; align-items: center; }
  .spread-picker .btn { min-width: 0; width: min(320px, 92vw); }
  .question-box { flex-direction: column; align-items: stretch; padding: 0 8px; }
  .question-box .btn { align-self: center; }
  .yesno-controls { flex-direction: column; align-items: stretch; }

  .form-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-row label { min-width: 0; width: 100%; }
  .form-card { padding: 18px 16px; }

  .daily-wrap { gap: 20px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .g-desc { font-size: .78rem; }

  .guide { margin: 0 4px; }
  .guide ol { padding-left: 20px; }
  .result-card, .num-card, .big3-card { padding: 18px 16px; }
  .picked-cards { gap: 12px; }
  .reveal-actions { flex-wrap: wrap; }
  .num-grid { grid-template-columns: 1fr; }
  .matrix-wrap { gap: 18px; }
  .matrix-chart { flex-basis: min(340px, 94vw); }
  .journal { margin: 0 4px; }
  .yesno-box { margin: 0 4px; }
}
@media (max-width: 380px) {
  .games-grid { grid-template-columns: 1fr; }
  .site-header nav { max-width: 58vw; }
}

/* ===== Header controls + hamburger ===== */
.header-ctl { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none;
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  border: 1px solid rgba(232,200,116,.4); background: rgba(255,255,255,.05);
  color: var(--gold-2); font-size: 1rem; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.nav-toggle:hover { border-color: var(--gold); background: rgba(232,200,116,.12); }

/* Nút về trang chủ nổi (trang game) */
.home-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #231a05; font-size: 1.5rem; line-height: 1; text-decoration: none;
  box-shadow: 0 8px 26px rgba(232,200,116,.4), 0 0 0 4px rgba(11,8,23,.5);
  transition: transform .2s, box-shadow .2s;
}
.home-fab:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 14px 34px rgba(232,200,116,.55); }

/* Chống tràn ngang toàn trang */
body { overflow-x: hidden; }

@media (max-width: 760px) {
  .site-header { position: sticky; }
  .nav-toggle { display: flex; }
  .site-header nav {
    position: absolute; top: 100%; right: 10px;
    flex-direction: column; align-items: stretch;
    min-width: 190px; padding: 12px 14px; gap: 2px;
    background: rgba(14,10,30,.97);
    border: 1px solid rgba(232,200,116,.35);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,.65);
    display: none; z-index: 60;
    overflow-x: visible; max-width: none;
  }
  .site-header.nav-open nav { display: flex; }
  .site-header nav a {
    padding: 10px 12px; border-radius: 9px; font-size: .92rem !important;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }
  .site-header nav a:last-child { border-bottom: none; }
  .site-header nav a:hover { background: rgba(232,200,116,.1); }

  /* Quạt bài xếp dày hơn nữa — hết tràn */
  .deck .tarot-card { margin: 0 calc(var(--card-w) * -0.5); }
  .deck { overflow-x: clip; }
}
@media (min-width: 761px) {
  .site-header nav { overflow-x: visible; }
}
