:root {
  --midnight: #0b0b1e;
  --abyss: #120e26;
  --violet: #2a174d;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.38);
  --moon: #f5f5f7;
  --mist: #a6e3d7;
  --ember: #d88c9a;
  --ink: #070710;
  --panel: rgba(13, 12, 30, 0.74);
  --line: rgba(245, 245, 247, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--moon);
  background:
    radial-gradient(circle at 20% 10%, rgba(166, 227, 215, 0.08), transparent 32rem),
    radial-gradient(circle at 82% 14%, rgba(216, 140, 154, 0.08), transparent 28rem),
    linear-gradient(135deg, var(--midnight), var(--abyss) 58%, #080713);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  touch-action: manipulation;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.cosmos,
.cosmos::before,
.cosmos::after,
.sacred-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.cosmos {
  z-index: 0;
  opacity: 0.9;
  background-image:
    radial-gradient(circle, rgba(245, 245, 247, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(212, 175, 55, 0.9) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(166, 227, 215, 0.58) 0 1px, transparent 1.2px);
  background-position:
    0 0,
    42px 72px,
    90px 24px;
  background-size:
    148px 148px,
    214px 214px,
    286px 286px;
  animation: star-drift 30s linear infinite;
}

.cosmos::before {
  content: "";
  background:
    radial-gradient(circle at 50% 20%, rgba(245, 245, 247, 0.16), transparent 13rem),
    radial-gradient(circle at 35% 70%, rgba(212, 175, 55, 0.1), transparent 18rem);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.cosmos::after {
  content: "";
  background-image:
    radial-gradient(circle, rgba(245, 245, 247, 0.55) 0 1px, transparent 1.2px),
    radial-gradient(circle, rgba(212, 175, 55, 0.65) 0 1px, transparent 1.2px);
  background-position:
    24px 32px,
    80px 110px;
  background-size:
    340px 340px,
    460px 460px;
  animation: star-breathe 4.8s ease-in-out infinite alternate;
}

.sacred-lines {
  z-index: 1;
  opacity: 0.5;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(212, 175, 55, 0.08) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(212, 175, 55, 0.07) 50%, transparent 50.2%),
    repeating-conic-gradient(from 45deg at 50% 42%, transparent 0deg 42deg, rgba(212, 175, 55, 0.055) 43deg 44deg, transparent 45deg 90deg);
  mask-image: radial-gradient(circle at 50% 35%, #000 0 29rem, transparent 48rem);
  animation: sacred-pulse 5.6s ease-in-out infinite;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  color: var(--moon);
  background: transparent;
  cursor: pointer;
  letter-spacing: 0;
  text-align: left;
}

.brand-sigil {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.16);
}

.stage {
  min-height: calc(100vh - 116px);
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: clamp(32px, 7vw, 86px);
  align-items: center;
  padding: clamp(34px, 7vw, 78px) 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: rgba(212, 175, 55, 0.86);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 7.25rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin: 26px 0 0;
  color: rgba(245, 245, 247, 0.74);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.9;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 34px;
}

.mystic-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: linear-gradient(135deg, #f3da87, var(--gold) 48%, #b98b21);
  box-shadow:
    0 12px 34px rgba(212, 175, 55, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  font-weight: 700;
  letter-spacing: 0;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    filter 220ms ease;
}

.mystic-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow:
    0 16px 48px rgba(212, 175, 55, 0.27),
    0 0 24px rgba(212, 175, 55, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.mystic-button:active {
  transform: translateY(0);
}

.mystic-button.secondary {
  color: var(--moon);
  background: rgba(245, 245, 247, 0.06);
  border-color: rgba(245, 245, 247, 0.16);
  box-shadow: inset 0 1px 0 rgba(245, 245, 247, 0.08);
}

.mystic-button.secondary:hover {
  border-color: rgba(212, 175, 55, 0.44);
  box-shadow:
    0 12px 34px rgba(212, 175, 55, 0.1),
    inset 0 1px 0 rgba(245, 245, 247, 0.12);
}

.mystic-button.ghost {
  min-height: 40px;
  color: rgba(245, 245, 247, 0.82);
  background: transparent;
  border-color: rgba(245, 245, 247, 0.13);
  box-shadow: none;
}

.mystic-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.hero-oracle {
  position: relative;
  min-height: 520px;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
}

.hero-oracle::before {
  content: "";
  position: absolute;
  width: min(88vw, 430px);
  aspect-ratio: 1;
  border: 1px solid rgba(212, 175, 55, 0.18);
  transform: rotate(45deg);
  animation: sacred-pulse 5s ease-in-out infinite;
}

.hero-oracle::after {
  content: "";
  position: absolute;
  width: min(78vw, 330px);
  aspect-ratio: 1;
  border: 1px solid rgba(245, 245, 247, 0.1);
  border-radius: 50%;
  animation: slow-spin 38s linear infinite;
}

.floating-card {
  position: absolute;
  width: clamp(118px, 17vw, 168px);
  aspect-ratio: 0.66;
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.42));
}

.floating-card:nth-child(1) {
  transform: translate(-74px, 12px) rotate(-12deg);
  animation: float-card-a 4.8s ease-in-out infinite;
}

.floating-card:nth-child(2) {
  transform: translate(58px, -30px) rotate(9deg);
  animation: float-card-b 5.4s ease-in-out infinite;
}

.floating-card:nth-child(3) {
  transform: translate(2px, 78px) rotate(0deg);
  animation: float-card-c 6s ease-in-out infinite;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.mode-card,
.result-panel,
.ritual-panel,
.question-form {
  border: 1px solid rgba(245, 245, 247, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(245, 245, 247, 0.075), rgba(245, 245, 247, 0.025)),
    rgba(10, 10, 24, 0.52);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(245, 245, 247, 0.08);
  backdrop-filter: blur(18px);
}

.mode-card {
  min-height: 256px;
  padding: 24px;
  text-align: left;
  transition:
    transform 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow:
    0 28px 78px rgba(0, 0, 0, 0.34),
    0 0 38px rgba(212, 175, 55, 0.12),
    inset 0 1px 0 rgba(245, 245, 247, 0.11);
}

.mode-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.07);
}

.screen-heading {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.screen-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 500;
  line-height: 1.03;
}

.screen-heading p {
  max-width: 650px;
  margin: 16px auto 0;
  color: rgba(245, 245, 247, 0.68);
  line-height: 1.8;
}

.question-page {
  padding: clamp(36px, 7vw, 72px) 0;
}

.question-form {
  display: grid;
  width: min(780px, 100%);
  gap: 22px;
  margin: 30px auto 0;
  padding: clamp(20px, 4vw, 32px);
}

.question-mode-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(245, 245, 247, 0.1);
}

.question-mode-summary .mode-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.question-mode-summary > span:last-child {
  display: grid;
  gap: 3px;
}

.question-mode-summary strong {
  color: var(--moon);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.question-mode-summary small {
  color: rgba(212, 175, 55, 0.68);
}

.guided-field {
  display: grid;
  gap: 10px;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(245, 245, 247, 0.86);
  font-size: 0.9rem;
}

.field-heading b {
  margin-right: 6px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.field-heading small {
  color: rgba(245, 245, 247, 0.36);
  font-size: 0.72rem;
}

.guided-field input,
.guided-field textarea {
  width: 100%;
  border: 1px solid rgba(245, 245, 247, 0.15);
  border-radius: 8px;
  outline: 0;
  color: var(--moon);
  background: rgba(7, 7, 16, 0.68);
  box-shadow: inset 0 1px 0 rgba(245, 245, 247, 0.04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.guided-field input {
  min-height: 52px;
  padding: 0 15px;
}

.guided-field textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.75;
}

.guided-field input::placeholder,
.guided-field textarea::placeholder {
  color: rgba(245, 245, 247, 0.34);
}

.guided-field input:focus,
.guided-field textarea:focus {
  border-color: rgba(212, 175, 55, 0.58);
  background: rgba(7, 7, 16, 0.86);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.08),
    0 0 26px rgba(212, 175, 55, 0.06);
}

.question-intention {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: rgba(166, 227, 215, 0.58);
  font-size: 0.78rem;
  line-height: 1.6;
}

.question-intention svg {
  width: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.question-submit {
  min-height: 50px;
  justify-self: end;
}

.ritual-panel {
  margin-top: 28px;
  padding: clamp(18px, 3vw, 28px);
}

.spread-area {
  display: grid;
  grid-template-columns: repeat(var(--slot-count), minmax(0, 1fr));
  gap: clamp(12px, 3vw, 24px);
  width: min(760px, 100%);
  margin: 0 auto 28px;
  align-items: start;
}

.oracle-slot {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 0;
}

.slot-card {
  width: min(clamp(116px, 21vw, 172px), 100%);
  aspect-ratio: 0.66;
  border: 1px dashed rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: rgba(245, 245, 247, 0.42);
  background: rgba(245, 245, 247, 0.035);
}

.slot-label {
  min-height: 24px;
  color: rgba(212, 175, 55, 0.82);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.deck-wrap {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.deck-fan {
  position: relative;
  width: min(920px, 100%);
  height: 242px;
}

.deck-card {
  --deck-x: var(--desktop-x);
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: clamp(74px, 10vw, 104px);
  aspect-ratio: 0.66;
  border: 0;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  transform:
    translateX(calc(-50% + var(--deck-x)))
    translateY(var(--y))
    rotate(var(--rot));
  transform-origin: 50% 120%;
  transition:
    transform 260ms ease,
    filter 260ms ease,
    opacity 220ms ease;
  will-change: transform, opacity;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}

.deck-card.is-shuffling {
  animation: shuffle-in 950ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay);
}

.deck-card:hover,
.deck-card:focus-visible {
  z-index: 20;
  outline: 0;
  transform:
    translateX(calc(-50% + var(--deck-x)))
    translateY(calc(var(--y) - 18px))
    rotate(var(--rot))
    scale(1.055);
  filter:
    drop-shadow(0 20px 28px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 16px rgba(212, 175, 55, 0.42));
}

.deck-card.is-departing {
  pointer-events: none;
  opacity: 0.24;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.2));
}

.deck-card.picked {
  pointer-events: none;
  opacity: 0;
}

.moving-card {
  z-index: 999;
  pointer-events: none;
  transform-origin: top left;
}

.tarot-card,
.oracle-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  perspective: 1100px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.oracle-card.is-revealed .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.46);
  border-radius: 8px;
  backface-visibility: hidden;
  background: #0b0b1e;
}

.card-back {
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px rgba(245, 245, 247, 0.08),
    inset 0 0 46px rgba(212, 175, 55, 0.12);
  background:
    linear-gradient(155deg, rgba(212, 175, 55, 0.1), transparent 26%),
    radial-gradient(circle at 50% 38%, rgba(212, 175, 55, 0.16), transparent 42%),
    linear-gradient(160deg, #171235, #080715 64%, #171126);
}

.card-back::before,
.card-back::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 6px;
}

.card-back::after {
  inset: 15%;
  border-color: rgba(245, 245, 247, 0.12);
  transform: rotate(45deg);
}

.back-sigil {
  position: relative;
  z-index: 1;
  width: 72%;
  color: var(--gold);
  filter: drop-shadow(0 0 9px rgba(212, 175, 55, 0.28));
}

.back-sigil line,
.back-sigil circle,
.back-sigil path,
.back-sigil polygon {
  vector-effect: non-scaling-stroke;
}

.card-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #f8f1db, #ddcfa6);
}

