/**
 * BIN TỬ VI — Hệ Thống Đồ Họa Động (Hero SVGs, Lá Số Tử Vi Tương Tác, Vòng Điểm Số & Hiệu Ứng Kết Quả)
 */

/* ===== 1. HERO AMBIENT LIGHT SWEEP, BỤI VÀNG & CHUYỂN ĐỘNG SVG ===== */
.tool-hero {
  position: relative;
  overflow: hidden;
}
.tool-hero::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(115deg, transparent 42%, rgba(201, 154, 75, 0.085) 50%, transparent 58%);
  transform: translateX(-45%);
  animation: heroLightSweep 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroLightSweep {
  0%, 100% { transform: translateX(-45%); }
  50% { transform: translateX(45%); }
}

.th-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.th-dust i {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 154, 75, 0.85), rgba(201, 154, 75, 0));
  animation-name: heroDustRise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes heroDustRise {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  20% { opacity: 0.72; }
  80% { opacity: 0.48; }
  100% { transform: translateY(-420px) translateX(18px) scale(1.25); opacity: 0; }
}

.th-chip {
  animation: heroChipIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes heroChipIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.th-cta-arr {
  display: inline-block;
  animation: heroCtaBounce 1.8s ease-in-out infinite;
}
@keyframes heroCtaBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3.5px); }
}

