:root {
  --bg: #050506;
  --panel: #111216;
  --gold: #c9ccd1;
  --gold-soft: #f3f4f6;
  --red: #3a3a3f;
  --red-soft: #7b7f89;
  --text: #eceef2;
  --muted: #b6bac2;
  --line: #3b3f48;
  --ink: #101116;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Serif SC", "STKaiti", "Songti SC", serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.09), transparent 42%),
    radial-gradient(circle at 84% 14%, rgba(222, 226, 235, 0.08), transparent 36%),
    radial-gradient(circle at 52% 100%, rgba(18, 20, 25, 0.82), transparent 54%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 32%),
    repeating-linear-gradient(
      -24deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 2px,
      transparent 2px,
      transparent 12px
    ),
    var(--bg);
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  opacity: 0.22;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 28px rgba(240, 242, 246, 0.13));
}

body::before {
  width: 360px;
  height: 360px;
  left: -84px;
  top: -70px;
  background-image: url("../assets/taiji-mono.svg");
  animation: mystic-rotate-a 40s linear infinite;
}

body::after {
  width: 530px;
  height: 530px;
  right: -162px;
  bottom: -162px;
  opacity: 0.43;
  background-image: url("../assets/bagua-mono.svg");
  filter: drop-shadow(0 0 38px rgba(242, 244, 248, 0.24)) brightness(1.16) contrast(1.1);
  animation: mystic-rotate-b 58s linear infinite;
}

@keyframes mystic-rotate-a {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(6px) rotate(90deg); }
  50% { transform: translateY(12px) rotate(180deg); }
  75% { transform: translateY(6px) rotate(270deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

@keyframes mystic-rotate-b {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-90deg); }
  50% { transform: translateY(-12px) rotate(-180deg); }
  75% { transform: translateY(-6px) rotate(-270deg); }
  100% { transform: translateY(0) rotate(-360deg); }
}

.container {
  position: relative;
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 20px 0 48px;
}

.container::before {
  content: "";
  position: absolute;
  inset: 120px 0 auto;
  height: 620px;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 18%, rgba(243, 244, 246, 0.08), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(136, 142, 155, 0.12), transparent 44%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.025) 48%, transparent 100%);
  z-index: -1;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}

.header-right {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  color: var(--gold-soft);
  font-size: 1.2rem;
  letter-spacing: 1.4px;
  text-shadow: 0 0 16px rgba(243, 244, 246, 0.26);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
  background:
    linear-gradient(145deg, rgba(29, 31, 38, 0.84), rgba(12, 13, 17, 0.94));
  box-shadow: inset 0 0 0 1px rgba(233, 236, 241, 0.12);
  transition: all 0.24s ease;
}

.nav-auth-btn {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
  background: linear-gradient(145deg, rgba(29, 31, 38, 0.84), rgba(12, 13, 17, 0.94));
  box-shadow: inset 0 0 0 1px rgba(233, 236, 241, 0.12);
  cursor: pointer;
  transition: all 0.24s ease;
  width: auto;
  margin-top: 0;
}

.nav-auth-btn:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(243, 244, 246, 0.28);
}

.top-user-badge {
  color: var(--gold-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  background: linear-gradient(145deg, rgba(31, 44, 36, 0.84), rgba(12, 20, 16, 0.94));
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav a:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(243, 244, 246, 0.28);
}

.auth-box {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background:
    linear-gradient(145deg, rgba(23, 25, 32, 0.9), rgba(12, 13, 17, 0.95));
  box-shadow: inset 0 0 0 1px rgba(232, 235, 240, 0.1);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-btn {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.auth-email {
  color: var(--gold-soft);
  font-size: 0.84rem;
}

.auth-usage {
  display: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(28, 22, 16, 0.96), rgba(10, 9, 8, 0.98));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.auth-switch-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-switch-btn {
  min-width: 112px;
}

.auth-actions {
  justify-content: flex-end;
}

.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.auth-code-row input {
  min-width: 0;
}

.hero,
.card,
.result,
.about-box {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(23, 25, 30, 0.88), rgba(11, 12, 16, 0.95));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(226, 230, 238, 0.08);
}

.hero::before,
.card::before,
.result::before,
.about-box::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(243, 244, 246, 0.65), transparent);
  pointer-events: none;
}

