:root {
  color-scheme: dark;
  --ink: #f8f0df;
  --muted: #cabfac;
  --dim: #8f8677;
  --panel: rgba(19, 20, 24, 0.82);
  --line: rgba(248, 240, 223, 0.16);
  --gold: #d8b96a;
  --rose: #c77b8c;
  --green: #82a97c;
  --blue: #6f9dc7;
  --black: #0f1115;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(216, 185, 106, 0.2), transparent 22rem),
    radial-gradient(circle at 88% 8%, rgba(111, 157, 199, 0.14), transparent 26rem),
    linear-gradient(135deg, #11151a 0%, #21191f 48%, #15201b 100%);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.access-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(216, 185, 106, 0.22);
  border-radius: 12px;
  padding: 14px;
  background: rgba(248, 240, 223, 0.045);
}

.access-panel div,
.access-panel label {
  display: grid;
  gap: 6px;
}

.access-panel span {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.access-panel strong {
  color: var(--paper);
  font-size: 1.08rem;
}

.access-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(248, 240, 223, 0.06);
  color: var(--ink);
  outline: none;
}

.access-panel input:focus {
  border-color: rgba(216, 185, 106, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 185, 106, 0.12);
}

.access-panel p {
  margin: 0;
  color: var(--dim);
  line-height: 1.55;
  font-size: 0.9rem;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.guide-screen,
.reader-screen {
  display: none;
}

.guide-screen.is-active,
.reader-screen.is-active {
  display: grid;
}

.reader-screen {
  gap: 22px;
}

.guide-screen {
  min-height: calc(100vh - 56px);
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: stretch;
}

.guide-altar,
.split-demo,
.camera-primer,
.question-ritual {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(216, 185, 106, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(216, 185, 106, 0.08) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(111, 157, 199, 0.07) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 50% 42%, rgba(111, 157, 199, 0.18), transparent 28rem),
    linear-gradient(145deg, #121722, #241724 58%, #101b19);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.62);
}

.guide-altar::before,
.question-ritual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(72%, 520px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(216, 185, 106, 0.18), transparent 26%),
    repeating-conic-gradient(from 0deg, rgba(216, 185, 106, 0.35) 0 1deg, transparent 1deg 16deg);
  opacity: 0.64;
  animation: auraSpin 26s linear infinite;
}

.cloth-mark {
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(70%, 540px);
  height: 52%;
  transform: translate(-50%, -50%) rotate(-1.5deg);
  border: 1px solid rgba(216, 185, 106, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(199, 123, 140, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(71, 34, 74, 0.72), rgba(20, 30, 39, 0.82));
}

.guide-deck {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 280px;
  height: 188px;
  transform: translate(-50%, -50%);
}

.guide-deck span {
  position: absolute;
  width: 104px;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(248, 240, 223, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(216, 185, 106, 0.14), transparent),
    linear-gradient(145deg, #171d27, #382030);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.guide-deck span:nth-child(1) {
  left: 24px;
  top: 22px;
  transform: rotate(-18deg);
}

.guide-deck span:nth-child(2) {
  left: 96px;
  top: 0;
}

.guide-deck span:nth-child(3) {
  right: 18px;
  top: 26px;
  transform: rotate(16deg);
}

.guide-candle {
  position: absolute;
  bottom: 48px;
  width: 38px;
  height: 112px;
  border-radius: 12px 12px 4px 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent 32% 70%, rgba(0, 0, 0, 0.22)),
    linear-gradient(#eadcc4, #96705e);
}

.guide-candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -36px;
  width: 20px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(#fff6c8, #ef7b3d 52%, transparent);
  filter: drop-shadow(0 0 18px rgba(239, 123, 61, 0.92));
  animation: flame 0.2s infinite alternate ease-in-out;
}

.guide-candle.left {
  left: 54px;
}

.guide-candle.right {
  right: 54px;
}

.guide-copy {
  border: 1px solid rgba(216, 185, 106, 0.18);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 48px);
  background:
    linear-gradient(180deg, rgba(248, 240, 223, 0.07), rgba(248, 240, 223, 0.03)),
    rgba(18, 20, 27, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.guide-copy h1,
.guide-copy h2 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.96;
}

.guide-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.secondary-button {
  min-height: 46px;
  border: 1px solid rgba(248, 240, 223, 0.18);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(248, 240, 223, 0.06);
}

.guide-copy .primary-button,
.guide-copy .secondary-button {
  width: fit-content;
  padding: 0 20px;
}

.split-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 38px;
  align-items: center;
}

.mock-window {
  min-height: 440px;
  border: 1px solid rgba(216, 185, 106, 0.24);
  border-radius: 8px;
  padding: 24px;
  background: rgba(15, 17, 21, 0.62);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.mock-window b {
  font-size: 2rem;
}

.mock-window span {
  color: var(--muted);
}

.browser-side {
  box-shadow: 0 0 58px rgba(111, 157, 199, 0.2);
}

.user-side {
  box-shadow: 0 0 58px rgba(199, 123, 140, 0.18);
}

.camera-primer {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
}

.hand-orbit {
  position: relative;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(216, 185, 106, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 185, 106, 0.18), transparent 65%);
}

.palm,
.finger {
  position: absolute;
  left: 50%;
  background: linear-gradient(#f0d3ad, #b37d6e);
  box-shadow: 0 0 28px rgba(216, 185, 106, 0.2);
}

.palm {
  bottom: 50px;
  width: 92px;
  height: 104px;
  transform: translateX(-50%);
  border-radius: 42px 42px 30px 30px;
}

.finger {
  bottom: 132px;
  width: 24px;
  height: 92px;
  border-radius: 999px;
  transform-origin: bottom center;
  animation: fingerPulse 1.6s ease-in-out infinite;
}

.f1 { transform: translateX(-58px) rotate(-18deg); }
.f2 { transform: translateX(-24px) rotate(-6deg); height: 108px; }
.f3 { transform: translateX(8px) rotate(4deg); height: 108px; }
.f4 { transform: translateX(42px) rotate(16deg); }

.gesture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 180px));
  gap: 12px;
}

.gesture-grid div {
  border: 1px solid rgba(248, 240, 223, 0.15);
  border-radius: 8px;
  padding: 16px;
  background: rgba(15, 17, 21, 0.58);
  display: grid;
  gap: 6px;
}

.gesture-grid span {
  color: var(--muted);
}

.question-ritual {
  display: grid;
  place-items: center;
}

.question-card {
  position: relative;
  z-index: 2;
  width: min(72%, 500px);
  min-height: 320px;
  border: 1px solid rgba(216, 185, 106, 0.26);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(216, 185, 106, 0.12), transparent),
    rgba(15, 17, 21, 0.72);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: center;
}

