/* ========================================
   I CHING REALM — 暖色禅意风 (Zen Warm)
   Inspired by 菩提苑 putiyuan.pages.dev
   ======================================== */

:root {
  /* 暖色基底 — Warm Base */
  --cream: #f5efe0;
  --cream-2: #ebe4d2;
  --parchment: #e8dcc8;
  --sand: #d9cdb5;
  --warm-gray: #b8a98a;
  --brown: #8b7355;
  --dark-brown: #5c4a32;
  --ink: #3d2b1f;
  --deep-ink: #2a1d13;
  --black: #1a130d;

  /* 寺庙红/朱砂 — Temple Red */
  --red: #9d3341;
  --cinnabar: #c23c2e;
  --temple-red: #a63d2f;
  --red-glow: rgba(194, 60, 46, .35);

  /* 金色/琥珀 — Gold/Amber */
  --gold: #d4a843;
  --gold-2: #b8922e;
  --amber: #e8b84d;
  --gold-dim: rgba(212, 168, 67, .25);

  /* 翡翠绿 — Jade Green */
  --jade: #4f907b;
  --jade-dim: rgba(79, 144, 123, .2);

  /* 中性色 — Neutrals */
  --muted: rgba(61, 43, 31, .65);
  --soft: rgba(61, 43, 31, .1);
  --line: rgba(194, 60, 46, .15);
  --line-gold: rgba(212, 168, 67, .2);

  /* 字体 — Typography */
  --font-serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-han: "Ma Shan Zheng", "Noto Serif SC", serif;

  /* 缓动 — Easing */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);

  /* 过渡 — Transitions */
  --transition-layer: 900ms var(--ease);
  --transition-slow: 1800ms var(--ease);

  /* 发光 — Glow (暖色版，无 cyan) */
  --glow-gold: 0 0 20px rgba(212, 168, 67, .3), 0 0 60px rgba(212, 168, 67, .1);
  --glow-red: 0 0 20px rgba(194, 60, 46, .3), 0 0 60px rgba(194, 60, 46, .1);
}

* { box-sizing: border-box; }
html { background: var(--cream); overflow: hidden; }

body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  background:
    radial-gradient(circle at 50% 8%, rgba(212, 168, 67, .08), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(194, 60, 46, .04), transparent 40%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 45%, var(--parchment) 100%);
  font-family: var(--font-sans); overflow: hidden;
}

/* 宣纸纹理 — Xuan paper texture overlay */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
  z-index: 0;
  opacity: .6;
}

a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { cursor: pointer; }

/* ========================================
   PERSISTENT LAYERS
   ======================================== */
#realm-canvas, #smoke-canvas, #seal-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  z-index: 0; pointer-events: none;
}
#smoke-canvas { z-index: 1; opacity: .4; }

/* 墨边框 — Ink border (暖色版) */
.ink-border {
  position: fixed; inset: 0; z-index: 51; pointer-events: none;
  border: 1px solid rgba(194, 60, 46, .08);
  box-shadow: inset 0 0 80px rgba(212, 168, 67, .06), inset 0 0 200px rgba(61, 43, 31, .04);
}

/* ========================================
   TOPBAR
   ======================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 52;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(245, 239, 224, .95), rgba(245, 239, 224, .8) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-serif); font-size: 21px; color: var(--ink); }
.brand__seal {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid rgba(194, 60, 46, .5);
  background: linear-gradient(145deg, var(--cinnabar), var(--temple-red));
  color: var(--cream); font-family: var(--font-han); border-radius: 4px;
  box-shadow: 0 0 20px rgba(194, 60, 46, .2);
}
.topbar nav { display: flex; gap: clamp(14px, 3vw, 34px); color: var(--brown); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.topbar nav a:hover { color: var(--cinnabar); }
.state-indicator { color: var(--cinnabar); font-family: var(--font-sans); font-size: 13px; letter-spacing: .2em; font-weight: 600; }

/* ========================================
   REALM LAYER SYSTEM
   ======================================== */
.realm-layer {
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px clamp(18px, 4vw, 54px) 24px;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden; transform: scale(1.03);
  transition: opacity var(--transition-layer), visibility 0s var(--transition-layer), transform var(--transition-layer);
  pointer-events: none;
}
.realm-layer > * { margin-block: auto; }
.realm-layer.is-active {
  opacity: 1; visibility: visible; transform: scale(1); pointer-events: auto;
  transition: opacity var(--transition-layer), visibility 0s 0s, transform var(--transition-layer);
  z-index: 2;
}
.realm-layer.is-exiting {
  opacity: 0; transform: scale(.97); pointer-events: none; z-index: 3;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.kicker { margin: 0 0 14px; color: var(--cinnabar); font-weight: 700; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: 500; letter-spacing: 0; color: var(--deep-ink); }
h1 { font-size: clamp(52px, 8vw, 118px); line-height: .9; text-shadow: 0 2px 20px rgba(61, 43, 31, .08); }
.han {
  display: block; margin-bottom: 10px; color: var(--cinnabar);
  font-family: var(--font-han); font-weight: 400; letter-spacing: .08em;
  text-shadow: 0 0 20px rgba(194, 60, 46, .2);
}
.lead { max-width: 58ch; margin: 24px 0 0; color: var(--muted); font-family: var(--font-serif); font-size: clamp(19px, 2vw, 25px); line-height: 1.45; }

/* ========================================
   BUTTONS
   ======================================== */
.hero-actions, .closing-actions, .path-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  min-height: 50px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; padding: 14px 22px;
  color: var(--cream); background: transparent; font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase;
  transition: transform 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease), box-shadow 260ms var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  color: var(--cream); border-color: rgba(255, 255, 255, .1);
  background: linear-gradient(135deg, var(--cinnabar), var(--temple-red) 45%, #8b2d22);
  box-shadow: 0 8px 30px rgba(194, 60, 46, .2);
}
.btn-gold:hover { box-shadow: 0 12px 40px rgba(194, 60, 46, .3); }
.btn-ghost { border-color: rgba(61, 43, 31, .2); background: rgba(61, 43, 31, .04); color: var(--ink); }
.btn-ghost:hover { border-color: var(--cinnabar); box-shadow: 0 0 20px rgba(194, 60, 46, .08); }
.btn-cinnabar {
  border-color: rgba(194, 60, 46, .3); background: linear-gradient(135deg, rgba(194, 60, 46, .1), rgba(194, 60, 46, .05));
  color: var(--cinnabar); letter-spacing: .1em;
  box-shadow: 0 0 20px rgba(194, 60, 46, .06);
}
.btn-cinnabar:hover {
  background: linear-gradient(135deg, rgba(194, 60, 46, .18), rgba(194, 60, 46, .08));
  box-shadow: 0 0 30px rgba(194, 60, 46, .12);
  transform: translateY(-2px);
}
.btn-cinnabar:disabled { opacity: .5; cursor: wait; transform: none; }
.btn-wide { width: 100%; }

/* ========================================
   LAYER 1: GATE
   ======================================== */
.culture-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 34px; justify-content: center; }
.culture-strip span {
  min-width: 76px; padding: 8px 12px; text-align: center;
  border: 1px solid rgba(194, 60, 46, .15); background: rgba(194, 60, 46, .04);
  border-radius: 4px; color: var(--ink); font-family: var(--font-han); font-size: 18px;
  box-shadow: inset 0 0 24px rgba(194, 60, 46, .02);
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.culture-strip span:hover { border-color: var(--cinnabar); box-shadow: 0 0 16px rgba(194, 60, 46, .1); }

/* ===== DAILY ORACLE CARD ===== */
.daily-oracle {
  margin: 20px 0 28px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, .4);
  border: 1px solid rgba(194, 60, 46, .1);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(61, 43, 31, .04);
}
.daily-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(194, 60, 46, .08);
  border: 1px solid rgba(194, 60, 46, .15);
  border-radius: 4px;
  color: var(--cinnabar);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.daily-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: .04em;
}
.daily-hex {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.daily-han {
  font-family: var(--font-han);
  font-size: clamp(36px, 6vw, 52px);
  color: var(--cinnabar);
  line-height: 1;
  text-shadow: 0 0 24px rgba(194, 60, 46, .15);
}
.daily-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.daily-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: .04em;
}
.daily-pinyin {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .06em;
}
.daily-energy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.energy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.energy-row span {
  width: 56px;
  font-size: 12px;
  color: rgba(61, 43, 31, .5);
  letter-spacing: .06em;
  text-align: right;
}
.energy-bar {
  flex: 1;
  height: 8px;
  background: rgba(194, 60, 46, .06);
  border-radius: 4px;
  overflow: hidden;
}
.energy-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold));
  width: 0;
  transition: width 800ms cubic-bezier(.22, 1, .36, 1);
}
.daily-reading {
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(61, 43, 31, .7);
  margin: 0 0 16px;
  border-left: 2px solid rgba(194, 60, 46, .15);
  padding-left: 12px;
}
.daily-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.daily-cast-btn, .daily-checkin-btn {
  font-size: 13px !important;
  padding: 8px 16px !important;
}
.daily-checkin-btn {
  font-size: 11px !important;
  opacity: .7;
}
.daily-checkin-btn:hover { opacity: 1; }
.daily-checkin-btn.is-checked {
  opacity: .5;
  pointer-events: none;
  text-decoration: line-through;
}

.gate-stage { min-height: clamp(430px, 70vh, 720px); display: grid; place-items: center; perspective: 1500px; position: relative; }
.gate-hero .gate-stage { position: absolute; inset: 0; z-index: 1; min-height: 100%; opacity: 0.25; pointer-events: none; }
.bagua-orbit {
  position: absolute; width: min(580px, 86vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(212, 168, 67, .2); animation: orbit 60s linear infinite;
  filter: drop-shadow(0 0 32px rgba(212, 168, 67, .08));
}
.bagua-orbit::before, .bagua-orbit::after {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .15);
}
.bagua-orbit::after { inset: 19%; border-color: rgba(79, 144, 123, .15); }
.bagua-orbit span {
  --a: calc(var(--i) * 45deg - 90deg); position: absolute; left: 50%; top: 50%;
  color: var(--cinnabar); font-family: var(--font-han); font-size: clamp(22px, 4vw, 34px);
  transform: rotate(var(--a)) translateX(min(290px, 43vw)) rotate(calc(var(--a) * -1));
  transform-origin: 0 0;
  text-shadow: 0 0 20px rgba(194, 60, 46, .3);
}

.stone-gate {
  position: relative; width: min(470px, 74vw); aspect-ratio: .72;
  transform-style: preserve-3d; filter: drop-shadow(0 55px 70px rgba(61, 43, 31, .2));
  transition: transform 1800ms var(--ease);
}
.stone-gate.is-open { transform: translateZ(220px) scale(1.08); }
.door {
  position: absolute; top: 4%; bottom: 8%; width: 50%; overflow: hidden;
  border: 1px solid rgba(194, 60, 46, .2);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .04), transparent 20% 80%, rgba(0, 0, 0, .15)),
    radial-gradient(circle at 50% 35%, rgba(212, 168, 67, .06), transparent 28%),
    linear-gradient(180deg, var(--cream-2), var(--parchment) 46%, var(--sand));
  box-shadow: inset 0 0 55px rgba(61, 43, 31, .08);
  transition: transform 1900ms cubic-bezier(.18, .78, .18, 1), filter 600ms var(--ease);
}
.door::before {
  content: ""; position: absolute; inset: 11%;
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 48% 48% 12% 12%;
  background:
    radial-gradient(circle, transparent 31%, rgba(194, 60, 46, .06) 32% 33%, transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(194, 60, 46, .03) 27px 28px);
}
.door strong {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  color: var(--cinnabar); font-family: var(--font-han);
  font-size: clamp(80px, 10vw, 126px); font-weight: 400;
  text-shadow: 0 0 24px rgba(194, 60, 46, .2);
}
.door i { position: absolute; inset: 0; background: linear-gradient(120deg, transparent, rgba(212, 168, 67, .04), transparent 42%); }
.door-left { left: 0; border-radius: 48% 0 0 10% / 11% 0 0 6%; transform-origin: left center; }
.door-right { right: 0; border-radius: 0 48% 10% 0 / 0 11% 6% 0; transform-origin: right center; }
.stone-gate:hover .door, .stone-gate.is-open .door { filter: brightness(1.05); }
.stone-gate.is-open .door-left { transform: rotateY(-82deg) translateX(-18px); }
.stone-gate.is-open .door-right { transform: rotateY(82deg) translateX(18px); }

/* Portal Mandala */
.portal-mandala {
  position: absolute; inset: 0; margin: auto;
  width: clamp(200px, 28vw, 320px); aspect-ratio: 1;
  display: grid; place-items: center;
  opacity: 0; transform: scale(0.3) rotate(-90deg);
  transition: opacity 1400ms var(--ease), transform 1800ms cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}
.stone-gate.is-open .portal-mandala { opacity: 1; transform: scale(1) rotate(0deg); }
.portal-mandala::before {
  content: ""; position: absolute;
  width: 140%; height: 140%; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(212, 168, 67, .15) 0%,
    rgba(194, 60, 46, .08) 30%,
    rgba(194, 60, 46, .02) 50%,
    transparent 70%);
  animation: portal-glow-pulse 3s ease-in-out infinite;
}
@keyframes portal-glow-pulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.12); opacity: 1; }
}
.portal-mandala::after {
  content: ""; position: absolute;
  width: 105%; height: 105%; border-radius: 50%;
  border: 1px solid rgba(212, 168, 67, .12);
  animation: portal-mandala-spin 40s linear infinite reverse;
  pointer-events: none;
}
.portal-mandala-trigrams {
  position: absolute; width: 100%; height: 100%;
  animation: portal-mandala-spin 25s linear infinite;
}
.portal-mandala-trigrams span {
  --pma: calc(var(--pmi) * 45deg - 90deg);
  position: absolute; left: 50%; top: 50%;
  font-family: var(--font-han); font-size: clamp(20px, 3vw, 30px);
  color: var(--cinnabar);
  text-shadow: 0 0 12px rgba(194, 60, 46, .3);
  transform: rotate(var(--pma)) translateY(calc(min(105px, 14vw) * -1)) rotate(calc(var(--pma) * -1));
  transform-origin: 0 0;
}
.portal-mandala-wuxing {
  position: absolute; width: 72%; height: 72%;
  animation: portal-mandala-spin 15s linear infinite reverse;
}
.portal-mandala-wuxing span {
  --pwa: calc(var(--pwi) * 72deg - 90deg);
  position: absolute; left: 50%; top: 50%;
  font-family: var(--font-han); font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 600;
  transform: rotate(var(--pwa)) translateY(calc(min(62px, 8.5vw) * -1)) rotate(calc(var(--pwa) * -1));
  transform-origin: 0 0;
  text-shadow: 0 0 10px currentColor;
}
.portal-mandala-taiji {
  width: clamp(52px, 7vw, 76px); aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(194, 60, 46, .4);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Ccircle cx='100' cy='100' r='100'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg clip-path='url(%23c)'%3E%3Crect width='200' height='200' fill='%233d2b1f'/%3E%3Cpath d='M100,0 A100,100 0 0,1 100,200 A50,50 0 0,0 100,100 A50,50 0 0,1 100,0Z' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='50' r='15' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='150' r='15' fill='%233d2b1f'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  box-shadow: 0 0 30px rgba(194, 60, 46, .2), 0 0 60px rgba(212, 168, 67, .1);
  animation: portal-taiji-breathe 4s ease-in-out infinite;
}
@keyframes portal-taiji-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(194, 60, 46, .2), 0 0 60px rgba(212, 168, 67, .1); }
  50% { transform: scale(1.06); box-shadow: 0 0 40px rgba(194, 60, 46, .3), 0 0 80px rgba(212, 168, 67, .15); }
}
@keyframes portal-mandala-spin { to { transform: rotate(360deg); } }