.hero {
  padding: 24px;
  margin-top: 16px;
}

.hero h1 {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  text-shadow: 0 0 18px rgba(240, 243, 247, 0.2);
  letter-spacing: 0.4px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-intro {
  margin-top: 14px;
  font-size: 0.95rem;
  color: #c8ccd4;
  line-height: 1.95;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 16px;
  width: 100%;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 246px;
  height: 100%;
}

.card h3 {
  margin: 0 0 8px;
  color: var(--gold-soft);
  letter-spacing: 0.4px;
}

.card h3 .price-tag {
  font-size: 0.8em;
  color: #cfd3dc;
  font-weight: 600;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
  flex-grow: 1;
}

.btn {
  border: 1px solid #8d929d;
  color: #090a0d;
  background: linear-gradient(140deg, #f0f2f6, #c5cad3);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  filter: saturate(1.05);
}

.btn.secondary {
  color: var(--text);
  background: linear-gradient(145deg, #2a2d35, #11131a);
  border-color: var(--line);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  background: linear-gradient(180deg, #151821, #0f1118);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(214, 168, 77, 0.18);
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card .actions {
  justify-content: center;
  margin-top: auto;
}

/* Homepage: free cards button slightly higher for better visual balance */
.free-services-grid .card p {
  flex-grow: 0;
  margin-bottom: 8px;
}

.free-services-grid .card .actions {
  margin-top: 8px;
}

/* Homepage: paid cards compact layout with inline "Paid: $XX" tag */
.paid-services-grid .paid-service-card {
  min-height: 232px;
}

.paid-services-grid .service-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.paid-services-grid .service-title {
  flex: 1 1 auto;
  min-width: 0;
}

.paid-services-grid .service-paid-tag {
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: #d6e59b;
  white-space: nowrap;
}

.paid-services-grid ul.clean {
  margin-top: 4px;
  margin-bottom: 0;
  flex-grow: 0;
}

.paid-services-grid .card .actions {
  margin-top: 10px;
}

.result {
  margin-top: 16px;
  padding: 18px;
  line-height: 1.8;
  background:
    linear-gradient(145deg, rgba(27, 29, 35, 0.93), rgba(11, 12, 16, 0.96));
}

.report-key-title {
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--gold-soft);
}

.report-email-row {
  margin-top: 12px;
}

.report-email-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d8ac5a;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(145deg, rgba(49, 38, 18, 0.95), rgba(20, 15, 6, 0.95));
  color: #f6ddb1;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.report-email-send-btn:hover {
  filter: brightness(1.08);
}

.report-email-send-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.report-email-note {
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

.hexagram {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.line-yang,
.line-yin {
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
}

.line-yin {
  background: linear-gradient(to right, var(--gold) 0 42%, transparent 42% 58%, var(--gold) 58% 100%);
}

.package-price {
  color: var(--gold-soft);
  font-size: 1.7rem;
  margin: 8px 0;
}

.muted {
  color: var(--muted);
}

ul.clean {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.footer {
  margin-top: 26px;
  color: #a9aeb8;
  font-size: 0.88rem;
  text-align: center;
  letter-spacing: 0.4px;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.footer-links a {
  color: var(--gold-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 244, 246, 0.35);
  padding-bottom: 1px;
}

.footer-links a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.78);
}

.legal-note {
  margin-top: 8px;
  color: #a8aeb9;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Compact Taiji checkout skin: style only, no behavior changes */
.checkout-page .container {
  width: min(1180px, 97vw);
  padding: 8px 0 10px;
}

.checkout-page .header {
  padding: 8px 0;
}

.checkout-page .nav {
  gap: 6px;
}

.checkout-page .nav a {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.checkout-page .hero {
  margin-top: 8px;
  padding: 12px 14px;
}

.checkout-page .hero {
  display: none;
}

.checkout-page .hero h1 {
  margin-bottom: 6px;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
}

.checkout-page .hero p {
  line-height: 1.35;
  font-size: 0.86rem;
}

.checkout-page .hero .actions {
  margin-top: 8px;
}

.checkout-page .card {
  min-height: 0;
}

.checkout-page section.card {
  margin-top: 8px !important;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(248, 250, 255, 0.06), transparent 56%),
    linear-gradient(145deg, rgba(20, 22, 28, 0.95), rgba(8, 9, 12, 0.98));
}

.checkout-page section.card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 25%, #111 0 7px, transparent 7px),
    radial-gradient(circle at 50% 75%, #f2f4f8 0 7px, transparent 7px),
    linear-gradient(180deg, #f2f4f8 0 50%, #0f1013 50% 100%);
  border: 1px solid rgba(210, 215, 224, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  opacity: 0.9;
  pointer-events: none;
}

.checkout-page section.card h3 {
  margin: 4px 0 4px;
  font-size: 0.92rem;
  line-height: 1.2;
}

.checkout-page section.card p.muted {
  margin: 0;
  line-height: 1.25;
  font-size: 0.78rem;
}

.checkout-page .form-grid {
  margin-top: 8px;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkout-page label {
  gap: 4px;
  font-size: 0.76rem;
}

.checkout-page input,
.checkout-page select,
.checkout-page textarea {
  padding: 7px 9px;
  min-height: 34px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.checkout-page hr {
  margin: 8px 0 !important;
}

.checkout-page .actions {
  margin-top: 7px;
  gap: 8px;
  align-items: center;
}

.checkout-page .btn {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.1;
}

.checkout-page button[data-method] {
  color: #eef1f6;
  background: linear-gradient(145deg, #23262f, #0f1218);
  border-color: #4a505d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.checkout-page button[data-method]:hover {
  filter: brightness(1.08);
}

.checkout-page #paypal-checkout-btn,
.checkout-page #stripe-checkout-btn,
.checkout-page #create-order-btn,
.checkout-page #submit-order-btn,
.checkout-page #copy-address-btn,
.checkout-page #copy-amount-btn,
.checkout-page #verify-payment-btn,
.checkout-page #check-status-btn {
  color: #eef1f6;
  background: linear-gradient(145deg, #23262f, #0f1218);
  border-color: #4a505d;
}

.checkout-page #payment-panel {
  margin-top: 8px !important;
  padding: 10px 12px;
  line-height: 1.45;
}

.checkout-page #payment-panel > div,
.checkout-page #payment-panel label {
  font-size: 0.8rem;
}

.checkout-page .checkout-split {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1.55fr 0.65fr;
  gap: 10px;
  align-items: start;
}

.checkout-page .checkout-left,
.checkout-page .checkout-right {
  display: grid;
  gap: 8px;
}

.checkout-page .checkout-right {
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.checkout-page .checkout-method-block {
  border: 1px solid rgba(210, 215, 224, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(145deg, rgba(24, 26, 33, 0.88), rgba(10, 12, 16, 0.92));
}

.checkout-page .checkout-method-block h3 {
  margin-top: 0 !important;
}

.checkout-page .checkout-crypto-block {
  padding: 8px 9px;
}

.checkout-page .checkout-crypto-block .actions {
  gap: 6px;
}

.checkout-page .checkout-crypto-block .btn {
  padding: 6px 9px;
  font-size: 0.78rem;
}

.checkout-page .footer {
  margin-top: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.2px;
}

.checkout-page .footer-links {
  margin-top: 4px;
  gap: 8px;
}

.checkout-page .legal-note {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.3;
}

@media (max-height: 900px) and (min-width: 1024px) {
  .checkout-page .container {
    transform: scale(0.9);
    transform-origin: top center;
    width: min(1280px, 108vw);
  }
}

@media (max-width: 900px) {
  .checkout-page .form-grid {
    grid-template-columns: 1fr;
  }

  .checkout-page .checkout-split {
    grid-template-columns: 1fr;
  }

  .checkout-page section.card::after {
    width: 36px;
    height: 36px;
  }
}

.stripe-pay-page .container {
  width: min(760px, 96vw);
}

.stripe-pay-page .card {
  padding: 16px;
}

.stripe-apple-wrap {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(24, 26, 31, 0.9), rgba(9, 10, 13, 0.95));
}

/* === Three Stripe Payment Method Buttons === */
.stripe-method-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.stripe-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 6px;
  border: 1px solid #4a505d;
  border-radius: 9px;
  background: linear-gradient(145deg, #23262f, #0f1218);
  color: #eef1f6;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, filter 0.18s;
  min-height: 52px;
  text-align: center;
  box-sizing: border-box;
}

.stripe-method-btn:hover {
  filter: brightness(1.12);
  border-color: #8d92a0;
}

.stripe-method-btn.active {
  border-color: #d8ac5a;
  box-shadow: 0 0 0 2px rgba(216, 172, 90, 0.35) inset;
  filter: brightness(1.08);
  color: #f5d98a;
}

.sm-icon {
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
}

.sm-label {
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}
/* === End Stripe Method Buttons === */

.stripe-divider {
  height: 1px;
  margin: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

#stripe-payment-element {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(9, 11, 15, 0.58);
}

.legal-layout {
  margin-top: 16px;
  padding: 22px;
}

.legal-layout h1 {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
}

.legal-updated {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-layout h2 {
  margin: 16px 0 8px;
  color: #e5e8ee;
  font-size: 1.05rem;
}

.legal-layout p,
.legal-layout li {
  color: var(--muted);
  line-height: 1.72;
}

.legal-layout ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.contact-form {
  margin-top: 14px;
}

.bazi-scene {
  padding-top: 8px;
}

.bazi-compass-wrap {
  width: 190px;
  height: 190px;
  margin: 0 auto;
  position: relative;
  display: grid;
  place-items: center;
}

.bazi-compass {
  width: 170px;
  height: 170px;
  border-radius: 999px;
  border: 2px solid #d7be84;
  background:
    radial-gradient(circle at 50% 50%, rgba(12, 12, 14, 0.6) 0 26%, transparent 27%),
    repeating-conic-gradient(from 0deg, rgba(219, 191, 128, 0.84) 0deg 5deg, rgba(72, 49, 26, 0.72) 5deg 10deg);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.45), inset 0 0 24px rgba(255, 227, 160, 0.12);
}

.bazi-compass.spin {
  animation: compass-spin 2.6s cubic-bezier(0.24, 0.82, 0.2, 1) forwards;
}

.bazi-core {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid rgba(252, 229, 173, 0.85);
  background: radial-gradient(circle at 35% 35%, #f8e6b8, #8f6427);
  box-shadow: 0 0 18px rgba(255, 214, 130, 0.45);
}

.bazi-pillars {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.bazi-pillars.reveal {
  opacity: 1;
  transform: translateY(0);
}

.pillar {
  text-align: center;
  border: 1px solid rgba(212, 190, 145, 0.5);
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 0.82rem;
  color: #f0e3c6;
  background: linear-gradient(180deg, rgba(50, 26, 18, 0.8), rgba(21, 14, 11, 0.86));
  letter-spacing: 0.4px;
}

.fortune-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.firework-dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: hsl(var(--h), 92%, 66%);
  box-shadow: 0 0 28px hsla(var(--h), 95%, 70%, 0.92), 0 0 50px hsla(var(--h), 95%, 72%, 0.45);
  transform: translate(-50%, -50%);
  animation: firework-burst 2.6s ease-out forwards;
}

@keyframes compass-spin {
  0% { transform: rotate(0deg) scale(1); filter: brightness(0.95); }
  60% { transform: rotate(540deg) scale(1.06); filter: brightness(1.12); }
  100% { transform: rotate(720deg) scale(1); filter: brightness(1); }
}

@keyframes firework-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}

/* Background blur on container – overlay is OUTSIDE .container so it won't inherit this filter */
body.anim-active .container {
  filter: blur(3px) brightness(0.55);
  pointer-events: none;
}

.fortune-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 3, 0.36);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.fortune-overlay-center {
  position: relative;
  width: min(680px, calc(100vw - 28px));
  min-height: 560px;
  padding: 34px 30px 22px;
  background: linear-gradient(180deg, rgba(76, 46, 25, 0.97), rgba(28, 18, 13, 0.99));
  border: 1px solid rgba(230, 192, 124, 0.34);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(255, 227, 173, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1501;
}

.fortune-overlay.coin-mode .fortune-overlay-center {
  background:
    radial-gradient(circle at 30% 30%, rgba(189, 127, 53, 0.26), transparent 34%),
    radial-gradient(circle at 70% 70%, rgba(85, 49, 25, 0.33), transparent 40%),
    linear-gradient(180deg, rgba(73, 44, 23, 0.97), rgba(29, 18, 13, 0.99));
}

.fortune-overlay.lot-mode .fortune-overlay-center {
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 152, 73, 0.25), transparent 26%),
    radial-gradient(circle at 88% 16%, rgba(255, 152, 73, 0.25), transparent 26%),
    linear-gradient(180deg, rgba(122, 22, 12, 0.96), rgba(66, 17, 12, 0.98) 55%, rgba(39, 13, 9, 0.99));
}

.fortune-scene {
  width: 100%;
}

.oracle-coin-stage {
  position: relative;
  width: min(500px, 100%);
  height: 290px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  place-items: center;
  column-gap: 6px;
  margin: 0 auto;
}

.oracle-coin-stage::before {
  content: "";
  position: absolute;
  inset: 20px 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 31, 16, 0.9) 0 42%, rgba(86, 51, 30, 0.96) 43% 58%, rgba(42, 24, 14, 0.95) 59% 100%);
  border: 1px solid rgba(184, 138, 76, 0.33);
  box-shadow: inset 0 0 0 10px rgba(35, 20, 11, 0.55), inset 0 0 26px rgba(0, 0, 0, 0.55);
}

.oracle-coin-stage .coin-wrap {
  position: relative;
  z-index: 2;
}

.oracle-lot-stage {
  width: 100%;
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 14px;
  padding: 12px 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 210, 122, 0.32), transparent 38%),
    linear-gradient(180deg, rgba(164, 22, 16, 0.25), rgba(68, 18, 12, 0.25));
}

.oracle-result {
  margin-top: 24px;
  padding: 18px 22px;
  background: rgba(246, 235, 210, 0.95);
  border: 1px solid rgba(111, 70, 26, 0.3);
  border-radius: 10px;
  color: #1a120b;
  font-size: 15px;
  line-height: 1.78;
  max-width: 520px;
  width: 100%;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.fortune-anim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fortune-anim-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.fortune-anim-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 28px));
  min-height: 230px;
  display: grid;
  place-items: center;
}

.fortune-anim-scene {
  width: 100%;
  display: none;
}

.fortune-anim-scene.active {
  display: block;
}

#coin-anim-scene {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 14px;
}

#coin-anim-scene.active {
  display: grid;
}