.question-card span {
  min-height: 170px;
  border: 1px solid rgba(248, 240, 223, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(248, 240, 223, 0.05);
}

.reading-question {
  border: 1px solid rgba(248, 240, 223, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(248, 240, 223, 0.05);
  display: grid;
  gap: 6px;
}

.reading-question span {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.reading-question strong {
  color: var(--ink);
  line-height: 1.5;
}

.reader {
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  align-items: stretch;
}

.reader__stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 17, 21, 0.1), rgba(15, 17, 21, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 16px);
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.72);
}

.reader__stage::before {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(216, 185, 106, 0.18);
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.reader__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 17, 21, 0.84), transparent 20%, transparent 80%, rgba(15, 17, 21, 0.84)),
    radial-gradient(circle at center, transparent 0 42%, rgba(15, 17, 21, 0.52) 78%);
  pointer-events: none;
  z-index: 4;
}

.tech-frame {
  position: absolute;
  inset: 12px;
  z-index: 9;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(111, 157, 199, 0.22) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(0deg, rgba(216, 185, 106, 0.12) 1px, transparent 1px) 0 0 / 38px 38px;
  mask-image: radial-gradient(circle at 50% 48%, transparent 0 32%, black 68%);
  opacity: 0.52;
}

.tech-frame::before,
.tech-frame::after {
  content: "";
  display: none;
}