/* Wuxing-Bagua Mandala */
.wuxing-bagua-mandala {
  position: absolute; inset: 0; margin: auto;
  width: clamp(160px, 22vw, 220px); aspect-ratio: 1;
  display: grid; place-items: center;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.stone-gate:hover .wuxing-bagua-mandala { animation: mandala-spin 8s linear infinite; }
.stone-gate.is-open .wuxing-bagua-mandala { opacity: 0; transform: scale(.6) rotate(180deg); }
.mandala-outer {
  position: absolute; width: 100%; height: 100%;
  animation: mandala-spin 30s linear infinite;
}
.mandala-outer span {
  --ma: calc(var(--mi) * 45deg - 90deg);
  position: absolute; left: 50%; top: 50%;
  font-family: var(--font-han); font-size: clamp(16px, 2.5vw, 22px);
  color: var(--cinnabar);
  text-shadow: 0 0 10px rgba(194, 60, 46, .25);
  transform: rotate(var(--ma)) translateY(calc(min(80px, 11vw) * -1)) rotate(calc(var(--ma) * -1));
  transform-origin: 0 0;
}
.mandala-wuxing {
  position: absolute; width: 72%; height: 72%;
  animation: mandala-spin 18s linear infinite reverse;
}
.mandala-wuxing span {
  --wa: calc(var(--wi) * 72deg - 90deg);
  position: absolute; left: 50%; top: 50%;
  font-family: var(--font-han); font-size: clamp(14px, 2vw, 18px);
  font-weight: 600;
  transform: rotate(var(--wa)) translateY(calc(min(48px, 6.5vw) * -1)) rotate(calc(var(--wa) * -1));
  transform-origin: 0 0;
  text-shadow: 0 0 8px currentColor;
}
.wuxing-wood { color: #5a9e4b; }
.wuxing-fire { color: #c23c2e; }
.wuxing-earth { color: #b8922e; }
.wuxing-metal { color: #9a8b7a; }
.wuxing-water { color: #4a7a8c; }
.mandala-taiji {
  width: clamp(40px, 6vw, 56px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .3);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Ccircle cx='100' cy='100' r='100'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg clip-path='url(%23c)'%3E%3Crect width='200' height='200' fill='%233d2b1f'/%3E%3Cpath d='M100,0 A100,100 0 0,1 100,200 A50,50 0 0,0 100,100 A50,50 0 0,1 100,0Z' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='50' r='15' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='150' r='15' fill='%233d2b1f'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  box-shadow: 0 0 20px rgba(194, 60, 46, .15);
  animation: lock-breathe 4.8s ease-in-out infinite;
}
.wuxing-bagua-mandala::before,
.wuxing-bagua-mandala::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .1);
  pointer-events: none;
}
.wuxing-bagua-mandala::before {
  width: 90%; height: 90%;
  border-color: rgba(212, 168, 67, .08);
}
.wuxing-bagua-mandala::after {
  width: 65%; height: 65%;
  border-color: rgba(79, 144, 123, .08);
  border-style: dashed;
  animation: mandala-spin 25s linear infinite reverse;
}
@keyframes mandala-spin { to { transform: rotate(360deg); } }
.threshold {
  position: absolute; left: 50%; bottom: 0; width: 90%; height: 15%;
  transform: translateX(-50%) rotateX(72deg);
  background: radial-gradient(ellipse, rgba(194, 60, 46, .1), rgba(212, 168, 67, .06) 42%, transparent 74%);
  filter: blur(2px);
}

/* ========================================
   LAYER 2: VOID TRANSIT
   ======================================== */
#vortex-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.void-content { position: relative; z-index: 2; text-align: center; max-width: 600px; }
.void-content h2 {
  font-size: clamp(34px, 5vw, 56px); line-height: 1; margin-bottom: 16px;
  border-right: 2px solid var(--cinnabar); animation: blink-caret .75s step-end infinite;
}
.void-sub {
  color: var(--cinnabar); font-family: var(--font-han); font-size: 28px;
  text-shadow: 0 0 20px rgba(194, 60, 46, .3);
  letter-spacing: .3em;
}
@keyframes blink-caret { from, to { border-color: transparent; } 50% { border-color: var(--cinnabar); } }

/* ========================================
   LAYER 3: PATH SELECT
   ======================================== */
.path-content { width: min(1180px, 100%); }
.section-head { max-width: 760px; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(34px, 5vw, 66px); line-height: 1; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 17px; line-height: 1.75; }
.path-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.path-card {
  min-height: 250px; padding: 20px;
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 10px;
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 2px 12px rgba(61, 43, 31, .04);
  transition: transform 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease), box-shadow 260ms var(--ease), opacity 600ms var(--ease);
  opacity: 0; transform: translateY(40px) scale(.95);
}
.realm-layer.is-active .path-card { opacity: 1; transform: translateY(0) scale(1); transition-delay: var(--reveal-delay, 0ms); }
.path-card:hover, .path-card.is-active {
  transform: translateY(-4px); border-color: var(--cinnabar);
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 4px 20px rgba(194, 60, 46, .08);
}
.path-card span { color: var(--cinnabar); font-family: var(--font-serif); font-size: 34px; }
.path-card h3 { margin: 20px 0 10px; font-size: 27px; }
.path-card p { color: var(--muted); line-height: 1.6; }
.path-card em {
  display: block; margin-top: 18px; color: var(--cinnabar);
  font-style: normal; font-family: var(--font-han); font-size: 18px;
}
.cosmos-panel {
  margin-top: 18px; display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
  align-items: center; gap: clamp(24px, 5vw, 70px); min-height: 420px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 12px;
  background: rgba(255, 255, 255, .35);
  box-shadow: 0 2px 16px rgba(61, 43, 31, .04);
  overflow: hidden;
}
.cosmos-core { position: relative; min-height: 320px; display: grid; place-items: center; }
.yin-yang-disc {
  width: min(260px, 54vw); aspect-ratio: 1; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Ccircle cx='100' cy='100' r='100'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg clip-path='url(%23c)'%3E%3Crect width='200' height='200' fill='%233d2b1f'/%3E%3Cpath d='M100,0 A100,100 0 0,1 100,200 A50,50 0 0,0 100,100 A50,50 0 0,1 100,0Z' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='50' r='15' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='150' r='15' fill='%233d2b1f'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  box-shadow: 0 0 50px rgba(194, 60, 46, .12), 0 0 100px rgba(212, 168, 67, .06);
  animation: orbit 18s linear infinite;
}
.phase-ring {
  position: absolute; width: min(340px, 66vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .1);
  background: conic-gradient(from 0deg, rgba(79, 144, 123, .1), rgba(194, 60, 46, .1), rgba(212, 168, 67, .1), rgba(154, 139, 122, .08), rgba(74, 122, 140, .1), rgba(79, 144, 123, .1));
  mask-image: radial-gradient(circle, transparent 54%, black 55% 58%, transparent 59%);
  animation: orbit 38s linear reverse infinite;
}
.hex-stack { position: absolute; display: grid; gap: 12px; width: 160px; transform: translateY(185px) scale(.78); opacity: .8; }
.hex-stack b { height: 10px; border-radius: 99px; background: var(--cinnabar); box-shadow: 0 0 12px rgba(194, 60, 46, .2); }
.hex-stack b:nth-child(2), .hex-stack b:nth-child(5) { background: linear-gradient(90deg, var(--cinnabar) 0 42%, transparent 42% 58%, var(--cinnabar) 58%); }
.cosmos-panel h2 { font-size: clamp(34px, 5vw, 66px); line-height: 1; }
.cosmos-panel p:not(.kicker) { color: var(--muted); font-size: 17px; line-height: 1.75; }
.path-actions { margin-top: 34px; display: flex; justify-content: center; }

/* ========================================
   LAYER 4: ORACLE CHAMBER
   ======================================== */
.oracle-ritual {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; z-index: 1;
}
.oracle-aura {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.aura-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .06);
  animation: aura-breathe 6s ease-in-out infinite;
}
.aura-ring-1 { width: 400px; height: 400px; animation-delay: 0s; border-color: rgba(194, 60, 46, .08); }
.aura-ring-2 { width: 560px; height: 560px; animation-delay: 0.8s; border-color: rgba(194, 60, 46, .06); }
.aura-ring-3 { width: 720px; height: 720px; animation-delay: 1.6s; border-color: rgba(79, 144, 123, .05); }
.aura-ring-4 { width: 900px; height: 900px; animation-delay: 2.4s; border-color: rgba(212, 168, 67, .04); }
.aura-ring-5 { width: 1100px; height: 1100px; animation-delay: 3.2s; border-color: rgba(194, 60, 46, .03); border-style: dashed; }
@keyframes aura-breathe {
  0%, 100% { transform: scale(1); opacity: .25; }
  50% { transform: scale(1.08); opacity: .6; }
}
.oracle-trigrams-float {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.oracle-trigrams-float span {
  position: absolute; left: 50%; top: 50%;
  color: rgba(194, 60, 46, .08);
  font-family: var(--font-han); font-size: clamp(28px, 5vw, 48px);
  transform: translate(var(--tf-x), var(--tf-y));
  animation: trigram-drift var(--tf-d) ease-in-out infinite alternate;
  opacity: 0; transition: opacity 2s var(--ease);
}
#layer-oracle.is-active .oracle-trigrams-float span { opacity: 1; transition-delay: calc(var(--tf-i) * 0.2s); }
@keyframes trigram-drift {
  0% { transform: translate(var(--tf-x), var(--tf-y)) rotate(0deg); }
  100% { transform: translate(calc(var(--tf-x) * 0.7), calc(var(--tf-y) * 1.3)) rotate(15deg); }
}
#oracle-smoke-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  z-index: 0; pointer-events: none; opacity: .4;
}
#layer-oracle::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .06;
  background:
    linear-gradient(0deg, transparent 49.5%, rgba(194, 60, 46, .04) 49.5%, rgba(194, 60, 46, .04) 50.5%, transparent 50.5%),
    linear-gradient(90deg, transparent 49.5%, rgba(212, 168, 67, .03) 49.5%, rgba(212, 168, 67, .03) 50.5%, transparent 50.5%);
  background-size: 80px 80px; z-index: 0;
}
.oracle-coins-orbit {
  position: fixed; top: -40px; right: -40px;
  width: 260px; height: 260px; display: grid; place-items: center;
  filter: drop-shadow(0 0 30px rgba(194, 60, 46, .08));
  opacity: .5; z-index: 0; pointer-events: none;
}
.coin-orbit-ring {
  position: absolute; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .1);
  animation: orbit 20s linear infinite;
}
.coin-orbit-ring::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; border: 1px solid rgba(212, 168, 67, .08); }
.coin-orbit-ring-inner {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  border: 1px solid rgba(212, 168, 67, .08);
  animation: orbit 14s linear infinite reverse;
}
.coin-orbit-ring-inner::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; border: 1px dashed rgba(194, 60, 46, .06); }
.coin {
  position: absolute; width: 72px; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 50%; color: var(--cream);
  background: radial-gradient(circle at 50% 45%, #f0d68a 0 12%, transparent 13%), radial-gradient(circle, #d4a843, #8b6914 72%);
  border: 5px solid #5d421a; font-family: var(--font-han); font-size: 28px;
  box-shadow: 0 12px 30px rgba(61, 43, 31, .2), inset 0 0 12px rgba(255, 255, 255, .15);
  overflow: hidden;
  left: 50%; top: 50%;
  transform: rotate(var(--orbit-angle)) translateX(100px) rotate(calc(var(--orbit-angle) * -1)) translate(-50%, -50%);
  transition: filter 300ms var(--ease);
}
.coin::after {
  content: ""; position: absolute; inset: -50%;
  background: linear-gradient(105deg, transparent 40%, rgba(212, 168, 67, .08) 45%, rgba(255, 255, 255, .1) 50%, rgba(212, 168, 67, .08) 55%, transparent 60%);
  animation: holographic-sweep 3s ease-in-out infinite;
}
.coin::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid rgba(93, 66, 26, .5);
  background: radial-gradient(circle, rgba(61, 43, 31, .3), rgba(93, 66, 26, .2));
  z-index: 1;
}
@keyframes holographic-sweep { 0% { transform: translateX(-100%) rotate(0deg); } 100% { transform: translateX(100%) rotate(5deg); } }
.coin.is-tossing { animation: coin-toss 1200ms cubic-bezier(.32, 1.38, .46, 1) var(--delay) both; }
@keyframes coin-toss {
  0% { transform: rotate(var(--orbit-angle)) translateX(100px) rotate(calc(var(--orbit-angle) * -1)) translate(-50%, -50%); }
  22% { transform: translate(-50%, calc(-50% - 170px)) rotateX(720deg) rotateY(360deg) scale(1.08); }
  62% { transform: translate(-50%, calc(-50% + 18px)) rotateX(1260deg) rotateY(760deg) scale(.96); }
  80% { transform: translate(-50%, calc(-50% - 18px)) rotateX(1440deg) rotateY(860deg); }
  100% { transform: rotate(var(--orbit-angle)) translateX(100px) rotate(calc(var(--orbit-angle) * -1)) translate(-50%, -50%); }
}

/* ===== RITUAL ALTAR ===== */
.ritual-altar {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  overflow-y: auto; overflow-x: hidden;
  padding: 40px clamp(20px, 5vw, 48px) 60px;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(194, 60, 46, .08) transparent;
  background: radial-gradient(ellipse at 50% 20%, rgba(194, 60, 46, .02) 0%, transparent 50%);
}
.ritual-altar::-webkit-scrollbar { width: 3px; }
.ritual-altar::-webkit-scrollbar-track { background: transparent; }
.ritual-altar::-webkit-scrollbar-thumb { background: rgba(194, 60, 46, .1); border-radius: 3px; }

.ritual-invocation {
  text-align: center; margin-bottom: 48px;
  animation: ritual-scroll-appear 1.2s var(--ease) both;
}
.ritual-seal-stamp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border: 2px solid rgba(194, 60, 46, .4);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(194, 60, 46, .08), rgba(194, 60, 46, .02));
  color: var(--cinnabar); font-family: var(--font-han); font-size: 28px;
  text-shadow: 0 0 16px rgba(194, 60, 46, .3);
  margin-bottom: 16px;
  animation: seal-stamp-breathe 3s ease-in-out infinite;
}
@keyframes seal-stamp-breathe {
  0%, 100% { box-shadow: 0 0 16px rgba(194, 60, 46, .1); transform: scale(1); }
  50% { box-shadow: 0 0 30px rgba(194, 60, 46, .2); transform: scale(1.04); }
}
.ritual-invocation h2 {
  font-size: clamp(36px, 6vw, 56px); line-height: 1; margin-bottom: 8px;
  text-shadow: 0 2px 20px rgba(61, 43, 31, .06);
}
.oracle-whisper {
  color: var(--muted); font-size: 14px; font-style: italic;
  max-width: 44ch; margin: 0 auto;
}
.ritual-ink-divider {
  margin: 28px auto 0;
  width: min(280px, 60vw); height: 2px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .3), rgba(212, 168, 67, .2), transparent);
  border-radius: 2px;
}
@keyframes ritual-scroll-appear {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== RITUAL STATIONS ===== */
.ritual-station {
  width: min(680px, 100%);
  padding: 0 0 12px; position: relative;
  opacity: 0; max-height: 0; overflow: hidden;
  transform: translateY(20px);
  transition: opacity 800ms var(--ease), max-height 800ms var(--ease), transform 800ms var(--ease), padding 800ms var(--ease);
  pointer-events: none;
}
.ritual-station.is-active { opacity: 1; max-height: 400px; transform: translateY(0); padding-bottom: 32px; pointer-events: auto; }
.ritual-station.is-revealed { opacity: 1; max-height: 500px; transform: translateY(0); padding-bottom: 32px; pointer-events: auto; }
.ritual-station.is-active::before,
.ritual-station.is-revealed::before {
  content: ""; position: absolute; left: -12px; top: 0; bottom: 12px; width: 2px;
  background: linear-gradient(180deg, rgba(194, 60, 46, .2), rgba(212, 168, 67, .1), transparent);
  border-radius: 2px;
}
.ritual-station.is-complete .station-seal { opacity: 1; transform: scale(1); }
.ritual-station.is-complete .station-number { color: var(--gold); }
.ritual-station.is-complete.is-revealed,
.ritual-station.is-complete.is-active { opacity: .75; }
.ritual-station.is-complete.is-revealed:hover,
.ritual-station.is-complete.is-active:focus-within { opacity: 1; }

.station-header {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 18px; position: relative;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(194, 60, 46, .06);
}
.station-header::before {
  content: ""; position: absolute; left: -20px; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(194, 60, 46, .2);
  transform: translateY(-50%);
}
.station-number {
  font-family: var(--font-han); font-size: 24px;
  color: var(--cinnabar);
  letter-spacing: .1em;
  transition: color 400ms var(--ease);
}
.station-title {
  font-family: var(--font-serif); font-size: 19px;
  color: rgba(61, 43, 31, .8);
  letter-spacing: .06em;
}
.station-required {
  color: var(--cinnabar); font-size: 18px; font-weight: 700;
  line-height: 1;
}
.station-seal {
  margin-left: auto;
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid rgba(212, 168, 67, .3); border-radius: 3px;
  background: rgba(212, 168, 67, .06);
  color: var(--gold); font-family: var(--font-han); font-size: 11px;
  opacity: 0; transform: scale(0);
  transition: opacity 400ms var(--ease), transform 400ms cubic-bezier(.34, 1.56, .64, 1);
}
.station-body { padding-top: 4px; }

/* ===== INK INPUT ===== */
.ink-input-wrap { position: relative; width: 100%; }
.ink-input {
  width: 100%; padding: 14px 4px;
  color: var(--ink); background: transparent;
  border: none; border-bottom: none; outline: none;
  font-size: 20px; font-family: var(--font-han), var(--font-serif);
  letter-spacing: .12em; caret-color: var(--cinnabar);
  transition: color 300ms var(--ease);
}
.ink-input::placeholder {
  color: rgba(61, 43, 31, .2); font-style: normal;
  font-size: 16px; font-family: var(--font-serif);
  letter-spacing: .04em;
}
.ink-input:focus { color: var(--ink); }
.ink-brush-line {
  position: absolute; bottom: 0; left: 50%; right: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .5), rgba(212, 168, 67, .4), rgba(194, 60, 46, .5), transparent);
  transition: left 500ms var(--ease), right 500ms var(--ease), height 300ms var(--ease);
  border-radius: 2px;
}
.ink-input:focus ~ .ink-brush-line { left: 0; right: 0; height: 3px; }
.ink-input.is-filled ~ .ink-brush-line {
  left: 0; right: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, .25), rgba(194, 60, 46, .15), transparent);
}

/* ===== ENERGY PORTALS ===== */
.portal-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; padding: 8px 0; }
.energy-portal {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 24px 24px;
  border: 1px solid rgba(194, 60, 46, .06); border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  color: var(--muted); cursor: pointer;
  transition: all 500ms var(--ease);
  position: relative; overflow: hidden;
  aspect-ratio: 1; max-width: 220px; justify-self: center;
}
.portal-ring {
  position: absolute; inset: -12%; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .04);
  transition: all 500ms var(--ease); pointer-events: none;
}
.energy-portal:hover .portal-ring { border-color: rgba(194, 60, 46, .12); }
.energy-portal:hover { transform: translateY(-4px) scale(1.03); border-color: rgba(194, 60, 46, .12); }
.portal-symbol {
  font-family: var(--font-han); font-size: clamp(36px, 6vw, 48px);
  color: rgba(194, 60, 46, .35);
  text-shadow: 0 0 16px rgba(194, 60, 46, .1);
  transition: all 400ms var(--ease);
}
.portal-trigram { font-size: 22px; color: rgba(194, 60, 46, .1); transition: all 400ms var(--ease); }
.portal-label { font-size: 12px; letter-spacing: .1em; color: rgba(61, 43, 31, .3); transition: color 300ms var(--ease); }

.energy-portal.is-selected {
  border-color: rgba(194, 60, 46, .35);
  background: rgba(255, 255, 255, .5);
  transform: translateY(-4px) scale(1.06);
}
.energy-portal.is-selected .portal-ring { border-color: rgba(194, 60, 46, .12); }
.energy-portal.is-selected .portal-symbol { transform: scale(1.1); }
.energy-portal.is-selected .portal-label { color: var(--ink); }
.portal-yang.is-selected {
  border-color: rgba(194, 60, 46, .4);
  box-shadow: 0 0 30px rgba(194, 60, 46, .08);
}
.portal-yang.is-selected .portal-symbol { color: var(--cinnabar); text-shadow: 0 0 20px rgba(194, 60, 46, .3); }
.portal-yang.is-selected .portal-trigram { color: rgba(194, 60, 46, .3); }
.portal-yin.is-selected {
  border-color: rgba(79, 144, 123, .4);
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 0 30px rgba(79, 144, 123, .08);
}
.portal-yin.is-selected .portal-ring { border-color: rgba(79, 144, 123, .12); }
.portal-yin.is-selected .portal-symbol { color: var(--jade); text-shadow: 0 0 20px rgba(79, 144, 123, .3); }
.portal-yin.is-selected .portal-trigram { color: rgba(79, 144, 123, .3); }

.portal-divider { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
.portal-taiji {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .1);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CclipPath id='c'%3E%3Ccircle cx='100' cy='100' r='100'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg clip-path='url(%23c)'%3E%3Crect width='200' height='200' fill='%233d2b1f'/%3E%3Cpath d='M100,0 A100,100 0 0,1 100,200 A50,50 0 0,0 100,100 A50,50 0 0,1 100,0Z' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='50' r='15' fill='%23c23c2e'/%3E%3Ccircle cx='100' cy='150' r='15' fill='%233d2b1f'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  animation: lock-breathe 4s ease-in-out infinite;
}

/* ===== ORACLE PORTALS (3-card layout) ===== */
.oracle-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 8px 0;
}
.oracle-portal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 12px 20px;
  border: 1px solid rgba(194, 60, 46, .06);
  border-radius: 16px;
  background: rgba(255, 255, 255, .3);
  color: var(--muted);
  cursor: pointer;
  transition: all 500ms var(--ease);
  position: relative;
  overflow: hidden;
  max-width: 200px;
  justify-self: center;
}
.oracle-portal .portal-ring {
  position: absolute;
  inset: -8%;
  border-radius: 16px;
  border: 1px solid rgba(194, 60, 46, .04);
  transition: all 500ms var(--ease);
  pointer-events: none;
}
.oracle-portal:hover .portal-ring { border-color: rgba(194, 60, 46, .12); }
.oracle-portal:hover { transform: translateY(-4px) scale(1.03); border-color: rgba(194, 60, 46, .12); }
.oracle-portal .portal-symbol {
  font-size: clamp(28px, 5vw, 40px);
  transition: all 400ms var(--ease);
}
.oracle-portal .portal-trigram {
  font-size: 18px;
  color: rgba(194, 60, 46, .1);
  transition: all 400ms var(--ease);
}
.oracle-portal .portal-label {
  font-size: 13px;
  letter-spacing: .08em;
  color: rgba(61, 43, 31, .5);
  text-align: center;
  line-height: 1.4;
  transition: color 300ms var(--ease);
}
.oracle-portal .portal-label small {
  display: block;
  font-size: 11px;
  opacity: .7;
}
.oracle-portal .portal-tagline {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(61, 43, 31, .25);
  transition: color 300ms var(--ease);
}

/* Oracle portal selected states */
.oracle-portal.is-selected {
  border-color: rgba(194, 60, 46, .35);
  background: rgba(255, 255, 255, .5);
  transform: translateY(-4px) scale(1.06);
}
.oracle-portal.is-selected .portal-ring { border-color: rgba(194, 60, 46, .12); }
.oracle-portal.is-selected .portal-symbol { transform: scale(1.15); }
.oracle-portal.is-selected .portal-label { color: var(--ink); }
.oracle-portal.is-selected .portal-tagline { color: var(--cinnabar); }

/* Sage variant — mountain/earth tones */
.portal-sage.is-selected {
  border-color: rgba(139, 115, 85, .5);
  box-shadow: 0 0 30px rgba(139, 115, 85, .1);
}
.portal-sage.is-selected .portal-symbol { text-shadow: 0 0 20px rgba(139, 115, 85, .3); }
.portal-sage.is-selected .portal-trigram { color: rgba(139, 115, 85, .3); }

/* Water/Oracle variant — jade tones */
.portal-water.is-selected {
  border-color: rgba(79, 144, 123, .5);
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 0 30px rgba(79, 144, 123, .1);
}
.portal-water.is-selected .portal-ring { border-color: rgba(79, 144, 123, .12); }
.portal-water.is-selected .portal-symbol { text-shadow: 0 0 20px rgba(79, 144, 123, .3); }
.portal-water.is-selected .portal-trigram { color: rgba(79, 144, 123, .3); }
.portal-water.is-selected .portal-tagline { color: var(--jade); }

/* Storm variant — cinnabar/red tones */
.portal-storm.is-selected {
  border-color: rgba(194, 60, 46, .5);
  box-shadow: 0 0 30px rgba(194, 60, 46, .1);
}
.portal-storm.is-selected .portal-symbol { text-shadow: 0 0 20px rgba(194, 60, 46, .3); }
.portal-storm.is-selected .portal-trigram { color: rgba(194, 60, 46, .3); }
.portal-storm.is-selected .portal-tagline { color: var(--cinnabar); }

/* Oracle station needs more vertical space for 3 cards */
.ritual-station[data-step="oracle"].is-revealed,
.ritual-station[data-step="oracle"].is-active { max-height: 600px; }

/* ===== CELESTIAL COORDINATES ===== */
.celestial-row { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; gap: 0; align-items: end; }
.celestial-node { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.celestial-ring {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 90%; height: 80%; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .04);
  pointer-events: none;
}
.celestial-label {
  font-family: var(--font-han); font-size: 13px;
  color: var(--cinnabar); letter-spacing: .18em;
}
.ink-input-celestial {
  text-align: center; padding: 12px 4px;
  font-size: 22px; font-family: var(--font-serif);
  letter-spacing: .15em; -moz-appearance: textfield; width: 100%;
}
.ink-input-celestial::-webkit-outer-spin-button,
.ink-input-celestial::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.celestial-connector {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .1), transparent);
  align-self: center; margin-bottom: 22px; position: relative;
}
.celestial-connector::before {
  content: ""; position: absolute; left: 50%; top: -2px;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(194, 60, 46, .12);
  transform: translateX(-50%);
}

/* ===== PRAYER SCROLL ===== */
.prayer-scroll {
  width: 100%; padding: 16px 18px 16px 48px;
  border: 1px solid rgba(194, 60, 46, .08); border-radius: 8px;
  background: rgba(255, 255, 255, .4);
  position: relative;
  transition: border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}