.coin-wrap {
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.coin {
  width: 102px;
  height: 102px;
  border-radius: 999px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.4));
}

.coin.anim-front {
  animation: coin-throw-front 3.45s cubic-bezier(0.22, 0.74, 0.2, 1) forwards;
}

.coin.anim-back {
  animation: coin-throw-back 3.45s cubic-bezier(0.22, 0.74, 0.2, 1) forwards;
}

.coin-wrap.delay-0 .coin { animation-delay: 0s; }
.coin-wrap.delay-1 .coin { animation-delay: 0.15s; }
.coin-wrap.delay-2 .coin { animation-delay: 0.31s; }

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #bb9350;
  color: #f8e8c3;
  font-size: 0.88rem;
  letter-spacing: 1px;
  font-weight: 700;
  background:
    radial-gradient(circle at 34% 30%, #d4b07b 0%, #a06f2a 45%, #5f3a15 82%),
    repeating-conic-gradient(from 0deg, rgba(0, 0, 0, 0.08) 0 8deg, rgba(255, 255, 255, 0.07) 8deg 16deg);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(58, 34, 11, 0.45),
    inset 0 0 14px rgba(255, 223, 168, 0.28);
  backface-visibility: hidden;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.coin-face::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: rgba(45, 30, 8, 0.8);
  box-shadow: inset 0 0 0 1px rgba(219, 180, 102, 0.35), 0 0 0 1px rgba(29, 18, 6, 0.55);
}