/* Bộ SVG động bên phải Hero (.ha-svg) */
.th-art {
  width: min(100%, 400px);
}
.ha-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.ha-ring-outer { fill: none; stroke: var(--vien); stroke-width: 1.2; }
.ha-ring-inner { fill: none; stroke: var(--vien-mo); stroke-width: 1; }
.ha-ring-dash { fill: none; stroke: rgba(var(--kim-rgb), 0.45); stroke-width: 1.1; stroke-dasharray: 1.5 7; transform-origin: 200px 200px; }
.ha-line { stroke: var(--vien-mo); stroke-width: 1; }
.ha-han-sm { font: 600 18px var(--font-han); fill: var(--kim-chu, #8a6326); }
html[data-theme="dark"] .ha-han-sm { fill: var(--kim-sang); }
.ha-zodiac-sym { font-size: 20px; fill: var(--kim-chu, #8a6326); }
html[data-theme="dark"] .ha-zodiac-sym { fill: var(--kim-sang); }

.ha-spin-slow { transform-origin: 200px 200px; animation: haSpin 96s linear infinite; }
.ha-spin-rev { transform-origin: 200px 200px; animation: haSpinRev 72s linear infinite; }
@keyframes haSpin { to { transform: rotate(360deg); } }
@keyframes haSpinRev { to { transform: rotate(-360deg); } }

.ha-tri {
  fill: none;
  stroke-width: 1.65;
  stroke-dasharray: 760;
  stroke-dashoffset: 760;
  animation: haDrawTri 6.5s ease-in-out infinite;
}
.ha-tri-red { stroke: #9a2a1e; }
html[data-theme="dark"] .ha-tri-red { stroke: #e06c5c; }
.ha-tri-jade { stroke: #2f7a59; animation-delay: 3.25s; }
html[data-theme="dark"] .ha-tri-jade { stroke: #55b88c; }
@keyframes haDrawTri {
  0% { stroke-dashoffset: 760; opacity: 0.25; }
  38%, 62% { stroke-dashoffset: 0; opacity: 0.92; }
  100% { stroke-dashoffset: -760; opacity: 0.25; }
}

.ha-breathe { transform-origin: 200px 200px; animation: haBreathe 4.6s ease-in-out infinite; }
@keyframes haBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.ha-core-fill { fill: rgba(var(--kim-rgb), 0.12); }
.ha-core-stroke { fill: none; stroke: rgba(var(--kim-rgb), 0.55); stroke-width: 1.3; }
.ha-core-han { font: 600 58px var(--font-han); fill: #9a2a1e; }
html[data-theme="dark"] .ha-core-han { fill: var(--kim-sang); }

.ha-star-dot { fill: var(--kim); animation: haPulseDot 2.2s ease-in-out infinite; }
@keyframes haPulseDot { 0%, 100% { opacity: 0.45; r: 3.5; } 50% { opacity: 1; r: 6; } }

/* Lịch vạn niên Moon Orbs */
.ha-moon-dark { fill: rgba(var(--kim-rgb), 0.14); }
.ha-moon-lit { fill: #b3843a; }
html[data-theme="dark"] .ha-moon-lit { fill: #e8c878; }
.ha-moon-rim { fill: none; stroke: rgba(var(--kim-rgb), 0.45); stroke-width: 1; }
.ha-moon-orb { transform-box: fill-box; transform-origin: center; animation: haOrbPulse 4s ease-in-out infinite; }
@keyframes haOrbPulse { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; transform: scale(1.08); } }
.ha-caption { font-size: 11.5px; fill: var(--chu-2); letter-spacing: 0.04em; }

/* Phong thủy Compass */
.ha-bagua { font-size: 24px; fill: var(--kim-chu, #7a571c); }
html[data-theme="dark"] .ha-bagua { fill: var(--kim-sang); }
.ha-dir { font: 600 13px var(--font-display); fill: var(--chu-2); }
.ha-needle { transform-origin: 200px 200px; animation: haCompassSwing 5.5s ease-in-out infinite; }
@keyframes haCompassSwing {
  0%, 100% { transform: rotate(-14deg); }
  45% { transform: rotate(18deg); }
  75% { transform: rotate(-5deg); }
}

/* Thần số học 3x3 Hero */
.ha-num-box { fill: var(--surface-card); stroke: var(--vien-mo); stroke-width: 1.1; }
.ha-num-box.is-hi { stroke: rgba(var(--kim-rgb), 0.55); }
.ha-num-txt { font: 400 30px var(--font-display); fill: var(--kim-chu, #7a571c); }
html[data-theme="dark"] .ha-num-txt { fill: var(--kim-sang); }
.ha-num-txt.is-red { fill: #9a2a1e; font-weight: 700; }
.ha-arrow-line {
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: haArrowSweep 5.2s ease-in-out infinite;
}
.ha-arrow-red { stroke: #9a2a1e; }
.ha-arrow-jade { stroke: #2f7a59; animation-delay: 2.6s; }
@keyframes haArrowSweep {
  0% { stroke-dashoffset: 240; opacity: 0.2; }
  35%, 65% { stroke-dashoffset: 0; opacity: 0.95; }
  100% { stroke-dashoffset: -240; opacity: 0.2; }
}

/* Ma trận Arcana Orbs */
.ha-arcana-circle { fill: var(--surface-card); stroke: var(--vien); stroke-width: 1.1; }
.ha-arcana-txt { font: 400 18px var(--font-display); fill: var(--chu); }
.ha-arcana-node { transform-box: fill-box; transform-origin: center; animation: haOrbPulse 3.6s ease-in-out infinite; }

/* Tarot 3 Cards Fan */
.ha-tcard { fill: var(--surface-card); stroke: #b3843a; stroke-width: 1.4; }
.ha-tcard-in { fill: none; stroke: rgba(var(--kim-rgb), 0.35); stroke-width: 1; }
.ha-card { transform-origin: 200px 260px; }
.ha-card-l { transform: rotate(-18deg); animation: haFanL 4.8s ease-in-out infinite; }
.ha-card-r { transform: rotate(18deg); animation: haFanR 4.8s ease-in-out infinite; }
.ha-card-c { animation: haFloatC 4.8s ease-in-out infinite; }
@keyframes haFanL { 0%, 100% { transform: rotate(-18deg) translateY(0); } 50% { transform: rotate(-23deg) translateY(-6px); } }
@keyframes haFanR { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(23deg) translateY(-6px); } }
@keyframes haFloatC { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* Kinh Dịch & Khói Hương */
.ha-hao { fill: #b3843a; animation: haHaoGlow 3s ease-in-out infinite; }
html[data-theme="dark"] .ha-hao { fill: #e8c878; }
@keyframes haHaoGlow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.ha-smoke { fill: none; stroke: rgba(var(--kim-rgb), 0.55); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 140; animation: haSmokeRise 4s ease-in-out infinite; }
@keyframes haSmokeRise { 0% { stroke-dashoffset: 140; opacity: 0; } 45% { opacity: 0.8; } 100% { stroke-dashoffset: -140; opacity: 0; } }

/* Dừng chuyển động khi Hero khuất khỏi màn hình */
.tool-hero.is-paused *,
.tool-hero.is-paused::after {
  animation-play-state: paused !important;
}
@media (max-width: 860px) {
  .th-art { display: grid !important; width: min(68%, 230px); order: 0; margin: 4px auto 0; }
}

/* ===== 2. LÁ SỐ TỬ VI: TIA CHIẾU SVG, THANH LỌC SAO, RADAR & ĐẠI HẠN ===== */
.tuvi-ctrl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--vien);
  background: var(--surface-card);
}
.tuvi-star-filters, .tuvi-year-ctrl, .tuvi-grp-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.tv-flt-btn, .tv-yr-btn, .tv-grp-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--vien-mo);
  background: transparent;
  color: var(--chu-2);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.tv-flt-btn:hover, .tv-yr-btn:hover, .tv-grp-btn:hover { border-color: var(--kim); color: var(--chu); }
.tv-flt-btn.is-active, .tv-grp-btn.is-active {
  background: var(--nen-kim);
  border-color: var(--nen-kim);
  color: var(--chu-tren-kim);
  font-weight: 600;
}
.tv-yr-cur { font-size: 0.85rem; padding: 0 8px; color: var(--chu); }
.tuvi-hoa-pill { font-size: 9.5px; border: 1px solid currentColor; padding: 0 4px; border-radius: 2px; }

/* Chế độ lọc sao trên lá số */
.tuvi-board[data-filter="main"] .tuvi-sub-stars { opacity: 0.16; transition: opacity 0.25s; }
.tuvi-board[data-filter="cat"] .sub-sat-row,
.tuvi-board[data-filter="cat"] .tuvi-main-stars { opacity: 0.25; transition: opacity 0.25s; }
.tuvi-board[data-filter="sat"] .sub-cat-row,
.tuvi-board[data-filter="sat"] .tuvi-main-stars { opacity: 0.25; transition: opacity 0.25s; }

/* Sân khấu lá số + lớp phủ SVG tia chiếu Tam Phương Tứ Chính */
.tuvi-board-stage {
  position: relative;
}
.tuvi-ray-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.tuvi-center { position: relative; z-index: 3; }
.tuvi-center-inner {
  position: relative;
  z-index: 4;
  background: rgba(251, 250, 246, 0.94);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.tv-ray-tamhop {
  fill: rgba(201, 154, 75, 0.06);
  stroke: #b3843a;
  stroke-width: 1.8;
  stroke-dasharray: 6 5;
  animation: tvRayDash 18s linear infinite;
}
.tv-ray-xung {
  stroke: #9a2a1e;
  stroke-width: 2;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: tvRayDraw 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.tv-ray-node {
  fill: #9a2a1e;
  stroke: #fff;
  stroke-width: 1.5;
}
.tv-ray-node.is-th { fill: #c99a4b; }
@keyframes tvRayDash { to { stroke-dashoffset: -220; } }
@keyframes tvRayDraw { to { stroke-dashoffset: 0; } }

/* Biểu đồ Radar 5 Phương Diện */
.tv-radar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tv-avg-badge {
  text-align: center;
  padding: 8px 18px;
  border: 1px solid var(--kim);
  background: rgba(var(--kim-rgb), 0.08);
}
.tv-avg-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--kim-chu, #9a2a1e);
  font-weight: 700;
}
html[data-theme="dark"] .tv-avg-num { color: var(--kim-sang); }
.tv-avg-badge small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--chu-2); }

.tv-radar-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.tv-radar-svg { width: 100%; max-width: 270px; margin: 0 auto; display: block; overflow: visible; }
.tv-radar-grid { fill: none; stroke: var(--vien-mo); stroke-width: 1; }
.tv-radar-spoke { stroke: var(--vien-mo); stroke-width: 1; stroke-dasharray: 2 3; }
.tv-radar-lbl { font-size: 10.5px; fill: var(--chu-2); font-weight: 500; }
.tv-radar-shape {
  fill: rgba(154, 42, 30, 0.18);
  stroke: #9a2a1e;
  stroke-width: 2;
  transform-origin: 140px 142px;
  animation: radarBloom 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html[data-theme="dark"] .tv-radar-shape {
  fill: rgba(201, 154, 75, 0.22);
  stroke: var(--kim-sang);
}
.tv-radar-dot { fill: #9a2a1e; stroke: #fff; stroke-width: 1.5; animation: radarBloom 0.8s ease both; }
html[data-theme="dark"] .tv-radar-dot { fill: var(--kim-sang); }
@keyframes radarBloom {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}

.tv-meters { display: grid; gap: 13px; }
.tv-meter-head { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 5px; }
.tv-meter-head small { color: var(--chu-3); font-weight: 400; }
.tv-meter-head b { font-family: var(--font-display); font-size: 1.05rem; color: var(--kim-chu, #9a2a1e); }
html[data-theme="dark"] .tv-meter-head b { color: var(--kim-sang); }
.tv-meter-track { height: 8px; background: rgba(var(--kim-rgb), 0.14); border-radius: 999px; overflow: hidden; }
.tv-meter-fill {
  display: block;
  height: 100%;
  width: var(--w, 70%);
  background: linear-gradient(90deg, #9a2a1e, #c99a4b);
  border-radius: 999px;
  transform-origin: 0 50%;
  animation: barGrowX 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes barGrowX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Lộ trình 9 Đại hạn tương tác */
.tv-dh-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 10px;
}
.tv-dh-step {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--vien-mo);
  background: rgba(var(--kim-rgb), 0.03);
  color: var(--chu);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tv-dh-step:hover { transform: translateY(-2px); border-color: var(--kim); }
.tv-dh-step.is-current {
  border-color: #9a2a1e;
  background: rgba(154, 42, 30, 0.07);
  box-shadow: 0 10px 24px -16px rgba(154, 42, 30, 0.6);
}
html[data-theme="dark"] .tv-dh-step.is-current {
  border-color: var(--kim);
  background: rgba(201, 154, 75, 0.12);
}
.tv-dh-age { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--chu-3); }
.tv-dh-palace { font-family: var(--font-display); font-size: 1.12rem; }
.tv-dh-canchi { font-size: 0.78rem; color: var(--chu-2); }
.tv-dh-stars { font-size: 0.8rem; color: var(--kim-chu, #7a571c); margin-top: 2px; }
html[data-theme="dark"] .tv-dh-stars { color: var(--kim-sang); }
.tv-dh-now { font-style: normal; font-size: 0.72rem; font-weight: 700; color: #9a2a1e; margin-top: 4px; }
html[data-theme="dark"] .tv-dh-now { color: #f6e3a6; }

/* Hộp căn cứ an sao */
.tuvi-proof-sum {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 1.02rem;
}
.tuvi-proof-sum::-webkit-details-marker { display: none; }
.tuvi-proof-sum small { color: var(--chu-2); font-weight: 400; margin-left: 6px; }
.tuvi-proof-icon { font-size: 1.3rem; color: var(--kim); transition: transform 0.25s; }
details[open] .tuvi-proof-icon { transform: rotate(45deg); }
.tuvi-proof-body { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--vien); }
.tuvi-proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tuvi-proof-grid small { display: block; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--kim-chu, var(--kim)); margin-bottom: 4px; font-weight: 600; }
.tuvi-proof-grid p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: var(--chu-2); }

.tuvi-readings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2rem 0 1rem;
}

@media (max-width: 860px) {
  .tv-radar-layout, .tuvi-proof-grid { grid-template-columns: minmax(0, 1fr); }
  .tv-dh-rail { display: flex; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .tv-dh-step { min-width: 172px; flex-shrink: 0; }
}

/* ===== 3. HIỆU ỨNG KẾT QUẢ TOÀN TRANG (SCORE GAUGE, MŨI TÊN 3X3, XU DỊCH, LẬT BÀI TAROT, NGHI THỨC LẬP BÀN) ===== */

/* Vòng tròn điểm số động (SVG Score Ring) */
.anim-ring-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}
.anim-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.anim-ring-bg { fill: none; stroke: rgba(var(--kim-rgb), 0.16); stroke-width: 6; }
.anim-ring-fg {
  fill: none;
  stroke: var(--ring-col, #c99a4b);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: var(--ring-off, 289);
  transition: stroke-dashoffset 1.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Mũi tên SVG vẽ trực tiếp trên 3 biểu đồ 3×3 Thần số học */
.tsh-chart-box .num-grid-3 { position: relative; }
.tsh-grid-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.tsh-arr-line {
  stroke: #9a2a1e;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.72;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: tvRayDraw 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}
html[data-theme="dark"] .tsh-arr-line { stroke: #f6e3a6; }

/* Hào quang xoay quanh Số Chủ Đạo */
.tsh-hero-num-wrap { position: relative; }
.tsh-hero-num-wrap::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--kim-rgb), 0.5);
  animation: haSpin 28s linear infinite;
  pointer-events: none;
}

/* Kinh Dịch: 3 đồng xu cổ xoay & 6 hào hiện từ dưới lên */
.iching-coins { display: flex; gap: 14px; margin-bottom: 14px; }
.ic-coin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6e3a6, #b3843a 65%, #6f4f1d);
  border: 1.5px solid #fbe9c9;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.55);
  animation: coinFlipIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ic-coin i { width: 11px; height: 11px; border: 1.5px solid #5c3f14; background: var(--surface-card); }
@keyframes coinFlipIn {
  0% { opacity: 0; transform: rotateY(540deg) translateY(-18px) scale(0.7); }
  100% { opacity: 1; transform: none; }
}
.iching-hao-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  animation: haoRiseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.iching-hao-lbl { width: 50px; font-size: 11.5px; opacity: 0.78; }
.iching-bar { width: 170px; height: 11px; }
.iching-bar.yang { background: linear-gradient(90deg, #b3843a, #e8c878); border-radius: 2px; }
.iching-bar.yang.mov { background: linear-gradient(90deg, #9a2a1e, #d9534f); box-shadow: 0 0 12px rgba(217, 83, 79, 0.45); }
.iching-bar.yin { display: flex; justify-content: space-between; }
.iching-bar.yin span { width: 74px; height: 11px; background: linear-gradient(90deg, #b3843a, #e8c878); border-radius: 2px; }
.iching-bar.yin.mov span { background: linear-gradient(90deg, #9a2a1e, #d9534f); box-shadow: 0 0 12px rgba(217, 83, 79, 0.45); }
.iching-hao-state { font-size: 11.5px; color: var(--chu-2); }
.iching-hao-row.is-moving .iching-hao-state { color: #d9534f; font-weight: 700; }
@keyframes haoRiseIn {
  from { opacity: 0; transform: translateY(10px) scaleX(0.85); }
  to { opacity: 1; transform: none; }
}

/* Ống xăm lắc nhẹ */
.xam-tube {
  width: 68px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 8px 8px 18px 18px;
  background: linear-gradient(135deg, #8a6326, #c99a4b 50%, #5c3f14);
  border: 1.5px solid #f6e3a6;
  position: relative;
  animation: xamShake 0.75s ease-in-out 2;
}
.xam-stick {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 7px;
  background: #fbe9c9;
  border: 1px solid #9a2a1e;
  color: #9a2a1e;
  font: 700 12px var(--font-han);
  border-radius: 3px 3px 0 0;
  animation: stickPop 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}
@keyframes xamShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  75% { transform: rotate(9deg); }
}
@keyframes stickPop {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Lá bài Tarot / Tây / Lenormand lật mở 3D */
.pc-tcard, .card-flip-in {
  animation: tarotCardFlip 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-style: preserve-3d;
}
@keyframes tarotCardFlip {
  0% { opacity: 0; transform: perspective(700px) rotateY(-85deg) translateY(14px); }
  100% { opacity: 1; transform: perspective(700px) rotateY(0) translateY(0); }
}

/* Hộp nghi thức 3 bước khi bấm Lập lá số / Xem kết quả */
.casting-ritual-box {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--kim);
  background: rgba(var(--kim-rgb), 0.08);
  display: grid;
  gap: 8px;
  animation: heroChipIn 0.25s ease both;
}
.ritual-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--chu-3);
  transition: color 0.2s;
}
.ritual-step i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--vien);
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
}
.ritual-step.is-doing { color: var(--chu); font-weight: 600; }
.ritual-step.is-doing i { border-color: var(--kim); border-top-color: transparent; animation: haSpin 0.7s linear infinite; }
.ritual-step.is-done { color: #2f7a59; }
html[data-theme="dark"] .ritual-step.is-done { color: #55b88c; }
.ritual-step.is-done i { border-color: currentColor; background: rgba(47, 122, 89, 0.15); }

@media (prefers-reduced-motion: reduce) {
  .tool-hero::after, .th-dust, .ha-spin-slow, .ha-spin-rev, .ha-tri, .ha-breathe, .ha-needle, .ha-arrow-line { animation: none !important; }
}