.tech-frame::after {
  display: none;
}

.tech-frame span {
  position: absolute;
  width: 48px;
  height: 48px;
  border-color: rgba(216, 185, 106, 0.72);
  border-style: solid;
}

.tech-frame span:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 1px 0 0 1px;
}

.tech-frame span:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 1px 1px 0 0;
}

.tech-frame span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-width: 0 1px 1px 0;
}

.tech-frame span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-width: 0 0 1px 1px;
}

.camera-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

#camera,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#camera {
  opacity: 0.42;
  filter: saturate(0.82) contrast(1.12);
}

#overlay {
  z-index: 5;
}

.camera-panel__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 17, 21, 0.18), rgba(15, 17, 21, 0.58)),
    radial-gradient(circle at 50% 46%, transparent 0 34%, rgba(15, 17, 21, 0.68) 78%);
  pointer-events: none;
}

.gesture-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 9;
  display: grid;
  gap: 4px;
  min-width: 170px;
  border: 1px solid rgba(216, 185, 106, 0.44);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 17, 21, 0.82);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32), 0 0 32px rgba(216, 185, 106, 0.12);
  backdrop-filter: blur(14px);
}

.gesture-badge span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.gesture-badge b {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.12;
  color: var(--paper);
}

.gesture-badge.is-open {
  border-color: rgba(126, 204, 166, 0.62);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32), 0 0 38px rgba(126, 204, 166, 0.26);
}

.gesture-badge.is-fist {
  border-color: rgba(216, 185, 106, 0.78);
  background: rgba(62, 38, 23, 0.86);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34), 0 0 48px rgba(216, 185, 106, 0.38);
}

.gesture-badge.is-fist b {
  color: var(--gold);
}

.camera-panel__status {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 8;
  width: min(620px, calc(100% - 36px));
  border: 1px solid rgba(216, 185, 106, 0.34);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(15, 17, 21, 0.78);
  color: var(--muted);
  line-height: 1.5;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.deck-orbit {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  pointer-events: none;
  perspective: 1200px;
}

.aura-ring {
  position: absolute;
  width: min(52vw, 540px);
  aspect-ratio: 1;
  border: 1px solid rgba(216, 185, 106, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(216, 185, 106, 0.22), transparent 18%),
    conic-gradient(from 0deg, transparent, rgba(199, 123, 140, 0.25), transparent, rgba(111, 157, 199, 0.22), transparent);
  filter: blur(2px);
  animation: auraSpin 18s linear infinite;
}

.deck-orbit.hand-open .aura-ring {
  animation-duration: 4s;
  filter: blur(0);
}

.deck-orbit.hand-fist .aura-ring,
.deck-orbit.locked .aura-ring {
  animation-duration: 1.4s;
  box-shadow: 0 0 72px rgba(216, 185, 106, 0.42);
}

.sigil-ring {
  position: absolute;
  width: min(64vw, 660px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(248, 240, 223, 0.28) 0 1deg, transparent 1deg 12deg),
    radial-gradient(circle, transparent 0 57%, rgba(111, 157, 199, 0.2) 58% 59%, transparent 60%);
  opacity: 0.4;
  animation: auraSpin 32s linear infinite reverse;
}

.deck-orbit.hand-open .sigil-ring {
  animation-duration: 8s;
  opacity: 0.72;
}

.deck-track {
  position: absolute;
  left: 0;
  top: 50%;
  width: max-content;
  display: flex;
  gap: 18px;
  align-items: center;
  transform-style: preserve-3d;
  animation: beltScroll 42s linear infinite;
  will-change: transform;
}

.deck-orbit.hand-open .deck-track {
  animation-duration: 12s;
}

.deck-orbit.hand-fist .deck-track {
  animation-duration: 7s;
}

.deck-orbit.locked .deck-track {
  animation-play-state: paused;
  filter: saturate(0.6) brightness(0.72);
}

.carousel-card {
  width: 116px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  transform-style: preserve-3d;
  animation: cardTurn 4.8s linear infinite;
  animation-delay: calc(var(--delay) * -0.11s);
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.4));
}