.coin-glyph {
  transform: translateY(24px);
  display: inline-block;
  color: #f2ddbb;
  font-size: 0.74rem;
  letter-spacing: 1.7px;
}

.meditation-copy {
  margin-top: 12px;
}

.bgm-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(27, 30, 36, 0.95), rgba(12, 13, 17, 0.98));
  color: #f3f4f6;
  font-size: 1.05rem;
  cursor: pointer;
  z-index: 1700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.bgm-toggle:hover {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 2px rgba(216, 172, 90, 0.25), 0 4px 16px rgba(0, 0, 0, 0.5);
}

.bgm-toggle.muted {
  opacity: 0.55;
}

.bgm-status {
  position: fixed;
  right: 14px;
  bottom: 66px;
  max-width: min(70vw, 420px);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(216, 172, 90, 0.55);
  background: rgba(11, 12, 16, 0.9);
  color: #f6d78f;
  font-size: 0.74rem;
  line-height: 1.35;
  z-index: 1700;
}

.bgm-unlock-btn {
  position: fixed;
  right: 14px;
  bottom: 112px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(216, 172, 90, 0.65);
  background: linear-gradient(145deg, rgba(33, 36, 44, 0.96), rgba(11, 12, 16, 0.98));
  color: #f6d78f;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1701;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
}

