:root {
  --tarot-accent: #e0c08a;
  --tarot-accent-soft: rgba(224, 192, 138, 0.16);
  --tarot-ink-soft: #d7dfeb;
}

.tarot-main {
  gap: 38px;
}

.tarot-grid {
  align-items: start;
}

.tarot-page .service-hero__title {
  max-width: 9ch;
}

.tarot-page .service-hero__subtitle,
.tarot-page .service-hero__lede {
  max-width: 40rem;
}

.tarot-form textarea {
  min-height: 148px;
  resize: vertical;
}

.step-track {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-track__item {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 16px 14px 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(9, 15, 24, 0.68);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.step-track__item::before {
  content: attr(data-step);
  position: absolute;
  top: 15px;
  left: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.step-track__label {
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step-track__meta {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.step-track__item.is-active {
  border-color: rgba(224, 192, 138, 0.44);
  box-shadow: 0 0 0 1px rgba(224, 192, 138, 0.12) inset;
  transform: translateY(-2px);
}

.step-track__item.is-complete::before {
  content: "OK";
  color: #111822;
  border-color: rgba(224, 192, 138, 0.58);
  background: rgba(224, 192, 138, 0.9);
}

.step-track__item.is-dim {
  opacity: 0.62;
}

.tarot-stage {
  overflow: hidden;
}

.tarot-draw,
.tarot-result {
  gap: 24px;
}

.tarot-draw__name {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.tarot-draw__name strong {
  color: var(--ink);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
}

.tarot-question-chip {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(8, 13, 21, 0.74);
}

.tarot-question-chip__label,
.tarot-record__label {
  margin: 0;
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tarot-question-chip p:last-child {
  margin: 0;
  color: var(--ink);
  line-height: 1.8;
}

.tarot-deck {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 22px 18px 30px;
}

.tarot-deck__back,
.tarot-card-shell {
  width: min(100%, 250px);
  aspect-ratio: 5 / 8;
  border-radius: 18px;
}

.tarot-deck__back {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(224, 192, 138, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(12, 17, 28, 0.98), rgba(7, 11, 19, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.tarot-deck__back::before,
.tarot-deck__back::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(224, 192, 138, 0.18);
}

.tarot-deck__back::after {
  inset: 50% auto auto 50%;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  margin-top: -23px;
  transform: rotate(45deg);
  background: rgba(224, 192, 138, 0.08);
}

.tarot-deck__back--one {
  transform: translateX(-50px) rotate(-10deg);
}

.tarot-deck__back--two {
  transform: translateX(-12px) rotate(-3deg);
}

.tarot-deck__back--three {
  transform: translateX(26px) rotate(6deg);
}

.tarot-card-shell {
  position: relative;
  z-index: 1;
  perspective: 1400px;
  transform: translateY(0);
  transition: transform 260ms ease;
}

.tarot-card-shell__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.tarot-card-shell.is-revealed .tarot-card-shell__inner {
  transform: rotateY(180deg);
}

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

.tarot-card-shell.is-drawing {
  transform: translateY(-14px) rotate(-1deg);
}

.tarot-deck.is-shuffling .tarot-deck__back--one {
  animation: tarot-shuffle-left 820ms ease-in-out infinite;
}

.tarot-deck.is-shuffling .tarot-deck__back--two {
  animation: tarot-shuffle-mid 820ms ease-in-out infinite;
}

.tarot-deck.is-shuffling .tarot-deck__back--three {
  animation: tarot-shuffle-right 820ms ease-in-out infinite;
}

.tarot-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  backface-visibility: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.tarot-card-face--back {
  background:
    radial-gradient(circle at top, rgba(224, 192, 138, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(14, 18, 29, 0.98), rgba(7, 11, 19, 0.98));
}

.tarot-card-face--back::before,
.tarot-card-face--back::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(224, 192, 138, 0.22);
}

.tarot-card-face--back::after {
  inset: 50% auto auto 50%;
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
  transform: rotate(45deg);
  background: rgba(224, 192, 138, 0.08);
}

.tarot-card-face__sigil,
.tarot-card-face__caption {
  position: relative;
  z-index: 1;
}

.tarot-card-face__sigil {
  color: #f5e3bd;
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.14em;
}

.tarot-card-face__caption {
  margin: 0;
  align-self: end;
  padding-bottom: 26px;
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
}

.tarot-card-face--front {
  transform: rotateY(180deg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    linear-gradient(180deg, rgba(11, 18, 29, 0.98), rgba(7, 11, 19, 0.98));
}

.tarot-card-face--front img,
.tarot-record__image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #040912;
}

.tarot-card-face__fallback,
.tarot-record__image-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    linear-gradient(180deg, rgba(12, 17, 28, 0.98), rgba(7, 11, 19, 0.98));
}

.tarot-card-face__fallback[hidden],
.tarot-record__image-fallback[hidden] {
  display: none !important;
}

.tarot-card-face__fallback span,
.tarot-record__image-fallback span {
  color: var(--tarot-accent);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  font-size: 2rem;
}

.tarot-card-face__fallback strong,
.tarot-record__image-fallback strong {
  color: var(--ink);
  font-family: "SJsuqian", "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: 1.42rem;
  line-height: 1.3;
}

.tarot-draw__status {
  margin: 0;
  color: var(--ink);
  line-height: 1.75;
}

.tarot-draw__status[data-tone="error"] {
  color: #ffd1d1;
}

.tarot-draw__status[data-tone="resolved"] {
  color: #f2ddb3;
}

.tarot-record {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
    linear-gradient(180deg, rgba(9, 15, 24, 0.96), rgba(8, 12, 20, 0.94));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 20px 48px rgba(0, 0, 0, 0.32);
}

.tarot-record__media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.tarot-record__image-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 8;
  width: min(100%, 248px);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(224, 192, 138, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(12, 17, 28, 0.98), rgba(7, 11, 19, 0.98));
}

.tarot-record__card-meta {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px 0;
  text-align: center;
}

.tarot-record__card-meta h3 {
  margin: 0;
  color: var(--ink);
  font-family: "SJsuqian", "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
}

.tarot-record__card-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.tarot-record__keywords {
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tarot-record__orientation {
  color: var(--tarot-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tarot-record__question {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(224, 192, 138, 0.08), rgba(224, 192, 138, 0) 18%),
    rgba(255, 255, 255, 0.02);
}

.tarot-record__question p:last-child {
  margin: 0;
  color: var(--ink);
  line-height: 1.82;
}

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

.tarot-record__metric {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.tarot-record__metric span {
  color: var(--strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tarot-record__metric strong {
  color: var(--ink);
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  font-size: 1.08rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tarot-record__image-frame img,
.tarot-record__image-fallback {
  transform-origin: center;
  transition: transform 240ms ease;
}

.tarot-record__image-frame.is-reversed img,
.tarot-record__image-frame.is-reversed .tarot-record__image-fallback {
  transform: rotate(180deg);
}

.tarot-reading {
  display: grid;
  gap: 14px;
}

.tarot-reading__block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(255, 255, 255, 0.02);
}

.tarot-reading__block--title {
  background:
    linear-gradient(90deg, rgba(224, 192, 138, 0.08), rgba(224, 192, 138, 0) 18%),
    rgba(255, 255, 255, 0.02);
}

.tarot-reading__block h4,
.tarot-reading__block p {
  margin: 0;
}

.tarot-reading__block h4 {
  color: var(--ink);
  font-family: "SJsuqian", "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.tarot-reading__block p:last-child {
  color: var(--tarot-ink-soft);
  line-height: 1.84;
}

.tarot-result .result-summary,
.tarot-result .result-status {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.tarot-result .result-summary {
  text-align: center;
}

.tarot-record.is-exporting {
  width: 420px;
  max-width: 420px;
}

@keyframes tarot-shuffle-left {
  0%, 100% {
    transform: translateX(-50px) rotate(-10deg);
  }

  50% {
    transform: translateX(-70px) rotate(-14deg);
  }
}

@keyframes tarot-shuffle-mid {
  0%, 100% {
    transform: translateX(-12px) rotate(-3deg);
  }

  50% {
    transform: translateX(0) rotate(0deg);
  }
}

@keyframes tarot-shuffle-right {
  0%, 100% {
    transform: translateX(26px) rotate(6deg);
  }

  50% {
    transform: translateX(44px) rotate(10deg);
  }
}

@media (max-width: 980px) {
  .tarot-record__image-frame {
    max-width: 280px;
  }
}

@media (max-width: 720px) {
  .tarot-record__meta {
    grid-template-columns: 1fr;
  }

  .tarot-deck__back,
  .tarot-card-shell {
    width: min(100%, 220px);
  }

  .tarot-deck {
    min-height: 360px;
  }
}

@media (max-width: 399px) {
  .tarot-main {
    gap: 22px;
  }

  .step-track__item {
    padding: 12px 12px 12px 42px;
  }

  .step-track__item::before {
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    font-size: 0.64rem;
  }

  .step-track__label {
    font-size: 0.9rem;
  }

  .step-track__meta,
  .tarot-draw__status,
  .tarot-question-chip p:last-child {
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .tarot-question-chip {
    padding: 14px;
  }

  .tarot-deck {
    min-height: 290px;
    padding: 14px 10px 18px;
  }

  .tarot-deck__back,
  .tarot-card-shell {
    width: min(100%, 186px);
  }

  .tarot-card-face__fallback,
  .tarot-record__image-fallback {
    padding: 18px;
  }

  .tarot-card-face__fallback strong,
  .tarot-record__image-fallback strong {
    font-size: 1.04rem;
  }

  .tarot-record {
    gap: 16px;
    width: 100%;
    max-width: 100%;
    padding: 16px 14px;
  }

  .tarot-record__media {
    gap: 16px;
  }

  .tarot-record__image-frame {
    width: min(100%, 210px);
  }

  .tarot-record__card-meta h3 {
    font-size: clamp(1.54rem, 8.8vw, 1.92rem);
  }

  .tarot-record__card-meta p,
  .tarot-record__question p:last-child,
  .tarot-reading__block p:last-child {
    font-size: 0.86rem;
    line-height: 1.64;
  }

  .tarot-record__question,
  .tarot-record__metric,
  .tarot-reading__block {
    padding: 14px;
  }

  .tarot-reading__block h4 {
    font-size: clamp(1.3rem, 7vw, 1.68rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-track__item,
  .tarot-card-shell,
  .tarot-card-shell__inner,
  .tarot-deck__back {
    transition: none;
    animation: none;
  }
}
