/* 麋鹿塔罗 — 对标 Quin 交互，暖色品牌气质 */
.page-scene-tarot {
  --tarot-warm: #B56B4A;
  --tarot-gold: #C4A574;
  --tarot-ink: #1A2421;
  --tarot-mist: #E8EDE8;
  min-height: 100vh;
  overflow-x: hidden;
}

.tarot-shell {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 28px;
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  box-sizing: border-box;
}

#screen-home.is-active {
  overflow: visible;
  padding-bottom: 12px;
}

.tarot-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(47, 111, 94, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tarot-brand {
  font-family: "Noto Serif SC", Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--tarot-ink);
  letter-spacing: 0.04em;
  text-align: center;
  justify-self: center;
}

.tarot-top-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
  align-items: center;
}

.tarot-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(47,111,94,0.12);
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 18px;
}

.tarot-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(47,111,94,0.08);
  color: var(--color-brand);
  font-size: 12px;
  font-weight: 600;
}

/* Hero */
.tarot-hero {
  margin: 12px 16px 20px;
  padding: 28px 22px 24px;
  border-radius: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(47, 111, 94, 0.18);
  box-shadow: 0 12px 32px rgba(47, 111, 94, 0.2);
  min-height: 168px;
}

.tarot-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #2F6F5E;
  background-image:
    linear-gradient(
      105deg,
      rgba(20, 32, 28, 0.82) 0%,
      rgba(32, 58, 48, 0.68) 36%,
      rgba(47, 111, 94, 0.38) 64%,
      rgba(47, 111, 94, 0.18) 100%
    ),
    url('/assets/generated/ui/tarot-hero-ritual.jpg');
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

.tarot-hero h2 {
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
  max-width: 14em;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.tarot-hero p {
  margin: 0 0 18px;
  font-size: 13px;
  position: relative;
  z-index: 1;
  max-width: 22em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}

.tarot-hero-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: #2F6F5E;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

/* Scene cards */
.tarot-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 20px 12px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--tarot-ink);
}

.tarot-section-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2F6F5E, #C4A574);
  flex-shrink: 0;
}

.tarot-scene-list {
  display: grid;
  gap: 12px;
  padding: 4px 16px 28px;
}

.tarot-scene-card {
  position: relative;
  display: block;
  min-height: 108px;
  padding: 22px 128px 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(47, 111, 94, 0.08);
  background: var(--scene-wash, linear-gradient(135deg, #E8F0EC 0%, #F3F5F1 100%));
  box-shadow: 0 4px 16px rgba(47, 111, 94, 0.06);
  text-align: left;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tarot-scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.48) 42%,
    rgba(255, 255, 255, 0.08) 68%,
    transparent 86%
  );
}

.tarot-scene-card:active {
  transform: scale(0.985);
}

.tarot-scene-card .tarot-scene-copy {
  position: relative;
  z-index: 3;
  max-width: 210px;
}

.tarot-scene-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--tarot-ink);
  font-family: "Noto Serif SC", Georgia, serif;
  letter-spacing: -0.01em;
}

.tarot-scene-card p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* 右侧主题图：用径向遮罩抹掉 JPG 方框，只留贴纸主体融入卡片 */
.tarot-scene-visual {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 168px;
  height: 168px;
  z-index: 2;
  pointer-events: none;
}

.tarot-scene-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  filter: drop-shadow(0 8px 14px rgba(47, 111, 94, 0.12));
  -webkit-mask-image: radial-gradient(
    ellipse 58% 58% at 52% 50%,
    #000 0%,
    #000 52%,
    rgba(0, 0, 0, 0.55) 68%,
    transparent 82%
  );
  mask-image: radial-gradient(
    ellipse 58% 58% at 52% 50%,
    #000 0%,
    #000 52%,
    rgba(0, 0, 0, 0.55) 68%,
    transparent 82%
  );
}

