/* Final visual layer: refined paper, cinnabar and warm metal. */
/* The ritual stepper is the page's primary wayfinding: larger, clearer, still one line. */
.flow{font-size:15px;letter-spacing:.1em;font-weight:600}.flow span{color:#d2bb96}.flow span.is-current{color:#ffe0a1;font-size:17px;font-weight:700;text-shadow:0 0 18px rgba(239,190,90,.64)}.flow i{width:42px;background:linear-gradient(90deg,rgba(224,184,108,.55),rgba(224,184,108,.12))}.flow span:not(.is-current){opacity:.9}
.flow-caption{margin:-17px auto 27px;color:#e4c88f;text-align:center;font:600 21px/1.4 "Noto Serif SC",serif;letter-spacing:.16em;text-shadow:0 0 18px rgba(224,177,85,.22)}
body .ritual-layout{display:block;max-width:760px}.ritual-card{margin:0 auto}#panel-prepare .panel-index{margin-bottom:8px;font:26px/1.3 "Ma Shan Zheng";letter-spacing:.08em;color:#8e3427}.rite-inline{display:flex;align-items:center;gap:11px;margin:0 0 25px;padding:10px 13px;border-left:2px solid #b98335;background:rgba(120,73,28,.08);color:#6c5037;font-size:12px;line-height:1.5;white-space:nowrap}.rite-inline span{flex:0 0 auto;color:#98362a;font-weight:700;letter-spacing:.12em}.rite-inline span::after{content:"·";margin-left:8px;color:#b98437}
.panel-index,#panel-prepare .panel-index{margin-bottom:10px;font:26px/1.3 "Ma Shan Zheng";letter-spacing:.08em;color:#8e3427}.casting-head .panel-index{margin:0}.sanqing-figure{position:relative;height:255px;margin:0 0 16px;overflow:hidden;border:1px solid rgba(139,92,31,.23);border-radius:5px;background:#e9dfcb;box-shadow:inset 0 0 0 6px rgba(255,251,241,.38),0 6px 16px rgba(91,55,20,.1)}.sanqing-figure::after{content:"三清";position:absolute;right:13px;bottom:10px;color:rgba(121,75,23,.65);font:24px "Ma Shan Zheng";letter-spacing:.14em;text-shadow:0 1px 2px #fff}.sanqing-figure img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 18%;filter:sepia(.12) saturate(.84) contrast(.96)}#panel-incense blockquote{margin-bottom:15px}.offering-stage{height:228px!important;border-radius:4px}.gesture-copy{position:absolute;z-index:5;top:12px;left:15px;display:flex;align-items:baseline;gap:9px;color:#8d402a}.gesture-copy span{font-size:11px;letter-spacing:.16em}.gesture-copy strong{font:22px "Ma Shan Zheng";letter-spacing:.07em;color:#7f3829}.offering-hand{width:195px!important;bottom:18px!important}.offering-hand .hand-palm{fill:#e9b786;stroke:#8e5538;stroke-width:2}.offering-hand .finger{fill:none;stroke:#b57955;stroke-width:12;stroke-linecap:round;transition:stroke .25s,filter .25s}.offering-hand .held-stick{stroke:#7d2d22!important;stroke-width:6;stroke-linecap:round;filter:drop-shadow(0 0 3px #f6c36c)}.incense-flow[data-gesture="1"] .finger-thumb,.incense-flow[data-gesture="1"] .finger-middle,.incense-flow[data-gesture="2"] .finger-thumb,.incense-flow[data-gesture="2"] .finger-ring,.incense-flow[data-gesture="3"] .finger-thumb,.incense-flow[data-gesture="3"] .finger-index{stroke:#d49c39;filter:drop-shadow(0 0 5px rgba(217,161,56,.7))}.incense-flow[data-gesture] .gesture-copy{animation:gesture-copy-in .45s ease-out}.offering-stage .censer{bottom:8px}.offering-stage .offering-stick{bottom:68px}.offering-status{font-size:13px!important;font-weight:600}.field-help{margin-bottom:22px}@keyframes gesture-copy-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
#panel-cast .field-help{text-align:center;margin:10px auto 3px;max-width:470px}.casting-head{align-items:flex-start}.casting-head b{margin-top:8px;padding:5px 9px;border-radius:99px;background:rgba(151,74,31,.1);font-size:11px}.shell-ritual{height:246px!important;margin:0!important}.shell-ritual::before{width:300px!important;bottom:7px!important}.shell-ritual .shell-halo{width:215px;height:215px}.shell-ritual .turtle-shell{transform:scale(1.48);transform-origin:center 61%;filter:drop-shadow(0 14px 12px rgba(64,35,10,.38))}.shell-ritual .turtle-shell:hover{transform:translateY(-3px) scale(1.48)}.shell-ritual .turtle-shell small{font-size:9px}.cast-counter{margin:0 0 9px;text-align:center;color:#a25b2e;font:25px "Ma Shan Zheng";letter-spacing:.08em}.cast-counter b{color:#8b3024;font:700 31px "Noto Serif SC"}.coin-drop{height:95px!important;gap:22px!important;padding:2px 0 10px}.drop-coin{position:relative;width:74px!important;height:74px!important;border:5px double #6e461b!important;background:radial-gradient(circle at 32% 26%,#f2d27f 0 6%,#c1842f 40%,#744014 70%,#c4903e 100%)!important;color:#4a2a12!important;font:15px "Ma Shan Zheng"!important;letter-spacing:.08em;text-shadow:0 1px #f8dfa0;box-shadow:0 8px 10px rgba(67,39,12,.25),inset 0 0 0 4px rgba(72,41,12,.42)!important}.drop-coin::after{content:"";position:absolute;left:50%;top:50%;width:17px;height:17px;transform:translate(-50%,-50%);background:#f1dfb0;border:2px solid #634017;box-shadow:inset 0 0 0 2px rgba(101,65,23,.17)}.drop-coin.is-reverse{filter:brightness(.78) saturate(.72);color:transparent!important}.coin-meaning{min-height:26px;margin:0 0 13px!important;font-size:14px!important;font-weight:600}.shell-action{min-width:0!important;width:100%;margin:0!important}.raw-record{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:19px!important;padding-top:0!important;border-top:0!important;min-height:0!important}.record-chip{position:relative;min-height:76px;padding:12px 13px!important;display:flex;flex-direction:column;gap:4px;border:1px solid rgba(155,95,37,.28)!important;border-radius:6px;background:rgba(255,252,242,.42);color:#68472f!important}.record-chip span{font-size:11px;letter-spacing:.08em;color:#9a6036}.record-chip strong{font-size:15px;color:#76341f}.mini-hex{position:absolute;right:13px;bottom:15px;width:47px;height:7px;border-radius:2px;background:#6d5137}.mini-hex.is-yin{background:linear-gradient(90deg,#6d5137 0 40%,transparent 40% 60%,#6d5137 60%)}
#panel-cast .shell-ritual .turtle-shell{width:184px;height:206px;transform:none;filter:drop-shadow(0 13px 12px rgba(64,35,10,.35))}.shell-ritual .turtle-shell:hover{transform:translateY(-3px)}.turtle-art{display:block;width:100%;height:100%;object-fit:contain}.shell-ritual .turtle-shell small{bottom:-11px}.drop-coin{border:0!important;background:transparent!important;box-shadow:none!important;color:transparent!important;text-shadow:none!important}.drop-coin::after{display:none}.drop-coin img{display:block;width:100%;height:100%;object-fit:contain}.drop-coin.is-reverse{filter:none}
@media(max-width:560px){.flow{font-size:11px;letter-spacing:.04em}.flow span.is-current{font-size:12px}.flow i{width:10px;flex:0 0 10px}}
@media(max-width:560px){.flow-caption{font-size:16px;margin:-14px auto 21px;letter-spacing:.1em}}
@media(max-width:560px){#panel-prepare .panel-index{font-size:23px}.rite-inline{gap:7px;margin-bottom:20px;padding:9px 10px;font-size:10px;letter-spacing:-.01em}}
@media(max-width:560px){.panel-index,#panel-prepare .panel-index{font-size:23px}.sanqing-figure{height:185px;margin-bottom:13px}.sanqing-figure::after{font-size:20px}.offering-stage{height:205px!important}.gesture-copy{top:10px;left:10px}.gesture-copy strong{font-size:19px}.gesture-copy span{font-size:10px}.offering-hand{width:164px!important;left:-151px!important;bottom:14px!important}.offering-stage .censer{transform:translateX(-50%) scale(.8);transform-origin:bottom}.offering-stage .offering-stick{bottom:59px}.offering-status{font-size:12px!important}}
@media(max-width:560px){#panel-cast .field-help{font-size:12px;line-height:1.75}.casting-head b{font-size:10px}.shell-ritual{height:215px!important}.shell-ritual .turtle-shell{transform:scale(1.25);transform-origin:center 62%}.shell-ritual .turtle-shell:hover{transform:translateY(-3px) scale(1.25)}.shell-ritual .shell-halo{transform:scale(.82)}.cast-counter{font-size:22px}.cast-counter b{font-size:27px}.coin-drop{height:80px!important;gap:12px!important}.drop-coin{width:58px!important;height:58px!important;font-size:12px!important}.drop-coin::after{width:13px;height:13px}.coin-meaning{font-size:12px!important}.raw-record{gap:8px}.record-chip{min-height:69px;padding:10px!important}.record-chip strong{font-size:13px}.mini-hex{right:10px;bottom:12px;width:38px;height:6px}}
@media(max-width:560px){#panel-cast .shell-ritual .turtle-shell{width:158px;height:177px}.shell-ritual .turtle-shell:hover{transform:translateY(-3px)}}
:root {
  --paper-bright: #f7ecd3;
  --paper-deep: #dfc79c;
  --cinnabar: #922c22;
  --cinnabar-dark: #6f1e18;
  --bronze: #b77b2e;
  --soft-border: rgba(94, 57, 25, .17);
}

body {
  min-width: 0;
  background:
    radial-gradient(circle at 50% -10%, #4b3422 0, #23170f 38%, #100c09 88%);
}

.page-shell {
  max-width: 1440px;
  padding: 22px clamp(18px, 3vw, 46px) 38px;
  background:
    radial-gradient(circle at 50% 18%, rgba(119, 79, 39, .24), transparent 42%),
    linear-gradient(180deg, rgba(35, 24, 16, .38), rgba(16, 12, 9, .82));
}

.masthead {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2px 14px;
  border-color: rgba(230, 195, 128, .22);
}

.back-link {
  padding: 5px 0;
  transition: color .2s, transform .2s;
}

.back-link:hover {
  color: #ffe0a2;
  transform: translateX(-3px);
}

.hero {
  padding: 44px 0 26px;
}

.hero h1 {
  font-size: clamp(50px, 5vw, 72px);
  letter-spacing: .08em;
  text-shadow: 0 7px 26px rgba(0, 0, 0, .56), 0 0 34px rgba(203, 139, 51, .12);
}

.hero p:last-child {
  margin: 15px 0 0;
  color: #d5c09e;
}

.flow {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 31px;
  padding: 10px 15px;
  border: 1px solid rgba(218, 179, 108, .14);
  border-radius: 999px;
  background: rgba(7, 5, 4, .2);
  backdrop-filter: blur(10px);
}

.flow span {
  white-space: nowrap;
}

.ritual-layout {
  max-width: 1240px;
  margin: 0 auto;
  grid-template-columns: 180px minmax(480px, 620px) minmax(230px, 1fr);
  gap: clamp(24px, 3vw, 42px);
  align-items: start;
}

.rite-copy {
  margin-top: 42px;
}

.rite-copy strong {
  display: block;
  margin-top: 14px;
  line-height: 1.6;
}

.ritual-card {
  width: 100%;
  min-height: 540px;
  padding: clamp(38px, 4vw, 54px);
  border: 1px solid rgba(230, 198, 135, .32);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 0, rgba(255, 255, 255, .36), transparent 30%),
    linear-gradient(132deg, var(--paper-bright), var(--paper-deep));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .46), inset 0 0 70px rgba(103, 60, 21, .1);
}

.ritual-card::before {
  inset: 10px;
  border-radius: 6px;
  border-color: rgba(104, 61, 24, .17);
}

.seal {
  right: 25px;
  top: 23px;
  border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(146, 44, 34, .07);
}

.panel-index {
  margin-bottom: 13px;
  font-weight: 600;
}

.panel h2 {
  margin-bottom: 24px;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.35;
}

.panel textarea {
  height: 132px;
  border-radius: 5px;
  background: rgba(255, 253, 246, .48);
  box-shadow: inset 0 1px 9px rgba(79, 44, 16, .05);
}

blockquote {
  margin: 0 0 18px;
  padding: 15px 18px;
  color: #634733;
  font-size: 14px;
  line-height: 1.9;
  border-left: 3px solid rgba(146, 44, 34, .58);
  background: rgba(255, 252, 241, .36);
}

.primary,
.secondary {
  min-height: 48px;
  border-radius: 4px;
}

.primary {
  background: linear-gradient(135deg, #a23a2d, var(--cinnabar-dark));
  box-shadow: 0 10px 22px rgba(91, 28, 20, .22), inset 0 1px rgba(255, 240, 211, .2);
}

.primary:hover {
  background: linear-gradient(135deg, #b24836, #7d241c);
  box-shadow: 0 13px 26px rgba(91, 28, 20, .28);
}

.secondary {
  border-radius: 4px;
  background: rgba(255, 250, 238, .32);
}

.hexagram-stage {
  position: sticky;
  top: 80px;
}

/* Result page: wider reading measure and clearer editorial rhythm. */
body:has(#panel-result.is-visible) .ritual-layout {
  grid-template-columns: 150px minmax(640px, 760px) minmax(210px, 1fr);
}

body:has(#panel-result.is-visible) .ritual-card {
  padding: clamp(40px, 4vw, 58px);
}

.result-heading {
  padding-bottom: 22px;
}

.query-strip {
  margin-top: 19px;
  border-radius: 3px;
}

.plain-reading {
  margin-top: 14px;
  padding: 21px 23px 19px;
  border-radius: 3px;
}

.plain-reading h3 {
  max-width: 88%;
  font-size: 23px;
}

.next-steps,
.analysis-cards,
.technical-reading[open] {
  border-radius: 4px;
}

.next-steps {
  padding: 18px 20px;
}

.next-steps li {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
}

.analysis-cards {
  margin-top: 18px;
  padding: 24px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px rgba(255, 250, 237, .3), 0 12px 25px rgba(91, 51, 13, .1);
}

.analysis-cards header {
  margin-bottom: 17px;
}

.analysis-cards h3 {
  font-size: 29px;
}

.analysis-verdict {
  border-radius: 3px;
}

.analysis-now,
.analysis-grid article,
.analysis-actions {
  border-radius: 3px;
}

.analysis-grid {
  gap: 13px;
}

.analysis-grid article p,
.analysis-now p,
.analysis-actions > p {
  font-size: 13px;
  font-weight: 600;
}

.technical-reading {
  margin-top: 17px;
  border: 1px solid transparent;
}

.technical-reading summary {
  padding: 10px 2px;
}

.technical-reading[open] {
  padding: 15px 17px;
  border-color: var(--soft-border);
}

.technical-reading .brief {
  white-space: pre-wrap;
  line-height: 2;
}

footer {
  margin-top: 42px;
  padding: 18px 0 5px;
  border-top: 1px solid rgba(220, 182, 111, .1);
}

@media (max-width: 1180px) {
  body:has(#panel-result.is-visible) .ritual-layout,
  .ritual-layout {
    grid-template-columns: 150px minmax(500px, 650px) 1fr;
    gap: 24px;
  }
}

@media (max-width: 950px) {
  .hero {
    padding-top: 34px;
  }

  .flow {
    margin-bottom: 22px;
  }

  body:has(#panel-result.is-visible) .ritual-layout,
  .ritual-layout {
    grid-template-columns: 1fr;
  }

  .ritual-card {
    max-width: 680px;
  }

  body:has(#panel-result.is-visible) .ritual-card {
    max-width: 760px;
  }

  .hexagram-stage {
    position: relative;
    top: auto;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 12px 12px 24px;
  }

  .masthead {
    padding-bottom: 11px;
  }

  .hero {
    padding: 29px 0 21px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero p:last-child {
    max-width: 280px;
    margin: 12px auto 0;
  }

  .flow {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding: 8px 9px;
    overflow-x: auto;
    border-radius: 5px;
  }

  .flow span {
    font-size: 9px;
  }

  .ritual-card,
  body:has(#panel-result.is-visible) .ritual-card {
    padding: 37px 24px 31px;
    border-radius: 7px;
  }

  .seal {
    right: 20px;
    top: 18px;
  }

  .panel h2 {
    font-size: 24px;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .result-heading {
    gap: 14px;
  }

  .plain-reading h3 {
    max-width: 100%;
    font-size: 20px;
  }

  .plain-reading::after {
    display: none;
  }

  .next-steps,
  .analysis-cards {
    padding: 16px;
  }

  .analysis-cards h3 {
    font-size: 24px;
    line-height: 1.35;
  }

  .analysis-grid li,
  .analysis-actions li,
  .next-steps li {
    font-size: 13px;
  }
}

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

/* Make the reset action visible without competing with the primary reading button. */
#panel-result .text-button {
  margin-top: 20px;
  padding: 11px 24px;
  color: #8c2e20;
  border: 1px solid rgba(140, 46, 32, .46);
  background: rgba(255, 247, 229, .46);
  font: 500 20px/1.2 "Noto Serif SC", serif;
  letter-spacing: .14em;
  text-decoration: none;
  box-shadow: 0 5px 13px rgba(106, 55, 19, .1);
  transition: .2s ease;
}

#panel-result .text-button:hover {
  color: #fff2d4;
  background: #9c3024;
  border-color: #9c3024;
  transform: translateY(-2px);
}

#long-reading[hidden] {
  display: none !important;
}

/* Incense placement follows the traditional center → right → left sequence. */
.offering-stick[data-stick="1"] { left: 50%; transform: rotate(1deg); }
.offering-stick[data-stick="2"] { left: 57%; transform: rotate(6deg); }
.offering-stick[data-stick="3"] { left: 43%; transform: rotate(-5deg); }

/* Jade elephant-foot censer: a quieter counterpoint to the page's parchment and gold. */
#panel-incense .offering-stage {
  height: 320px !important;
  background:
    radial-gradient(ellipse at 50% 88%, rgba(49, 91, 81, .2), transparent 45%),
    linear-gradient(90deg, rgba(121, 76, 31, .07), transparent 30% 70%, rgba(121, 76, 31, .07));
}

#panel-incense .elephant-censer {
  width: 192px;
  height: 205px;
  bottom: 0;
  filter: drop-shadow(0 11px 10px rgba(55, 37, 17, .26));
}

.elephant-censer img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.elephant-censer .offering-stick {
  bottom: 164px !important;
  z-index: 3;
}

.elephant-censer .offering-stick.is-placed {
  height: 76px;
}

/* Slender sandalwood sticks and airy, layered smoke suit the jade vessel. */
.elephant-censer .offering-stick {
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #251b17 0%, #694027 18%, #b17b3e 49%, #633a24 78%, #211814 100%);
  box-shadow: 0 0 0 1px rgba(245, 202, 112, .16), 0 2px 5px rgba(53, 31, 17, .35);
}

.elephant-censer .offering-stick::after {
  top: -4px;
  left: -1px;
  width: 6px;
  height: 7px;
  background: radial-gradient(circle, #ffe19a 0 20%, #dc8c39 45%, #6d2c19 78%);
  box-shadow: 0 0 7px 2px rgba(228, 150, 51, .55);
}

.elephant-censer .offering-stick::before {
  display: none;
}

.elephant-censer .incense-smoke {
  position: absolute;
  z-index: 2;
  left: 40px;
  top: -174px;
  width: 112px;
  height: 142px;
  overflow: visible;
  opacity: 0;
  filter: drop-shadow(0 0 2px rgba(109, 137, 124, .25));
  transition: opacity .7s ease;
}

.elephant-censer:has(.offering-stick.is-placed) .incense-smoke {
  opacity: 1;
}

.incense-smoke path {
  fill: none;
  stroke: rgba(112, 139, 125, .58);
  stroke-width: 1.5;
  stroke-linecap: round;
  animation: incense-wisp 5.6s ease-in-out infinite;
}

.incense-smoke path:nth-child(2) { stroke: rgba(145, 161, 147, .5); animation-delay: -1.9s; }
.incense-smoke path:nth-child(3) { stroke: rgba(103, 129, 117, .42); animation-delay: -3.7s; }

@keyframes incense-wisp {
  0%, 100% { transform: translate(-3px, 5px) scale(.82); opacity: .28; }
  48% { transform: translate(4px, -6px) scale(1.04); opacity: .86; }
  76% { transform: translate(-1px, -12px) scale(.94); opacity: .45; }
}

@media (max-width: 560px) {
  #panel-incense .offering-stage {
    height: 276px !important;
  }

  #panel-incense .elephant-censer {
    width: 162px;
    height: 174px;
    bottom: 0;
    transform: translateX(-50%) !important;
  }

  .elephant-censer .offering-stick {
    bottom: 140px !important;
  }

  .elephant-censer .offering-stick.is-placed {
    height: 62px;
  }

  .elephant-censer .incense-smoke {
    left: 25px;
    top: -150px;
    width: 112px;
    height: 126px;
  }
}

#panel-result .result-change {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.55;
}

@media (max-width: 560px) {
  #panel-result .text-button {
    width: 100%;
    font-size: 18px;
  }

  #panel-result .result-change {
    font-size: 17px;
  }
}