.carousel-card::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 12px;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 42%, transparent), transparent 62%);
  opacity: 0.24;
  transform: translateZ(-1px);
}

.ritual-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.candle {
  position: absolute;
  bottom: 22px;
  width: 34px;
  height: 86px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 28% 70%, rgba(0, 0, 0, 0.18)),
    linear-gradient(#eadcc4, #a77b62);
  box-shadow:
    inset 0 -10px 16px rgba(102, 55, 44, 0.28),
    0 0 42px rgba(216, 185, 106, 0.24);
}

.candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -34px;
  width: 18px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50% 50% 48% 48%;
  background:
    radial-gradient(circle at 50% 68%, #ffffff 0 12%, transparent 13%),
    linear-gradient(#f9e6a0, #ef7b3d 48%, rgba(239, 123, 61, 0));
  filter: drop-shadow(0 0 14px rgba(239, 123, 61, 0.95));
  animation: flame 0.18s infinite alternate ease-in-out;
}

.candle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -42px;
  width: 70px;
  height: 70px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 185, 106, 0.32), transparent 62%);
  animation: candleGlow 2.2s ease-in-out infinite;
}

.candle span {
  position: absolute;
  left: 50%;
  top: -5px;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  background: #342018;
  border-radius: 999px;
}

.candle-left {
  left: 34px;
}

.candle-right {
  right: 34px;
  height: 72px;
  transform: scaleX(-1);
}

.crystal {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 84px;
  height: 44px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 58%, 75% 100%, 25% 100%, 0 58%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(111, 157, 199, 0.28) 45%, rgba(199, 123, 140, 0.24));
  opacity: 0.72;
  filter: drop-shadow(0 0 24px rgba(111, 157, 199, 0.44));
}

.incense {
  position: absolute;
  right: 92px;
  bottom: 32px;
  width: 2px;
  height: 120px;
  transform: rotate(24deg);
  background: linear-gradient(#4b2c22, #151515);
}

.incense::before,
.incense::after {
  content: "";
  position: absolute;
  left: -28px;
  top: -68px;
  width: 54px;
  height: 130px;
  border-radius: 50%;
  border-left: 1px solid rgba(202, 191, 172, 0.22);
  filter: blur(1px);
  animation: smoke 4.8s ease-in-out infinite;
}

.incense::after {
  left: -12px;
  animation-delay: -2s;
}

.deck-orbit.hand-open .carousel-card {
  animation-duration: 1.35s;
}

.deck-orbit.hand-fist .carousel-card {
  animation-duration: 0.82s;
}

.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.brand p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.question-box {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(248, 240, 223, 0.06);
  color: var(--ink);
  outline: none;
  line-height: 1.55;
}

textarea:focus {
  border-color: rgba(216, 185, 106, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 185, 106, 0.12);
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mode-button,
.primary-button,
.icon-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(248, 240, 223, 0.07);
}

.mode-button.is-active {
  border-color: rgba(216, 185, 106, 0.68);
  background: rgba(216, 185, 106, 0.16);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 52px;
  gap: 10px;
}

.primary-button {
  border-color: rgba(216, 185, 106, 0.72);
  background: linear-gradient(135deg, #d8b96a, #c77b8c);
  color: #171313;
  font-weight: 760;
}

.icon-button {
  font-size: 1.2rem;
}

.camera-button {
  padding: 0 12px;
}

.reading-input textarea {
  min-height: 96px;
}

.hint {
  margin: auto 0 0;
  color: var(--dim);
  line-height: 1.55;
}

.reading {
  margin-top: 22px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(15, 17, 21, 0.62);
}

.reading__empty {
  min-height: 204px;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--dim);
  gap: 12px;
}

.reading__empty span {
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 185, 106, 0.42);
  transform: rotate(45deg);
}

