:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #fbfcfa;
  --surface-strong: #ffffff;
  --ink: #2f3431;
  --muted: #68726b;
  --line: #d5ded6;
  --accent: #9a7480;
  --accent-strong: #6f4f63;
  --sage: #dce8dd;
  --rose: #ead7dd;
  --gold: #b9a15d;
  --shadow: 0 18px 50px rgba(72, 88, 76, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(220, 232, 221, 0.9), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(234, 215, 221, 0.75), transparent 28rem),
    linear-gradient(135deg, #f6f8f5 0%, #f7f4f8 48%, #eef5f0 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.6;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 22px;
  align-items: start;
}

.intro-panel,
.shuffle-panel,
.analysis-panel,
.reading-panel,
.result-panel {
  background: rgba(251, 252, 250, 0.9);
  border: 1px solid rgba(213, 222, 214, 0.96);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-panel {
  position: sticky;
  top: 24px;
  padding: 28px;
}

.shuffle-panel,
.analysis-panel,
.reading-panel,
.result-panel {
  padding: 24px;
}

.result-panel {
  grid-column: 2;
}

.brand-row,
.section-header,
.form-actions,
.result-card-title {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 10px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--surface-strong);
  font-family: Georgia, serif;
  font-size: 14px;
  letter-spacing: 0;
}

.brand-label,
.eyebrow,
.question-summary span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.lead {
  color: var(--muted);
  font-size: 17px;
}

.question-form {
  margin-top: 24px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157, 107, 95, 0.14);
}

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

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  background: var(--accent-strong);
  color: #fff;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--accent-strong);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.safety-note,
.deck-guidance,
.card-meaning,
.gentle-disclaimer {
  color: var(--muted);
}

.safety-note {
  margin: 18px 0 0;
  font-size: 14px;
}

.section-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin-bottom: 4px;
}

.draw-counter {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--sage);
  color: #3f513b;
  font-weight: 800;
  text-align: center;
}

.draw-stage {
  min-height: 760px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  overflow: visible;
}

.draw-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(620px, 100%);
  margin: 42px auto 12px;
}

.draw-slot {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(154, 116, 128, 0.12);
  border-radius: 8px;
  background: rgba(246, 241, 249, 0.72);
  color: rgba(111, 79, 99, 0.52);
  box-shadow: 0 12px 34px rgba(72, 88, 76, 0.08);
}

.slot-number {
  font-size: 48px;
  font-weight: 800;
}

.slot-label,
.slot-card-name {
  font-size: 14px;
}

.slot-card-name {
  display: block;
  max-width: 100%;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
}

.draw-slot.is-filled {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.draw-slot.is-receiving {
  border-color: rgba(185, 161, 93, 0.75);
  box-shadow: 0 14px 38px rgba(185, 161, 93, 0.22);
}

.swipe-hint {
  margin: 8px 0 0;
  text-align: center;
  color: #9a9496;
  font-size: 20px;
}

.deck-scroll {
  width: calc(100% + 48px);
  margin: 0 -24px -24px;
  padding: 18px 0 30px;
  overflow: visible;
  overflow-y: hidden;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
}

.deck-scroll.is-dragging {
  cursor: grabbing;
}

.deck-fan {
  --card-w: 48px;
  --card-h: 82px;
  --radius: 300px;
  --neg-radius: -300px;
  --wheel-rotation: 0deg;
  position: relative;
  left: 50%;
  width: 660px;
  height: 660px;
  margin: 0 auto;
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  transition: filter 160ms ease;
}

.tarot-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  height: var(--card-h);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  --lift: 0px;
  --focus-scale: 1;
  cursor: pointer;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--angle) + var(--wheel-rotation)))
    translateY(calc(var(--neg-radius) - var(--lift)))
    rotate(calc(-1 * (var(--angle) + var(--wheel-rotation))))
    scale(var(--focus-scale));
  transform-origin: 50% 50%;
  transition: opacity 140ms ease, filter 140ms ease, box-shadow 140ms ease;
  will-change: transform;
  z-index: var(--i);
}

.tarot-card:hover:not(:disabled) {
  --lift: 10px;
}