.bgm-unlock-btn:hover {
  filter: brightness(1.08);
}

.site-build-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 9, 12, 0.86);
  color: #bfc5d0;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.06em;
  z-index: 1695;
}

.coin-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 35% 35%, #cfa86f 0%, #916122 45%, #57310f 82%),
    repeating-conic-gradient(from 0deg, rgba(0, 0, 0, 0.09) 0 8deg, rgba(255, 255, 255, 0.06) 8deg 16deg);
}

@keyframes coin-throw-front {
  0%   { transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  14%  { transform: translateY(-78px) rotateX(380deg) rotateY(140deg) rotateZ(6deg); }
  35%  { transform: translateY(-52px) rotateX(730deg) rotateY(260deg) rotateZ(-4deg); }
  58%  { transform: translateY(-22px) rotateX(930deg) rotateY(330deg) rotateZ(2deg); }
  76%  { transform: translateY(-8px) rotateX(1020deg) rotateY(350deg) rotateZ(0deg); }
  88%  { transform: translateY(-2px) rotateX(1060deg) rotateY(358deg) rotateZ(0deg); }
  94%  { transform: translateY(-4px) rotateX(1070deg) rotateY(359deg) rotateZ(0deg); }
  100% { transform: translateY(0) rotateX(1080deg) rotateY(360deg) rotateZ(0deg); }
}

@keyframes coin-throw-back {
  0%   { transform: translateY(0) rotateX(0deg) rotateY(180deg) rotateZ(0deg); }
  14%  { transform: translateY(-78px) rotateX(390deg) rotateY(300deg) rotateZ(-6deg); }
  35%  { transform: translateY(-52px) rotateX(740deg) rotateY(450deg) rotateZ(4deg); }
  58%  { transform: translateY(-22px) rotateX(940deg) rotateY(560deg) rotateZ(-2deg); }
  76%  { transform: translateY(-8px) rotateX(1030deg) rotateY(620deg) rotateZ(0deg); }
  88%  { transform: translateY(-2px) rotateX(1070deg) rotateY(690deg) rotateZ(0deg); }
  94%  { transform: translateY(-4px) rotateX(1080deg) rotateY(710deg) rotateZ(0deg); }
  100% { transform: translateY(0) rotateX(1080deg) rotateY(720deg) rotateZ(0deg); }
}

#fortune-overlay-close {
  margin-top: 24px;
  min-width: 148px;
  border-radius: 12px;
  border-color: rgba(249, 220, 160, 0.44);
  background: linear-gradient(160deg, #6d2e17, #3b1b11);
  color: #f8e6c2;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
}

#fortune-overlay-close:hover {
  filter: brightness(1.08);
}