/* Soft moss/mist washes — keep Soft Structuralism, avoid Quin purple pastels */
.tarot-scene-card[data-tone="sage"] { --scene-wash: linear-gradient(135deg, #DDEAE3 0%, #E9F1EC 55%, #F2F5F1 100%); }
.tarot-scene-card[data-tone="blush"] { --scene-wash: linear-gradient(135deg, #EDE4DF 0%, #F3EBE6 50%, #E8F0EC 100%); }
.tarot-scene-card[data-tone="lavender-warm"] { --scene-wash: linear-gradient(135deg, #E6E9E8 0%, #EEF1EE 45%, #E4ECE8 100%); }
.tarot-scene-card[data-tone="dusk"] { --scene-wash: linear-gradient(135deg, #E2E6E2 0%, #EBEFEC 50%, #DDE8E3 100%); }
.tarot-scene-card[data-tone="rose"] { --scene-wash: linear-gradient(135deg, #EADFD9 0%, #F1E9E4 50%, #E8EFEA 100%); }
.tarot-scene-card[data-tone="peach"] { --scene-wash: linear-gradient(135deg, #EFE6DE 0%, #F4EEE8 50%, #E8F0EC 100%); }
.tarot-scene-card[data-tone="coral"] { --scene-wash: linear-gradient(135deg, #ECDFD6 0%, #F2E9E2 55%, #E7EFEA 100%); }
.tarot-scene-card[data-tone="violet-warm"] { --scene-wash: linear-gradient(135deg, #E5E8E5 0%, #EBEEEB 50%, #E0EAE5 100%); }
.tarot-scene-card[data-tone="sky"] { --scene-wash: linear-gradient(135deg, #E2E9E8 0%, #EBF1F0 50%, #E4F0EB 100%); }
.tarot-scene-card[data-tone="cream"] { --scene-wash: linear-gradient(135deg, #EFEBE4 0%, #F4F1EB 55%, #E9F0EB 100%); }
.tarot-scene-card[data-tone="mist"] { --scene-wash: linear-gradient(135deg, #E4E9E5 0%, #EDF1ED 50%, #E6EEE9 100%); }
.tarot-scene-card[data-tone="soft-lilac"] { --scene-wash: linear-gradient(135deg, #E7E8E8 0%, #F0F1F0 50%, #E6EEEA 100%); }
.tarot-scene-card[data-tone="leaf"] { --scene-wash: linear-gradient(135deg, #D7E8DE 0%, #E4F0EB 50%, #F0F5F1 100%); }
.tarot-scene-card[data-tone="soft-purple"] { --scene-wash: linear-gradient(135deg, #E5E9E7 0%, #EEF1EF 50%, #E4ECE8 100%); }
.tarot-scene-card[data-tone="sand"] { --scene-wash: linear-gradient(135deg, #EBE4DA 0%, #F2ECE4 50%, #E8EFEA 100%); }
.tarot-scene-card[data-tone="gold-mist"] { --scene-wash: linear-gradient(135deg, #E9E4D8 0%, #F1EEE6 50%, #E7EFEA 100%); }

/* Flow screens */
.tarot-screen { display: none; }
.tarot-screen.is-active { display: block; animation: tarotFade 0.35s ease; }

/* 洗牌 / 抽牌 / 翻牌：撑满视口，主 CTA 沉底 */
#screen-shuffle.is-active,
#screen-draw.is-active,
#screen-reveal.is-active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 64px);
  min-height: calc(100vh - 64px);
  padding-bottom: calc(116px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#screen-shuffle.is-active {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}

#screen-shuffle .tarot-flow-title,
#screen-draw .tarot-flow-title,
#screen-reveal .tarot-flow-title {
  padding-top: 8px;
  flex-shrink: 0;
}

#screen-shuffle .tarot-flow-sub,
#screen-draw .tarot-flow-sub,
#screen-reveal .tarot-flow-sub {
  padding-bottom: 8px;
  flex-shrink: 0;
}

@keyframes tarotFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.tarot-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 6px 20px 2px;
}

.tarot-progress span {
  height: 3px;
  flex: 1;
  max-width: 56px;
  border-radius: 99px;
  background: rgba(47,111,94,0.14);
}

.tarot-progress span.on {
  background: linear-gradient(90deg, #2F6F5E, #B56B4A);
}

.tarot-flow-title {
  text-align: center;
  padding: 12px 24px 4px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--tarot-ink);
  letter-spacing: -0.02em;
  text-shadow:
    0 0 12px rgba(243, 245, 241, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.75);
}

.tarot-flow-sub {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 13px;
  padding: 0 28px 12px;
  line-height: 1.55;
  text-shadow:
    0 0 10px rgba(243, 245, 241, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.65);
}

#screen-question .tarot-suggests {
  padding-bottom: 96px;
}

.tarot-suggests {
  display: grid;
  gap: 10px;
  padding: 0 20px 100px;
}

.tarot-suggest {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(47, 111, 94, 0.1);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--color-text-secondary);
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(47, 111, 94, 0.04);
}

.tarot-suggest:active,
.tarot-suggest.is-on {
  border-color: rgba(47,111,94,0.35);
  background: #E4F0EB;
  color: var(--color-brand);
}

.tarot-composer {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, transparent, rgba(230,235,230,0.95) 28%);
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.tarot-composer input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(47,111,94,0.12);
  background: #fff;
  padding: 0 18px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.tarot-composer button.send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2F6F5E, #B56B4A);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Shuffle */
.tarot-shuffle-stage {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  min-height: 300px;
  margin: 8px 16px 0;
  touch-action: none;
  user-select: none;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.1);
  background-color: rgba(255, 255, 255, 0.35);
  background-image:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35) 0%, transparent 62%),
    linear-gradient(180deg, rgba(232, 236, 230, 0.55), rgba(230, 235, 230, 0.72)),
    url('/assets/generated/ui/tarot-shuffle-glow.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 8px 28px rgba(47, 111, 94, 0.08);
}

.tarot-pile {
  position: absolute;
  inset: 8px 8px 8px;
}

.tarot-pile-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 116px;
  margin: -58px 0 0 -36px;
  border-radius: 8px;
  background: url("/assets/tarot/cards/back.png") center/cover;
  box-shadow:
    0 6px 16px rgba(47, 111, 94, 0.2),
    0 0 0 1px rgba(196, 165, 116, 0.22);
  will-change: transform;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.tarot-pile.is-shuffling .tarot-pile-card {
  transition: transform 0.12s linear;
}

#screen-shuffle.is-shuffling .tarot-shuffle-stage {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 8px 28px rgba(47, 111, 94, 0.1),
    0 0 40px rgba(196, 165, 116, 0.22);
}

/* 发牌飞行克隆 */
.tarot-fly-card {
  position: fixed;
  z-index: 4000;
  pointer-events: none;
  border-radius: 8px;
  background: url("/assets/tarot/cards/back.png") center/cover;
  box-shadow:
    0 16px 36px rgba(47, 111, 94, 0.32),
    0 0 0 1px rgba(196, 165, 116, 0.35);
  transform: translate(0, 0) rotate(0deg) scale(1);
  transition: transform 0.48s cubic-bezier(0.22, 0.82, 0.2, 1), opacity 0.48s ease;
  will-change: transform;
}

.spread-slot.is-awaiting .spread-slot-frame {
  border-color: rgba(196, 165, 116, 0.65);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.16);
}

.spread-slot.is-landing .spread-slot-frame {
  animation: tarotSlotLand 0.42s ease;
}

@keyframes tarotSlotLand {
  0% { transform: scale(0.86); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* 统一底部操作条：贴屏幕底部（与提问页 composer 同习惯） */
.tarot-shuffle-footer,
.tarot-reveal-footer,
.tarot-draw-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  z-index: 45;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(236, 240, 236, 0) 0%, rgba(236, 240, 236, 0.55) 34%, rgba(236, 240, 236, 0.82) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  gap: 10px;
  box-sizing: border-box;
}

.tarot-ghost-btn {
  display: block;
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(47,111,94,0.18);
  background: rgba(255,255,255,0.92);
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 600;
}

.tarot-primary-btn {
  display: block;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #2F6F5E 0%, #3D8A74 55%, #B56B4A 160%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(47,111,94,0.22);
}

.tarot-primary-btn:disabled {
  opacity: 0.4;
  box-shadow: none;
}

/* Wheel */
.tarot-wheel-wrap {
  position: relative;
  height: min(62vh, 480px);
  overflow: hidden;
  touch-action: none;
  margin-bottom: 12px;
}

.tarot-wheel {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 0;
  height: 0;
  transform-origin: center center;
}

.tarot-wheel-card {
  position: absolute;
  width: 72px;
  height: 116px;
  margin-left: -36px;
  margin-top: -58px;
  border-radius: 8px;
  background: url("/assets/tarot/cards/back.png") center/cover;
  box-shadow: 0 8px 18px rgba(47, 111, 94, 0.22), 0 0 0 1px rgba(196, 165, 116, 0.2);
  transform-origin: center center;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.tarot-wheel-card.is-picked {
  outline: 2px solid #C4A574;
  filter: brightness(1.15);
}

.tarot-draw-slots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}

.tarot-slot {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px dashed rgba(47,111,94,0.25);
  text-align: center;
  font-size: 11px;
  color: var(--color-text-light);
}

.tarot-slot.filled {
  border-style: solid;
  border-color: rgba(47,111,94,0.35);
  color: var(--color-brand);
  font-weight: 600;
}

/* Quin-style spread board during draw */
.tarot-draw-scene {
  text-align: center;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-light);
  letter-spacing: 0.06em;
}

.tarot-draw-lead {
  font-size: 20px !important;
  line-height: 1.4 !important;
  padding-top: 6px !important;
  padding-bottom: 2px !important;
}

.tarot-draw-lead #draw-step-num {
  color: var(--color-brand);
  font-weight: 700;
}

.tarot-draw-hint {
  padding-bottom: 8px !important;
  font-size: 12px !important;
}

.tarot-spread-board {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
  padding: 4px 12px 8px;
  min-height: 0;
}

.tarot-spread-board.is-cross5 {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: auto auto auto;
  gap: 8px 10px;
  justify-content: center;
  min-height: 0;
  padding-bottom: 4px;
}

.tarot-spread-board.is-cross5 .spread-slot:nth-child(1) { grid-column: 2; grid-row: 1; }
.tarot-spread-board.is-cross5 .spread-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.tarot-spread-board.is-cross5 .spread-slot:nth-child(3) { grid-column: 2; grid-row: 2; }
.tarot-spread-board.is-cross5 .spread-slot:nth-child(4) { grid-column: 3; grid-row: 2; }
.tarot-spread-board.is-cross5 .spread-slot:nth-child(5) { grid-column: 2; grid-row: 3; }

.spread-slot {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.spread-slot-frame {
  width: 66px;
  height: 102px;
  border-radius: 10px;
  border: 1.5px dashed rgba(47,111,94,0.28);
  background: rgba(255,255,255,0.45);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.spread-slot.is-active .spread-slot-frame {
  border-style: dashed;
  border-color: rgba(47,111,94,0.55);
  background: rgba(228,240,235,0.75);
  box-shadow: 0 0 0 3px rgba(47,111,94,0.12), 0 6px 16px rgba(47,111,94,0.1);
}

.spread-slot.is-filled .spread-slot-frame {
  border-style: solid;
  border-color: rgba(196,165,116,0.55);
  background: transparent;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.spread-slot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spread-slot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.spread-slot.is-active .spread-slot-label {
  color: var(--color-brand);
}

.tarot-wheel-tip {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 2px auto 4px;
  max-width: 240px;
  padding: 4px 10px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* 抽牌区与整页雾气背景一体，不再单独垫暖色图造成「上下断层」 */
#screen-draw .tarot-wheel-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 280px;
  max-height: min(52vh, 400px);
  margin: 0;
  overflow: hidden;
  touch-action: none;
  position: relative;
  border-radius: 0;
  background: transparent;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 8%,
    #000 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 8%,
    #000 86%,
    transparent 100%
  );
}

.tarot-wheel-table {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 140%;
  height: 48%;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(
    ellipse at center bottom,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(228, 240, 235, 0.12) 38%,
    transparent 70%
  );
  opacity: 1;
  filter: none;
}

#screen-draw .tarot-wheel {
  position: absolute;
  left: 50%;
  top: 108%;
  width: 0;
  height: 0;
  transform-origin: center center;
  will-change: transform;
}

#screen-draw .tarot-wheel-card {
  width: 56px;
  height: 92px;
  margin-left: -28px;
  margin-top: -46px;
  border-radius: 8px;
  background: url("/assets/tarot/cards/back.png") center/cover;
  box-shadow:
    0 10px 22px rgba(47, 111, 94, 0.24),
    0 0 0 1px rgba(196, 165, 116, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  cursor: pointer;
  position: absolute;
  transform-origin: center center;
  transition: transform 0.35s ease, filter 0.2s ease, opacity 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}

#screen-draw .tarot-wheel-card:active {
  filter: brightness(1.08);
}

/* 抽走中：向上抬出并淡出，再从扇面消失 */
#screen-draw .tarot-wheel-card.is-drawing {
  z-index: 200 !important;
  pointer-events: none;
  opacity: 0;
  filter: brightness(1.12);
}

#screen-draw .tarot-wheel-card.is-drawn {
  display: none;
}

/* Reveal */
.tarot-reveal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 8px;
}

.tarot-reveal-card {
  width: 118px;
  perspective: 800px;
}

.tarot-reveal-card.layout-single { width: 160px; }
.tarot-reveal-inner {
  position: relative;
  width: 100%;
  padding-top: 160%;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
}

.tarot-reveal-card.is-flipped .tarot-reveal-inner {
  transform: rotateY(180deg);
}

.tarot-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(47, 111, 94, 0.18), 0 0 0 1px rgba(196, 165, 116, 0.18);
}

.tarot-face.back {
  background: url("/assets/tarot/cards/back.png") center/cover;
}

.tarot-face.front {
  transform: rotateY(180deg);
  background: #F7F1E8;
}

.tarot-face.front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tarot-face.front.is-reversed img {
  transform: rotate(180deg);
}

.tarot-pos-label {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--tarot-ink);
  font-weight: 600;
  display: inline-block;
  width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 10px rgba(47, 111, 94, 0.08);
}

.tarot-card-name {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

/* Result */
.tarot-result {
  padding: 0 16px 120px;
}

.tarot-result-panel {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(47, 111, 94, 0.1);
  box-shadow: 0 8px 24px rgba(47, 111, 94, 0.08);
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tarot-result-panel h3 {
  margin: 0 0 10px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 18px;
  color: var(--tarot-ink);
}

.tarot-result-panel p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.tarot-advice li {
  margin: 6px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.tarot-chat {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.tarot-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 92%;
}

.tarot-bubble.user {
  margin-left: auto;
  background: #E4F0EB;
  color: var(--color-brand);
}

.tarot-bubble.assistant {
  background: #fff;
  border: 1px solid rgba(47,111,94,0.08);
  color: var(--color-text-secondary);
}

/* Modal paywall */
.tarot-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(26, 36, 33, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.tarot-modal-mask.is-on { display: flex; }

.tarot-modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #F7F9F6;
  background-image: linear-gradient(180deg, #FBFCFB, #EEF2EE);
  background-clip: padding-box;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(47, 111, 94, 0.1);
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(47, 111, 94, 0.16);
}

.tarot-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tarot-modal-head h2 {
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 22px;
  margin: 0;
  color: var(--tarot-ink);
}

.tarot-modal-benefits {
  margin: 0 0 4px;
  padding: 0 4px 0 18px;
  color: #4A5A54;
  font-size: 13px;
  line-height: 1.7;
  flex-shrink: 0;
}

.tarot-pay-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(42vh, 320px);
}

.tarot-pay-item {
  position: relative;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid rgba(47,111,94,0.08);
  text-align: left;
}

.tarot-pay-item.is-on {
  border-color: #2F6F5E;
  box-shadow: 0 0 0 1px rgba(47,111,94,0.12);
}

.tarot-pay-item .badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: #B56B4A;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.tarot-pay-item .name {
  font-weight: 700;
  font-size: 15px;
  color: var(--tarot-ink);
}

.tarot-pay-item .price-row {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tarot-pay-item .price {
  font-size: 22px;
  color: #2F6F5E;
  font-weight: 700;
}

.tarot-pay-item .unit {
  font-size: 12px;
  color: #6B7C74;
  font-weight: 500;
}

.tarot-pay-item .desc {
  font-size: 12px;
  color: #6B7C74;
  margin-top: 4px;
  line-height: 1.45;
}

.tarot-modal #btn-buy,
.tarot-modal .tarot-modal-note {
  flex-shrink: 0;
}

.tarot-empty-pay {
  text-align: center;
  padding: 28px 18px 8px;
}

.tarot-empty-pay .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(47,111,94,0.08);
  color: #2F6F5E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.tarot-empty-pay h3 {
  margin: 0 0 8px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 18px;
  color: var(--tarot-ink);
}

.tarot-empty-pay p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #6B7C74;
  line-height: 1.6;
}

.tarot-history-wrap {
  padding: 0 16px 40px;
}

#screen-result.has-paywall .tarot-flow-title,
#screen-result.has-paywall #follow-composer {
  display: none;
}

#screen-result.has-paywall .tarot-result {
  padding-bottom: 40px;
}

.tarot-tutorial {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(26, 36, 33, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tarot-tutorial.is-on { display: flex; }

.tarot-tutorial-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid rgba(47, 111, 94, 0.1);
  box-shadow: 0 16px 40px rgba(47, 111, 94, 0.18);
}

.tarot-tutorial-card h3 {
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 18px;
  margin: 0 0 8px;
}

.tarot-tutorial-card p {
  font-size: 13px;
  color: #6B7C74;
  line-height: 1.6;
  margin: 0 0 16px;
}

.tarot-tutorial-visual {
  height: 72px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #E4F0EB, #F7F1E8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2F6F5E;
  font-size: 28px;
}

.tarot-tutorial-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: #6B7C74;
}

.tarot-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-light);
}

.tarot-cross5 {
  display: grid;
  grid-template-columns: repeat(3, 118px);
  grid-template-rows: auto auto auto;
  gap: 10px;
  justify-content: center;
  padding: 12px 8px 24px;
}

.tarot-cross5 .c0 { grid-column: 2; grid-row: 1; }
.tarot-cross5 .c1 { grid-column: 1; grid-row: 2; }
.tarot-cross5 .c2 { grid-column: 2; grid-row: 2; }
.tarot-cross5 .c3 { grid-column: 3; grid-row: 2; }
.tarot-cross5 .c4 { grid-column: 2; grid-row: 3; }

.tarot-history-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(47,111,94,0.08);
}

.tarot-history-item strong {
  display: block;
  font-size: 14px;
  color: var(--tarot-ink);
  margin-bottom: 4px;
}

.tarot-history-item span {
  font-size: 12px;
  color: var(--color-text-light);
}

#screen-reveal .tarot-reveal-grid {
  padding-bottom: 8px;
}

#screen-home {
  padding-bottom: 24px;
}