.selection-ritual {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(216, 185, 106, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(216, 185, 106, 0.16), transparent 24rem),
    radial-gradient(circle at 24% 18%, rgba(199, 123, 140, 0.14), transparent 22rem),
    linear-gradient(145deg, rgba(15, 17, 21, 0.96), rgba(31, 22, 34, 0.9));
  display: grid;
  place-items: center;
  isolation: isolate;
}

.selection-ritual::before {
  content: "";
  position: absolute;
  width: min(76vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(216, 185, 106, 0.18);
  background:
    repeating-conic-gradient(from 0deg, rgba(216, 185, 106, 0.18) 0 1deg, transparent 1deg 18deg),
    radial-gradient(circle, transparent 0 54%, rgba(111, 157, 199, 0.12) 55% 56%, transparent 57%);
  opacity: 0.66;
  animation: auraSpin 34s linear infinite;
  z-index: -1;
}

.selection-ritual p {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.08em;
}

.smoke-field,
.smoke-field::before,
.smoke-field::after {
  position: absolute;
  content: "";
  width: 58%;
  height: 72%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(248, 240, 223, 0.13), transparent 62%),
    radial-gradient(ellipse at 35% 55%, rgba(111, 157, 199, 0.12), transparent 58%);
  filter: blur(18px);
  opacity: 0;
  animation: ritualSmoke 6s ease-in-out infinite;
}

.smoke-field {
  left: 18%;
  top: 8%;
}

.smoke-field::before {
  left: 22%;
  top: 12%;
  animation-delay: -2s;
}

.smoke-field::after {
  right: 4%;
  top: 24%;
  animation-delay: -3.4s;
}

.deck-source {
  position: absolute;
  left: 50%;
  bottom: 76px;
  width: 170px;
  height: 120px;
  transform: translateX(-50%);
  perspective: 900px;
}

.deck-source i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(216, 185, 106, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(216, 185, 106, 0.16), transparent 40%),
    linear-gradient(145deg, #151922, #2a1b28);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  transform: rotateX(68deg) rotateZ(calc((var(--i, 0) - 2) * 2deg)) translateY(calc(var(--i, 0) * -4px));
}

.deck-source i:nth-child(1) { --i: 0; }
.deck-source i:nth-child(2) { --i: 1; }
.deck-source i:nth-child(3) { --i: 2; }
.deck-source i:nth-child(4) { --i: 3; }
.deck-source i:nth-child(5) { --i: 4; }

.selected-spread {
  position: relative;
  z-index: 2;
  width: min(920px, 94%);
  min-height: 360px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 4vw, 52px);
  perspective: 1200px;
}

.selected-card {
  width: clamp(150px, 20vw, 230px);
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  opacity: 0;
  filter: drop-shadow(0 30px 58px rgba(0, 0, 0, 0.42));
  animation: dealSelected 1.25s cubic-bezier(.2, .82, .22, 1) forwards;
}

.selected-1 {
  --deal-x: -118%;
  --deal-r: -10deg;
  animation-delay: 0.12s;
}

.selected-2 {
  --deal-x: 0%;
  --deal-r: 0deg;
  animation-delay: 0.34s;
}

.selected-3 {
  --deal-x: 118%;
  --deal-r: 10deg;
  animation-delay: 0.56s;
}

.selected-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: flipSelected 1.18s cubic-bezier(.2, .7, .24, 1) forwards;
  animation-delay: 1.2s;
}

.selected-2 .selected-inner {
  animation-delay: 1.44s;
}

.selected-3 .selected-inner {
  animation-delay: 1.68s;
}

.card-back,
.selected-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 8px;
}

.card-back {
  border: 1px solid rgba(216, 185, 106, 0.48);
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 185, 106, 0.18), transparent 26%),
    linear-gradient(135deg, rgba(199, 123, 140, 0.14), transparent 48%),
    repeating-linear-gradient(90deg, rgba(248, 240, 223, 0.04) 0 1px, transparent 1px 12px),
    linear-gradient(145deg, #151922, #2d1d2c);
  box-shadow: inset 0 0 0 12px rgba(15, 17, 21, 0.28);
}