#lot-anim-scene {
  display: none;
}

#lot-anim-scene.active {
  display: block;
}

.lot-shaker {
  width: 300px;
  height: 290px;
  margin: 0 auto;
  position: relative;
  animation: cup-shake 1.35s ease-in-out 3;
  transform-origin: center bottom;
}

.lot-cup {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 186px;
  height: 198px;
  transform: translateX(-50%);
  border-radius: 20px 20px 18px 18px;
  border: 1px solid rgba(96, 52, 25, 0.7);
  background:
    linear-gradient(180deg, #8a4c24 0%, #6f3b1a 34%, #5f3316 62%, #4b2912 100%),
    repeating-linear-gradient(90deg, rgba(255, 209, 142, 0.08) 0 2px, rgba(93, 52, 24, 0.06) 2px 6px, transparent 6px 11px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 214, 150, 0.18), inset 0 -12px 18px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.lot-cup::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 176px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(111, 66, 35, 0.7);
  background: radial-gradient(circle at 50% 20%, #a0653a, #6a3818 70%, #4c2812 100%);
  box-shadow: inset 0 1px 0 rgba(255, 223, 168, 0.28);
}

.lot-cup::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 160px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 20%, rgba(41, 22, 10, 0.86), rgba(21, 10, 6, 0.95));
}

