:root {
  color-scheme: dark;
  --ink: #0b0712;
  --ink-soft: #130d1c;
  --plum: #21142e;
  --plum-raised: #2c1b3a;
  --paper: #efe3c1;
  --paper-soft: #d4c7ab;
  --gold: #b78a3b;
  --gold-bright: #d8ad5b;
  --silver: #c8c1d5;
  --rose: #8e4c62;
  --danger: #d87f86;
  --success: #85b99b;
  --line: rgba(239, 227, 193, 0.13);
  --line-strong: rgba(183, 138, 59, 0.38);
  --surface: rgba(24, 15, 34, 0.86);
  --surface-raised: rgba(38, 24, 52, 0.9);
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.32);
  --shadow-gold: 0 18px 60px rgba(183, 138, 59, 0.13);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% -20%, rgba(183, 138, 59, 0.11), transparent 34rem),
    linear-gradient(180deg, #0d0814 0%, var(--ink) 38%, #09060f 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(183, 138, 59, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  inset: 11%;
  content: "";
  border: 1px dashed rgba(239, 227, 193, 0.05);
  border-radius: inherit;
}

.ambient::after {
  inset: 27%;
}

.ambient-one {
  top: 12rem;
  right: -25rem;
}

.ambient-two {
  bottom: 8rem;
  left: -27rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 1240px);
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 7, 18, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--gold-bright);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(183, 138, 59, 0.06);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.2;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.brand small {
  margin-top: -2px;
  color: rgba(239, 227, 193, 0.52);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.header-actions,
.hero-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.text-button,
.quiet-button,
.secondary-button,
.primary-button,
.danger-button {
  min-height: 44px;
  border: 0;
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 220ms;
  transition-timing-function: var(--ease);
}

.icon-button:active,
.text-button:active,
.quiet-button:active,
.secondary-button:active,
.primary-button:active,
.danger-button:active {
  transform: scale(0.96);
}

.icon-button {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  color: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
}

.icon-button:hover {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(183, 138, 59, 0.08);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.text-button,
.quiet-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.text-button:hover,
.quiet-button:hover,
.secondary-button:hover {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(183, 138, 59, 0.08);
}

.text-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

.primary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  color: #160f0b;
  border: 1px solid #d6ad61;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9b768, #ad7b2f);
  box-shadow: 0 12px 32px rgba(183, 138, 59, 0.18), inset 0 1px rgba(255, 255, 255, 0.28);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-button:hover {
  box-shadow: 0 16px 42px rgba(183, 138, 59, 0.28), inset 0 1px rgba(255, 255, 255, 0.38);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: scale(0.96);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.primary-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

main {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: calc(100vh - 76px);
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(40px, 8vw, 120px);
  padding: 80px 0 100px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 34px;
  height: 1px;
  background: currentColor;
}

.hero h1,
.section-heading h2,
.consultation-intro h2,
.ritual-section h2,
.result-header h2,
.dialog-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero h1 {
  max-width: 750px;
  font-size: clamp(45px, 6.3vw, 86px);
}

.hero h1 em {
  color: var(--gold-bright);
  font-style: normal;
}

.hero-description {
  max-width: 610px;
  margin: 28px 0 34px;
  color: rgba(239, 227, 193, 0.66);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.9;
  text-wrap: pretty;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 30px 0 0;
  padding: 0;
  color: rgba(239, 227, 193, 0.54);
  font-size: 13px;
  list-style: none;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust-list span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.oracle-visual {
  position: relative;
  display: grid;
  min-height: 620px;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(183, 138, 59, 0.18);
  border-radius: 50%;
}

.orbit-outer {
  width: min(39vw, 510px);
  aspect-ratio: 1;
}

.orbit-inner {
  width: min(29vw, 380px);
  aspect-ratio: 1;
  border-style: dashed;
  opacity: 0.55;
  animation: orbit-rotate 34s linear infinite;
}

.orbit-outer::before,
.orbit-outer::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(239, 227, 193, 0.08);
  border-radius: 50%;
}

.orbit-outer::before {
  inset: 7%;
}

.orbit-outer::after {
  inset: 22%;
}

.orbit-outer i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 16px rgba(216, 173, 91, 0.8);
}

.orbit-outer i:nth-child(1) { top: -3px; left: calc(50% - 3px); }
.orbit-outer i:nth-child(2) { right: -3px; top: calc(50% - 3px); }
.orbit-outer i:nth-child(3) { bottom: -3px; left: calc(50% - 3px); }
.orbit-outer i:nth-child(4) { left: -3px; top: calc(50% - 3px); }

.hero-card {
  position: relative;
  z-index: 2;
  width: min(55vw, 270px);
  aspect-ratio: 0.62;
  padding: 10px;
  color: var(--gold-bright);
  border: 1px solid rgba(216, 173, 91, 0.5);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(183, 138, 59, 0.12), transparent 38%),
    #171020;
  box-shadow: 0 42px 100px rgba(0, 0, 0, 0.55), 0 0 70px rgba(183, 138, 59, 0.12);
  transform: rotate(3deg);
  animation: card-float 6s var(--ease) infinite;
}

.hero-card-frame {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  padding: 18px 12px;
  border: 1px solid rgba(216, 173, 91, 0.34);
  border-radius: 14px;
}

.hero-card-frame::before,
.hero-card-frame::after {
  position: absolute;
  width: 26px;
  height: 26px;
  content: "";
  border-color: rgba(216, 173, 91, 0.6);
}

.hero-card-frame::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.hero-card-frame::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.card-index,
.card-name {
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.mirror-symbol {
  width: 92%;
}

.mirror-symbol svg {
  width: 100%;
  stroke-width: 1.2;
}

.visual-caption {
  position: absolute;
  bottom: 5%;
  margin: 0;
  color: rgba(239, 227, 193, 0.42);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.how-it-works,
.consultation-shell,
.result-section {
  padding: 110px 0;
}

.how-it-works {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.section-heading h2,
.consultation-intro h2,
.ritual-section h2,
.result-header h2 {
  font-size: clamp(36px, 5vw, 66px);
}

.steps-grid {
  display: grid;
  margin-top: 68px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.steps-grid article {
  min-height: 250px;
  padding: 34px 32px;
  border-right: 1px solid var(--line);
}

.steps-grid article:first-child {
  border-left: 1px solid var(--line);
}

.steps-grid b {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.15em;
}

.steps-grid h3 {
  margin: 68px 0 12px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.steps-grid p {
  margin: 0;
  color: rgba(239, 227, 193, 0.52);
  line-height: 1.8;
}

.consultation-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(50px, 8vw, 120px);
}

.consultation-intro {
  position: sticky;
  top: 120px;
  align-self: start;
}

.consultation-intro > p:not(.eyebrow) {
  max-width: 390px;
  margin: 26px 0;
  color: rgba(239, 227, 193, 0.56);
}

.privacy-note {
  display: flex;
  max-width: 390px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: rgba(239, 227, 193, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
  font-size: 13px;
}

.privacy-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--gold-bright);
}

.consultation-form-wrap {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 20%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-section {
  margin: 0 0 40px;
  padding: 0;
  border: 0;
}

.form-section legend {
  width: 100%;
  margin-bottom: 24px;
  padding: 0 0 16px;
  color: var(--paper);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.form-section legend span {
  margin-right: 11px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.field-grid {
  display: grid;
  gap: 18px;
}

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

.field {
  display: grid;
  gap: 9px;
}

.field > span:first-child,
.question-field > span:first-child {
  color: rgba(239, 227, 193, 0.76);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  color: var(--paper);
  border: 1px solid rgba(239, 227, 193, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(6, 4, 10, 0.42);
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 180ms;
}

.field input,
.field select {
  min-height: 50px;
  padding: 0 14px;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(239, 227, 193, 0.27);
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: rgba(183, 138, 59, 0.36);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: var(--gold);
  background: rgba(12, 8, 17, 0.72);
  box-shadow: 0 0 0 3px rgba(183, 138, 59, 0.1);
}

.field small,
.question-field small {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(239, 227, 193, 0.38);
  font-size: 11px;
  line-height: 1.6;
}

.field small b {
  flex: 0 0 auto;
  color: rgba(239, 227, 193, 0.5);
  font-variant-numeric: tabular-nums;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 64px;
}

.password-field button {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 48px;
  min-height: 40px;
  padding: 0 8px;
  color: var(--gold-bright);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
}

.password-field button:hover {
  background: rgba(183, 138, 59, 0.08);
}

.model-row {
  display: grid;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.secondary-button {
  min-height: 50px;
  border-radius: var(--radius-sm);
}

.connection-status {
  min-height: 28px;
  margin-top: 10px;
  color: rgba(239, 227, 193, 0.5);
  font-size: 12px;
}

.connection-status.success { color: var(--success); }
.connection-status.error { color: var(--danger); }
.connection-status.loading { color: var(--gold-bright); }

.topic-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.topic-grid label {
  position: relative;
  cursor: pointer;
}

.topic-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-grid span {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: rgba(239, 227, 193, 0.54);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 13px;
  transition-property: color, border-color, background-color, transform;
  transition-duration: 180ms;
}

.topic-grid label:hover span {
  color: var(--paper);
  border-color: rgba(183, 138, 59, 0.35);
}

.topic-grid input:checked + span {
  color: #171008;
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(183, 138, 59, 0.14);
}

.topic-grid input:focus-visible + span {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.question-field {
  margin-top: 22px;
}

.switch-row,
.consent-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
}

.switch-row {
  min-height: 76px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}

.switch-row span {
  display: grid;
}

.switch-row strong {
  color: rgba(239, 227, 193, 0.78);
  font-size: 13px;
}

.switch-row small {
  color: rgba(239, 227, 193, 0.38);
  font-size: 11px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition-property: background-color, border-color;
  transition-duration: 180ms;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  content: "";
  border-radius: 50%;
  background: var(--paper-soft);
  transition: transform 180ms var(--ease);
}

.switch-row input:checked + i {
  border-color: var(--gold-bright);
  background: var(--gold);
}

.switch-row input:checked + i::after {
  background: #fff6dd;
  transform: translateX(20px);
}

.switch-row input:focus-visible + i {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.consent-row {
  justify-content: flex-start;
  color: rgba(239, 227, 193, 0.5);
  font-size: 12px;
}

.consent-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.form-error {
  min-height: 26px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
}

.submit-button {
  width: 100%;
  margin-top: 8px;
}

.ritual-section {
  min-height: 80vh;
  padding: 120px 0;
  text-align: center;
}

.ritual-section .eyebrow {
  justify-content: center;
}

.ritual-section > p:not(.eyebrow) {
  margin: 20px 0 0;
  color: rgba(239, 227, 193, 0.52);
}

.deck-stage {
  position: relative;
  width: 230px;
  height: 360px;
  margin: 70px auto 50px;
  perspective: 1200px;
}

.deck-card {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(216, 173, 91, 0.45);
  border-radius: 20px;
  background: #171020;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

.deck-card::before,
.deck-card-main span {
  position: absolute;
  inset: 10px;
  content: "";
  border: 1px solid rgba(216, 173, 91, 0.32);
  border-radius: 13px;
  background:
    radial-gradient(circle at center, transparent 0 16%, rgba(183, 138, 59, 0.12) 16.5% 17%, transparent 17.5%),
    repeating-conic-gradient(from 0deg at center, rgba(183, 138, 59, 0.18) 0 2deg, transparent 2deg 18deg);
}

.deck-card-back-3 { transform: translate(16px, 10px) rotate(6deg); opacity: 0.5; }
.deck-card-back-2 { transform: translate(-13px, 6px) rotate(-5deg); opacity: 0.7; }
.deck-card-back-1 { transform: translate(6px, 3px) rotate(2deg); opacity: 0.82; }
.deck-card-main { animation: deck-shuffle 1.5s var(--ease) infinite; }

.ritual-progress {
  width: min(360px, 76vw);
  height: 2px;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(239, 227, 193, 0.1);
}

.ritual-progress i {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--gold-bright);
  box-shadow: 0 0 16px var(--gold);
  transition: width 700ms var(--ease);
}

.result-section {
  border-top: 1px solid var(--line);
}

.result-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 42px;
}

.reading-meta span {
  padding: 7px 11px;
  color: rgba(239, 227, 193, 0.52);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.drawn-cards {
  display: grid;
  align-items: start;
  gap: clamp(12px, 2vw, 24px);
  margin-bottom: 54px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.tarot-card-wrap {
  display: grid;
  gap: 13px;
  text-align: center;
}

.tarot-card {
  position: relative;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 0.62;
  margin: 0 auto;
  color: var(--gold-bright);
  border: 1px solid rgba(216, 173, 91, 0.46);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 40%, rgba(183, 138, 59, 0.11), transparent 44%),
    #171020;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  transform-style: preserve-3d;
  animation: reveal-card 700ms var(--ease) both;
  animation-delay: var(--delay, 0ms);
}

.tarot-card.reversed .tarot-card-inner {
  transform: rotate(180deg);
}

.tarot-card-inner {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  padding: 14px 8px;
  border: 1px solid rgba(216, 173, 91, 0.28);
  border-radius: 10px;
}

.tarot-card-symbol {
  display: grid;
  width: 64%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(216, 173, 91, 0.22);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 42px);
}

.tarot-card-number,
.tarot-card-name {
  font-family: Georgia, var(--serif);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.tarot-card-wrap strong {
  color: rgba(239, 227, 193, 0.8);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.tarot-card-wrap small {
  color: rgba(239, 227, 193, 0.42);
  font-size: 11px;
}

.reading-card {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.reading-label {
  display: block;
  margin-bottom: 24px;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.summary-card {
  margin-bottom: 24px;
  border-color: rgba(183, 138, 59, 0.3);
  background:
    linear-gradient(120deg, rgba(183, 138, 59, 0.09), transparent 38%),
    var(--surface-raised);
  box-shadow: var(--shadow-gold);
}

.summary-card p,
.reading-card p {
  margin: 0 0 14px;
  color: rgba(239, 227, 193, 0.68);
  text-wrap: pretty;
}

.summary-card p {
  color: rgba(239, 227, 193, 0.86);
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.75;
}

.reading-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.reading-sidebar {
  display: grid;
  align-content: start;
  gap: 24px;
}

.compact-card {
  padding: 28px;
}

.card-readings {
  display: grid;
  gap: 22px;
}

.card-reading-item {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.card-reading-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.card-reading-item h3 {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.card-reading-item h3 span {
  color: var(--gold-bright);
}

.trend-item {
  margin-bottom: 18px;
}

.trend-item:last-child {
  margin-bottom: 0;
}

.trend-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--paper);
  font-family: var(--serif);
}

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

.advice-card ol,
.avoid-card ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 22px;
  color: rgba(239, 227, 193, 0.68);
}

.advice-card li::marker {
  color: var(--gold-bright);
  font-family: Georgia, serif;
}

.avoid-card {
  border-color: rgba(216, 127, 134, 0.2);
}

.avoid-card li::marker {
  color: var(--danger);
}

.boundary {
  margin: 28px 0 0;
  color: rgba(239, 227, 193, 0.38);
  font-size: 12px;
  text-align: center;
}

.site-footer {
  display: flex;
  width: min(100% - 32px, 1240px);
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.footer-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.site-footer > p {
  max-width: 540px;
  margin: 0;
  color: rgba(239, 227, 193, 0.35);
  font-size: 12px;
  text-align: right;
}

.history-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: min(780px, calc(100vh - 24px));
  padding: 0;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #120c1a;
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7);
}

.history-dialog::backdrop {
  background: rgba(5, 3, 8, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 12, 26, 0.94);
  backdrop-filter: blur(14px);
}

.dialog-header .eyebrow {
  margin-bottom: 6px;
}

.dialog-header h2 {
  font-size: 34px;
}

.dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.danger-button {
  color: var(--danger);
  border-color: rgba(216, 127, 134, 0.24);
}

.danger-button:hover {
  color: #fff;
  border-color: var(--danger);
  background: rgba(216, 127, 134, 0.16);
}

.history-list {
  min-height: 220px;
  max-height: 560px;
  overflow-y: auto;
  padding: 12px 28px 28px;
}

.history-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: rgba(239, 227, 193, 0.4);
  text-align: center;
}

.history-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.history-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.history-item time,
.history-item small {
  color: rgba(239, 227, 193, 0.36);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.history-item p {
  display: -webkit-box;
  margin: 12px 0;
  overflow: hidden;
  color: rgba(239, 227, 193, 0.58);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-item-actions {
  display: flex;
  gap: 8px;
}

.history-item-actions button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
}

.history-item-actions button:hover {
  color: var(--gold-bright);
  border-color: var(--line-strong);
}

.history-item-actions .delete-history:hover {
  color: var(--danger);
  border-color: rgba(216, 127, 134, 0.35);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100% - 32px));
  padding: 13px 17px;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(30, 19, 41, 0.96);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition-property: opacity, transform;
  transition-duration: 220ms;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes card-float {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50% { transform: translateY(-16px) rotate(1.5deg); }
}

@keyframes deck-shuffle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  35% { transform: translateX(-34px) rotate(-4deg); }
  70% { transform: translateX(31px) rotate(4deg); }
}

@keyframes reveal-card {
  from { opacity: 0; transform: translateY(28px) rotateY(90deg); }
  to { opacity: 1; transform: translateY(0) rotateY(0deg); }
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 70px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-description {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-actions,
  .trust-list,
  .hero-copy .eyebrow {
    justify-content: center;
  }

  .oracle-visual {
    min-height: 520px;
  }

  .orbit-outer { width: min(78vw, 470px); }
  .orbit-inner { width: min(58vw, 350px); }
  .hero-card { width: min(50vw, 250px); }

  .consultation-shell {
    grid-template-columns: 1fr;
  }

  .consultation-intro {
    position: static;
  }

  .consultation-intro > p:not(.eyebrow),
  .privacy-note {
    max-width: 630px;
  }

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

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

@media (max-width: 720px) {
  .site-header {
    width: min(100% - 24px, 1240px);
    min-height: 68px;
  }

  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .header-actions .text-button { width: 44px; padding: 0; font-size: 0; }
  .header-actions .text-button svg { width: 20px; height: 20px; }

  main,
  .site-footer {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    gap: 24px;
    padding: 58px 0 70px;
  }

  .hero h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .hero h1 br {
    display: none;
  }

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

  .hero-actions button {
    width: 100%;
  }

  .oracle-visual {
    min-height: 460px;
  }

  .hero-card { width: min(62vw, 230px); }
  .visual-caption { bottom: 1%; }

  .how-it-works,
  .consultation-shell,
  .result-section {
    padding: 78px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .steps-grid article,
  .steps-grid article:first-child {
    min-height: auto;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .steps-grid h3 {
    margin-top: 32px;
  }

  .consultation-form-wrap {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .two-columns,
  .advice-grid {
    grid-template-columns: 1fr;
  }

  .model-row {
    grid-template-columns: 1fr;
  }

  .model-row .secondary-button {
    width: 100%;
  }

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

  .switch-row {
    align-items: flex-start;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions button {
    flex: 1;
  }

  .drawn-cards {
    display: flex;
    margin-right: -12px;
    padding-right: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .tarot-card-wrap {
    min-width: 145px;
    scroll-snap-align: center;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 34px 0;
  }

  .site-footer > p {
    text-align: left;
  }

  .dialog-header,
  .dialog-footer {
    padding: 20px;
  }

  .history-list {
    padding: 8px 20px 20px;
  }

  .history-item-header {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .header-actions { gap: 6px; }
  .hero-copy .eyebrow { font-size: 9px; }
  .trust-list { gap: 8px 16px; }
  .oracle-visual { min-height: 420px; }
  .result-actions { flex-direction: column; }
  .reading-card { padding: 22px 18px; border-radius: 20px; }
}

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