.prayer-scroll:focus-within { border-color: rgba(194, 60, 46, .2); box-shadow: 0 0 20px rgba(194, 60, 46, .04); }
.prayer-seal {
  position: absolute; top: 12px; left: 12px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid rgba(194, 60, 46, .2); border-radius: 3px;
  background: rgba(194, 60, 46, .04);
  color: var(--cinnabar); font-family: var(--font-han); font-size: 14px;
  pointer-events: none;
}
.prayer-scroll::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 40px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .2), transparent);
}
textarea {
  width: 100%; resize: vertical; min-height: 80px; padding: 12px;
  color: var(--ink); background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(194, 60, 46, .06); border-radius: 6px; outline: none;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
  font-size: 16px; font-family: var(--font-serif);
}
textarea:focus { border-color: rgba(194, 60, 46, .25); box-shadow: 0 0 12px rgba(194, 60, 46, .04); }
textarea::placeholder { color: rgba(61, 43, 31, .2); font-style: italic; }
.prompt-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 100%; margin-top: 12px; }
.prompt-row button {
  padding: 6px 10px; color: var(--muted); font-size: 11px;
  border: 1px solid rgba(194, 60, 46, .06); border-radius: 4px;
  background: rgba(255, 255, 255, .3);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  white-space: nowrap;
}
.prompt-row button:hover { border-color: rgba(194, 60, 46, .25); box-shadow: 0 0 8px rgba(194, 60, 46, .06); }

/* ===== CAST BUTTON ===== */
.ritual-cast-wrap { text-align: center; padding-top: 16px; }
.btn-cast {
  min-height: 56px; font-size: 15px; letter-spacing: .18em;
  padding: 16px 40px; position: relative; overflow: hidden;
  width: min(480px, 90%);
}
.btn-cast::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(212, 168, 67, .12), transparent 70%);
  opacity: 0; transform: scale(0);
  transition: opacity 400ms var(--ease), transform 600ms var(--ease);
}
.btn-cast:hover::after { opacity: 1; transform: scale(1.5); }
.cast-icon { display: inline-block; margin-right: 8px; font-size: 20px; animation: cast-icon-pulse 2s ease-in-out infinite; }
@keyframes cast-icon-pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.ritual-cast-hint {
  margin-top: 12px; font-size: 12px;
  color: rgba(194, 60, 46, .3); letter-spacing: .06em;
  font-family: var(--font-sans);
  transition: opacity 400ms var(--ease), color 400ms var(--ease);
}
.ritual-cast-hint.is-ready { color: rgba(212, 168, 67, .6); }
.ritual-cast-hint.is-hidden { opacity: 0; }
.btn-cast.is-locked { opacity: .3; cursor: not-allowed; filter: grayscale(.4); }
.btn-cast.is-locked:hover { transform: none; }
.btn-cast.is-locked::after { display: none; }
.btn-cast.is-locked .cast-icon { animation: none; opacity: .5; }

.ritual-station.is-error .station-required { animation: required-pulse 1s ease-in-out infinite; }
@keyframes required-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; text-shadow: 0 0 8px rgba(194, 60, 46, .4); }
}

/* ========================================
   LAYER 5: CASTING
   ======================================== */
.casting-content { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.countdown { position: relative; }
.countdown span {
  display: block; font-family: var(--font-serif); font-size: clamp(120px, 20vw, 200px);
  font-weight: 600; color: var(--cinnabar);
  text-shadow: 0 0 40px rgba(194, 60, 46, .2);
  animation: countdown-pulse 800ms ease-out;
}
@keyframes countdown-pulse { 0% { transform: scale(1.4); opacity: .5; } 50% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.hexagram-assembly { width: 200px; display: grid; gap: 14px; }
.hexagram-assembly span {
  height: 14px; border-radius: 99px; background: rgba(61, 43, 31, .1);
  opacity: 0; transform: translateX(-200px) scaleX(0);
  transition: opacity 400ms var(--ease), transform 600ms cubic-bezier(.34, 1.56, .64, 1);
}
.hexagram-assembly span.is-assembled { opacity: 1; transform: translateX(0) scaleX(1); }
.hexagram-assembly span.yang { background: var(--cinnabar); box-shadow: 0 0 14px rgba(194, 60, 46, .2); }
.hexagram-assembly span.yin { background: linear-gradient(90deg, var(--cinnabar) 0 42%, transparent 42% 58%, var(--cinnabar) 58%); box-shadow: 0 0 14px rgba(194, 60, 46, .2); }
.hexagram-assembly span.changing { background-color: var(--gold); box-shadow: 0 0 18px rgba(212, 168, 67, .3); animation: pulse-changing 1.2s ease-in-out infinite; }
@keyframes pulse-changing { 0%, 100% { box-shadow: 0 0 18px rgba(212, 168, 67, .3); } 50% { box-shadow: 0 0 30px rgba(212, 168, 67, .5); } }
.energy-signature { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; height: 100px; align-items: end; width: 240px; }
.energy-signature i { display: block; height: 0; border-radius: 99px 99px 4px 4px; background: linear-gradient(180deg, var(--cinnabar), var(--gold)); box-shadow: 0 0 8px rgba(194, 60, 46, .15); transition: height 800ms cubic-bezier(.34, 1.56, .64, 1); }
.energy-signature i.is-filled { height: var(--v, 50%); }

/* ========================================
   LAYER 6: READING
   ======================================== */
#layer-reading { align-items: flex-start; justify-content: center; }
.reading-revelation {
  display: flex; flex-direction: column; align-items: center;
  max-width: 680px; width: 100%; text-align: center;
  position: relative; overflow-y: auto; overflow-x: hidden;
  padding-bottom: 40px;
  scrollbar-width: thin; scrollbar-color: rgba(194, 60, 46, .08) transparent;
}
.reading-revelation::-webkit-scrollbar { width: 3px; }
.reading-revelation::-webkit-scrollbar-track { background: transparent; }
.reading-revelation::-webkit-scrollbar-thumb { background: rgba(194, 60, 46, .1); border-radius: 3px; }

.reading-float-symbols {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.reading-float-symbols span {
  position: absolute;
  color: rgba(194, 60, 46, .04);
  font-family: var(--font-han); font-size: clamp(60px, 10vw, 120px);
  animation: reading-symbol-float var(--rfs-d, 18s) ease-in-out infinite alternate;
  opacity: 0; transition: opacity 1.5s var(--ease);
}
.reading-float-symbols span:nth-child(1) { left: 5%; top: 15%; --rfs-d: 18s; }
.reading-float-symbols span:nth-child(2) { right: 8%; top: 25%; --rfs-d: 22s; animation-delay: -3s; }
.reading-float-symbols span:nth-child(3) { left: 12%; bottom: 20%; --rfs-d: 20s; animation-delay: -6s; }
.reading-float-symbols span:nth-child(4) { right: 5%; bottom: 15%; --rfs-d: 24s; animation-delay: -9s; }
.reading-float-symbols span:nth-child(5) { left: 25%; top: 60%; --rfs-d: 19s; animation-delay: -2s; }
.reading-float-symbols span:nth-child(6) { right: 20%; top: 50%; --rfs-d: 21s; animation-delay: -5s; }
#layer-reading.is-active .reading-float-symbols span { opacity: 1; transition-delay: calc(var(--rfs-i) * 0.3s + 1s); }
@keyframes reading-symbol-float { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(-20px) rotate(5deg); } }

.reading-shrine {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 16px; margin-bottom: 32px;
}
.shrine-glow {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 168, 67, .08), rgba(194, 60, 46, .04) 40%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: shrine-pulse 4s ease-in-out infinite;
  pointer-events: none;
}
.shrine-glow-2 {
  position: absolute; width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 60, 46, .05), rgba(212, 168, 67, .02) 50%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: shrine-pulse 4s ease-in-out infinite reverse;
  pointer-events: none;
}
.shrine-rays { display: none; }
@keyframes shrine-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .4; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: .8; }
}
.hexagram-display {
  width: 140px; display: grid; gap: 10px; margin: 0 auto;
  position: relative; z-index: 1;
}
.hexagram-display span {
  height: 12px; border-radius: 99px; background: rgba(61, 43, 31, .1);
  opacity: 0; transform: scaleX(0);
  transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1), opacity 400ms var(--ease);
}
.hexagram-display span.is-revealed { opacity: 1; transform: scaleX(1); }
.hexagram-display span.yang { background: var(--cinnabar); box-shadow: 0 0 14px rgba(194, 60, 46, .2); }
.hexagram-display span.yin { background: linear-gradient(90deg, var(--cinnabar) 0 42%, transparent 42% 58%, var(--cinnabar) 58%); }
.hexagram-display span.changing { background-color: var(--gold); box-shadow: 0 0 18px rgba(212, 168, 67, .3); animation: pulse-changing 1.2s ease-in-out infinite; }
.reading-shrine h2 {
  font-size: clamp(30px, 4.5vw, 48px); line-height: 1; position: relative; z-index: 1;
  text-shadow: 0 2px 16px rgba(61, 43, 31, .06);
}
.reading-meta {
  color: var(--cinnabar); font-size: 13px; letter-spacing: .12em;
  position: relative; z-index: 1;
}

.reading-scroll {
  width: 100%; text-align: left;
  padding: 28px 28px; margin-bottom: 20px;
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 10px;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 2px 12px rgba(61, 43, 31, .03);
  position: relative; overflow: hidden;
  animation: scroll-unfurl 1.2s var(--ease) both;
}
@keyframes scroll-unfurl { 0% { opacity: 0; } 30% { opacity: .5; } 100% { opacity: 1; } }
.reading-scroll::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .3), rgba(212, 168, 67, .2), transparent);
}
.scroll-ornament { width: 100%; height: 12px; position: relative; margin: 8px 0; }
.scroll-ornament::before {
  content: ""; position: absolute; top: 50%; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .12), rgba(212, 168, 67, .1), rgba(194, 60, 46, .12), transparent);
}
.scroll-ornament::after {
  content: "◆"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(194, 60, 46, .2); font-size: 8px;
  background: var(--cream); padding: 0 6px;
}
.scroll-ornament-bottom { margin-top: 16px; }
.reading-scroll .kicker { margin-bottom: 20px; }
.reading-judgment, .reading-image {
  color: var(--muted); font-family: var(--font-serif); font-size: 17px; line-height: 1.7;
  margin-bottom: 16px; padding: 14px 18px; border-left: 2px solid rgba(194, 60, 46, .15); text-align: left;
}
.reading-judgment { border-left-color: rgba(212, 168, 67, .2); }
.reading-body { color: var(--ink); font-size: 16px; line-height: 1.85; margin-bottom: 0; min-height: 60px; text-align: left; }

/* AI Deep Reading */
.ai-reading {
  width: 100%; margin-top: 0; margin-bottom: 20px;
  padding: 0; text-align: left;
  border: 1px solid rgba(194, 60, 46, .15); border-radius: 10px;
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 2px 16px rgba(61, 43, 31, .03);
  position: relative;
  transition: border-color 800ms var(--ease), box-shadow 800ms var(--ease);
}
.ai-reading.is-streaming { border-color: rgba(194, 60, 46, .25); box-shadow: 0 4px 20px rgba(194, 60, 46, .06); }
.ai-reading.is-complete { border-color: rgba(212, 168, 67, .25); box-shadow: 0 4px 20px rgba(212, 168, 67, .06); }
.ai-reading.is-loading { border-color: rgba(194, 60, 46, .2); animation: ai-panel-pulse 2s ease-in-out infinite; }
@keyframes ai-panel-pulse {
  0%, 100% { box-shadow: 0 2px 16px rgba(194, 60, 46, .03); }
  50% { box-shadow: 0 4px 24px rgba(194, 60, 46, .08); }
}
.ai-reading::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(194, 60, 46, .4), rgba(212, 168, 67, .2), transparent);
}
.ai-reading .kicker { color: var(--cinnabar); margin-bottom: 16px; padding: 24px 24px 0; }
.ai-reading-body { color: var(--ink); font-size: 15px; line-height: 1.85; white-space: pre-wrap; padding: 0 24px 24px; }

.ai-loading { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px 24px; }
.ai-loading-trigrams { display: flex; gap: 8px; font-size: 20px; }
.ai-trigram-spin {
  display: inline-block; color: var(--cinnabar);
  animation: trigram-appear 0.5s var(--ease) var(--td) both;
}
@keyframes trigram-appear {
  0% { opacity: 0; transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.ai-loading-text {
  color: var(--cinnabar); font-family: var(--font-han); font-size: 20px;
  letter-spacing: .15em;
  animation: ai-text-pulse 1.5s ease-in-out infinite;
}
@keyframes ai-text-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

.ai-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; text-align: center; }
.ai-error-icon { font-size: 28px; }
.ai-error span { color: var(--cinnabar); }
.ai-error-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ai-error code { background: rgba(194, 60, 46, .06); color: var(--cinnabar); padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.ai-error-steps {
  display: flex; flex-direction: column; gap: 6px; margin-top: 12px;
  padding: 16px; border: 1px solid rgba(194, 60, 46, .08); border-radius: 8px;
  background: rgba(255, 255, 255, .3);
}
.ai-error-steps code { display: block; text-align: left; font-size: 13px; background: rgba(194, 60, 46, .04); color: var(--cinnabar); padding: 6px 12px; border-radius: 4px; }
.ai-error-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

.ai-reading-body .ai-loading {
  display: flex; align-items: center; gap: 12px; color: var(--cinnabar);
  font-family: var(--font-han); font-size: 20px; letter-spacing: .15em;
}
.ai-reading-body .ai-loading::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(194, 60, 46, .15); border-top-color: var(--cinnabar);
  animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.energy-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; height: 60px; align-items: end; margin: 0 auto 20px; max-width: 240px; }
.energy-bars i { display: block; height: 0; border-radius: 99px 99px 4px 4px; background: linear-gradient(180deg, var(--cinnabar), var(--gold)); box-shadow: 0 0 8px rgba(194, 60, 46, .15); transition: height 800ms cubic-bezier(.34, 1.56, .64, 1); }
.energy-bars i.is-filled { height: var(--v, 50%); }
.closing-actions { justify-content: center; margin-top: 8px; }

/* ========================================
   LAYER 7: GATE SEALED
   ======================================== */
#seal-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 0; pointer-events: none; }
.seal-ink-splash {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(194, 60, 46, .08), transparent 60%);
  opacity: 0; transition: opacity 400ms var(--ease);
}
.seal-ink-splash.is-active { opacity: 1; animation: ink-splash-pulse 800ms ease-out forwards; }
@keyframes ink-splash-pulse { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1.2); } 60% { opacity: .6; } 100% { opacity: 0; } }

.gate-close-anim { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.seal-ring {
  position: absolute; width: 340px; height: 340px;
  border-radius: 50%; border: 3px solid rgba(194, 60, 46, .4);
  display: grid; place-items: center;
  box-shadow: 0 0 60px rgba(194, 60, 46, .15), inset 0 0 40px rgba(194, 60, 46, .06);
  opacity: 0; transform: scale(0) rotate(-720deg);
  transition: opacity 800ms var(--ease), transform 1600ms cubic-bezier(.16, 1, .3, 1);
}
.seal-ring.is-sealing { opacity: 1; transform: scale(1) rotate(0deg); box-shadow: 0 0 80px rgba(194, 60, 46, .2), inset 0 0 40px rgba(194, 60, 46, .1); }
.seal-ring.is-sealed { opacity: 1; transform: scale(1.15) rotate(0deg); box-shadow: 0 0 120px rgba(194, 60, 46, .25), inset 0 0 60px rgba(194, 60, 46, .12); animation: sealed-ring-breathe 3s ease-in-out infinite; }
@keyframes sealed-ring-breathe {
  0%, 100% { box-shadow: 0 0 120px rgba(194, 60, 46, .25), inset 0 0 60px rgba(194, 60, 46, .12); }
  50% { box-shadow: 0 0 160px rgba(194, 60, 46, .35), inset 0 0 80px rgba(194, 60, 46, .18); }
}
.seal-ring-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; }
.seal-trigram { color: rgba(212, 168, 67, .4); font-size: 24px; }
.seal-stamp {
  font-family: var(--font-han); font-size: 110px; color: var(--cinnabar);
  text-shadow: 0 0 30px rgba(194, 60, 46, .3);
  line-height: 1;
}
.seal-trigram-orbit {
  position: absolute; width: 100%; height: 100%;
  animation: seal-text-rotate 12s linear infinite;
}
.seal-trigram-orbit span {
  position: absolute; left: 50%; top: 50%;
  font-family: var(--font-han); font-size: 14px;
  color: rgba(194, 60, 46, .3);
  transform: rotate(calc(var(--sto-i) * 45deg)) translateY(-165px) rotate(calc(var(--sto-i) * -45deg));
  transform-origin: 0 0; letter-spacing: .1em;
}

.close-doors { position: absolute; inset: 0; display: flex; perspective: 1200px; }
.close-door {
  width: 50%; height: 100%;
  background: linear-gradient(90deg, var(--cream-2), var(--parchment));
  border: 1px solid rgba(194, 60, 46, .1);
  opacity: 0; transition: opacity 600ms var(--ease), transform 1600ms cubic-bezier(.16, 1, .3, 1);
  position: relative; overflow: hidden;
}
.door-texture {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 48px, rgba(194, 60, 46, .02) 48px 50px),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(212, 168, 67, .01) 48px 50px);
}
.door-rune {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-family: var(--font-han); font-size: clamp(80px, 12vw, 140px);
  color: rgba(194, 60, 46, .06);
}
.door-rune-l { right: 20%; }
.door-rune-r { left: 20%; }
.close-door-l { transform-origin: left center; transform: rotateY(90deg); }
.close-door-r { transform-origin: right center; transform: rotateY(-90deg); }
.close-doors.is-closing .close-door { opacity: 1; }
.close-doors.is-closing .close-door-l { transform: rotateY(0deg); }
.close-doors.is-closing .close-door-r { transform: rotateY(0deg); }

.sealed-content {
  position: relative; z-index: 3; text-align: center;
  opacity: 0; transform: translateY(30px);
  transition: opacity 800ms var(--ease) 2000ms, transform 800ms var(--ease) 2000ms;
}
.sealed-content.is-revealed { opacity: 1; transform: translateY(0); }
.sealed-seal-mark { margin-bottom: 28px; animation: seal-float 4s ease-in-out infinite; }
@keyframes seal-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.seal-circle {
  width: 160px; height: 160px; margin: 0 auto; position: relative;
  border-radius: 50%; border: 2px solid rgba(194, 60, 46, .35);
  display: grid; place-items: center;
  box-shadow: 0 0 40px rgba(194, 60, 46, .1), inset 0 0 24px rgba(194, 60, 46, .04);
  background: radial-gradient(circle, rgba(194, 60, 46, .04), transparent 70%);
}
.seal-char {
  font-family: var(--font-han); font-size: 72px; color: var(--cinnabar);
  text-shadow: 0 0 24px rgba(194, 60, 46, .3);
  line-height: 1;
}
.seal-ring-text {
  position: absolute; width: 100%; height: 100%;
  font-family: var(--font-han); font-size: 14px; color: rgba(194, 60, 46, .3);
  letter-spacing: .3em; animation: seal-text-rotate 20s linear infinite;
}
@keyframes seal-text-rotate { to { transform: rotate(360deg); } }

.sealed-content h2 { font-size: clamp(38px, 6vw, 76px); margin-bottom: 12px; }
.sealed-sub {
  color: var(--cinnabar); font-family: var(--font-han); font-size: 20px;
  letter-spacing: .2em; margin-bottom: 8px;
}
.sealed-verse {
  color: var(--muted); font-family: var(--font-serif); font-size: 17px;
  font-style: italic; max-width: 40ch; margin: 0 auto 28px; line-height: 1.6;
}
.sealed-content p:not(.sealed-sub):not(.sealed-verse) { color: var(--muted); margin-bottom: 24px; }

/* ========================================
   SCREEN SHAKE + GLITCH (保留但弱化)
   ======================================== */
@keyframes screen-shake {
  0% { transform: translate(0, 0); } 10% { transform: translate(-3px, 2px); }
  20% { transform: translate(2px, -2px); } 30% { transform: translate(-2px, 3px); }
  40% { transform: translate(3px, -1px); } 50% { transform: translate(-2px, 2px); }
  60% { transform: translate(2px, -3px); } 70% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, 2px); } 90% { transform: translate(-1px, -2px); }
  100% { transform: translate(0, 0); }
}
.screen-shake { animation: screen-shake 700ms ease-out; }
.glitch-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: linear-gradient(0deg, transparent 48%, rgba(194, 60, 46, .06) 49%, rgba(212, 168, 67, .04) 50%, transparent 51%);
  animation: glitch-flash 400ms ease-out forwards;
}
@keyframes glitch-flash { 0% { opacity: 0; } 10% { opacity: .5; } 20% { opacity: 0; } 30% { opacity: .2; } 40% { opacity: 0; } 100% { opacity: 0; } }

/* ========================================
   KEYFRAMES
   ======================================== */
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes lock-breathe { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.045); filter: brightness(1.06); } }

/* ========================================
   GATE LAYER — HOMEPAGE REDESIGN
   ======================================== */

/* Gate layer: scrollable when active */
.realm-layer[data-state="gate"].is-active {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}
.realm-layer[data-state="gate"].is-active > * {
  margin-block: 0;
}

/* Home wrapper */
.gate-home {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 54px);
}