.card-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-front.reversed img {
  transform: rotate(180deg);
}

.oracle-card {
  filter:
    drop-shadow(0 24px 30px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 18px rgba(212, 175, 55, 0.13));
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: min(920px, 100%);
  margin: 28px auto 0;
}

.reading-spread {
  --slot-count: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.reading-spread.three {
  --slot-count: 3;
}

.result-panel {
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 3vw, 28px);
  overflow-wrap: anywhere;
}

.reading-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  font-weight: 500;
}

.reading-question {
  display: grid;
  gap: 7px;
  margin-top: 17px;
  border-left: 2px solid rgba(212, 175, 55, 0.48);
  padding: 3px 0 3px 13px;
}

.reading-question > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.72rem;
}

.reading-question > span svg {
  width: 15px;
}

.reading-question strong {
  color: rgba(245, 245, 247, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
}

.reading-question p {
  margin: 0;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.8rem;
  line-height: 1.65;
}

.reading-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.reading-meta-item {
  border-top: 1px solid rgba(245, 245, 247, 0.1);
  padding-top: 12px;
}

.reading-meta-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: rgba(245, 245, 247, 0.74);
  font-size: 0.82rem;
}

.reading-meta-head strong {
  min-width: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: right;
}

.reading-meta-body {
  margin-top: 6px;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.84rem;
  line-height: 1.6;
}