.tarot-card.is-focus:not(:disabled) {
  --lift: 30px;
  --focus-scale: 1.16;
  z-index: 220;
  filter: drop-shadow(0 14px 22px rgba(185, 161, 93, 0.36));
}

.deck-scroll.is-dragging .tarot-card {
  transition: opacity 90ms linear, filter 90ms linear;
}

.deck-scroll.is-dragging .tarot-card.is-focus {
  --lift: 22px;
  --focus-scale: 1.1;
}

.tarot-card:disabled {
  cursor: default;
}

.tarot-card.is-muted {
  opacity: 0.18;
  filter: grayscale(0.2);
}

.tarot-card.is-drawn {
  opacity: 0;
  pointer-events: none;
}

.tarot-card.is-selected {
  --lift: 34px;
  --focus-scale: 1.12;
  z-index: 180;
}

.card-back,
.card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 12px 24px rgba(111, 79, 99, 0.16);
}

.card-back {
  position: relative;
  padding: 0;
  border: 1px solid rgba(190, 157, 79, 0.68);
  background: #181b30;
  color: #f6e4a8;
  overflow: hidden;
}

.card-back img,
.image-card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-art {
  border: 1px solid rgba(185, 161, 93, 0.74);
  background: linear-gradient(180deg, #fffdf7 0%, #f7edf3 100%);
}

.card-art.is-reversed .art-frame {
  transform: rotate(180deg);
}

.image-card-art {
  padding: 0;
  overflow: hidden;
  background: #f4ecdc;
}

.image-card-art .fallback-card-art {
  display: none;
}

.image-card-art.is-missing-image {
  padding: 8px;
}

.image-card-art.is-missing-image .fallback-card-art {
  display: grid;
  border: 0;
  box-shadow: none;
}

.image-card-art.is-reversed img {
  transform: rotate(180deg);
}

.art-frame {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 6px;
  padding: 9px 7px;
  border: 1px solid rgba(154, 116, 128, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(234, 215, 221, 0.44));
}

.art-top,
.art-orientation {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.art-illustration {
  position: relative;
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 100%;
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185, 161, 93, 0.72);
  border-radius: 5px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #b9dcf0 0 42%, #f6df86 42% 70%, #8fbf7a 70% 100%);
}

.art-sun {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6c85f;
  box-shadow: 0 0 0 7px rgba(246, 200, 95, 0.2);
}

.art-figure {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 79, 99, 0.28);
  color: var(--accent-strong);
  font-family: Georgia, serif;
  font-size: 20px;
}

.art-ground {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8px;
  height: 28px;
  border-radius: 50% 50% 0 0;
  background: rgba(119, 154, 94, 0.74);
}

.wand-art {
  background:
    linear-gradient(180deg, #f5d36b 0 46%, #f1b66d 46% 70%, #8fbe75 70% 100%);
}

.wand-art::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 54px;
  border-radius: 999px;
  background: #9b6a3c;
  transform: rotate(-18deg);
}

.cup-art {
  background:
    linear-gradient(180deg, #b9def5 0 48%, #f4df99 48% 72%, #8fbf7a 72% 100%);
}

.cup-art::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 28px;
  border: 4px solid #d39b45;
  border-top: 8px solid #d39b45;
  border-radius: 0 0 16px 16px;
}