.card-back span {
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(216, 185, 106, 0.38);
  transform: rotate(45deg);
}

.selected-front {
  transform: rotateY(180deg);
}

.selected-front .face.large {
  border-radius: 8px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tarot-card {
  min-height: 540px;
  border: 1px solid rgba(248, 240, 223, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #191c21, #111318);
  display: grid;
  grid-template-rows: 430px auto;
  opacity: 0;
  transform: translateY(24px) rotateX(16deg);
  animation: revealCard 0.82s cubic-bezier(.2, .8, .2, 1) forwards;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.tarot-card:nth-child(2) {
  animation-delay: 0.14s;
}

.tarot-card:nth-child(3) {
  animation-delay: 0.28s;
}

.tarot-card.is-reversed .face.large {
  transform: rotate(180deg);
}

.tarot-body {
  padding: 15px;
}

.tarot-body small {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tarot-body h2 {
  margin: 7px 0 10px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.tarot-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.face {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(248, 240, 223, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 240, 223, 0.14), transparent 24%),
    radial-gradient(circle at 50% 26%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 24%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 32%, #171920), #101318 68%);
  box-shadow: inset 0 0 0 5px rgba(15, 17, 21, 0.42);
}

.rws-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04) brightness(0.96);
  transform: scale(1.012);
}

.face.compact .rws-image {
  filter: saturate(1.12) contrast(1.08) brightness(0.9);
}

.face.large .rws-image {
  object-fit: contain;
  padding: 12px;
  background:
    radial-gradient(circle at center, rgba(216, 185, 106, 0.18), transparent 58%),
    #111318;
}

.holo-sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.22) 42%, transparent 49%),
    radial-gradient(circle at 50% 18%, rgba(216, 185, 106, 0.18), transparent 34%);
  mix-blend-mode: screen;
  animation: sheen 3.8s ease-in-out infinite;
}

.face::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(216, 185, 106, 0.42);
  border-radius: 6px;
  z-index: 4;
}

.face::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.16) 43%, transparent 49%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 9px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 5;
}

.face.compact {
  font-size: 0.74rem;
}

.face.large {
  border-radius: 0;
  border-width: 0;
  transition: transform 0.5s ease;
}

.inner-frame {
  position: absolute;
  inset: 24px 16px 42px;
  border: 1px solid rgba(248, 240, 223, 0.16);
  border-radius: 5px;
  z-index: 4;
}

.corner {
  position: absolute;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 760;
}

.corner.top {
  top: 10px;
  left: 10px;
}

.corner.bottom {
  right: 10px;
  bottom: 10px;
  transform: rotate(180deg);
}

.scene {
  position: absolute;
  inset: 24px 14px 46px;
  overflow: hidden;
  border-radius: 5px;
}

.celestial,
.figure,
.artifact {
  position: absolute;
  display: block;
}

.celestial.one {
  left: 50%;
  top: 12%;
  width: 30%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), transparent 66%);
  box-shadow: 0 0 28px color-mix(in srgb, var(--gold) 60%, transparent);
}

.celestial.two {
  right: 12%;
  top: 18%;
  width: 18%;
  aspect-ratio: 1;
  border: 2px solid color-mix(in srgb, var(--gold) 70%, transparent);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(25deg);
}