.keyword-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.keyword-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 999px;
  padding: 3px 9px;
  color: rgba(245, 245, 247, 0.78);
  background: rgba(212, 175, 55, 0.06);
  font-size: 0.76rem;
  line-height: 1;
  text-align: center;
}

.oracle-text {
  min-height: 320px;
  margin-top: 22px;
  color: rgba(245, 245, 247, 0.82);
  font-size: 0.96rem;
  line-height: 1.82;
}

.ai-reading-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: rgba(245, 245, 247, 0.5);
  font-size: 0.78rem;
}

.ai-status-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
}

.ai-status-mark svg {
  width: 13px;
}

.ai-reading-status[data-status="loading"] .ai-status-mark {
  animation: ai-status-pulse 1.4s ease-in-out infinite;
}

.ai-reading-status[data-status="complete"] {
  color: rgba(166, 227, 215, 0.7);
}

.ai-reading-status[data-status="error"] {
  color: rgba(216, 140, 154, 0.8);
}

.oracle-text h3 {
  margin: 30px 0 13px;
  border-top: 1px solid rgba(212, 175, 55, 0.14);
  padding-top: 18px;
  color: var(--gold);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.55;
}

.oracle-text h3:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.oracle-text p {
  margin: 0 0 12px;
  color: rgba(245, 245, 247, 0.79);
}