.sword-art {
  background:
    linear-gradient(180deg, #c8d6ee 0 48%, #f2e8ad 48% 72%, #a8c58d 72% 100%);
}

.sword-art::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 62px;
  border-radius: 999px;
  background: #9ba4b3;
  transform: rotate(32deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.pentacle-art {
  background:
    linear-gradient(180deg, #b5d6c7 0 44%, #f4dc75 44% 72%, #90b76d 72% 100%);
}

.pentacle-art::before {
  content: "★";
  position: absolute;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7b84d;
  color: #6f4f63;
  font-size: 22px;
}

.major-art {
  background:
    linear-gradient(180deg, #b8d8f0 0 38%, #f0cb74 38% 67%, #86b777 67% 100%);
}

.major-art::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 54px;
  border-radius: 22px 22px 8px 8px;
  background: linear-gradient(180deg, #e18d73, #b7658b);
}

.art-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.fan-card-art {
  pointer-events: none;
}

.slot-flight-target {
  width: 84px;
  height: 140px;
  display: block;
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.result-actions .ghost-button {
  min-width: 148px;
}

@media (max-width: 640px) {
  .slot-flight-target {
    width: 70px;
    height: 118px;
  }
}

@media (max-width: 390px) {
  .slot-flight-target {
    width: 60px;
    height: 102px;
  }
}
.slot-card-art {
  width: 84px;
  height: 140px;
}

.drawn-card-animation {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.98;
  transform: translateZ(0);
  transition:
    left 620ms cubic-bezier(0.2, 0.72, 0.18, 1),
    top 620ms cubic-bezier(0.2, 0.72, 0.18, 1),
    width 620ms cubic-bezier(0.2, 0.72, 0.18, 1),
    height 620ms cubic-bezier(0.2, 0.72, 0.18, 1),
    opacity 220ms ease 520ms;
}

.drawn-card-animation.is-flying {
  opacity: 0;
}

.animation-card-art {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .drawn-card-animation {
    transition: none;
  }

  .shuffle-card {
    animation: none;
  }
}

.question-summary {
  padding: 16px 18px;
  margin-bottom: 18px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 8px;
}

.question-summary p {
  margin: 4px 0 0;
}

.card-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.result-card,
.synthesis {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.result-card {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.result-card-art {
  width: min(150px, 100%);
  height: 238px;
  justify-self: center;
}

.result-card-title {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result-card-title strong {
  font-size: 18px;
}

.result-card p:last-child,
.synthesis p:last-child {
  margin-bottom: 0;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}

.card-core {
  margin-bottom: 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.keyword-row span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sage);
  color: #405541;
  font-size: 12px;
  font-weight: 700;
}

.synthesis {
  margin-top: 16px;
  padding: 20px;
}

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

.fallback-reading summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.fallback-reading[hidden] {
  display: none;
}

.ai-reading-panel {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.ai-reading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-reading-header h3 {
  margin-bottom: 0;
}

.ai-status {
  color: var(--muted);
  font-size: 14px;
}

.ai-reading-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.ai-card {
  padding: 16px;
  border: 1px solid rgba(154, 116, 128, 0.2);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.92);
}

.ai-card-wide {
  grid-column: 1 / -1;
}

.ai-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.ai-card strong {
  display: block;
  margin-bottom: 8px;
}

.ai-card p {
  margin-bottom: 0;
}

.safety-ai-card {
  border-color: rgba(185, 161, 93, 0.5);
  background: rgba(255, 250, 235, 0.82);
}

.location-ai-card {
  border-color: rgba(111, 79, 99, 0.32);
  background: rgba(246, 241, 249, 0.88);
}

.location-ai-card p {
  font-weight: 700;
}

.gentle-disclaimer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    position: static;
  }

  .result-panel {
    grid-column: auto;
  }

  .draw-stage {
    min-height: 700px;
  }

  .deck-fan {
    --card-w: 44px;
    --card-h: 74px;
    --radius: 270px;
    --neg-radius: -270px;
    width: 600px;
    height: 600px;
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding: 14px 0 32px;
    gap: 14px;
  }

  .intro-panel,
.shuffle-panel,
.analysis-panel,
.reading-panel,
.result-panel {
    padding: 18px;
  }

  h1 {
    font-size: 46px;
  }

  .lead {
    font-size: 15px;
  }

  .section-header {
    align-items: flex-start;
  }

  .draw-slots {
    gap: 10px;
    margin-top: 22px;
  }

  .draw-slot {
    min-height: 172px;
  }

  .slot-number {
    font-size: 38px;
  }

  .slot-card-art {
    width: 70px;
    height: 118px;
  }

  .draw-stage {
    min-height: 570px;
  }

  .deck-fan {
    --card-w: 30px;
    --card-h: 52px;
    --radius: 170px;
    --neg-radius: -170px;
    width: 390px;
    height: 390px;
    transform: translateX(-50%);
  }

  .tarot-card,
  .card-back,
  .card-art {
    min-height: 0;
  }

  .card-back {
    padding: 4px;
    border-width: 1px;
  }

  .card-back::before {
    inset: 5px;
    border-width: 1px;
  }

  .card-symbol {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .back-corner {
    width: 5px;
    height: 5px;
    box-shadow: 0 0 0 3px rgba(255, 241, 169, 0.18);
  }

  .back-corner:first-child {
    top: 9px;
    left: 7px;
  }

  .back-corner:last-child {
    right: 7px;
    bottom: 9px;
  }

  .card-results {
    grid-template-columns: 1fr;
  }

  .ai-reading-header {
    align-items: stretch;
    display: grid;
  }

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

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

@media (max-width: 390px) {
  .draw-slots {
    gap: 8px;
  }

  .draw-slot {
    min-height: 150px;
  }

  .slot-card-art {
    width: 60px;
    height: 102px;
  }

  .deck-fan {
    --card-w: 26px;
    --card-h: 46px;
    --radius: 142px;
    --neg-radius: -142px;
    width: 328px;
    height: 328px;
  }
}
.app-shell.is-question-phase,
.app-shell.is-shuffle-phase {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.app-shell.is-question-phase .intro-panel,
.app-shell.is-shuffle-phase .shuffle-panel {
  position: static;
  min-height: min(720px, calc(100vh - 80px));
  display: grid;
  align-content: center;
}

.shuffle-panel[hidden],
.reading-panel[hidden],
.result-panel[hidden],
.intro-panel[hidden] {
  display: none;
}

.shuffle-panel {
  overflow: hidden;
}

.shuffle-copy {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

.shuffle-copy h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 62px);
  line-height: 1;
}

.shuffle-copy p:last-child {
  color: var(--muted);
  font-size: 17px;
}

.shuffle-stage {
  position: relative;
  min-height: 320px;
  margin-top: 28px;
  display: grid;
  place-items: center;
}

.shuffle-deck {
  position: relative;
  width: min(520px, 100%);
  height: 280px;
}

.shuffle-card {
  --spread-x: calc(var(--n) * 42px);
  --spread-r: calc(var(--n) * 7deg);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 132px;
  border: 1px solid rgba(190, 157, 79, 0.78);
  border-radius: 8px;
  background:
    url("assets/card-backs/oil-moon-back.png") center / cover,
    #181b30;
  box-shadow: 0 18px 34px rgba(72, 88, 76, 0.18);
  transform: translate(-50%, -50%) rotate(calc(var(--n) * 1deg));
  animation: shuffle-flow 2800ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
  animation-delay: calc((var(--n) + 4) * 42ms);
}

.shuffle-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(246, 228, 168, 0.38);
  border-radius: 6px;
}

@keyframes shuffle-flow {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.92) rotate(0deg);
  }
  16% {
    opacity: 1;
    transform: translate(calc(-50% + var(--spread-x)), -50%) rotate(var(--spread-r));
  }
  38% {
    transform: translate(calc(-50% - var(--spread-x) * 0.72), -54%) rotate(calc(var(--spread-r) * -0.8));
  }
  58% {
    transform: translate(-50%, -50%) rotate(calc(var(--n) * 1deg));
  }
  76% {
    transform: translate(-50%, -50%) scale(1.03) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--spread-x) * 0.72), -50%) rotate(calc(var(--spread-r) * 0.72));
  }
}

@media (max-width: 640px) {
  .shuffle-stage {
    min-height: 260px;
  }

  .shuffle-deck {
    height: 230px;
  }

  .shuffle-card {
    --spread-x: calc(var(--n) * 28px);
    width: 58px;
    height: 98px;
  }
}
.reading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.reading-actions .ghost-button {
  min-height: 38px;
  padding: 0 14px;
}
body[data-theme="purple"] {
  --bg: #f4f0fb;
  --surface: #fbf8ff;
  --surface-strong: #ffffff;
  --ink: #31283d;
  --muted: #746781;
  --line: #ded2ea;
  --accent: #9b77b7;
  --accent-strong: #65457d;
  --sage: #e6def3;
  --rose: #ead8ef;
  --gold: #c5a852;
  --shadow: 0 18px 50px rgba(74, 52, 105, 0.16);
  background:
    radial-gradient(circle at top left, rgba(213, 197, 238, 0.9), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(238, 211, 232, 0.8), transparent 28rem),
    linear-gradient(135deg, #f4f0fb 0%, #f9f5ff 48%, #efe8f8 100%);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11142a;
  --surface: #181b34;
  --surface-strong: #202442;
  --ink: #f3efe7;
  --muted: #b8b2c7;
  --line: rgba(232, 221, 194, 0.2);
  --accent: #e0c75c;
  --accent-strong: #f0d96d;
  --sage: rgba(224, 199, 92, 0.18);
  --rose: rgba(155, 119, 183, 0.22);
  --gold: #ead765;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  background:
    radial-gradient(circle at top left, rgba(66, 53, 116, 0.82), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(125, 91, 145, 0.35), transparent 28rem),
    linear-gradient(135deg, #11142a 0%, #1b1e3a 54%, #090b18 100%);
}

body[data-theme="dark"] .intro-panel,
body[data-theme="dark"] .shuffle-panel,
body[data-theme="dark"] .analysis-panel,
body[data-theme="dark"] .reading-panel,
body[data-theme="dark"] .result-panel,
body[data-theme="dark"] .ai-reading-panel,
body[data-theme="dark"] .result-card,
body[data-theme="dark"] .ai-card,
body[data-theme="dark"] .synthesis {
  background: rgba(24, 27, 52, 0.88);
  border-color: rgba(232, 221, 194, 0.18);
}

.theme-switcher {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  box-shadow: 0 10px 28px rgba(72, 88, 76, 0.12);
  backdrop-filter: blur(10px);
}

.theme-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.theme-chip.is-active {
  background: var(--accent-strong);
  color: var(--surface-strong);
}

.analysis-panel {
  min-height: min(720px, calc(100vh - 80px));
  display: grid;
  place-items: center;
  gap: 28px;
  text-align: center;
}

.analysis-panel[hidden] {
  display: none;
}

.analysis-orbit {
  position: relative;
  width: min(320px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.analysis-ring,
.analysis-dot {
  position: absolute;
  border-radius: 50%;
}

.analysis-ring {
  inset: 18%;
  border: 1px solid rgba(185, 161, 93, 0.55);
  border-left-color: transparent;
  border-bottom-color: transparent;
  animation: analysis-spin 4.8s linear infinite;
}

.ring-two {
  inset: 11%;
  animation-duration: 7s;
  animation-direction: reverse;
  opacity: 0.74;
}

.ring-three {
  inset: 4%;
  animation-duration: 10s;
  opacity: 0.46;
}

.analysis-core {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #f1df6a 0%, #d2b847 72%);
  color: #272944;
  font-size: 26px;
  box-shadow: 0 0 34px rgba(234, 215, 101, 0.55);
}

.analysis-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(234, 215, 101, 0.72);
  animation: analysis-pulse 1.8s ease-in-out infinite alternate;
}

.dot-one {
  top: 12%;
  left: 58%;
}

.dot-two {
  right: 18%;
  bottom: 26%;
  animation-delay: 320ms;
}

.dot-three {
  left: 19%;
  bottom: 18%;
  animation-delay: 640ms;
}

.analysis-copy {
  max-width: 520px;
}

.analysis-copy h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
}

.analysis-copy p:last-child {
  color: var(--muted);
}

@keyframes analysis-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes analysis-pulse {
  from {
    transform: scale(0.8);
    opacity: 0.48;
  }
  to {
    transform: scale(1.2);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .theme-switcher {
    position: static;
    width: fit-content;
    margin: 10px auto 0;
  }

  .analysis-panel {
    min-height: 560px;
  }
}
.app-shell.is-analysis-phase,
.app-shell.is-result-phase {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

.app-shell.is-analysis-phase .analysis-panel,
.app-shell.is-result-phase .result-panel {
  grid-column: auto;
}