.figure {
  left: 50%;
  bottom: 18%;
  width: 35%;
  height: 44%;
  transform: translateX(-50%);
  border-radius: 45% 45% 18% 18%;
  background:
    radial-gradient(circle at 50% 12%, #f5d7aa 0 16%, transparent 17%),
    linear-gradient(150deg, color-mix(in srgb, var(--gold) 68%, #33251c), color-mix(in srgb, var(--accent) 72%, #17201e));
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.3);
}

.figure::before,
.figure::after {
  content: "";
  position: absolute;
  top: 30%;
  width: 52%;
  height: 12%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 74%, #f8f0df);
}

.figure::before {
  left: -36%;
  transform: rotate(-28deg);
}

.figure::after {
  right: -36%;
  transform: rotate(28deg);
}

.artifact {
  z-index: 3;
  color: rgba(248, 240, 223, 0.9);
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 58%, transparent);
}

.artifact.main {
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-size: 3.8em;
}

.artifact.second {
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 1.6em;
}

.card-title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 13px;
  z-index: 6;
  display: grid;
  gap: 1px;
  text-align: center;
  text-transform: uppercase;
  background: linear-gradient(180deg, transparent, rgba(15, 17, 21, 0.72));
  padding-top: 22px;
}

.card-title strong {
  color: var(--ink);
  font-size: 0.82em;
  letter-spacing: 0.04em;
}

.card-title em {
  color: color-mix(in srgb, var(--gold) 80%, var(--ink));
  font-size: 0.56em;
  font-style: normal;
  letter-spacing: 0.08em;
}

.pip-grid {
  position: absolute;
  inset: 19% 18% 18%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  gap: 2px;
}

.pip-grid i {
  color: rgba(248, 240, 223, 0.9);
  font-style: normal;
  font-size: 1.5em;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--gold) 50%, transparent));
}

.count-1 {
  grid-template-columns: 1fr;
}

.count-3,
.count-5,
.count-7,
.count-9 {
  grid-template-columns: repeat(3, 1fr);
}

.scene-sunrise .figure,
.scene-lantern .figure {
  width: 28%;
}

.scene-moon .celestial.one,
.scene-lunar .celestial.one {
  background: radial-gradient(circle at 65% 35%, transparent 0 38%, var(--gold) 39% 64%, transparent 66%);
}

.scene-throne .figure,
.scene-temple .figure,
.scene-chariot .figure {
  width: 42%;
  height: 48%;
}

.scene-wheel .figure,
.scene-world .figure {
  background: conic-gradient(var(--gold), var(--accent), var(--gold));
  border-radius: 50%;
}

.scene-tower .figure {
  width: 34%;
  height: 58%;
  border-radius: 8px 8px 0 0;
}

.scene-tower .artifact.main,
.scene-reaper .artifact.main {
  color: var(--gold);
}

.scene-wands .artifact.main,
.scene-cups .artifact.main,
.scene-swords .artifact.main,
.scene-pentacles .artifact.main {
  font-size: 2.8em;
}

.scene-wands .figure,
.scene-cups .figure,
.scene-swords .figure,
.scene-pentacles .figure {
  opacity: 0.68;
}

.interpretation {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.72;
}

.interpretation h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
}

.interpretation p {
  margin: 0;
}

.interpretation b {
  color: color-mix(in srgb, var(--gold) 82%, var(--ink));
}

.ai-reading {
  position: relative;
  border: 1px solid rgba(216, 185, 106, 0.16);
  border-radius: 8px;
  padding: 18px;
  background:
    radial-gradient(circle at 16% 0%, rgba(216, 185, 106, 0.1), transparent 18rem),
    rgba(248, 240, 223, 0.035);
}

.ai-reading h3 {
  margin: 8px 0 2px;
  color: var(--ink);
  font-size: 1.12rem;
}

.ai-meta {
  width: fit-content;
  border: 1px solid rgba(216, 185, 106, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--gold);
  background: rgba(216, 185, 106, 0.08);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.takeaway-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(248, 240, 223, 0.12);
}

.takeaway-actions button {
  min-width: 180px;
}

.takeaway-actions button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.download-status {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--gold);
  font-size: 0.92rem;
  line-height: 1.55;
}