/* ===== HERO ===== */
.gate-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
  padding-top: 60px;
}
.gate-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.gate-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  animation: scroll-bounce 2.4s ease-in-out infinite;
}
.scroll-arrow {
  width: 20px;
  height: 20px;
  margin: 8px auto 0;
  border-right: 2px solid var(--cinnabar);
  border-bottom: 2px solid var(--cinnabar);
  transform: rotate(45deg);
  opacity: .4;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== GATE SECTIONS ===== */
.gate-section {
  padding: 80px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.gate-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.gate-section .section-head {
  text-align: center;
  margin-bottom: 48px;
}
.gate-section .section-head h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
}
.gate-section-cta {
  text-align: center;
  margin-top: 24px;
}
.gate-section-desc {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 20px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}
.section-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: .06em;
}
.section-desc {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 20px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}
.gate-section-note {
  text-align: center;
  font-size: 13px;
  color: var(--brown);
  margin: 12px auto 0;
  max-width: 480px;
}
.lead-sub {
  font-size: clamp(14px, 1.5vw, 18px);
  color: var(--brown);
  font-family: var(--font-serif);
  letter-spacing: .12em;
  margin-top: 8px;
}

/* ===== DAILY ORACLE SECTION ===== */
.gate-daily-section .daily-oracle {
  max-width: 480px;
  margin: 0 auto;
}

/* ===== SIX GATES CARD GRID ===== */
.gates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gate-card {
  padding: 28px 24px;
  border: 1px solid rgba(194, 60, 46, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
  position: relative;
}
.gate-card:hover {
  transform: translateY(-4px);
  border-color: var(--cinnabar);
  box-shadow: 0 8px 30px rgba(194, 60, 46, .08), 0 0 0 1px rgba(194, 60, 46, .1);
}
.gate-card:active {
  transform: translateY(-1px);
}
.gate-card-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(61, 43, 31, .06);
  color: var(--brown);
  margin-bottom: 14px;
}
.gate-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(194, 60, 46, .08);
  color: var(--cinnabar);
  margin-bottom: 14px;
}
.gate-card-badge.badge-new {
  background: rgba(212, 168, 67, .12);
  color: var(--gold-2);
}
.gate-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--deep-ink);
  font-family: var(--font-serif);
  letter-spacing: .02em;
}
.gate-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

/* ===== WHY CHOOSE US ===== */
.why-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: .06em;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.why-card {
  text-align: center;
  padding: 32px 24px;
}
.why-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--deep-ink);
  font-family: var(--font-serif);
}
.why-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ===== LANTERN WALL PREVIEW ===== */
.lantern-preview-stats {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: .04em;
}
.lantern-preview-stats strong {
  color: var(--gold);
  font-weight: 600;
}
.lantern-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.lantern-preview-item {
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(212, 168, 67, .06);
  border: 1px solid rgba(212, 168, 67, .1);
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.lantern-preview-item:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(212, 168, 67, .15);
}

/* ===== QUOTES ===== */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.quote-card {
  padding: 28px 24px;
  border-left: 3px solid var(--cinnabar);
  background: rgba(255, 255, 255, .35);
  border-radius: 0 10px 10px 0;
  margin: 0;
}
.quote-card p {
  font-family: var(--font-han);
  font-size: 22px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 14px;
}
.quote-card cite {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
}