.lot-bundle {
  position: relative;
  width: 162px;
  height: 128px;
  margin: -26px auto 0;
  z-index: 2;
}

.bamboo-stick {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 9px;
  height: 126px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #f6deaa, #d7b06e 68%, #b58444),
    repeating-linear-gradient(180deg, rgba(127, 87, 37, 0.22) 0 2px, transparent 2px 18px);
  border: 1px solid rgba(124, 86, 40, 0.36);
  transform-origin: center bottom;
  box-shadow: inset 0 0 0 1px rgba(255, 237, 190, 0.34), 0 6px 12px rgba(0, 0, 0, 0.18);
}

.bamboo-stick:nth-child(1) { transform: translateX(-63px) rotate(-12deg); height: 118px; }
.bamboo-stick:nth-child(2) { transform: translateX(-52px) rotate(-9deg); height: 126px; }
.bamboo-stick:nth-child(3) { transform: translateX(-41px) rotate(-7deg); height: 120px; }
.bamboo-stick:nth-child(4) { transform: translateX(-30px) rotate(-4deg); height: 132px; }
.bamboo-stick:nth-child(5) { transform: translateX(-19px) rotate(-2deg); height: 124px; }
.bamboo-stick:nth-child(6) { transform: translateX(-8px) rotate(-1deg); height: 136px; }
.bamboo-stick:nth-child(7) { transform: translateX(3px) rotate(1deg); height: 128px; }
.bamboo-stick:nth-child(8) { transform: translateX(14px) rotate(2deg); height: 134px; }
.bamboo-stick:nth-child(9) { transform: translateX(25px) rotate(4deg); height: 122px; }
.bamboo-stick:nth-child(10) { transform: translateX(36px) rotate(6deg); height: 130px; }
.bamboo-stick:nth-child(11) { transform: translateX(47px) rotate(8deg); height: 121px; }
.bamboo-stick:nth-child(12) { transform: translateX(58px) rotate(10deg); height: 126px; }
.bamboo-stick:nth-child(13) { transform: translateX(-70px) rotate(-15deg); height: 112px; }
.bamboo-stick:nth-child(14) { transform: translateX(68px) rotate(13deg); height: 116px; }

.lot-draw-slip {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 34px;
  height: 138px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #fff4de, #f0e1c0 76%, #dbc7a0),
    repeating-linear-gradient(0deg, rgba(156, 116, 53, 0.09) 0 2px, transparent 2px 9px);
  border: 1px solid rgba(128, 97, 50, 0.35);
  transform: translateX(-50%) rotate(var(--pull-tilt, 4deg));
  opacity: 0;
  animation: lot-pull 3.9s cubic-bezier(0.24, 0.76, 0.2, 1) forwards;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 224, 0.48), 0 8px 16px rgba(0, 0, 0, 0.22);
  z-index: 7;
}

.lot-draw-text {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: rgba(72, 45, 15, 0.9);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 1px;
  font-family: "Kaiti SC", "STKaiti", serif;
}

@keyframes cup-shake {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  10% { transform: rotate(-9deg) translateX(-4px); }
  20% { transform: rotate(10deg) translateX(5px); }
  30% { transform: rotate(-8deg) translateX(-4px); }
  44% { transform: rotate(8deg) translateX(4px); }
  58% { transform: rotate(-6deg) translateX(-3px); }
  72% { transform: rotate(6deg) translateX(3px); }
  86% { transform: rotate(-3deg) translateX(-1px); }
}