.oracle-text strong {
  color: rgba(245, 245, 247, 0.96);
  font-weight: 650;
}

.oracle-text em {
  color: rgba(245, 245, 247, 0.9);
  font-style: normal;
}

.oracle-text code {
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
  color: rgba(245, 245, 247, 0.9);
  background: rgba(212, 175, 55, 0.07);
  font-family: inherit;
}

.reading-list {
  display: grid;
  gap: 11px;
  margin: 4px 0 18px;
  padding: 0;
  list-style: none;
}

.reading-list li {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: rgba(245, 245, 247, 0.79);
}

.reading-list li::before {
  content: "";
  position: absolute;
  top: 0.76em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.28);
}

.reading-list li.reading-do,
.reading-list li.reading-dont,
.oracle-text p.reading-do,
.oracle-text p.reading-dont {
  border-left: 2px solid rgba(166, 227, 215, 0.5);
  padding: 9px 12px;
  background: rgba(166, 227, 215, 0.045);
}

.reading-list li.reading-dont,
.oracle-text p.reading-dont {
  border-left-color: rgba(216, 140, 154, 0.58);
  background: rgba(216, 140, 154, 0.045);
}

.reading-do strong {
  color: rgba(166, 227, 215, 0.92);
}

.reading-dont strong {
  color: rgba(235, 163, 174, 0.94);
}

.reading-list li.reading-do::before,
.reading-list li.reading-dont::before {
  display: none;
}

.oracle-text::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.08em;
  margin-left: 3px;
  vertical-align: -0.17em;
  background: var(--gold);
  animation: cursor-blink 850ms steps(2, start) infinite;
}

.is-typed .oracle-text::after {
  display: none;
}

.mini-note {
  color: rgba(245, 245, 247, 0.56);
  font-size: 0.84rem;
  line-height: 1.7;
}