.pdf-stage {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 920px;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.ai-loader {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.ai-loader span {
  width: 9px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(216, 185, 106, 0.5);
  animation: aiPulse 1s ease-in-out infinite;
}

.ai-loader span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-loader span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes auraSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes beltScroll {
  from {
    transform: translate3d(0, -50%, 0) rotateX(4deg);
  }
  to {
    transform: translate3d(calc(-50% - 9px), -50%, 0) rotateX(4deg);
  }
}

@keyframes cardTurn {
  0% {
    transform: rotateY(0deg) translateY(0);
  }
  50% {
    transform: rotateY(180deg) translateY(-16px);
  }
  100% {
    transform: rotateY(360deg) translateY(0);
  }
}

@keyframes fingerPulse {
  50% {
    filter: brightness(1.12);
  }
}

@keyframes dealSelected {
  0% {
    opacity: 0;
    transform: translate3d(0, 160px, 0) rotateX(66deg) rotateZ(0deg) scale(0.62);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(var(--deal-x), 0, 0) rotateX(0deg) rotateZ(var(--deal-r)) scale(1);
  }
}

@keyframes flipSelected {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

@keyframes ritualSmoke {
  0% {
    transform: translateY(42px) translateX(-18px) scale(0.78);
    opacity: 0;
  }
  32% {
    opacity: 0.48;
  }
  100% {
    transform: translateY(-52px) translateX(28px) scale(1.18);
    opacity: 0;
  }
}

@keyframes aiPulse {
  50% {
    opacity: 0.35;
    transform: translateY(-4px);
  }
}

@keyframes scanLine {
  0% {
    top: 6%;
    opacity: 0;
  }
  14%,
  70% {
    opacity: 0.8;
  }
  100% {
    top: 92%;
    opacity: 0;
  }
}

@keyframes flame {
  from {
    transform: translateX(-50%) rotate(-3deg) scaleY(0.92);
  }
  to {
    transform: translateX(-50%) rotate(4deg) scaleY(1.08);
  }
}

@keyframes candleGlow {
  50% {
    transform: translateX(-50%) scale(1.14);
    opacity: 0.75;
  }
}

@keyframes smoke {
  0% {
    transform: translateY(24px) translateX(0) scale(0.72);
    opacity: 0;
  }
  35% {
    opacity: 0.56;
  }
  100% {
    transform: translateY(-36px) translateX(-24px) scale(1.18);
    opacity: 0;
  }
}

@keyframes sheen {
  0%,
  100% {
    transform: translateX(-45%);
    opacity: 0.18;
  }
  50% {
    transform: translateX(45%);
    opacity: 0.72;
  }
}

@keyframes revealCard {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 22px, 620px);
    padding: 12px 0 24px;
  }

  .reader {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .guide-screen {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .guide-altar,
  .split-demo,
  .camera-primer,
  .question-ritual {
    min-height: 430px;
  }

  .split-demo {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .mock-window {
    min-height: 170px;
  }

  .question-card {
    width: min(92%, 500px);
    grid-template-columns: 1fr;
  }

  .question-card span {
    min-height: 88px;
  }

  .selection-ritual {
    min-height: 720px;
  }

  .selected-spread {
    min-height: 590px;
    flex-direction: column;
    gap: 18px;
  }

  .selected-card {
    width: min(210px, 58vw);
  }

  .selected-1,
  .selected-2,
  .selected-3 {
    --deal-x: 0%;
    --deal-r: 0deg;
  }

  .reader__stage {
    min-height: 430px;
  }

  .carousel-card {
    width: 88px;
  }

  .control-panel {
    padding: 18px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .reader__stage {
    min-height: 370px;
  }

  .guide-copy {
    padding: 20px;
  }

  .guide-copy h1,
  .guide-copy h2 {
    font-size: 2.45rem;
  }

  .gesture-grid {
    grid-template-columns: 1fr;
  }

  .guide-candle.left {
    left: 18px;
  }

  .guide-candle.right {
    right: 18px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .carousel-card {
    width: 72px;
  }

  .tarot-card {
    min-height: 480px;
    grid-template-rows: 340px auto;
  }

  .candle {
    width: 24px;
    height: 58px;
    bottom: 14px;
  }

  .candle-left {
    left: 18px;
  }

  .candle-right {
    right: 18px;
  }
}