@keyframes lot-pull {
  0% { opacity: 0; transform: translateX(-50%) translateY(12px) rotate(var(--pull-tilt, 4deg)); }
  30% { opacity: 0; }
  44% { opacity: 1; transform: translateX(-50%) translateY(2px) rotate(var(--pull-tilt, 4deg)); }
  66% { opacity: 1; transform: translateX(-50%) translateY(-72px) rotate(calc(var(--pull-tilt, 4deg) - 2deg)); }
  82% { opacity: 1; transform: translateX(-16%) translateY(-116px) rotate(calc(var(--pull-tilt, 4deg) + 7deg)); }
  92% { opacity: 1; transform: translateX(-14%) translateY(-106px) rotate(calc(var(--pull-tilt, 4deg) + 5deg)); }
  100% { opacity: 1; transform: translateX(-16%) translateY(-116px) rotate(calc(var(--pull-tilt, 4deg) + 7deg)); }
}

@media (max-width: 640px) {
  body::before {
    width: 220px;
    height: 220px;
    left: -62px;
    top: -48px;
    opacity: 0.18;
  }

  body::after {
    width: 300px;
    height: 300px;
    right: -108px;
    bottom: -108px;
    opacity: 0.24;
  }

  .container {
    width: min(100%, calc(100vw - 20px));
    padding: 10px 0 36px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    font-size: 1rem;
    letter-spacing: 0.8px;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav a,
  .nav-auth-btn,
  .top-user-badge {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .top-user-badge {
    max-width: none;
  }

  .header-right {
    width: 100%;
    align-items: stretch;
  }

  .auth-box {
    width: 100%;
  }

  .auth-row,
  .auth-actions {
    justify-content: flex-start;
    text-align: left;
  }

  .auth-panel {
    width: min(100vw - 20px, 420px);
    padding: 14px;
    border-radius: 12px;
  }

  .auth-switch-row {
    flex-wrap: wrap;
  }

  .auth-switch-btn {
    min-width: 0;
    flex: 1 1 140px;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .hero {
    margin-top: 10px;
    padding: 18px 14px;
    border-radius: 14px;
  }

  .hero h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .hero p {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .hero-intro {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.75;
    text-align: left;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .paid-services-grid .service-title-row {
    gap: 6px;
  }

  .paid-services-grid .service-title {
    font-size: 0.98rem;
  }

  .paid-services-grid .service-paid-tag {
    font-size: 0.84rem;
  }

  .card,
  .result,
  .about-box {
    border-radius: 14px;
  }

  .card {
    min-height: 0;
    padding: 14px;
  }

  .card h3 {
    font-size: 1rem;
    line-height: 1.35;
  }

  .card p,
  .card li,
  .result,
  .legal-note {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .actions {
    gap: 8px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .footer {
    margin-top: 16px;
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bgm-status {
    left: 10px;
    right: 10px;
    bottom: 118px;
    max-width: none;
  }

  .bgm-unlock-btn {
    left: 10px;
    right: 10px;
    bottom: 66px;
    width: auto;
    text-align: center;
  }

  .bgm-toggle {
    right: 10px;
    bottom: 12px;
  }

  .site-build-badge {
    left: 10px;
    bottom: 12px;
    font-size: 0.64rem;
    padding: 6px 8px;
  }

  .coin {
    width: 72px;
    height: 72px;
  }

  .coin-face {
    font-size: 0.85rem;
  }

  .coin-face::after {
    width: 13px;
    height: 13px;
  }

  .lot-shaker {
    width: 220px;
    height: 220px;
  }

  .lot-cup {
    width: 142px;
    height: 150px;
  }

  .lot-bundle {
    width: 126px;
  }

  .bamboo-stick {
    width: 8px;
    height: 108px;
  }

  .bazi-compass-wrap {
    width: 168px;
    height: 168px;
  }

  .bazi-compass {
    width: 148px;
    height: 148px;
  }

  .bazi-pillars {
    grid-template-columns: repeat(2, 1fr);
  }

  .legal-layout {
    padding: 16px;
  }

  .footer-links {
    gap: 8px 12px;
  }
}