@media (min-width: 1280px) {
  .result-grid {
    grid-template-columns: minmax(520px, 0.95fr) minmax(420px, 1.05fr);
    width: min(1180px, 100%);
  }
}

.catalog-page {
  align-self: start;
  padding: clamp(44px, 7vw, 82px) 0;
}

.catalog-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(245, 245, 247, 0.12);
}

.catalog-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.catalog-title-row h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 500;
  line-height: 1;
}

.catalog-title-row p {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(245, 245, 247, 0.66);
  line-height: 1.8;
}

.catalog-total {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.78rem;
}

.catalog-total strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.6rem;
  font-weight: 500;
  line-height: 0.9;
}

.catalog-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(230px, 340px) 1fr;
  gap: 16px;
  padding: 16px 0;
  background: linear-gradient(180deg, rgba(11, 11, 30, 0.98) 76%, rgba(11, 11, 30, 0));
  backdrop-filter: blur(14px);
}

.catalog-search {
  position: relative;
  display: flex;
  align-items: center;
}

.catalog-search svg {
  position: absolute;
  left: 14px;
  width: 18px;
  color: rgba(212, 175, 55, 0.7);
  pointer-events: none;
}

.catalog-search input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(245, 245, 247, 0.15);
  border-radius: 8px;
  outline: 0;
  padding: 0 42px;
  color: var(--moon);
  background: rgba(7, 7, 16, 0.82);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.catalog-search input::placeholder {
  color: rgba(245, 245, 247, 0.38);
}

.catalog-search input:focus {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

.catalog-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.catalog-tabs::-webkit-scrollbar {
  display: none;
}

.catalog-tab {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  color: rgba(245, 245, 247, 0.6);
  background: transparent;
  cursor: pointer;
  font-size: 0.84rem;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.catalog-tab svg {
  width: 16px;
}

.catalog-tab:hover {
  color: var(--moon);
  background: rgba(245, 245, 247, 0.05);
}

.catalog-tab.active {
  border-color: rgba(212, 175, 55, 0.34);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.09);
}

.catalog-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.78rem;
}

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

.catalog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 245, 247, 0.12);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(245, 245, 247, 0.07), rgba(245, 245, 247, 0.018)),
    rgba(9, 9, 22, 0.7);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.23),
    inset 0 1px 0 rgba(245, 245, 247, 0.06);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.3),
    0 0 28px rgba(212, 175, 55, 0.07);
}

.catalog-card-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.catalog-card-art {
  display: block;
  width: 88px;
  aspect-ratio: 0.66;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.catalog-card-identity {
  min-width: 0;
}

.catalog-number {
  display: block;
  color: rgba(212, 175, 55, 0.75);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
}

.catalog-card-identity h2 {
  margin: 7px 0 2px;
  color: var(--moon);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
}

.catalog-card-identity p {
  min-height: 20px;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  color: rgba(245, 245, 247, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
}

.catalog-arcana,
.catalog-energy {
  display: block;
  overflow-wrap: anywhere;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.74rem;
  line-height: 1.55;
}

.catalog-arcana {
  color: rgba(166, 227, 215, 0.74);
}

.catalog-keywords {
  min-height: 50px;
  margin-top: 16px;
}

.catalog-meanings {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 245, 247, 0.1);
}

.catalog-meanings > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.meaning-label {
  padding-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
}

.meaning-label.upright {
  color: var(--mist);
}

.meaning-label.reversed {
  color: var(--ember);
}

.catalog-meanings p {
  margin: 0;
  color: rgba(245, 245, 247, 0.69);
  font-size: 0.82rem;
  line-height: 1.72;
}

.catalog-details {
  margin-top: 16px;
  border-top: 1px solid rgba(245, 245, 247, 0.1);
}

.catalog-details summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(212, 175, 55, 0.78);
  cursor: pointer;
  font-size: 0.8rem;
  list-style: none;
}

.catalog-details summary::-webkit-details-marker {
  display: none;
}

.catalog-details summary svg {
  width: 16px;
  transition: transform 200ms ease;
}

.catalog-details[open] summary svg {
  transform: rotate(180deg);
}