/* ===== FOOTER ===== */
.gate-footer {
  padding: 48px 0 32px;
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.gate-footer-disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.gate-footer-consent {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.gate-footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
}
.gate-footer-links a {
  font-size: 13px;
  color: var(--brown);
  transition: color 200ms;
}
.gate-footer-links a:hover { color: var(--cinnabar); }
.gate-footer-tagline {
  font-family: var(--font-han);
  font-size: 16px;
  color: var(--cinnabar);
  margin: 0;
  opacity: .7;
}

/* ===== MOBILE BOTTOM TAB BAR ===== */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(245, 239, 224, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(194, 60, 46, .1);
  align-items: stretch;
  justify-content: space-around;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 200ms;
  padding: 0;
  min-height: 0;
  letter-spacing: .04em;
}
.tab-item.is-active { color: var(--cinnabar); }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* More sheet */
.mobile-more-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 110;
  background: rgba(245, 239, 224, .98);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid rgba(194, 60, 46, .1);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 300ms var(--ease);
  box-shadow: 0 -4px 30px rgba(61, 43, 31, .08);
}
.mobile-more-sheet:not([hidden]) { transform: translateY(0); }
.more-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--sand);
  margin: 0 auto 16px;
}
.more-item {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  background: none;
  text-align: left;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms;
  min-height: 0;
}
.more-item:hover, .more-item:active { background: rgba(194, 60, 46, .04); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 980px) {
  .cosmos-panel { grid-template-columns: 1fr; }
  .gate-stage { order: 1; min-height: 430px; }
  .culture-strip, .hero-actions, .closing-actions, .path-actions { justify-content: center; }
  .daily-oracle { text-align: center; }
  .daily-hex { justify-content: center; }
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oracle-coins-orbit { width: 260px; height: 260px; }
  .coin-orbit-ring { width: 220px; height: 220px; }
  .coin-orbit-ring-inner { width: 140px; height: 140px; }
  .coin { width: 72px; font-size: 28px; transform: rotate(var(--orbit-angle)) translateX(100px) rotate(calc(var(--orbit-angle) * -1)) translate(-50%, -50%); }
  .portal-mandala { width: 180px; }
  .seal-ring { width: 280px; height: 280px; }
  .seal-trigram-orbit span { transform: rotate(calc(var(--sto-i) * 45deg)) translateY(-130px) rotate(calc(var(--sto-i) * -45deg)); }
  /* Homepage responsive */
  .gates-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .quotes-grid { grid-template-columns: 1fr; }
  .gate-hero .gate-stage { opacity: .15; }
  .topbar nav { gap: clamp(8px, 2vw, 20px); font-size: 11px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .topbar { display: none; }
  .brand__text { display: none; }
  .bagua-orbit { width: min(390px, 88vw); }
  .path-grid { grid-template-columns: 1fr; }
  .btn, .hero-actions a, .hero-actions button { width: 100%; }
  .ritual-altar { padding: 30px 16px 40px; }
  .ritual-invocation h2 { font-size: 36px; }
  .oracle-coins-orbit { width: 200px; height: 200px; top: -30px; right: -30px; }
  .coin-orbit-ring { width: 160px; height: 160px; }
  .coin-orbit-ring-inner { width: 100px; height: 100px; }
  .coin { width: 56px; font-size: 22px; transform: rotate(var(--orbit-angle)) translateX(68px) rotate(calc(var(--orbit-angle) * -1)) translate(-50%, -50%); }
  .oracle-trigrams-float { display: none; }
  .portal-row { grid-template-columns: 1fr 28px 1fr; gap: 8px; }
  .energy-portal { padding: 20px 14px 16px; max-width: 160px; }
  .portal-symbol { font-size: 28px; }
  .oracle-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .oracle-portal { padding: 16px 8px 14px; max-width: 140px; }
  .oracle-portal .portal-symbol { font-size: 24px; }
  .oracle-portal .portal-label { font-size: 11px; }
  .oracle-portal .portal-tagline { font-size: 9px; }
  .celestial-row { grid-template-columns: 1fr 16px 1fr 16px 1fr; }
  .ink-input-celestial { font-size: 18px; padding: 10px 2px; }
  .reading-float-symbols { display: none; }
  .portal-mandala { width: 140px; }
  .seal-ring { width: 240px; height: 240px; }
  .seal-stamp { font-size: 80px; }
  .seal-trigram-orbit span { transform: rotate(calc(var(--sto-i) * 45deg)) translateY(-110px) rotate(calc(var(--sto-i) * -45deg)); font-size: 12px; }
  .seal-circle { width: 120px; height: 120px; }
  .seal-char { font-size: 52px; }
  .shrine-rays { display: none; }
  .door-rune { font-size: 80px; }
  .btn-cast { width: 100%; padding: 16px 20px; }
  /* Homepage mobile */
  .gates-grid { grid-template-columns: 1fr; }
  .gate-hero-cta { flex-direction: column; width: 100%; }
  .gate-hero-cta .btn { width: 100%; }
  .gate-section { padding: 48px 0; }
  .gate-hero .gate-stage { display: none; }
  .gate-scroll-hint { display: none; }
  .gate-hero-content { padding-top: 24px; }
  .why-grid { gap: 20px; }
  .why-card { padding: 20px 16px; }
  .quotes-grid { gap: 16px; }
  .quote-card { padding: 20px 16px; }
  .quote-card p { font-size: 18px; }
  /* Mobile tab bar */
  .mobile-tab-bar { display: flex; }
  .realm-layer[data-state="gate"].is-active { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .gate-footer { padding-bottom: calc(48px + 56px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 1ms !important; }
  .path-card { opacity: 1 !important; transform: none !important; }
  .ritual-station { opacity: 1 !important; max-height: none !important; transform: none !important; overflow: visible !important; pointer-events: auto !important; }
}

/* ==================================================
   菩提苑 CURRENT DARK VISUAL SYSTEM — 2026-07-14
   Keeps the existing application/API layer intact.
   ================================================== */
@font-face {
  font-family: "ZhiMangXing";
  src: url("./assets/putiyuan/ZhiMangXing-subset.woff2") format("woff2");
  font-display: swap;
}

:root {
  --cream: #1a1410;
  --cream-2: #211813;
  --parchment: #2b211a;
  --sand: #6d5a45;
  --warm-gray: #a9977d;
  --brown: #b9a98d;
  --dark-brown: #d4c5a8;
  --ink: #e5d7ba;
  --deep-ink: #f1e4c6;
  --black: #0e0a08;
  --red: #b13e3c;
  --cinnabar: #ca4b48;
  --temple-red: #a93432;
  --gold: #c9a05c;
  --gold-2: #efd89e;
  --amber: #d9b46c;
  --gold-dim: rgba(201,160,92,.22);
  --muted: rgba(229,215,186,.66);
  --soft: rgba(229,215,186,.08);
  --line: rgba(201,160,92,.16);
  --line-gold: rgba(201,160,92,.22);
}

html { background: #17110d; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 7%, rgba(201,160,92,.10), transparent 22%),
    radial-gradient(ellipse at center, rgba(10,6,4,.16), rgba(10,6,4,.72)),
    linear-gradient(180deg, #17110d, #211813 55%, #17110d);
}
body::before {
  opacity: .2;
  background: url("./assets/putiyuan/temple-mountain.svg") center/cover no-repeat;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(10,6,4,.08), rgba(10,6,4,.38) 58%, rgba(10,6,4,.72));
}
#realm-canvas { opacity: .34; }
#smoke-canvas { opacity: .24; }
.ink-border { border-color: rgba(201,160,92,.06); box-shadow: inset 0 0 110px rgba(0,0,0,.26); }

.topbar {
  min-height: 64px; padding: 9px clamp(20px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(23,17,13,.94), rgba(23,17,13,.68) 74%, transparent);
  border-bottom: 1px solid transparent;
}
.brand { color: var(--gold); gap: 9px; }
.brand__leaf {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  color: var(--gold); border: 1px solid rgba(201,160,92,.35); font-size: 25px; transform: rotate(180deg);
}
.brand__text {
  font-family: "ZhiMangXing", cursive; font-size: 27px; letter-spacing: .12em;
  background: linear-gradient(#f5e6b8,#c9a05c 55%,#8b6914); background-clip: text; color: transparent;
}
.topbar nav { gap: clamp(12px,1.8vw,24px); color: #c9baa0; font-size: 14px; letter-spacing: 0; text-transform: none; }
.topbar nav a:hover { color: var(--gold); }
.state-indicator { display: none; }
.user-menu-trigger { border-color: rgba(201,160,92,.28) !important; background: rgba(23,17,13,.5) !important; color: var(--gold) !important; }

.realm-layer { color: var(--ink); }
.realm-layer[data-state="gate"].is-active { padding-top: 0; }
.gate-home { max-width: 1120px; padding: 0 16px; }
.gate-hero { min-height: 100dvh; }
.gate-hero-content { max-width: 620px; padding-top: 54px; }
.hero-leaf {
  position: relative; width: 84px; height: 84px; margin: 0 auto 23px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(201,160,92,.34); color: var(--gold); background: rgba(201,160,92,.08);
  box-shadow: 0 0 30px rgba(201,160,92,.16); font-size: 52px; transform: rotate(180deg);
}
.hero-leaf i { position:absolute; inset:0; border-radius:50%; border:1px solid rgba(201,160,92,.56); animation: puti-ring 3s ease-out infinite; }
.hero-leaf i:last-child { animation-delay:1.5s; }
@keyframes puti-ring { to { opacity:0; transform:scale(1.55); } }
.gate-hero h1 { line-height: 1; }
.gate-hero .han {
  margin: 0; font-family: "ZhiMangXing", cursive; font-size: clamp(58px,6vw,78px); letter-spacing: .14em;
  background: linear-gradient(#f5e6b8,#c9a05c 52%,#8b6914); background-clip:text; color:transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
}
.gate-hero .lead { margin: 22px auto 0; color: #d2c3a9; font-family: "Noto Serif SC",serif; font-size: 18px; }
.culture-strip { margin: 6px 0 28px; gap: 0; }
.culture-strip span { min-width: auto; padding: 0 8px; border: 0; background: none; box-shadow: none; color: #c9baa0; font-family: "Noto Serif SC",serif; font-size: 17px; }
.culture-strip span+span::before { content:"·"; margin-right:16px; color:rgba(201,160,92,.7); }
.gate-hero-cta { margin-top: 0; gap: 14px; }
.gate-hero-cta .btn { min-width: 195px; min-height: 54px; border-radius: 9px; font-size: 17px; letter-spacing: .04em; text-transform: none; }
.btn { border-radius: 8px; color: var(--ink); letter-spacing:.06em; text-transform:none; }
.btn-gold { color:#fff; background:#ca4b48; border-color:transparent; box-shadow:0 8px 28px rgba(202,75,72,.22); }
.btn-gold:hover { background:#dc5a56; box-shadow:0 12px 34px rgba(202,75,72,.3); }
.btn-ghost { color:var(--gold); border-color:rgba(201,160,92,.42); background:rgba(0,0,0,.12); }
.btn-ghost:hover { border-color:rgba(201,160,92,.68); background:rgba(201,160,92,.08); }
.btn-cinnabar { color:#fff; border-color:rgba(255,255,255,.1); background:linear-gradient(135deg,#ca4b48,#a93432); }
.gate-scroll-hint { bottom: 54px; color: rgba(201,186,160,.6); letter-spacing:.03em; text-transform:none; font-size:13px; }
.scroll-arrow { display:none; }
.gate-hero .gate-stage { opacity:.2; filter:sepia(1) brightness(.55); }

.putiyuan-hidden-section { display:none !important; }
.gate-section { padding: 0 0 78px; }
.gate-section .section-head { margin-bottom: 30px; }
.gate-section .section-head .kicker { display:none; }
.gate-section .section-head h2 { color: var(--gold); font-size:32px; letter-spacing:.2em; }
.gates-grid { gap:17px; }
.gate-card {
  min-height: 196px; padding:24px; border:1px solid rgba(201,160,92,.2); border-radius:10px;
  background:rgba(33,24,19,.95); box-shadow:0 10px 28px rgba(0,0,0,.18); backdrop-filter:blur(5px);
}
.gate-card:hover { transform:translateY(-3px); border-color:rgba(201,160,92,.48); box-shadow:0 0 25px rgba(201,160,92,.1); }
.gate-card-icon { float:left; display:block; color:var(--gold); font-size:35px; line-height:1; margin:0 0 14px; }
.gate-card:first-child .gate-card-icon { color:var(--cinnabar); }
.gate-card-badge { float:right; border:1px solid rgba(201,160,92,.28); border-radius:20px; color:rgba(201,160,92,.86); background:transparent; font-size:11px; font-weight:400; padding:4px 9px; letter-spacing:0; text-transform:none; }
.gate-card-badge.badge-new { color:rgba(201,160,92,.86); background:transparent; }
.gate-card h3 { clear:both; color:#dfd0b5; font-size:23px; font-weight:500; margin-bottom:9px; }
.gate-card p { color:rgba(225,212,185,.72); font-size:15px; line-height:1.7; }

.gate-why-section {
  margin-bottom:78px; padding:30px; border:1px solid rgba(201,160,92,.2); border-radius:10px;
  background:rgba(33,24,19,.95); box-shadow:0 10px 28px rgba(0,0,0,.18);
}
.gate-why-section .section-head { margin-bottom:22px; }
.gate-why-section .section-subtitle { display:inline-block; border:1px solid rgba(201,160,92,.28); border-radius:20px; padding:5px 11px; color:var(--gold); }
.why-grid { gap:15px; }
.why-card { text-align:left; padding:18px; border:1px solid rgba(201,160,92,.14); border-radius:8px; background:rgba(43,33,26,.55); }
.why-card .why-icon { display:none; }
.why-card h3 { color:var(--gold); font-size:19px; }
.why-card p { color:rgba(225,212,185,.72); }
.classics-strip { display:block; width:100%; margin-top:22px; }

.gate-incense-cta,.gate-share-section {
  margin-bottom:78px; padding:28px 34px; color:#3b2b20; background:#f0dfbf;
  border-left:4px solid rgba(201,160,92,.55); border-right:4px solid rgba(201,160,92,.55); border-radius:12px;
  box-shadow:0 15px 35px rgba(0,0,0,.25);
}
.gate-incense-cta::before,.gate-share-section::before,.gate-incense-cta::after,.gate-share-section::after { content:""; display:block; height:1px; background:linear-gradient(90deg,transparent,#c9a05c,transparent); }
.gate-incense-cta::before,.gate-share-section::before { margin-bottom:17px; }
.gate-incense-cta::after,.gate-share-section::after { margin-top:20px; }
.gate-incense-cta .section-head h2,.gate-share-section .section-head h2 { color:#3b2b20; letter-spacing:.18em; }
.gate-incense-cta .section-subtitle,.gate-share-section .section-subtitle,.gate-incense-cta .section-desc,.gate-share-section .section-desc,.gate-share-section .section-desc-sub { color:#6e5946; }
.gate-share-section .btn-gold { min-width:180px; }

.gate-quotes-section { padding-bottom:50px; }
.quotes-grid { display:block; text-align:center; }
.quote-card { padding:6px; border:0; background:transparent; }
.quote-card p { margin:0; font-family:"Noto Serif SC",serif; font-size:14px; color:rgba(225,212,185,.68); }
.quote-card:first-child p { color:rgba(201,160,92,.86); }
.gate-footer { border-color:rgba(201,160,92,.12); color:rgba(225,212,185,.58); }
.gate-footer-links a { color:rgba(201,160,92,.82); }
.gate-footer-tagline { color:rgba(225,212,185,.58); }

/* Optical centering for homepage section headings and CTA copy */
.gate-gates-section > .section-head,
.gate-why-section > .section-head,
.gate-incense-cta > .section-head,
.gate-share-section > .section-head {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gate-gates-section > .section-head h2,
.gate-why-section > .section-head h2,
.gate-incense-cta > .section-head h2,
.gate-share-section > .section-head h2,
.gate-why-section > .section-head .section-subtitle,
.gate-incense-cta > .section-head .section-subtitle,
.gate-share-section > .section-head .section-subtitle {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  text-indent: 0;
}
.gate-incense-cta > .section-desc,
.gate-share-section > .section-desc,
.gate-share-section > .section-desc-sub {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.gate-share-section > .section-desc-sub { max-width: 640px; }

.wechat-payment{text-align:center;padding:24px!important;margin:18px auto!important;max-width:440px}.wechat-payment .payment-qr{display:flex;justify-content:center;margin:18px auto;background:#fff;padding:10px;border-radius:12px;width:max-content}.wechat-amount{font-size:22px;color:var(--gold);font-weight:600;margin:12px 0}.wechat-open-btn{display:inline-flex;justify-content:center;margin:4px auto 14px;text-decoration:none}.wechat-payment .payment-waiting{display:block!important;margin-top:10px}.token-select option{background:#241b14;color:#eadfc8}
.language-switcher{height:38px;max-width:112px;padding:0 28px 0 10px;border:1px solid rgba(201,160,92,.28);border-radius:20px;background:rgba(28,20,15,.72);color:#d8c49c;font:12px var(--font-sans);cursor:pointer}.language-switcher:focus{outline:1px solid var(--gold)}.language-switcher option{background:#211812;color:#eadfc8}@media(max-width:760px){.language-switcher{position:fixed;right:58px;top:11px;height:34px;max-width:94px}.topbar-music{margin-left:auto}}
.mobile-language-switcher{display:none}
@media(max-width:640px){.mobile-language-switcher{display:block;position:fixed;z-index:180;top:calc(10px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:auto;max-width:106px;height:40px;padding:0 30px 0 12px;border:1px solid rgba(201,160,92,.46);border-radius:22px;background:rgba(28,20,15,.94);color:#efd89e;box-shadow:0 8px 24px rgba(0,0,0,.34);font:600 12px var(--font-sans);backdrop-filter:blur(14px)}.mobile-language-switcher:focus{outline:2px solid rgba(201,160,92,.55);outline-offset:2px}.mobile-language-switcher option{background:#211812;color:#eadfc8}}

.mobile-tab-bar { background:rgba(20,14,10,.97); border-color:rgba(201,160,92,.2); }
.tab-item { color:rgba(218,205,180,.68); }
.tab-item.is-active { color:var(--gold); }
.mobile-more-sheet { background:rgba(32,23,18,.99); border-color:rgba(201,160,92,.25); color:var(--ink); }
.more-item { color:var(--ink); }
.more-item:hover { background:rgba(201,160,92,.07); }

/* Existing app overlays inherit the new lacquer-and-gold system. */
.auth-overlay,.pricing-overlay,.history-overlay,.lantern-overlay,.incense-overlay,.dream-overlay,.zen-overlay,.bazi-overlay,.huangli-overlay {
  background:rgba(10,7,5,.86) !important; backdrop-filter:blur(22px) !important;
}
.auth-card,.pricing-card,.history-card,.lantern-card,.incense-card,.dream-card,.zen-card,.bazi-card,.huangli-card,
.ritual-altar,.cosmos-panel,.reading-layout,.seal-card {
  color:var(--ink) !important; border-color:rgba(201,160,92,.22) !important;
  background:linear-gradient(175deg,rgba(38,27,20,.98),rgba(24,17,13,.99)) !important;
  box-shadow:0 24px 70px rgba(0,0,0,.5) !important;
}
input,textarea,select { color:var(--ink) !important; background:rgba(255,255,255,.04) !important; border-color:rgba(201,160,92,.2) !important; }
input::placeholder,textarea::placeholder { color:rgba(225,212,185,.42) !important; }

@media (max-width:980px) {
  .topbar nav { gap:12px; font-size:12px; }
}
@media (max-width:640px) {
  .gate-home { padding:0 14px; }
  .gate-hero { min-height:calc(100dvh - 56px); }
  .gate-hero-content { padding-top:0; }
  .hero-leaf { width:78px; height:78px; margin-bottom:22px; }
  .gate-hero .han { font-size:58px; }
  .gate-hero .lead { font-size:15px; }
  .culture-strip span { font-size:15px; padding:0 5px; }
  .culture-strip span+span::before { margin-right:10px; }
  .gate-scroll-hint { display:block; bottom:26px; }
  .gate-section { padding-bottom:58px; }
  .gate-section .section-head h2 { font-size:27px; }
  .gate-card { min-height:0; padding:20px; }
  .gate-why-section { padding:21px 15px; margin-bottom:58px; }
  .gate-incense-cta,.gate-share-section { padding:25px 17px; margin-bottom:58px; }
  .mobile-tab-bar { height:calc(68px + env(safe-area-inset-bottom,0px)); }
  .realm-layer[data-state="gate"].is-active { padding-bottom:calc(68px + env(safe-area-inset-bottom,0px)); }
}

/* ================================================
   AUTH OVERLAY — Warm Zen
   ================================================ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245, 239, 224, .92);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  opacity: 0; visibility: hidden;
  transition: opacity 400ms var(--ease), visibility 400ms;
}
.auth-overlay:not([hidden]) { opacity: 1; visibility: visible; }

.auth-card, .pricing-card, .history-card {
  position: relative;
  max-width: 420px; width: calc(100% - 32px); max-height: 90vh;
  overflow-y: auto; overflow-x: hidden; padding: 0;
  border: 1px solid rgba(194, 60, 46, .12);
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255, 255, 255, .95), rgba(245, 239, 224, .98));
  box-shadow: 0 4px 30px rgba(61, 43, 31, .08), 0 0 60px rgba(194, 60, 46, .03);
  transform: scale(.92) translateY(16px);
  transition: transform 500ms cubic-bezier(.16, 1, .3, 1);
}
.auth-overlay:not([hidden]) .auth-card,
.auth-overlay:not([hidden]) .pricing-card,
.auth-overlay:not([hidden]) .history-card { transform: scale(1) translateY(0); }

.auth-card-bg {
  position: absolute; inset: 0; pointer-events: none;
  overflow: hidden; border-radius: 20px;
}
.auth-card-ring {
  position: absolute; top: -60%; left: -30%; width: 160%; height: 160%;
  border-radius: 50%; border: 1px solid rgba(194, 60, 46, .03);
  animation: auth-ring-drift 25s linear infinite;
}
.auth-card-ring-2 { top: -70%; left: -40%; width: 180%; height: 180%; border-color: rgba(212, 168, 67, .02); animation-direction: reverse; animation-duration: 35s; }
@keyframes auth-ring-drift { to { transform: rotate(360deg); } }

.auth-card-char {
  position: absolute; font-family: var(--font-han); font-size: 28px;
  color: rgba(194, 60, 46, .03);
  animation: auth-char-float 12s ease-in-out infinite alternate;
}
.auth-card-char:nth-child(3) { top: 8%; left: 12%; animation-delay: 0s; }
.auth-card-char:nth-child(4) { top: 5%; right: 15%; animation-delay: -1.5s; }
.auth-card-char:nth-child(5) { top: 40%; right: 8%; animation-delay: -3s; }
.auth-card-char:nth-child(6) { bottom: 25%; right: 10%; animation-delay: -4.5s; }
.auth-card-char:nth-child(7) { bottom: 8%; right: 20%; animation-delay: -6s; }
.auth-card-char:nth-child(8) { bottom: 5%; left: 18%; animation-delay: -7.5s; }
.auth-card-char:nth-child(9) { bottom: 30%; left: 6%; animation-delay: -9s; }
.auth-card-char:nth-child(10) { top: 35%; left: 10%; animation-delay: -10.5s; }
@keyframes auth-char-float { 0% { transform: translateY(0) rotate(0deg); opacity: .5; } 100% { transform: translateY(-6px) rotate(4deg); opacity: 1; } }

.auth-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: rgba(61, 43, 31, .03); border: 1px solid rgba(61, 43, 31, .06);
  border-radius: 50%; color: var(--brown); font-size: 16px; cursor: pointer; line-height: 1;
  transition: all 250ms var(--ease);
}
.auth-close:hover { color: var(--ink); border-color: rgba(194, 60, 46, .2); background: rgba(194, 60, 46, .04); }

.auth-header { text-align: center; padding: 40px 32px 24px; position: relative; }
.auth-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(150deg, var(--cinnabar), var(--temple-red));
  color: var(--cream); font-family: var(--font-han); font-size: 28px;
  margin-bottom: 18px; border: 2px solid rgba(212, 168, 67, .1);
  box-shadow: 0 0 30px rgba(194, 60, 46, .12);
  animation: auth-seal-breathe 3.5s ease-in-out infinite;
}
@keyframes auth-seal-breathe {
  0%, 100% { box-shadow: 0 0 30px rgba(194, 60, 46, .12); transform: scale(1); }
  50% { box-shadow: 0 0 40px rgba(194, 60, 46, .2); transform: scale(1.04); }
}
.auth-header h2 { font-family: var(--font-serif); font-size: 28px; color: var(--gold); margin: 0; }
.auth-subtitle { margin: 8px 0 0; font-size: 13px; color: var(--brown); font-style: italic; font-family: var(--font-serif); letter-spacing: .06em; }

.auth-tabs {
  display: flex; gap: 0; margin: 0 32px;
  border-bottom: 1px solid rgba(194, 60, 46, .08);
  position: relative;
}
.auth-tab {
  flex: 1; padding: 12px 0; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--brown); font-family: var(--font-sans);
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; cursor: pointer;
  transition: color 300ms, border-color 300ms;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }

.auth-form { display: flex; flex-direction: column; gap: 20px; padding: 28px 32px 32px; }
.auth-form[hidden] { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brown); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: rgba(194, 60, 46, .2); pointer-events: none; z-index: 1;
  transition: color 300ms;
}
.auth-input-wrap:focus-within .auth-input-icon { color: rgba(194, 60, 46, .4); }
.auth-input {
  width: 100%; background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(194, 60, 46, .08); border-radius: 10px;
  padding: 13px 14px 13px 40px; color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; caret-color: var(--cinnabar);
  transition: border-color 300ms, box-shadow 300ms, background 300ms;
}
.auth-input::placeholder { color: rgba(61, 43, 31, .2); }
.auth-input:focus { outline: none; border-color: rgba(194, 60, 46, .2); box-shadow: 0 0 16px rgba(194, 60, 46, .04); background: rgba(255, 255, 255, .7); }

.auth-pwd-meter { height: 3px; border-radius: 3px; background: rgba(61, 43, 31, .06); overflow: hidden; margin-top: -2px; }
.auth-pwd-bar { height: 100%; width: 0%; border-radius: 3px; transition: width 400ms var(--ease), background 400ms; background: rgba(61, 43, 31, .1); }
.auth-pwd-bar.is-weak { width: 25%; background: #9d3341; }
.auth-pwd-bar.is-fair { width: 50%; background: #b8922e; }
.auth-pwd-bar.is-good { width: 75%; background: var(--gold); }
.auth-pwd-bar.is-strong { width: 100%; background: var(--jade); }
.auth-password-hint { font-size: 11px; color: var(--brown); margin-top: 2px; }
.auth-error { color: #c23c2e; font-size: 13px; min-height: 18px; padding: 0 2px; }

.auth-submit {
  padding: 15px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--cinnabar), var(--temple-red));
  color: var(--cream); font-family: var(--font-serif);
  font-size: 17px; font-weight: 600; letter-spacing: .1em;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 4px 16px rgba(194, 60, 46, .1);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.auth-submit-icon { display: inline-block; margin-right: 6px; font-size: 14px; vertical-align: middle; }
.auth-submit::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(212, 168, 67, .1), transparent 70%);
  opacity: 0; transform: scale(0); transition: opacity 400ms, transform 600ms;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(194, 60, 46, .15); }
.auth-submit:hover::after { opacity: 1; transform: scale(1.6); }
.auth-submit:active { transform: translateY(0); }

.auth-footer-links { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }
.auth-footer-links a {
  font-size: 12px; color: var(--cinnabar); text-decoration: none;
  letter-spacing: .04em; border-bottom: 1px solid rgba(194, 60, 46, .15);
  transition: color 200ms, border-color 200ms;
}
.auth-footer-links a:hover { border-bottom-color: var(--cinnabar); }

.auth-gift {
  text-align: center; padding: 10px 16px; border-radius: 8px;
  border: 1px solid rgba(212, 168, 67, .12);
  background: rgba(212, 168, 67, .04);
  color: var(--brown); font-size: 12px;
}
.auth-gift strong { color: var(--gold); }
.auth-success { text-align: center; padding: 32px; color: var(--gold); font-size: 15px; line-height: 1.6; }
.auth-success-icon { font-size: 36px; margin-bottom: 12px; animation: auth-success-pulse 1.5s ease-in-out infinite; }
@keyframes auth-success-pulse { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }

.ai-btn-main { display: block; }
.ai-btn-sub { display: block; font-size: 11px; font-weight: 400; letter-spacing: .06em; opacity: .7; margin-top: 2px; }

/* ================================================
   USER MENU
   ================================================ */
.user-menu { position: relative; margin-left: 12px; }
.user-menu-trigger { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; padding: 4px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(194, 60, 46, .06); color: var(--ink);
  font-family: var(--font-serif); font-size: 14px; font-weight: 600;
  border: 2px solid rgba(194, 60, 46, .1);
  transition: border-color 200ms;
}
.user-tier-badge { width: 8px; height: 8px; border-radius: 50%; position: absolute; bottom: 2px; right: 2px; }
.user-tier-badge.is-seeker { background: var(--brown); }
.user-tier-badge.is-oracle { background: var(--gold); }
.user-tier-badge.is-mystic { background: var(--cinnabar); }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; padding: 12px 0;
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(61, 43, 31, .08);
}
.user-dropdown-header { padding: 8px 16px; display: flex; align-items: baseline; gap: 8px; }
.user-dropdown-name { color: var(--ink); font-weight: 600; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-tier { color: var(--brown); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.user-dropdown-credits { padding: 4px 16px 8px; color: var(--gold); font-size: 13px; }
.user-dropdown-divider { border: none; border-top: 1px solid rgba(194, 60, 46, .06); margin: 4px 0; }
.user-dropdown-item { display: block; padding: 8px 16px; color: var(--muted); text-decoration: none; font-size: 13px; transition: color 200ms, background 200ms; }
.user-dropdown-item:hover { color: var(--ink); background: rgba(194, 60, 46, .03); }

/* ================================================
   PRICING OVERLAY
   ================================================ */
.pricing-card { max-width: 720px; padding: 36px 32px; }
.pricing-header { text-align: center; margin-bottom: 28px; }
.pricing-sub { color: var(--muted); font-size: 14px; margin-top: 6px; font-style: italic; }
.pricing-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.pricing-tier {
  position: relative; padding: 24px 16px; border-radius: 8px;
  border: 1px solid rgba(194, 60, 46, .08);
  background: rgba(255, 255, 255, .5);
  text-align: center; transition: border-color 300ms, box-shadow 300ms;
}
.pricing-tier.is-current { border-color: rgba(61, 43, 31, .15); }
.pricing-tier-oracle { border-color: rgba(212, 168, 67, .2); box-shadow: 0 0 16px rgba(212, 168, 67, .04); }
.pricing-tier h3 { font-family: var(--font-serif); font-size: 20px; color: var(--gold); margin: 0 0 8px; }
.pricing-price { font-family: var(--font-serif); font-size: 28px; color: var(--ink); margin-bottom: 16px; }
.pricing-price span { font-size: 14px; color: var(--brown); }
.pricing-features { list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: var(--muted); text-align: left; }
.pricing-features li { padding: 4px 0; }
.pricing-features li::before { content: "✓ "; color: var(--jade); }
.pricing-features .pricing-disabled::before { content: "✗ "; color: var(--red); }
.pricing-features .pricing-disabled { opacity: .5; }
.pricing-popular {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  padding: 2px 12px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--cream); font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.pricing-badge { display: inline-block; padding: 4px 16px; border-radius: 4px; border: 1px solid rgba(194, 60, 46, .08); color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.pricing-cta { width: 100%; font-size: 12px; padding: 10px; }
.pricing-cta:disabled { opacity: .4; cursor: not-allowed; }
.pricing-packs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pricing-pack-btn { width: 100%; font-size: 12px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 6px; text-align: left; }
.pricing-pack-btn .pack-savings { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(212, 168, 67, .1); color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.pricing-pack-btn.is-loading, .pricing-cta.is-loading { opacity: .6; pointer-events: none; position: relative; }
.pricing-pack-btn.is-loading::after, .pricing-cta.is-loading::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid transparent; border-top-color: var(--gold); border-radius: 50%; animation: pay-spin .6s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }

.pricing-network { color: var(--muted); font-size: 12px; margin-top: 4px; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; gap: 4px; }
.pricing-network strong { color: var(--gold); }
.token-select {
  appearance: none; -webkit-appearance: none;
  background: rgba(255, 255, 255, .6); color: var(--gold);
  border: 1px solid rgba(194, 60, 46, .1); border-radius: 4px;
  padding: 6px 24px 6px 10px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23d4a843'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 10px;
}
.token-select:focus { outline: 1px solid var(--gold); outline-offset: 1px; }

.pricing-pay-status { text-align: center; padding: 20px 16px; margin: 16px 0; border-radius: 10px; border: 1px solid rgba(194, 60, 46, .08); background: rgba(255, 255, 255, .4); }
.pay-status-icon { font-size: 28px; margin-bottom: 8px; }
.pay-status-text { color: var(--ink); font-size: 15px; font-weight: 600; }
.pay-status-detail { color: var(--muted); font-size: 12px; margin-top: 4px; }

.payment-details { text-align: center; padding: 20px 16px; margin: 16px 0; border-radius: 10px; border: 1px solid rgba(194, 60, 46, .08); background: rgba(255, 255, 255, .4); }
.payment-details-header { margin-bottom: 16px; }
.payment-qr { display: flex; justify-content: center; margin: 12px 0; }
.payment-qr canvas { border-radius: 8px; }
.payment-info { text-align: left; margin: 16px 0; }
.payment-field { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(61, 43, 31, .06); }
.payment-field label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; min-width: 60px; }
.payment-value { color: var(--ink); font-size: 13px; font-weight: 600; flex: 1; word-break: break-all; }
.payment-address { font-family: monospace; font-size: 11px; font-weight: 400; }
.payment-copy { background: rgba(212, 168, 67, .08); color: var(--gold); border: 1px solid rgba(212, 168, 67, .12); border-radius: 4px; padding: 2px 8px; font-size: 10px; cursor: pointer; white-space: nowrap; }
.payment-copy:hover { background: rgba(212, 168, 67, .15); }
.payment-warning { color: var(--gold); font-size: 11px; padding: 8px; border-radius: 6px; background: rgba(212, 168, 67, .06); margin: 12px 0; }
.payment-wallet-btn { width: 100%; margin-top: 8px; font-size: 13px; }
.payment-waiting { margin-top: 12px; }

.pricing-faq { border-top: 1px solid rgba(61, 43, 31, .06); padding-top: 20px; }
.pricing-faq h3 { font-family: var(--font-serif); font-size: 18px; color: var(--gold); margin: 0 0 12px; }
.pricing-faq details { border-bottom: 1px solid rgba(61, 43, 31, .04); padding: 10px 0; }
.pricing-faq summary { color: var(--ink); font-size: 14px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.pricing-faq summary::after { content: "+"; color: var(--muted); }
.pricing-faq details[open] summary::after { content: "−"; }
.pricing-faq p { color: var(--muted); font-size: 13px; margin: 8px 0 0; line-height: 1.6; }

/* ================================================
   HISTORY PANEL
   ================================================ */
.history-card { max-width: 560px; padding: 36px 32px; }
.history-header { text-align: center; margin-bottom: 20px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { padding: 12px 16px; border-radius: 6px; border: 1px solid rgba(194, 60, 46, .06); background: rgba(255, 255, 255, .4); cursor: pointer; transition: border-color 200ms, background 200ms; }
.history-item:hover { border-color: rgba(194, 60, 46, .15); background: rgba(255, 255, 255, .6); }
.history-item-header { display: flex; align-items: center; gap: 8px; }
.history-item-han { font-family: var(--font-han); font-size: 20px; color: var(--cinnabar); }
.history-item-name { flex: 1; font-size: 14px; color: var(--ink); }
.history-item-oracle { font-size: 14px; margin-left: 4px; }
.history-item-date { font-size: 11px; color: var(--muted); }
.history-item-question { font-size: 13px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(61, 43, 31, .06); font-size: 14px; line-height: 1.7; color: var(--ink); }
.history-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.history-page-btn { padding: 6px 12px; border: 1px solid rgba(194, 60, 46, .08); border-radius: 4px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; transition: all 200ms; }
.history-page-btn.is-active, .history-page-btn:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

/* ================================================
   TOAST
   ================================================ */
.auth-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 101; padding: 12px 24px; border-radius: 8px;
  border: 1px solid rgba(212, 168, 67, .2);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--gold); font-size: 14px;
  opacity: 0; visibility: hidden;
  transition: opacity 400ms, transform 400ms var(--ease), visibility 400ms;
  pointer-events: none;
}
.auth-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ================================================
   MOBILE AUTH BUTTON
   ================================================ */
.mobile-auth-btn {
  display: none; position: fixed; top: 12px; right: 12px; z-index: 98;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(194, 60, 46, .25);
  background: rgba(255, 255, 255, .9); cursor: pointer;
  align-items: center; justify-content: center;
}
.mobile-auth-btn .auth-seal { width: 28px; height: 28px; font-size: 14px; margin: 0; box-shadow: none; }

/* ================================================
   RESPONSIVE (Auth/Pricing/History)
   ================================================ */
@media (max-width: 980px) {
  .pricing-tiers { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto 28px; }
}
@media (max-width: 640px) {
  .mobile-auth-btn { display: flex; width: 44px; height: 44px; top: calc(12px + env(safe-area-inset-top)); }
  .user-menu { display: none !important; }
  .auth-form { padding: 20px 16px 24px; }
  .auth-header { padding: 24px 16px 16px; }
  .auth-tabs { margin: 0 16px; }
  .pricing-card { padding: 20px 12px; }
  .auth-header h2 { font-size: 24px; }
  .user-dropdown-name { max-width: 80px; }
  .topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .auth-toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .auth-overlay { padding-bottom: env(safe-area-inset-bottom); }
  .auth-close { width: 44px; height: 44px; }
  .auth-tab { min-height: 44px; font-size: 13px; }
  .pricing-pack-btn { padding: 12px 16px; min-height: 44px; font-size: 14px; }
  .pricing-cta { padding: 12px 16px; min-height: 44px; font-size: 14px; }
  .payment-copy { padding: 8px 14px; font-size: 12px; min-height: 36px; }
  .payment-address { font-size: 12px; }
  .payment-warning { font-size: 12px; }
  .history-page-btn { padding: 10px 16px; min-height: 38px; }
  .prompt-row button { padding: 10px 16px; min-height: 38px; }
  .payment-field { flex-direction: column; align-items: flex-start; gap: 4px; }
  .payment-field label { min-width: auto; }
  .payment-copy { align-self: flex-end; }
  .reading-scroll { padding: 16px; }
  .reading-judgment, .reading-image { padding: 12px 14px; }
  .ai-reading-body { padding: 0 16px 16px; }
  .ai-reading .kicker { padding: 16px 16px 0; }
  .ai-loading { padding: 24px 16px; }
  .mouse-glow { display: none; }
  .shrine-glow, .shrine-glow-2, .shrine-rays { display: none; }
  .aura-ring-1, .aura-ring-2, .aura-ring-3, .aura-ring-4, .aura-ring-5 { display: none; }
}

/* ================================================
   CLIFFHANGER
   ================================================ */
.ai-cliffhanger-blur { filter: blur(8px); user-select: none; transition: filter 300ms; }
.ai-cliffhanger-placeholder { height: 200px; margin: 12px 0; border-radius: 6px; background: linear-gradient(180deg, rgba(61, 43, 31, .06) 0%, rgba(61, 43, 31, .02) 100%); filter: blur(6px); user-select: none; }
.ai-cliffhanger-cta { text-align: center; margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ai-cliffhanger-or { font-size: 12px; color: var(--brown); text-transform: uppercase; letter-spacing: .1em; }

/* ================================================
   RITUAL THEMES
   ================================================ */
:root, [data-theme="bronze"] { /* Default — warm zen palette already defined */ }

[data-theme="jade"] {
  --cinnabar: #3d8b6e;
  --temple-red: #4a907b;
  --gold: #4f907b;
  --gold-2: #2d5a4a;
  --jade: #4f907b;
}
[data-theme="jade"] .btn-gold {
  background: linear-gradient(135deg, #6ab89a, var(--gold) 45%, var(--gold-2));
  color: var(--cream);
}

[data-theme="cinnabar"] {
  --cinnabar: #d94f3d;
  --temple-red: #c23c2e;
  --gold: #e8a54b;
  --gold-2: #a83228;
  --jade: #c23c2e;
}
[data-theme="cinnabar"] .btn-gold {
  background: linear-gradient(135deg, #f0c060, var(--gold) 45%, var(--gold-2));
  color: var(--cream);
}

/* ================================================
   THEME PICKER
   ================================================ */
.user-dropdown-theme { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px !important; font-size: 13px; color: var(--muted); }
.theme-options { display: flex; gap: 4px; }
.theme-btn { padding: 3px 8px; border: 1px solid rgba(194, 60, 46, .08); border-radius: 3px; background: none; color: var(--muted); font-size: 10px; cursor: pointer; transition: all 200ms; text-transform: uppercase; letter-spacing: .04em; }
.theme-btn:hover, .theme-btn.is-active { border-color: var(--gold); color: var(--gold); }

/* ================================================
   REFERRAL
   ================================================ */
.referral-code-display { font-family: var(--font-sans); font-size: 28px; font-weight: 700; color: var(--gold); letter-spacing: .2em; }

/* ================================================
   HISTORY DELETE + UPGRADE
   ================================================ */
.history-item-delete { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; }
.history-item-delete:hover { color: #c23c2e; }
.history-upgrade-cta { text-align: center; padding: 16px; margin-top: 12px; border: 1px solid rgba(194, 60, 46, .1); border-radius: 6px; color: var(--muted); font-size: 13px; }
.history-upgrade-cta a { color: var(--cinnabar); cursor: pointer; }

/* ================================================
   WISH LANTERNS
   ================================================ */
#lantern-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  z-index: 0; pointer-events: none;
}

.lantern-card {
  position: relative;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  border: 1px solid rgba(194, 60, 46, .12);
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255, 255, 255, .95), rgba(245, 239, 224, .98));
  box-shadow: 0 4px 30px rgba(61, 43, 31, .08), 0 0 60px rgba(194, 60, 46, .03);
  transform: scale(.92) translateY(16px);
  transition: transform 500ms cubic-bezier(.16, 1, .3, 1);
}
.auth-overlay:not([hidden]) .lantern-card { transform: scale(1) translateY(0); }

.lantern-header { text-align: center; padding: 40px 32px 24px; position: relative; }
.lantern-header h2 { font-family: var(--font-serif); font-size: 28px; color: var(--gold); margin: 0; }

.lantern-section { padding: 0 32px; margin-bottom: 20px; }
.lantern-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--brown); letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 10px;
}
.lantern-hint { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 11px; }

/* Lantern type selector */
.lantern-types {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.lantern-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border: 1px solid rgba(194, 60, 46, .12);
  border-radius: 12px; background: rgba(255, 255, 255, .5);
  cursor: pointer; transition: all 250ms var(--ease);
  color: var(--ink);
}
.lantern-type-btn:hover {
  border-color: rgba(194, 60, 46, .3);
  box-shadow: 0 0 16px rgba(194, 60, 46, .08);
}
.lantern-type-btn.is-selected {
  border-color: var(--cinnabar);
  background: rgba(194, 60, 46, .06);
  box-shadow: 0 0 20px rgba(194, 60, 46, .12);
}
.lantern-type-emoji { font-size: 28px; line-height: 1; }
.lantern-type-name { font-family: var(--font-serif); font-size: 14px; letter-spacing: .04em; }
.lantern-type-price { font-size: 11px; color: var(--muted); }

/* Dedication pills */
.lantern-dedications {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.lantern-ded-btn {
  padding: 6px 14px; border: 1px solid rgba(194, 60, 46, .12);
  border-radius: 20px; background: rgba(255, 255, 255, .5);
  font-size: 12px; color: var(--ink); cursor: pointer;
  transition: all 250ms var(--ease); letter-spacing: .04em;
}
.lantern-ded-btn:hover { border-color: rgba(194, 60, 46, .3); }
.lantern-ded-btn.is-selected {
  border-color: var(--cinnabar); background: rgba(194, 60, 46, .08);
  color: var(--cinnabar);
}

/* Wish textarea */
.lantern-wish-input {
  resize: none; min-height: 60px; font-family: var(--font-serif);
  font-style: italic;
}
.lantern-char-count {
  display: block; text-align: right; font-size: 11px;
  color: var(--muted); margin-top: 4px;
}

/* Payment row */
.lantern-pay-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lantern-pay-label { font-size: 12px; color: var(--muted); }
.lantern-submit-btn {
  display: block; width: calc(100% - 64px); margin: 8px 32px 24px;
  padding: 14px; font-size: 15px; text-align: center;
}
.lantern-submit-btn:disabled { opacity: .4; pointer-events: none; }

/* Lighting animation */
.lantern-lighting {
  text-align: center; padding: 60px 32px 40px;
}
.lantern-lighting-icon {
  font-size: 64px; line-height: 1;
  animation: lantern-rise 1.5s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes lantern-rise {
  0% { transform: translateY(40px); opacity: 0; }
  60% { transform: translateY(-10px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
.lantern-lighting-wish {
  font-family: var(--font-serif); font-style: italic;
  font-size: 16px; color: var(--ink); margin: 20px 0 12px;
  animation: lantern-fade-in 1s ease 0.8s both;
}
.lantern-lighting-merit {
  font-size: 14px; color: var(--gold); letter-spacing: .1em;
  animation: lantern-fade-in 0.6s ease 1.2s both;
}
@keyframes lantern-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lantern Wall */
.lantern-wall {
  border-top: 1px solid rgba(194, 60, 46, .1);
  padding: 24px 32px 32px;
}
.lantern-wall-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.lantern-wall-title {
  font-family: var(--font-serif); font-size: 16px;
  color: var(--gold); letter-spacing: .06em;
}
.lantern-wall-count {
  font-size: 11px; color: var(--muted); letter-spacing: .04em;
}
.lantern-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.wall-lantern {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border: 1px solid rgba(194, 60, 46, .08);
  border-radius: 8px; background: rgba(255, 255, 255, .4);
  transition: all 250ms var(--ease);
}
.wall-lantern:hover {
  border-color: rgba(194, 60, 46, .2);
  box-shadow: 0 0 12px rgba(194, 60, 46, .06);
}
.wall-lantern-emoji { font-size: 20px; line-height: 1; }
.wall-lantern-name {
  font-size: 11px; color: var(--ink); letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.wall-lantern-ded {
  font-size: 9px; color: var(--muted); letter-spacing: .06em;
  text-transform: uppercase;
}
.wall-lantern-wish {
  font-size: 10px; color: rgba(61, 43, 31, .6);
  font-style: italic; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-align: center;
}
.lantern-wall-pagination {
  display: flex; justify-content: center; gap: 8px; margin-top: 16px;
}
.lantern-wall-page-btn {
  padding: 6px 12px; border: 1px solid rgba(194, 60, 46, .12);
  border-radius: 6px; background: rgba(255, 255, 255, .5);
  font-size: 12px; color: var(--ink); cursor: pointer;
  transition: all 200ms var(--ease);
}
.lantern-wall-page-btn:hover { border-color: var(--cinnabar); }
.lantern-wall-page-btn.is-active { border-color: var(--cinnabar); background: rgba(194, 60, 46, .06); color: var(--cinnabar); }

/* Gate layer lantern button */
.lantern-gate-btn {
  margin-top: 12px; font-size: 13px !important;
  padding: 8px 16px !important;
}

/* Lantern responsive */
@media (max-width: 640px) {
  .lantern-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .lantern-section { padding: 0 20px; }
  .lantern-header { padding: 32px 20px 20px; }
  .lantern-submit-btn { width: calc(100% - 40px); margin: 8px 20px 20px; }
  .lantern-wall { padding: 20px 20px 24px; }
  .lantern-wall-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
  .lantern-types { gap: 6px; }
  .lantern-type-btn { padding: 12px 4px; }
  .lantern-type-emoji { font-size: 22px; }
  .lantern-lighting { padding: 40px 20px 30px; }
  .lantern-lighting-icon { font-size: 48px; }
}

/* ── VIRTUAL INCENSE ── */

#incense-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.incense-card {
  position: relative;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255,255,255,.95), rgba(245,239,224,.98));
  border: 1px solid rgba(194, 60, 46, .12);
  box-shadow: 0 24px 80px rgba(61,43,31,.12), 0 4px 16px rgba(194,60,46,.06);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .35s;
}

#incense-overlay:not([hidden]) .incense-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Header */
.incense-header {
  text-align: center;
  padding: 32px 32px 12px;
}
.incense-header .auth-seal {
  font-size: 18px;
}
.incense-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 4vw, 26px);
  font-weight: 500;
  color: var(--ink);
  margin: 8px 0 4px;
}
.incense-header .auth-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Visual area — 福 + incense holder */
.incense-visual {
  position: relative;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
  margin: 0 32px;
  overflow: hidden;
}

.incense-fu {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Ma Shan Zheng', var(--font-han);
  font-size: 72px;
  color: var(--cinnabar);
  opacity: 0.12;
  user-select: none;
  animation: fu-breathe 4s ease-in-out infinite;
  transition: opacity .6s, transform .6s;
}
.incense-fu.is-active {
  opacity: 0.3;
  transform: translateX(-50%) scale(1.08);
}

@keyframes fu-breathe {
  0%, 100% { opacity: 0.10; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.16; transform: translateX(-50%) scale(1.03); }
}

.incense-holder {
  position: relative;
  width: 100px;
  height: 16px;
  background: linear-gradient(180deg, var(--brown), #5a3e28);
  border-radius: 4px 4px 8px 8px;
  box-shadow: 0 2px 8px rgba(61,43,31,.15);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding-bottom: 0;
}

.incense-stick {
  position: relative;
  width: 2px;
  height: 0;
  background: linear-gradient(to top, #8b7355, var(--gold-dim));
  border-radius: 1px;
  opacity: 0;
  transition: height .6s cubic-bezier(.22,1,.36,1), opacity .4s;
}
.incense-stick.is-lit {
  height: 56px;
  opacity: 1;
  transform: translateY(-56px);
}

.incense-stick::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  box-shadow: 0 0 8px 2px rgba(212,168,67,.5);
  transition: opacity .4s;
}
.incense-stick.is-lit::after {
  opacity: 1;
  animation: ember-glow 1.2s ease-in-out infinite alternate;
}

@keyframes ember-glow {
  0% { box-shadow: 0 0 6px 1px rgba(212,168,67,.4); transform: translateX(-50%) scale(.9); }
  100% { box-shadow: 0 0 12px 3px rgba(212,168,67,.7); transform: translateX(-50%) scale(1.1); }
}

/* Type selection */
.incense-section {
  padding: 0 32px;
  margin-bottom: 16px;
}
.incense-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.incense-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.incense-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px;
  border: 1.5px solid var(--soft);
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.incense-type-btn:hover {
  border-color: var(--gold-dim);
  background: rgba(212,168,67,.04);
}
.incense-type-btn.is-selected {
  border-color: var(--cinnabar);
  background: rgba(194,60,46,.04);
  box-shadow: 0 0 0 1px var(--cinnabar);
}
.incense-type-emoji {
  font-size: 28px;
  line-height: 1;
}
.incense-type-name {
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  text-align: center;
}

/* Progress */
.incense-progress-section {
  margin-bottom: 12px;
}
.incense-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
}
.incense-progress-bar {
  height: 4px;
  background: var(--soft);
  border-radius: 2px;
  overflow: hidden;
}
.incense-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
  border-radius: 2px;
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

/* Offer button */
.incense-offer-btn {
  display: block;
  width: calc(100% - 64px);
  margin: 4px 32px 16px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.incense-offer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.incense-offer-btn.is-max {
  background: var(--soft);
  color: var(--muted);
}

/* Merit display */
.incense-merit-section {
  text-align: center;
  padding: 12px 32px 8px;
  border-top: 1px solid var(--soft);
  margin: 0 32px 0;
  padding-left: 0;
  padding-right: 0;
}
.incense-merit-info {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.incense-merit-points {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
}
.incense-merit-label {
  font-size: 12px;
  color: var(--muted);
}

.incense-merit-level {
  margin-bottom: 8px;
}
.incense-level-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--soft);
  color: var(--muted);
}
.incense-level-badge.is-pilgrim { background: rgba(79,144,123,.12); color: var(--jade); }
.incense-level-badge.is-adept { background: rgba(212,168,67,.12); color: var(--gold); }
.incense-level-badge.is-sage { background: rgba(194,60,46,.10); color: var(--cinnabar); }
.incense-level-badge.is-immortal { background: var(--cinnabar); color: var(--cream); }

.incense-merit-bar {
  height: 4px;
  background: var(--soft);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
  max-width: 200px;
}
.incense-merit-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

.incense-merit-next {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Philosophy quote */
.incense-quote {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 32px 24px;
  line-height: 1.5;
}

/* Gate layer incense button */
.incense-gate-btn {
  margin-top: 8px;
  font-size: 13px !important;
  padding: 8px 16px !important;
}

/* User dropdown merit */
.user-dropdown-merit {
  font-size: 12px;
  color: var(--muted);
  padding: 0 16px;
  margin-top: 4px;
}

/* Incense responsive */
@media (max-width: 640px) {
  .incense-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .incense-section { padding: 0 20px; }
  .incense-header { padding: 32px 20px 12px; }
  .incense-visual { margin: 0 20px; height: 140px; }
  .incense-fu { font-size: 56px; }
  .incense-offer-btn { width: calc(100% - 40px); margin: 8px 20px 16px; }
  .incense-types { gap: 6px; }
  .incense-type-btn { padding: 10px 4px; }
  .incense-type-emoji { font-size: 22px; }
  .incense-merit-section { margin: 0 20px; }
  .incense-quote { padding: 12px 20px 24px; }
}

/* ── DREAM ORACLE ── */

.dream-card {
  position: relative;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255,255,255,.95), rgba(245,239,224,.98));
  border: 1px solid rgba(194, 60, 46, .12);
  box-shadow: 0 24px 80px rgba(61,43,31,.12), 0 4px 16px rgba(194,60,46,.06);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .35s;
}
#dream-overlay:not([hidden]) .dream-card { transform: scale(1) translateY(0); opacity: 1; }

.dream-header { text-align: center; padding: 32px 32px 12px; }
.dream-header .auth-seal { font-size: 18px; }
.dream-header h2 { font-family: var(--font-serif); font-size: clamp(22px, 4vw, 26px); font-weight: 500; color: var(--ink); margin: 8px 0 4px; }
.dream-header .auth-subtitle { font-size: 13px; color: var(--muted); margin: 0; }

.dream-section { padding: 0 32px; margin-bottom: 14px; }
.dream-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

.dream-input {
  width: 100%; min-height: 80px; padding: 12px;
  border: 1.5px solid var(--soft); border-radius: 10px;
  background: rgba(255,255,255,.6); color: var(--ink);
  font-family: inherit; font-size: 14px; resize: vertical;
  transition: border-color .2s;
}
.dream-input:focus { outline: none; border-color: var(--cinnabar); }
.dream-input::placeholder { color: var(--muted); opacity: .6; }
.dream-char-count { text-align: right; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Oracle buttons */
.dream-oracles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dream-oracle-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border: 1.5px solid var(--soft); border-radius: 12px;
  background: rgba(255,255,255,.6); cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.dream-oracle-btn:hover { border-color: var(--gold-dim); }
.dream-oracle-btn.is-selected { border-color: var(--cinnabar); background: rgba(194,60,46,.04); box-shadow: 0 0 0 1px var(--cinnabar); }
.dream-oracle-emoji { font-size: 22px; }
.dream-oracle-name { font-size: 11px; color: var(--ink); font-weight: 500; }

/* Interpret button */
.dream-interpret-btn { display: block; width: calc(100% - 64px); margin: 4px 32px 14px; padding: 13px 24px; font-size: 15px; font-weight: 600; text-align: center; }
.dream-interpret-btn:disabled { opacity: .4; cursor: not-allowed; }
.dream-interpret-btn.is-loading { opacity: .7; pointer-events: none; }

/* Response area */
.dream-response { padding: 0 32px 14px; }
.dream-verdict {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}
.dream-verdict.is-auspicious { background: rgba(79,144,123,.12); color: var(--jade); }
.dream-verdict.is-neutral { background: rgba(212,168,67,.12); color: var(--gold); }
.dream-verdict.is-cautionary { background: rgba(194,60,46,.10); color: var(--cinnabar); }
.dream-reading {
  font-size: 14px; line-height: 1.65; color: var(--ink);
  white-space: pre-wrap;
}
.dream-reading h3, .dream-reading h4 { color: var(--cinnabar); margin: 12px 0 4px; font-size: 15px; }
.dream-reading strong { color: var(--gold); }

/* Category grid */
.dream-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.dream-cat-btn {
  padding: 6px 12px; border: 1px solid var(--soft); border-radius: 20px;
  background: rgba(255,255,255,.6); font-size: 12px; color: var(--ink);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.dream-cat-btn:hover { border-color: var(--gold-dim); }
.dream-cat-btn.is-active { border-color: var(--cinnabar); background: rgba(194,60,46,.06); }

/* Symbol results */
.dream-symbols { padding: 0 32px 10px; }
.dream-symbol-item {
  padding: 8px 0; border-bottom: 1px solid var(--soft);
  font-size: 13px; line-height: 1.5;
}
.dream-symbol-keyword { font-weight: 600; color: var(--ink); }
.dream-symbol-classic { color: var(--muted); font-style: italic; }
.dream-symbol-verdict { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.dream-symbol-verdict.is-auspicious { color: var(--jade); }
.dream-symbol-verdict.is-neutral { color: var(--gold); }
.dream-symbol-verdict.is-cautionary { color: var(--cinnabar); }

/* History */
.dream-history { padding: 0 32px 20px; }
.dream-history-item { padding: 8px 0; border-bottom: 1px solid var(--soft); font-size: 13px; }
.dream-history-text { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.dream-history-time { font-size: 11px; color: var(--muted); }

/* Gate buttons */
.dream-gate-btn { margin-top: 8px; font-size: 13px !important; padding: 8px 16px !important; }

/* Dream responsive */
@media (max-width: 640px) {
  .dream-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .dream-section { padding: 0 20px; }
  .dream-header { padding: 32px 20px 12px; }
  .dream-interpret-btn { width: calc(100% - 40px); margin: 8px 20px 14px; }
  .dream-response { padding: 0 20px 14px; }
  .dream-symbols, .dream-history { padding: 0 20px 16px; }
  .dream-oracles { gap: 6px; }
  .dream-oracle-btn { padding: 8px 4px; }
}

/* ── ZEN CHAMBER ── */

.zen-card {
  position: relative;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255,255,255,.95), rgba(245,239,224,.98));
  border: 1px solid rgba(194, 60, 46, .12);
  box-shadow: 0 24px 80px rgba(61,43,31,.12), 0 4px 16px rgba(194,60,46,.06);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .35s;
}
#zen-overlay:not([hidden]) .zen-card { transform: scale(1) translateY(0); opacity: 1; }

/* Dim mode — darken everything except the breathing ring */
.zen-card.is-dim { background: rgba(20,15,10,.97); border-color: rgba(194,60,46,.05); }
.zen-card.is-dim .zen-header,
.zen-card.is-dim .zen-section,
.zen-card.is-dim .zen-controls,
.zen-card.is-dim .zen-stats,
.zen-card.is-dim .zen-dim-btn { opacity: .15; pointer-events: none; transition: opacity 1s; }
.zen-card.is-dim .zen-breathing-ring { box-shadow: 0 0 60px 20px rgba(212,168,67,.15); }
.zen-card.is-dim .zen-breathing-text { color: var(--gold); }

.zen-header { text-align: center; padding: 32px 32px 8px; }
.zen-header .auth-seal { font-size: 18px; }
.zen-header h2 { font-family: var(--font-serif); font-size: clamp(22px, 4vw, 26px); font-weight: 500; color: var(--ink); margin: 8px 0 4px; }
.zen-header .auth-subtitle { font-size: 13px; color: var(--muted); margin: 0; }

/* Breathing circle */
.zen-breathing-area {
  display: flex; justify-content: center; align-items: center;
  padding: 24px 32px 16px;
}
.zen-breathing-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: transform 4s cubic-bezier(.4,0,.2,1), box-shadow 4s ease;
  box-shadow: 0 0 20px 4px rgba(212,168,67,.08);
}
.zen-breathing-ring.is-inhale {
  transform: scale(1.25);
  box-shadow: 0 0 40px 12px rgba(212,168,67,.2);
  border-color: var(--gold);
}
.zen-breathing-ring.is-exhale {
  transform: scale(1);
  box-shadow: 0 0 20px 4px rgba(212,168,67,.08);
  border-color: var(--gold-dim);
}
.zen-breathing-text { font-family: var(--font-serif); font-size: 16px; color: var(--ink); font-weight: 500; }
.zen-breathing-timer { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Soundscape buttons */
.zen-section { padding: 0 32px; margin-bottom: 12px; }
.zen-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

.zen-soundscapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zen-soundscape-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border: 1.5px solid var(--soft); border-radius: 12px;
  background: rgba(255,255,255,.6); cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.zen-soundscape-btn:hover { border-color: var(--gold-dim); }
.zen-soundscape-btn.is-selected { border-color: var(--cinnabar); background: rgba(194,60,46,.04); box-shadow: 0 0 0 1px var(--cinnabar); }
.zen-sound-emoji { font-size: 24px; }
.zen-sound-name { font-size: 11px; color: var(--ink); font-weight: 500; }

/* Duration buttons */
.zen-durations { display: flex; gap: 6px; flex-wrap: wrap; }
.zen-duration-btn {
  padding: 8px 16px; border: 1.5px solid var(--soft); border-radius: 20px;
  background: rgba(255,255,255,.6); font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.zen-duration-btn:hover { border-color: var(--gold-dim); }
.zen-duration-btn.is-selected { border-color: var(--cinnabar); background: rgba(194,60,46,.04); }

/* Session controls */
.zen-controls { text-align: center; padding: 4px 32px 12px; }
.zen-start-btn { padding: 13px 32px; font-size: 15px; font-weight: 600; }
.zen-stop-btn { padding: 10px 24px; font-size: 13px; margin-left: 8px; }

/* Stats */
.zen-stats {
  display: flex; justify-content: center; gap: 24px;
  padding: 8px 32px 16px; text-align: center;
}
.zen-stat-item { display: flex; flex-direction: column; }
.zen-stat-value { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--gold); }
.zen-stat-label { font-size: 11px; color: var(--muted); }

/* Dim toggle */
.zen-dim-btn {
  position: absolute; top: 16px; right: 48px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--soft); background: rgba(255,255,255,.6);
  font-size: 16px; cursor: pointer; transition: background .2s;
}
.zen-dim-btn:hover { background: rgba(212,168,67,.1); }
.zen-dim-btn.is-active { background: rgba(61,43,31,.8); color: var(--gold); border-color: var(--gold-dim); }

/* Gate button */
.zen-gate-btn { margin-top: 8px; font-size: 13px !important; padding: 8px 16px !important; }

/* Zen responsive */
@media (max-width: 640px) {
  .zen-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .zen-section { padding: 0 20px; }
  .zen-header { padding: 32px 20px 8px; }
  .zen-breathing-ring { width: 120px; height: 120px; }
  .zen-controls { padding: 4px 20px 12px; }
  .zen-soundscapes { gap: 6px; }
  .zen-soundscape-btn { padding: 10px 4px; }
}

/* ── BAZI READING ── */
.bazi-card {
  position: relative;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(255,255,255,.95), rgba(245,239,224,.98));
  border: 1px solid rgba(194, 60, 46, .12);
  box-shadow: 0 24px 80px rgba(61,43,31,.12), 0 4px 16px rgba(194,60,46,.06);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .35s;
}
#bazi-overlay:not([hidden]) .bazi-card { transform: scale(1) translateY(0); opacity: 1; }

.bazi-header { text-align: center; padding: 32px 32px 12px; }
.bazi-header .auth-seal { font-size: 18px; }
.bazi-header h2 { font-family: var(--font-serif); font-size: clamp(22px, 4vw, 26px); font-weight: 500; color: var(--ink); margin: 8px 0 4px; }
.bazi-header .auth-subtitle { font-size: 13px; color: var(--muted); margin: 0; }

.bazi-section { padding: 0 32px; margin-bottom: 14px; }
.bazi-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

/* Birth input selects */
.bazi-inputs { display: flex; flex-direction: column; gap: 10px; }
.bazi-input-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bazi-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,.8);
  border: 1.5px solid var(--soft);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239b8b7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color .2s;
}
.bazi-select:focus { outline: none; border-color: var(--cinnabar); box-shadow: 0 0 0 2px rgba(194,60,46,.1); }
.bazi-select:hover { border-color: var(--gold-dim); }

/* Gender toggle */
.bazi-gender-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bazi-gender-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px;
  border: 1.5px solid var(--soft);
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  transition: all .2s;
}
.bazi-gender-btn:hover { border-color: var(--gold-dim); }
.bazi-gender-btn.is-selected { border-color: var(--cinnabar); background: rgba(194,60,46,.04); box-shadow: 0 0 0 1px var(--cinnabar); }

/* Oracle selection */
.bazi-oracles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bazi-oracle-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px;
  border: 1.5px solid var(--soft);
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  transition: all .2s;
}
.bazi-oracle-btn:hover { border-color: var(--gold-dim); }
.bazi-oracle-btn.is-selected { border-color: var(--cinnabar); background: rgba(194,60,46,.04); box-shadow: 0 0 0 1px var(--cinnabar); }
.bazi-oracle-emoji { font-size: 22px; }
.bazi-oracle-name { font-size: 11px; color: var(--ink); font-weight: 500; }

/* Cast button */
.bazi-cast-btn {
  display: block;
  width: calc(100% - 64px);
  margin: 8px 32px 16px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
}
.bazi-cast-btn:disabled { opacity: .5; cursor: not-allowed; }
.bazi-cast-btn.is-loading { opacity: .7; pointer-events: none; }

/* Four Pillars grid */
.bazi-pillars { padding: 0 32px; margin-bottom: 16px; }
.bazi-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.bazi-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border: 1.5px solid var(--soft);
  border-radius: 12px;
  background: rgba(255,255,255,.7);
}
.bazi-pillar-day {
  border-color: var(--cinnabar);
  background: rgba(194,60,46,.03);
}
.bazi-pillar-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.bazi-pillar-ganzhi { font-family: var(--font-han); font-size: 22px; font-weight: 600; color: var(--cinnabar); line-height: 1.2; }
.bazi-pillar-day .bazi-pillar-ganzhi { color: var(--ink); }
.bazi-pillar-element { font-size: 11px; color: var(--gold); font-weight: 500; }
.bazi-pillar-shishen { font-size: 10px; color: var(--jade); font-weight: 500; }
.bazi-pillar-nayin { font-size: 9px; color: var(--muted); line-height: 1.2; text-align: center; }

/* Da Yun timeline */
.bazi-dayun { padding: 0 32px; margin-bottom: 16px; }
.bazi-dayun-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}
.bazi-dayun-timeline::-webkit-scrollbar { height: 4px; }
.bazi-dayun-timeline::-webkit-scrollbar-thumb { background: var(--soft); border-radius: 2px; }
.bazi-dayun-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: rgba(255,255,255,.6);
  min-width: 64px;
}
.bazi-dayun-item.is-current { border-color: var(--cinnabar); background: rgba(194,60,46,.04); }
.bazi-dayun-age { font-size: 9px; color: var(--muted); }
.bazi-dayun-ganzhi { font-family: var(--font-han); font-size: 14px; font-weight: 600; color: var(--ink); }
.bazi-dayun-year { font-size: 8px; color: var(--muted); }

/* AI response */
.bazi-response { padding: 0 32px; margin-bottom: 16px; }
.bazi-chart-strength {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.bazi-chart-strength.is-strong { background: rgba(79,144,123,.1); color: var(--jade); }
.bazi-chart-strength.is-moderate { background: rgba(212,168,67,.1); color: var(--gold); }
.bazi-chart-strength.is-weak { background: rgba(194,60,46,.1); color: var(--cinnabar); }
.bazi-reading {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* History */
.bazi-history { padding: 0 32px 16px; }
.bazi-history-list { display: flex; flex-direction: column; gap: 8px; }
.bazi-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: rgba(255,255,255,.5);
  font-size: 12px;
  color: var(--ink);
}
.bazi-history-pillars { font-family: var(--font-han); font-weight: 500; }
.bazi-history-date { color: var(--muted); font-size: 11px; }

/* Gate button */
.bazi-gate-btn { margin-top: 8px; font-size: 13px !important; padding: 8px 16px !important; }

/* Responsive */
@media (max-width: 640px) {
  .bazi-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .bazi-section { padding: 0 20px; }
  .bazi-header { padding: 32px 20px 8px; }
  .bazi-input-row { grid-template-columns: repeat(2, 1fr); }
  .bazi-pillars { padding: 0 20px; }
  .bazi-pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .bazi-dayun { padding: 0 20px; }
  .bazi-response { padding: 0 20px; }
  .bazi-history { padding: 0 20px 16px; }
  .bazi-cast-btn { width: calc(100% - 40px); margin: 8px 20px 16px; }
  .bazi-oracles { gap: 6px; }
  .bazi-oracle-btn { padding: 8px 4px; }
}

/* ══════════════════════════════════════════
   HUANGLI — 今日黄历 (Chinese Almanac)
   1:1 复刻 putiyuan.pages.dev/almanac/
   ══════════════════════════════════════════ */

/* Main card */
.huangli-card {
  max-width: 480px; width: 90vw; max-height: 90vh; overflow-y: auto;
  margin: auto; padding: 0; border-radius: 20px;
  background: linear-gradient(175deg, rgba(26,19,13,.97), rgba(42,29,19,.98));
  border: 1px solid rgba(212,168,67,.25);
  box-shadow: 0 8px 40px rgba(0,0,0,.4), var(--glow-gold);
  color: var(--cream);
  font-family: var(--font-sans);
}
.huangli-card::-webkit-scrollbar { width: 4px; }
.huangli-card::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }

/* Close button inherits .auth-close */

/* ── Date Header ── */
.huangli-date-header {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 32px 20px 16px; text-align: center;
  border-bottom: 1px solid rgba(212,168,67,.15);
}
.huangli-date-center { flex: 1; min-width: 0; }
.huangli-date-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; letter-spacing: .15em; color: rgba(212,168,67,.85);
  font-weight: 500; margin: 0 0 8px;
}
.huangli-date-solar {
  font-family: var(--font-han); font-size: 2rem; font-weight: 600;
  color: var(--gold); margin: 0 0 4px; line-height: 1.3;
}
.huangli-date-lunar {
  font-size: 15px; color: rgba(245,239,224,.85); margin: 0 0 4px;
}
.huangli-date-ganzhi {
  font-size: 13px; color: rgba(245,239,224,.7); margin: 0;
}
.huangli-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(212,168,67,.3); background: transparent;
  color: var(--gold); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.huangli-nav-btn:hover { background: rgba(212,168,67,.1); border-color: rgba(212,168,67,.5); }

/* ── Fortune Badge ── */
.huangli-fortune-badge {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 16px auto 20px; padding: 8px 20px;
  border-radius: 999px; border: 2px solid rgba(61,43,31,.2);
  background: rgba(61,43,31,.08);
}
.huangli-fortune-icon { font-size: 18px; opacity: .7; }
.huangli-fortune-rank {
  font-family: var(--font-han); font-size: 18px;
  color: rgba(245,239,224,.7); font-weight: 500;
}
.huangli-fortune-desc {
  font-size: 14px; color: rgba(245,239,224,.85);
}

/* ── 宜忌 Grid ── */
.huangli-yiji-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 0 20px; margin-bottom: 16px;
}
.huangli-yi-card, .huangli-ji-card {
  border-radius: 12px; padding: 16px;
  transition: all .3s;
}
.huangli-yi-card {
  border: 1px solid rgba(79,144,123,.3);
  background: rgba(79,144,123,.08);
}
.huangli-ji-card {
  border: 1px solid rgba(194,60,46,.3);
  background: rgba(194,60,46,.1);
}

.huangli-yiji-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-han); font-size: 22px;
  margin: 0 0 10px; font-weight: 500;
}
.huangli-yiji-sub {
  font-family: var(--font-sans); font-size: 14px;
  color: rgba(245,239,224,.85); font-weight: 400;
}
.huangli-yi-title { color: rgba(79,144,123,.85); }
.huangli-ji-title { color: rgba(194,60,46,.85); }

.huangli-yiji-badge {
  display: inline-block; padding: 2px 10px; border-radius: 6px;
  font-size: 16px;
}
.huangli-yi-badge { background: rgba(79,144,123,.2); }
.huangli-ji-badge { background: rgba(194,60,46,.2); }

.huangli-yiji-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.huangli-yiji-tags span {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  font-size: 15px;
}
.huangli-yi-card .huangli-yiji-tags span {
  border: 1px solid rgba(79,144,123,.4);
  background: rgba(79,144,123,.15);
  color: rgba(79,144,123,.9);
}
.huangli-ji-card .huangli-yiji-tags span {
  border: 1px solid rgba(194,60,46,.4);
  background: rgba(194,60,46,.15);
  color: rgba(194,60,46,.85);
}

/* ── Section Cards (神煞, 时辰, 未来七日) ── */
.huangli-section-card {
  margin: 0 20px 16px; padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(212,168,67,.2);
  background: rgba(26,19,13,.6);
}
.huangli-section-title {
  font-family: var(--font-han); font-size: 18px;
  color: var(--gold); margin: 0 0 12px; font-weight: 500;
}

/* ── 神煞 Grid ── */
.huangli-shensha-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.huangli-shensha-item {
  border-radius: 10px; padding: 12px;
  border: 1px solid rgba(212,168,67,.15);
  background: rgba(42,29,19,.4);
}
.huangli-shensha-label {
  font-size: 13px; margin: 0 0 4px; color: rgba(212,168,67,.85);
}
.huangli-shensha-value {
  font-size: 15px; margin: 0; color: rgba(245,239,224,.85);
  line-height: 1.4;
}
.huangli-label-ji { color: rgba(79,144,123,.85) !important; }
.huangli-label-xiong { color: rgba(194,60,46,.85) !important; }

/* ── 时辰 Grid ── */
.huangli-shichen-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.huangli-shichen-item {
  border-radius: 10px; padding: 10px 12px;
  border: 1px solid rgba(212,168,67,.15);
  background: rgba(42,29,19,.4);
}
.huangli-shichen-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.huangli-shichen-zhi {
  font-family: var(--font-han); font-size: 16px;
  color: var(--gold); font-weight: 500;
}
.huangli-shichen-fortune {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  font-weight: 500;
}
.huangli-shichen-fortune.is-ji { background: rgba(79,144,123,.2); color: rgba(79,144,123,.9); }
.huangli-shichen-fortune.is-xiong { background: rgba(194,60,46,.2); color: rgba(194,60,46,.9); }
.huangli-shichen-fortune.is-ping { background: rgba(212,168,67,.15); color: rgba(212,168,67,.9); }
.huangli-shichen-ganzhi {
  font-size: 12px; color: rgba(245,239,224,.65); margin: 0;
}
.huangli-shichen-clash {
  font-size: 11px; color: rgba(245,239,224,.5); margin: 2px 0 0;
}

/* ── 未来七日 ── */
.huangli-week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.huangli-week-day {
  border-radius: 10px; padding: 8px 4px; text-align: center;
  border: 2px solid rgba(212,168,67,.2);
  background: rgba(42,29,19,.4);
  cursor: pointer; transition: all .2s;
}
.huangli-week-day:hover { border-color: rgba(212,168,67,.5); }
.huangli-week-day.is-today {
  border-color: var(--gold); background: rgba(212,168,67,.15);
}
.huangli-week-weekday {
  font-size: 11px; color: rgba(245,239,224,.55); margin-bottom: 4px;
}
.huangli-week-lunar {
  font-family: var(--font-han); font-size: 15px;
  color: var(--gold); margin-bottom: 4px;
}
.huangli-week-fortune {
  font-size: 11px; margin: 0;
}
.huangli-week-fortune.is-shangshang { color: rgba(194,60,46,.85); }
.huangli-week-fortune.is-shangji { color: rgba(194,60,46,.85); }
.huangli-week-fortune.is-zhongji { color: var(--gold); }
.huangli-week-fortune.is-zhongping { color: var(--cream); }
.huangli-week-fortune.is-xiaji { color: rgba(212,168,67,.7); }
.huangli-week-fortune.is-xiaxia { color: rgba(245,239,224,.55); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .huangli-card { max-width: 100%; width: calc(100% - 16px); border-radius: 16px; }
  .huangli-date-header { padding: 28px 16px 12px; gap: 8px; }
  .huangli-date-solar { font-size: 1.6rem; }
  .huangli-yiji-grid { padding: 0 16px; gap: 8px; }
  .huangli-yi-card, .huangli-ji-card { padding: 12px; }
  .huangli-section-card { margin: 0 16px 12px; padding: 12px; }
  .huangli-shichen-grid { grid-template-columns: repeat(2, 1fr); }
  .huangli-week-grid { gap: 4px; }
  .huangli-week-day { padding: 6px 2px; }
  .huangli-week-lunar { font-size: 13px; }
}
@media (min-width: 641px) {
  .huangli-shichen-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Five core culture pages — full-page Puti Yuan treatment */
#lantern-overlay,#huangli-overlay,#bazi-overlay,#dream-overlay,#zen-overlay{
  align-items:flex-start;overflow-y:auto;padding:86px 18px 60px;
  background:
    radial-gradient(circle at 86% 15%,rgba(211,169,88,.12),transparent 18%),
    linear-gradient(rgba(18,13,10,.84),rgba(18,13,10,.92)),
    url('/assets/putiyuan/temple-mountain.svg') center bottom/100% auto no-repeat,
    #1a1410;
}
#lantern-overlay .lantern-card,#huangli-overlay .huangli-card,#bazi-overlay .bazi-card,#dream-overlay .dream-card,#zen-overlay .zen-card{
  width:min(1040px,calc(100vw - 36px));max-width:1040px;max-height:none;overflow:visible;
  margin:0 auto;padding:0 0 34px;border-radius:18px;
  border:1px solid rgba(205,172,105,.3);color:#e9ddc4;
  background:linear-gradient(150deg,rgba(48,36,24,.94),rgba(30,23,17,.96));
  box-shadow:0 0 0 1px rgba(255,238,190,.05),0 0 22px rgba(222,194,139,.22),0 28px 80px rgba(0,0,0,.44);
}
#lantern-overlay .auth-close,#huangli-overlay .auth-close,#bazi-overlay .auth-close,#dream-overlay .auth-close,#zen-overlay .auth-close{
  position:fixed;top:82px;right:28px;z-index:4;width:42px;height:42px;border:1px solid rgba(205,172,105,.3);border-radius:50%;background:#251c15;color:#d8bc7b;
}
.lantern-header,.dream-header,.zen-header,.bazi-header{padding:42px 34px 25px;text-align:center;border-bottom:1px solid rgba(205,172,105,.14)}
.lantern-header h2,.dream-header h2,.zen-header h2,.bazi-header h2{font-family:var(--font-han);font-size:34px;letter-spacing:.14em;color:#d9b76e!important;margin:10px 0 8px}
.lantern-header .auth-subtitle,.dream-header .auth-subtitle,.zen-header .auth-subtitle,.bazi-header .auth-subtitle{color:rgba(233,221,196,.7);font-size:16px}
.lantern-section,.dream-section,.zen-section,.bazi-section{padding-left:28px!important;padding-right:28px!important;margin-top:24px}
.lantern-label,.dream-label,.zen-label,.bazi-label{font-size:15px!important;letter-spacing:.08em;color:#d5bd89!important;margin-bottom:12px!important}
.lantern-types,.dream-oracles,.zen-soundscapes,.bazi-oracles{grid-template-columns:repeat(3,1fr);gap:14px}
.lantern-type-btn,.dream-oracle-btn,.zen-soundscape-btn,.bazi-oracle-btn,.lantern-ded-btn,.bazi-gender-btn,.zen-duration-btn,.dream-cat-btn{
  min-height:58px;border:1px solid rgba(205,172,105,.24)!important;background:rgba(255,247,222,.025)!important;color:#e9ddc4!important;border-radius:14px!important
}
.lantern-type-btn.is-selected,.dream-oracle-btn.is-selected,.zen-soundscape-btn.is-selected,.bazi-oracle-btn.is-selected,.lantern-ded-btn.is-selected,.bazi-gender-btn.is-selected,.zen-duration-btn.is-selected{
  border-color:#caa45b!important;background:linear-gradient(135deg,rgba(183,145,71,.22),rgba(105,76,36,.18))!important;box-shadow:0 0 18px rgba(202,164,91,.18)!important
}
.lantern-submit-btn,.dream-interpret-btn,.zen-start-btn,.bazi-cast-btn{width:calc(100% - 56px)!important;max-width:none;margin:26px 28px 18px!important;min-height:54px;border-radius:12px!important;font-size:17px!important;letter-spacing:.1em}
.dream-input,.bazi-select,#lantern-overlay .auth-input{background:rgba(14,10,8,.5)!important;border-color:rgba(205,172,105,.27)!important;color:#f0e4ca!important}
.bazi-input-row{grid-template-columns:repeat(4,1fr);gap:14px}.bazi-select{height:70px;font-size:18px}.bazi-oracle-name small{font-size:11px;color:rgba(233,221,196,.48)}
.zen-breathing-ring{border-color:rgba(211,178,104,.6)!important;box-shadow:0 0 35px rgba(211,178,104,.2)!important}.zen-breathing-text{color:#d9b76e!important}
.huangli-card{padding-top:10px!important}.huangli-date-header{padding-top:42px}.huangli-date-solar{font-size:2.5rem}.huangli-fortune-badge{display:flex;width:max-content}.huangli-shichen-grid{grid-template-columns:repeat(4,1fr)}
.lantern-wall{margin:30px 28px 0!important}.dream-response,.dream-symbols,.dream-history,.bazi-pillars,.bazi-dayun,.bazi-response,.bazi-history{padding-left:28px!important;padding-right:28px!important}
@media(max-width:640px){
  #lantern-overlay,#huangli-overlay,#bazi-overlay,#dream-overlay,#zen-overlay{padding:62px 0 90px;background-size:auto 52%}
  #lantern-overlay .lantern-card,#huangli-overlay .huangli-card,#bazi-overlay .bazi-card,#dream-overlay .dream-card,#zen-overlay .zen-card{width:100%;border-left:0;border-right:0;border-radius:0;min-height:calc(100vh - 62px)}
  #lantern-overlay .auth-close,#huangli-overlay .auth-close,#bazi-overlay .auth-close,#dream-overlay .auth-close,#zen-overlay .auth-close{top:68px;right:10px;position:fixed}
  .lantern-header,.dream-header,.zen-header,.bazi-header{padding:34px 20px 20px}.lantern-header h2,.dream-header h2,.zen-header h2,.bazi-header h2{font-size:28px}
  .lantern-section,.dream-section,.zen-section,.bazi-section{padding-left:16px!important;padding-right:16px!important}
  .lantern-types,.dream-oracles,.zen-soundscapes,.bazi-oracles{gap:7px}.bazi-input-row{grid-template-columns:repeat(3,1fr)}.bazi-input-row .bazi-select:last-child{grid-column:1/-1}
  .huangli-shichen-grid{grid-template-columns:repeat(2,1fr)}.huangli-week-grid{overflow-x:auto;grid-template-columns:repeat(7,74px)}
  .lantern-submit-btn,.dream-interpret-btn,.zen-start-btn,.bazi-cast-btn{width:calc(100% - 32px)!important;margin:24px 16px 16px!important}
}

/* Final dark-surface normalization for all existing feature overlays. */
.auth-overlay,.pricing-overlay,.history-overlay,.referral-overlay,.lantern-overlay,.incense-overlay,.dream-overlay,.zen-overlay,.bazi-overlay,.huangli-overlay {
  background:rgba(10,7,5,.88) !important; backdrop-filter:blur(22px) !important;
}
.auth-card,.pricing-card,.history-card,.referral-card,.lantern-card,.incense-card,.dream-card,.zen-card,.bazi-card,.huangli-card,
.ritual-altar,.cosmos-panel,.reading-layout,.seal-card {
  color:#e5d7ba !important; border-color:rgba(201,160,92,.24) !important;
  background:linear-gradient(175deg,rgba(38,27,20,.99),rgba(24,17,13,.99)) !important;
  box-shadow:0 24px 70px rgba(0,0,0,.52) !important;
}
.auth-card h2,.pricing-card h2,.history-card h2,.lantern-card h2,.incense-card h2,.dream-card h2,.zen-card h2,.bazi-card h2,.huangli-card h2,
.auth-card h3,.pricing-card h3,.history-card h3,.lantern-card h3,.incense-card h3,.dream-card h3,.zen-card h3,.bazi-card h3,.huangli-card h3 { color:#efd89e !important; }
.auth-card p,.pricing-card p,.history-card p,.lantern-card p,.incense-card p,.dream-card p,.zen-card p,.bazi-card p { color:rgba(229,215,186,.7); }
.gate-scroll-hint { position:static; transform:none; margin-top:20px; animation:puti-hint 2.4s ease-in-out infinite; }
@keyframes puti-hint { 50% { transform:translateY(7px); } }
@media (max-width:640px) { .mobile-auth-btn { display:none !important; } }

/* Shared full-feature surfaces: lottery, physiognomy, naming */
.feature-overlay { position:fixed; inset:0; z-index:130; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(9,6,4,.9); backdrop-filter:blur(22px); opacity:0; visibility:hidden; transition:.3s; }
.feature-overlay:not([hidden]) { opacity:1; visibility:visible; }
.feature-card { position:relative; width:min(680px,100%); max-height:92dvh; overflow:auto; border:1px solid rgba(201,160,92,.27); border-radius:18px; background:linear-gradient(170deg,#2a1d16,#17100c); color:#e5d7ba; box-shadow:0 30px 90px rgba(0,0,0,.62); }
.feature-close { position:absolute; z-index:2; right:16px; top:14px; width:38px; height:38px; border-radius:50%; border:1px solid rgba(201,160,92,.25); background:rgba(0,0,0,.18); color:#c9a05c; font-size:25px; line-height:1; }
.feature-header { padding:34px 28px 24px; text-align:center; border-bottom:1px solid rgba(201,160,92,.12); background:radial-gradient(circle at 50% 0,rgba(201,160,92,.13),transparent 60%); }
.feature-seal { display:grid; place-items:center; width:58px; height:58px; margin:0 auto 12px; border:1px solid rgba(201,160,92,.45); border-radius:50%; color:#c9a05c; font:34px "ZhiMangXing",serif; box-shadow:0 0 25px rgba(201,160,92,.12); }
.feature-header p { margin:0 0 7px; color:#a9977d; font-size:12px; letter-spacing:.16em; }
.feature-header h2 { margin:0; color:#efd89e !important; font:42px "ZhiMangXing",serif; letter-spacing:.14em; }
.feature-header small { color:rgba(229,215,186,.58); }
.feature-body { padding:26px 28px 30px; }
.feature-body h3 { margin:0 0 13px; color:#c9a05c; font-size:16px; }
.master-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:20px; }
.master-option { padding:15px 10px; border:1px solid rgba(201,160,92,.16); border-radius:9px; background:rgba(255,255,255,.025); color:#e5d7ba; }
.master-option b,.master-option span { display:block; }.master-option b{font-size:16px;margin-bottom:6px}.master-option span{font-size:11px;color:#a9977d}.master-option.is-selected{border-color:#c9a05c;background:rgba(201,160,92,.09);box-shadow:0 0 16px rgba(201,160,92,.08)}
.feature-field { display:block; margin-bottom:16px; }.feature-field>span{display:block;margin-bottom:7px;color:#c9a05c;font-size:13px}.feature-field input,.feature-field textarea,.feature-field select{width:100%;min-height:44px;padding:11px 13px;border:1px solid rgba(201,160,92,.2);border-radius:8px;background:rgba(255,255,255,.035)!important;color:#e5d7ba!important}.feature-field textarea{min-height:92px;resize:vertical}
.feature-submit { width:100%; margin-top:18px; }.feature-note{margin:12px 0 0;text-align:center;color:#8e7d66!important;font-size:11px}
.lottery-cylinder { position:relative; width:150px; height:175px; margin:18px auto 7px; padding-top:34px; text-align:center; color:#efd89e; border:2px solid #8f2d2b; border-radius:28px 28px 48px 48px; background:linear-gradient(90deg,#6e1f1f,#a83b36,#6e1f1f); box-shadow:inset 0 0 30px rgba(0,0,0,.4),0 12px 30px rgba(0,0,0,.3)}
.lottery-cylinder::before{content:"";position:absolute;left:12px;right:12px;top:-16px;height:27px;border-radius:50%;background:#b8904c;border:4px solid #5f401b;box-shadow:inset 0 4px 8px rgba(0,0,0,.45)}.lottery-cylinder i{position:absolute;top:-54px;left:36px;width:9px;height:55px;background:#d5b36a;box-shadow:18px 3px #b8924d,36px -2px #d5b36a,54px 4px #a77d35,72px 0 #d5b36a}.lottery-cylinder b{font:24px "ZhiMangXing",serif;line-height:1.25}.lottery-cylinder span{display:block;margin-top:13px;font-size:11px;color:#e5c98d}.lottery-cylinder.is-shaking{animation:lottery-shake .65s ease-in-out 2}@keyframes lottery-shake{20%,60%{transform:rotate(-5deg)}40%,80%{transform:rotate(5deg)}}
.lottery-result-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;color:#c9a05c}.lottery-result-head span{font-size:23px}.lottery-result-head b{border:1px solid rgba(201,160,92,.35);border-radius:20px;padding:5px 13px}.feature-result blockquote{margin:0 0 20px;padding:23px;text-align:center;white-space:pre-line;border:1px solid rgba(201,160,92,.15);background:rgba(201,160,92,.045);font:20px/2 "Noto Serif SC",serif;color:#efd89e}.reading-block{padding:20px;border-radius:10px;background:rgba(255,255,255,.03);border-left:3px solid #c9a05c}.reading-block p{color:rgba(229,215,186,.75)!important;line-height:1.85;white-space:pre-line}.result-actions{display:flex;gap:10px;margin-top:22px}.result-actions .btn{flex:1}
.feature-tabs,.segmented{display:grid;grid-template-columns:repeat(2,1fr);gap:5px;padding:4px;margin-bottom:20px;border-radius:9px;background:rgba(0,0,0,.22)}.feature-tabs button,.segmented button{min-height:42px;border:0;border-radius:7px;background:transparent;color:#a9977d}.feature-tabs button.is-active,.segmented button.is-active{background:rgba(201,160,92,.13);color:#efd89e}
.photo-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:240px;padding:20px;border:1px dashed rgba(201,160,92,.38);border-radius:12px;background:rgba(201,160,92,.035);overflow:hidden;cursor:pointer}.photo-drop input{position:absolute;opacity:0;pointer-events:none}.photo-drop>span{font:64px "ZhiMangXing",serif;color:#c9a05c}.photo-drop>b{margin:8px 0;color:#efd89e}.photo-drop small{color:#8e7d66}.photo-drop img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#120d0a}.feature-consent{display:flex;align-items:flex-start;gap:9px;margin-top:14px;font-size:12px;color:#a9977d}.analysis-preview{position:relative;height:290px;border-radius:12px;overflow:hidden;background:#110c09}.analysis-preview img{width:100%;height:100%;object-fit:contain}.analysis-lines i{position:absolute;width:46%;height:2px;left:27%;top:42%;background:#ca4b48;box-shadow:0 0 8px #ca4b48;transform:rotate(10deg)}.analysis-lines i:nth-child(2){top:54%;transform:rotate(-8deg)}.analysis-lines i:nth-child(3){top:66%;transform:rotate(4deg)}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.form-grid.three{grid-template-columns:repeat(3,1fr)}.style-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}.style-chips button{padding:8px 14px;border:1px solid rgba(201,160,92,.18);border-radius:20px;background:transparent;color:#a9977d}.style-chips button.is-selected{border-color:#c9a05c;background:rgba(201,160,92,.1);color:#efd89e}.name-result-card{padding:20px;margin-bottom:12px;border:1px solid rgba(201,160,92,.18);border-radius:10px;background:rgba(255,255,255,.025)}.name-result-card h3{font:32px "Noto Serif SC",serif!important;color:#efd89e!important}.name-result-meta{display:flex;gap:9px;flex-wrap:wrap}.name-result-meta span{font-size:11px;border:1px solid rgba(201,160,92,.22);border-radius:20px;padding:4px 9px;color:#c9a05c}.name-result-card p{color:rgba(229,215,186,.7)!important;line-height:1.7}.name-score{font-size:48px;color:#c9a05c;text-align:center}.name-score small{display:block;font-size:12px;color:#a9977d}
@media(max-width:640px){.feature-overlay{padding:0;align-items:flex-end}.feature-card{width:100%;max-height:94dvh;border-radius:18px 18px 0 0}.feature-header{padding:26px 18px 18px}.feature-header h2{font-size:34px}.feature-body{padding:20px 16px 28px}.master-grid{grid-template-columns:1fr}.master-option{text-align:left}.form-grid,.form-grid.three{grid-template-columns:1fr 1fr}.result-actions{flex-direction:column}.analysis-preview{height:240px}}
.topbar-music{flex:0 0 38px;width:38px;height:38px;border-radius:50%;border:1px solid rgba(201,160,92,.28);background:rgba(0,0,0,.12);color:#c9a05c;font-size:17px}.topbar-music.is-playing{background:rgba(201,160,92,.14);box-shadow:0 0 20px rgba(201,160,92,.16)}
.earn-fab{position:fixed;z-index:85;right:24px;bottom:25px;width:62px;height:62px;border-radius:50%;border:1px solid rgba(201,160,92,.56);background:rgba(35,24,18,.94);color:#c9a05c;box-shadow:0 0 24px rgba(201,160,92,.18);font-size:18px}.profile-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:20px}.profile-summary>div{padding:16px 10px;text-align:center;border:1px solid rgba(201,160,92,.16);border-radius:9px;background:rgba(255,255,255,.025)}.profile-summary span,.profile-summary b{display:block}.profile-summary span{font-size:11px;color:#8e7d66;margin-bottom:7px}.profile-summary b{color:#efd89e}.profile-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:24px}.profile-local-history{display:flex;flex-direction:column;gap:8px}.profile-history-item{display:flex;justify-content:space-between;gap:12px;padding:12px;border:1px solid rgba(201,160,92,.12);border-radius:8px;background:rgba(255,255,255,.02)}.profile-history-item b{color:#efd89e}.profile-history-item span{color:#8e7d66;font-size:11px}.profile-empty{padding:24px;text-align:center;color:#8e7d66;border:1px dashed rgba(201,160,92,.16);border-radius:9px}
@media(max-width:640px){.topbar-music{display:none}.earn-fab{right:14px;bottom:82px;width:54px;height:54px}.profile-summary{grid-template-columns:1fr 1fr 1fr;gap:6px}.profile-actions{grid-template-columns:1fr}}

/* Mobile hardening: safe areas, touch targets and scroll-contained dialogs. */
@media (max-width:640px) {
  html,body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%}
  button,a,input,select,textarea{touch-action:manipulation}
  input,select,textarea{font-size:16px!important}
  button,.btn,[role="button"]{min-height:44px}
  .gate-home{width:100%;padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  .gate-hero{min-height:calc(100svh - 68px);padding-top:env(safe-area-inset-top)}
  .gate-hero-content,.gate-section-cta,.gate-incense-cta,.gate-share-section{width:100%}
  .gate-hero-cta{gap:10px}.gate-section{scroll-margin-top:12px}
  .gate-footer-links{justify-content:center;row-gap:12px}.gate-footer-links a{min-height:36px;display:inline-flex;align-items:center;padding:0 5px}
  .mobile-tab-bar{width:100%;max-width:100%;overflow:hidden;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  .mobile-tab{min-width:0;padding:7px 2px;gap:2px}.mobile-tab span:last-child{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}.mobile-tab .mobile-tab-icon{font-size:18px}
  .earn-fab{bottom:calc(82px + env(safe-area-inset-bottom))}
  .auth-overlay,.pricing-overlay,.history-overlay,.referral-overlay,.incense-overlay,.feature-overlay{align-items:flex-end!important;padding:env(safe-area-inset-top) 0 0!important;overflow:hidden;overscroll-behavior:contain}
  .auth-card,.pricing-card,.history-card,.referral-card,.incense-card,.feature-card{width:100%!important;max-width:100%!important;max-height:calc(100dvh - env(safe-area-inset-top))!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border-left:0!important;border-right:0!important;border-radius:18px 18px 0 0!important;padding-bottom:max(24px,env(safe-area-inset-bottom))!important}
  .pricing-card{padding-left:12px!important;padding-right:12px!important}.pricing-header{padding:18px 38px 12px}.pricing-header h2{font-size:25px;line-height:1.2}.pricing-network{display:flex;flex-direction:column;align-items:center;gap:8px}.token-select{width:min(100%,260px);max-width:none;min-height:44px}.pricing-tiers{width:100%;max-width:none;gap:12px}.pricing-tier{padding:22px 16px}.pricing-pack-btn,.pricing-cta{width:100%;white-space:normal;line-height:1.35}
  .wechat-payment{width:100%;padding:16px 10px!important}.wechat-payment .payment-qr{max-width:100%}.wechat-payment .payment-qr img{max-width:min(230px,75vw);height:auto}
  #lantern-overlay,#huangli-overlay,#bazi-overlay,#dream-overlay,#zen-overlay{padding:calc(54px + env(safe-area-inset-top)) 0 calc(76px + env(safe-area-inset-bottom))!important;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  #lantern-overlay .lantern-card,#huangli-overlay .huangli-card,#bazi-overlay .bazi-card,#dream-overlay .dream-card,#zen-overlay .zen-card{min-height:calc(100dvh - 54px - env(safe-area-inset-top))!important;height:auto;overflow:visible}
  #lantern-overlay .auth-close,#huangli-overlay .auth-close,#bazi-overlay .auth-close,#dream-overlay .auth-close,#zen-overlay .auth-close{top:calc(60px + env(safe-area-inset-top))!important;right:max(10px,env(safe-area-inset-right))!important}
  .lantern-header,.dream-header,.zen-header,.bazi-header{padding-left:52px;padding-right:52px}.lantern-types,.dream-oracles,.zen-soundscapes,.bazi-oracles{grid-template-columns:repeat(3,minmax(0,1fr))}.lantern-type-btn,.dream-oracle-btn,.zen-soundscape-btn,.bazi-oracle-btn{min-width:0;padding-left:6px!important;padding-right:6px!important}
  .huangli-date-nav{gap:6px}.huangli-date-arrow{flex:0 0 44px;width:44px;height:44px}.huangli-date-solar{font-size:clamp(28px,9vw,40px)!important}.huangli-week-grid{width:100%;padding-bottom:6px;scroll-snap-type:x proximity}.huangli-week-day{scroll-snap-align:start}
  .feature-header{padding-left:54px;padding-right:54px}.feature-close{width:44px;height:44px;top:calc(10px + env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right))}.feature-tabs,.segmented{position:sticky;top:0;z-index:2}.form-grid,.form-grid.three{grid-template-columns:1fr}.photo-drop{min-height:220px}.style-chips button{min-height:40px}.profile-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.profile-summary b{overflow-wrap:anywhere}
  .auth-toast{width:calc(100% - 28px);text-align:center;bottom:calc(82px + env(safe-area-inset-bottom))}
}
@media (max-width:374px){.gate-home{padding-left:10px;padding-right:10px}.gate-hero .han{font-size:48px}.culture-strip{gap:2px}.culture-strip span{font-size:13px;padding:0 2px}.gate-card{padding:18px 14px}.mobile-tab span:last-child{font-size:9px}.earn-fab{width:48px;height:48px;right:10px}.lantern-types,.dream-oracles,.zen-soundscapes,.bazi-oracles{grid-template-columns:1fr}.pricing-tier{padding-left:12px;padding-right:12px}}

/* Mobile height fix: one scroll owner, content-driven cards, no clipped footer/actions. */
@media (max-width:640px) {
  .auth-overlay,.pricing-overlay,.history-overlay,.referral-overlay,.incense-overlay,.feature-overlay {
    display:block !important;
    height:100vh !important;
    height:100svh !important;
    min-height:100svh !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    padding:calc(10px + env(safe-area-inset-top)) 0 calc(84px + env(safe-area-inset-bottom)) !important;
  }
  .auth-overlay[hidden],.pricing-overlay[hidden],.history-overlay[hidden],.referral-overlay[hidden],.incense-overlay[hidden],.feature-overlay[hidden] { display:none !important; }
  .auth-card,.pricing-card,.history-card,.referral-card,.incense-card,.feature-card {
    position:relative;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    overflow:visible !important;
    contain:none !important;
  }
  .auth-card,.pricing-card,.history-card,.referral-card,.incense-card { margin-top:0 !important; }
  .feature-card { border-radius:18px 18px 0 0 !important; }
  .auth-close,.feature-close { position:sticky !important; top:8px !important; float:right; margin-right:8px; z-index:20; }
  .auth-close + *,.feature-close + * { clear:both; }

  #lantern-overlay,#huangli-overlay,#bazi-overlay,#dream-overlay,#zen-overlay {
    display:block !important;
    height:100vh !important;
    height:100svh !important;
    min-height:100svh !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    padding:calc(8px + env(safe-area-inset-top)) 0 calc(88px + env(safe-area-inset-bottom)) !important;
  }
  #lantern-overlay[hidden],#huangli-overlay[hidden],#bazi-overlay[hidden],#dream-overlay[hidden],#zen-overlay[hidden] { display:none !important; }
  #lantern-overlay .lantern-card,#huangli-overlay .huangli-card,#bazi-overlay .bazi-card,#dream-overlay .dream-card,#zen-overlay .zen-card {
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    overflow:visible !important;
  }
  #lantern-overlay .auth-close,#huangli-overlay .auth-close,#bazi-overlay .auth-close,#dream-overlay .auth-close,#zen-overlay .auth-close {
    position:sticky !important;
    top:8px !important;
    right:8px !important;
    float:right;
    margin:8px 8px -52px 0;
  }
  .pricing-faq,.lantern-wall,.dream-history,.bazi-history,.feature-result,.result-actions { margin-bottom:max(24px,env(safe-area-inset-bottom)) !important; }
}

@media (max-width:640px) and (orientation:landscape) {
  .auth-overlay,.pricing-overlay,.history-overlay,.referral-overlay,.incense-overlay,.feature-overlay,
  #lantern-overlay,#huangli-overlay,#bazi-overlay,#dream-overlay,#zen-overlay {
    padding-top:max(4px,env(safe-area-inset-top)) !important;
  }
  .feature-header,.pricing-header,.auth-header,.lantern-header,.dream-header,.zen-header,.bazi-header { padding-top:16px !important; padding-bottom:14px !important; }
  .photo-drop { min-height:170px; }
}