.catalog-detail-content {
  display: grid;
  gap: 11px;
  padding: 2px 0 6px;
}

.catalog-detail-content p {
  margin: 0;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.8rem;
  line-height: 1.7;
}

.catalog-detail-content strong {
  display: block;
  margin-bottom: 2px;
  color: rgba(245, 245, 247, 0.84);
  font-weight: 600;
}

.catalog-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(245, 245, 247, 0.15);
  border-radius: 8px;
  color: rgba(245, 245, 247, 0.45);
  text-align: center;
}

.catalog-empty svg {
  width: 28px;
  height: 28px;
  color: rgba(212, 175, 55, 0.62);
}

.catalog-empty strong {
  color: rgba(245, 245, 247, 0.82);
}

.catalog-empty span {
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(340px, calc(100vw - 36px));
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--moon);
  background: rgba(8, 8, 19, 0.86);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  animation: toast-rise 260ms ease both;
}

@keyframes star-drift {
  from {
    background-position:
      0 0,
      42px 72px,
      90px 24px;
  }
  to {
    background-position:
      148px 148px,
      256px 286px,
      376px 310px;
  }
}

@keyframes star-breathe {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 0.8;
  }
}

@keyframes sacred-pulse {
  0%,
  100% {
    opacity: 0.34;
  }
  50% {
    opacity: 0.68;
  }
}

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

@keyframes float-card-a {
  50% {
    transform: translate(-78px, -8px) rotate(-8deg);
  }
}

@keyframes float-card-b {
  50% {
    transform: translate(64px, -48px) rotate(13deg);
  }
}

@keyframes float-card-c {
  50% {
    transform: translate(4px, 58px) rotate(-3deg);
  }
}

@keyframes shuffle-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-16px) rotate(0deg) scale(0.9);
  }
  46% {
    opacity: 1;
    transform: translateX(calc(-50% + var(--shuffle-x))) translateY(-42px) rotate(var(--shuffle-rot)) scale(1.04);
  }
  100% {
    opacity: 1;
    transform:
      translateX(calc(-50% + var(--deck-x)))
      translateY(var(--y))
      rotate(var(--rot));
  }
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

@keyframes ai-status-pulse {
  50% {
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.28);
    transform: rotate(16deg) scale(1.06);
  }
}

@keyframes toast-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero-oracle {
    min-height: 410px;
    order: -1;
  }

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

  .result-grid {
    gap: 18px;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-tabs {
    justify-content: flex-start;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-spread {
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .stage {
    min-height: calc(100vh - 86px);
  }

  .hero-title {
    font-size: clamp(2.75rem, 17vw, 4.7rem);
  }

  .hero-copy {
    line-height: 1.72;
  }

  .hero-oracle {
    min-height: 330px;
  }

  .catalog-page {
    padding: 38px 0;
  }

  .catalog-title-row {
    align-items: start;
  }

  .catalog-total {
    display: none;
  }

  .catalog-toolbar {
    margin: 0 -11px;
    padding: 14px 11px 18px;
  }

  .catalog-result-bar span:last-child {
    display: none;
  }

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

  .catalog-card {
    padding: 16px;
  }

  .catalog-card-head {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .catalog-card-art {
    width: 82px;
  }

  .floating-card {
    width: 112px;
  }

  .mode-card {
    min-height: 220px;
    padding: 20px;
  }

  .question-page {
    padding: 32px 0;
  }

  .question-form {
    gap: 19px;
    padding: 18px;
  }

  .question-submit {
    width: 100%;
  }

  .spread-area {
    gap: 10px;
  }

  .slot-card {
    width: min(clamp(86px, 29vw, 124px), 100%);
  }

  .deck-wrap {
    min-height: 230px;
  }

  .deck-fan {
    height: 222px;
  }

  .deck-card {
    --deck-x: var(--mobile-x);
    width: clamp(58px, 16vw, 76px);
    bottom: 28px;
  }

  .reading-spread.three {
    gap: 7px;
  }

  .reading-spread.three .slot-label {
    font-size: 0.72rem;
  }

  .action-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mystic-button {
    width: 100%;
  }
}

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