:root {
  --bg: #0e0b12;
  --card-dark: #17121f;
  --card-soft: #22182a;
  --gold: #c9a45c;
  --gold-soft: rgba(201, 164, 92, 0.2);
  --beige: #f2e7d0;
  --muted: #a99ab0;
  --purple: #3a263f;
  --line: rgba(242, 231, 208, 0.14);
  --danger: #d9907d;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(58, 38, 63, 0.62), transparent 34rem),
    radial-gradient(circle at 82% 8%, rgba(201, 164, 92, 0.12), transparent 28rem),
    linear-gradient(180deg, #0e0b12, #120d18 44%, #0e0b12);
  color: var(--beige);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 11, 18, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--beige);
  font-weight: 780;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(201, 164, 92, 0.45);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(201, 164, 92, 0.18), rgba(58, 38, 63, 0.36));
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0;
}

.site-header nav a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.hero,
.form-shell,
.result-shell,
.draw-shell,
.message-shell {
  padding: clamp(44px, 7vw, 92px) clamp(20px, 5vw, 72px);
}

.draw-shell {
  padding-top: clamp(28px, 5vw, 58px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: center;
  min-height: calc(100vh - 82px);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  color: var(--beige);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  margin-bottom: 24px;
}

.lead {
  color: var(--muted);
  max-width: 640px;
  font-size: 1.08rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 820;
  padding: 0 22px;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-action {
  border: 1px solid rgba(201, 164, 92, 0.58);
  background: linear-gradient(135deg, #c9a45c, #8d6635);
  color: #120d18;
}

.secondary-action {
  border: 1px solid rgba(201, 164, 92, 0.44);
  background: rgba(23, 18, 31, 0.86);
  color: var(--beige);
}

.secondary-action:disabled {
  cursor: progress;
  opacity: 0.62;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.hero-panel {
  min-height: 500px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  border-left: 1px solid var(--line);
}

.mini-card,
.drawn-card {
  background:
    linear-gradient(135deg, rgba(201, 164, 92, 0.18), transparent 44%),
    linear-gradient(180deg, #1b1424, #100c16);
  border: 1px solid rgba(201, 164, 92, 0.2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.mini-card {
  width: min(260px, 72vw);
  aspect-ratio: 3 / 4.2;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  animation: floatCard 5.5s ease-in-out infinite;
}

.mini-card.offset {
  transform: translateX(42px);
  animation-delay: -1.4s;
}

.process {
  padding: 24px clamp(20px, 5vw, 72px) 72px;
}

.process h2,
.prompt-preview h2 {
  font-size: 1.35rem;
}

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

.steps article {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.steps span {
  color: var(--gold);
  font-weight: 850;
}

.steps p,
.site-footer,
.draw-toolbar p {
  color: var(--muted);
}

.form-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 5vw, 80px);
}

.message-shell {
  min-height: calc(100vh - 170px);
}

.order-note {
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(201, 164, 92, 0.28);
  border-radius: 8px;
  background: rgba(23, 18, 31, 0.72);
}

.order-note span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 840;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-note strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.order-note p {
  color: var(--muted);
  margin-bottom: 0;
}

.reading-form {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 18, 31, 0.86);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
}

label {
  display: grid;
  gap: 8px;
  color: var(--beige);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(242, 231, 208, 0.16);
  border-radius: 8px;
  background: rgba(14, 11, 18, 0.82);
  color: var(--beige);
  font: inherit;
  padding: 13px 14px;
}

textarea {
  resize: vertical;
}

.error {
  border-left: 3px solid var(--danger);
  background: rgba(217, 144, 125, 0.12);
  color: #ffd9d1;
  padding: 12px 14px;
}

.draw-shell {
  min-height: calc(100vh - 82px);
}

.draw-intro {
  max-width: 1040px;
  margin: 0 auto;
}

.draw-shell h1 {
  max-width: 720px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  margin-bottom: 14px;
}

.draw-shell .lead {
  font-size: 1rem;
}

.draw-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  margin: auto 0 0;
  text-align: center;
}

.draw-toolbar p {
  margin: 0;
  font-weight: 760;
  min-height: 24px;
}

.shuffle-card-button {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: min(100%, 360px);
  min-height: 88px;
  border: 1px solid rgba(201, 164, 92, 0.44);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 50%, rgba(201, 164, 92, 0.22), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(242, 231, 208, 0.1), transparent 28%),
    linear-gradient(135deg, rgba(23, 18, 31, 0.98), rgba(58, 38, 63, 0.66));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  color: var(--beige);
  cursor: pointer;
  font: inherit;
  padding: 13px 24px 13px 16px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.shuffle-card-button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201, 164, 92, 0.22);
  border-radius: 7px;
  pointer-events: none;
}

.shuffle-card-button::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 15px;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 164, 92, 0.7), transparent);
  pointer-events: none;
}

.shuffle-card-button:hover {
  border-color: rgba(201, 164, 92, 0.72);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.34), 0 0 28px rgba(201, 164, 92, 0.12);
  transform: translateY(-2px);
}

.shuffle-card-button:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.shuffle-button-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 164, 92, 0.56);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(201, 164, 92, 0.24), transparent 58%),
    rgba(14, 11, 18, 0.52);
  box-shadow: inset 0 0 18px rgba(201, 164, 92, 0.12), 0 0 26px rgba(201, 164, 92, 0.1);
}

.shuffle-button-sigil::before,
.shuffle-button-sigil::after,
.shuffle-button-sigil span {
  content: "";
  position: absolute;
  border: 1px solid rgba(201, 164, 92, 0.62);
  border-radius: 50%;
}

.shuffle-button-sigil::before {
  width: 30px;
  height: 30px;
}

.shuffle-button-sigil::after {
  width: 14px;
  height: 14px;
  background: rgba(201, 164, 92, 0.42);
  box-shadow: 0 0 18px rgba(201, 164, 92, 0.34);
}

.shuffle-button-sigil span {
  width: 42px;
  height: 42px;
  border-left-color: transparent;
  border-right-color: transparent;
}

.shuffle-button-copy {
  display: grid;
  gap: 3px;
}

.shuffle-button-kicker {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shuffle-button-title {
  color: var(--beige);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.28rem, 2.2vw, 1.68rem);
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(201, 164, 92, 0.22);
}

.draw-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 520px) minmax(280px, 360px);
  align-items: stretch;
  justify-content: center;
  gap: clamp(28px, 5vw, 74px);
  max-width: 1040px;
  margin: 22px auto 0;
}

.deck-area {
  display: grid;
  align-content: start;
  justify-items: start;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(98px, 120px));
  gap: 12px;
  align-items: stretch;
  justify-content: start;
  max-width: 400px;
  margin: 0;
}

.deck-grid.is-animating {
  display: block;
  position: relative;
}

.tarot-card {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 2.75 / 4.2;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transform: translate3d(0, 0, 0);
  animation: breatheCard 4.8s ease-in-out infinite;
  transition: transform 260ms ease, filter 260ms ease;
  will-change: transform;
}

.tarot-card:nth-child(2n) {
  animation-delay: -0.8s;
}

.tarot-card:nth-child(3n) {
  animation-delay: -1.6s;
}

.tarot-card:hover {
  transform: translateY(-8px);
}

.deck-grid.is-stacking .tarot-card {
  animation: none;
}

.deck-grid.is-cutting .tarot-card {
  animation: none;
  z-index: 2;
}

.deck-grid.is-dealing .tarot-card {
  animation: none;
}

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  border: 1px solid rgba(201, 164, 92, 0.24);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.card-back {
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 164, 92, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(58, 38, 63, 0.92), rgba(23, 18, 31, 0.98));
  z-index: 2;
  opacity: 1;
  transform: scale(1);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-back-image {
  position: absolute;
  inset: 9%;
  display: grid;
  place-items: center;
}

.card-back-generated {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.card-back-generated ~ .card-back-image {
  opacity: 0;
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(201, 164, 92, 0.42);
  border-radius: 8px;
}

.card-back::after {
  content: "";
  position: absolute;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 164, 92, 0.44);
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(201, 164, 92, 0.24);
}

.back-moon {
  position: absolute;
  top: 5%;
  width: 34%;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 164, 92, 0.42);
  border-radius: 50%;
  box-shadow: inset -12px 0 0 rgba(201, 164, 92, 0.13);
}

.back-star {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  opacity: 0.7;
}

.back-star-a {
  left: 18%;
  top: 38%;
}

.back-star-b {
  right: 18%;
  bottom: 32%;
  scale: 0.76;
}

.back-mark {
  z-index: 1;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
}

.back-line {
  position: absolute;
  bottom: 18%;
  width: 44%;
  height: 1px;
  background: rgba(201, 164, 92, 0.52);
}

.card-front {
  gap: 10px;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 164, 92, 0.14), transparent 34%),
    linear-gradient(180deg, #21172b, #100c16);
  color: var(--beige);
  text-align: center;
  z-index: 3;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-front-generated {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.card-front-generated ~ .card-art {
  opacity: 0;
}

.card-front-generated ~ .card-number,
.card-front-generated ~ strong {
  z-index: 4;
}

.card-front-generated ~ .card-number {
  align-self: start;
  justify-self: start;
  border: 1px solid rgba(201, 164, 92, 0.48);
  border-radius: 999px;
  background: rgba(14, 11, 18, 0.72);
  padding: 3px 8px;
}

.card-front-generated ~ strong {
  align-self: end;
  max-width: 92%;
  border: 1px solid rgba(201, 164, 92, 0.28);
  border-radius: 8px;
  background: rgba(14, 11, 18, 0.76);
  padding: 7px 9px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

.card-front::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(201, 164, 92, 0.32);
  border-radius: 8px;
}

.card-front strong {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.6vw, 1.45rem);
  font-weight: 500;
}

.card-front span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: clamp(0.62rem, 1vw, 0.78rem);
}

.card-number {
  color: var(--beige) !important;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(72%, 92px);
  aspect-ratio: 1;
  margin: 2px 0 0;
}

.art-orbit,
.art-core,
.art-line {
  position: absolute;
  display: block;
}

.art-orbit {
  inset: 8%;
  border: 1px solid rgba(201, 164, 92, 0.58);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(201, 164, 92, 0.14);
}

.art-core {
  width: 38%;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 164, 92, 0.8);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 164, 92, 0.42), transparent 68%);
}

.art-line {
  bottom: 18%;
  width: 70%;
  height: 1px;
  background: rgba(201, 164, 92, 0.62);
}

.card-art-fool .art-core {
  translate: -18% -18%;
}

.card-art-magician .art-orbit {
  border-radius: 42% 58% 42% 58%;
  rotate: 45deg;
}

.card-art-high-priestess .art-core {
  width: 18%;
  height: 78%;
  border-radius: 99px;
}

.card-art-empress .art-core {
  border-radius: 45% 45% 52% 52%;
  box-shadow: 0 18px 0 rgba(201, 164, 92, 0.18);
}

.card-art-emperor .art-orbit {
  border-radius: 8px;
  rotate: 45deg;
}

.card-art-hierophant .art-line {
  height: 60%;
  width: 1px;
  bottom: 18%;
}

.card-art-lovers .art-core {
  box-shadow: -20px 12px 0 rgba(201, 164, 92, 0.2), 20px 12px 0 rgba(201, 164, 92, 0.2);
}

.card-art-chariot .art-line {
  bottom: 28%;
  height: 24%;
  width: 66%;
  border: 1px solid rgba(201, 164, 92, 0.58);
  background: transparent;
  border-radius: 0 0 99px 99px;
}

.card-art-strength .art-orbit {
  border-radius: 50%;
  box-shadow: -14px 0 0 rgba(201, 164, 92, 0.12), 14px 0 0 rgba(201, 164, 92, 0.12);
}

.card-art-hermit .art-core {
  border-radius: 8px 8px 50% 50%;
}

.card-art-wheel-of-fortune .art-orbit::after {
  content: "";
  position: absolute;
  inset: 30%;
  border: 1px solid rgba(201, 164, 92, 0.5);
  border-radius: 50%;
}

.card-art-justice .art-line {
  width: 1px;
  height: 76%;
  bottom: 12%;
}

.card-art-justice .art-core {
  border-radius: 4px;
  rotate: 45deg;
}

.card-art-hanged-man {
  rotate: 180deg;
}

.card-art-death .art-core {
  width: 58%;
  border-radius: 50% 50% 8px 8px;
}

.card-art-temperance .art-core {
  border-radius: 8px;
  rotate: 45deg;
  box-shadow: 22px 0 0 rgba(201, 164, 92, 0.16), -22px 0 0 rgba(201, 164, 92, 0.16);
}

.card-art-devil .art-core {
  border-radius: 50% 50% 14% 14%;
  box-shadow: -18px -12px 0 rgba(201, 164, 92, 0.14), 18px -12px 0 rgba(201, 164, 92, 0.14);
}

.card-art-tower .art-core {
  height: 68%;
  width: 28%;
  border-radius: 4px;
  rotate: 8deg;
}

.card-art-star .art-core {
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
  border: 0;
  border-radius: 0;
}

.card-art-moon .art-core {
  box-shadow: inset -18px 0 0 rgba(14, 11, 18, 0.92);
}

.card-art-sun .art-core {
  box-shadow: 0 0 0 12px rgba(201, 164, 92, 0.12), 0 0 30px rgba(201, 164, 92, 0.28);
}

.card-art-judgement .art-line {
  width: 48%;
  height: 26%;
  border: 1px solid rgba(201, 164, 92, 0.6);
  border-radius: 999px 999px 8px 8px;
  background: transparent;
}

.card-art-world .art-orbit {
  border-style: double;
  border-width: 3px;
}

.tarot-card.is-selected {
  filter: drop-shadow(0 0 18px rgba(201, 164, 92, 0.58));
  transform: translateY(-14px);
}

.tarot-card.is-selected .card-face {
  border-color: rgba(201, 164, 92, 0.72);
}

.tarot-card.is-selected .card-back {
  opacity: 0;
  transform: scale(0.96);
}

.tarot-card.is-selected .card-front {
  opacity: 1;
  transform: scale(1);
}

.reading-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.positions-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}

.position-slot {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 18, 31, 0.62);
  padding: 13px 14px;
  transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.position-slot.is-filled {
  border-color: rgba(201, 164, 92, 0.46);
  background:
    linear-gradient(135deg, rgba(201, 164, 92, 0.1), transparent 44%),
    rgba(23, 18, 31, 0.82);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
}

.positions-strip span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.positions-strip p {
  margin: 8px 0 0;
  color: var(--beige);
  font-weight: 720;
}

.position-slot .slot-card-name {
  color: var(--beige);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.12;
  margin-top: 0;
}

.position-slot .slot-card-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 520;
  margin-top: 6px;
}

.slot-result {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.slot-card-preview {
  width: 54px;
  aspect-ratio: 2.75 / 4.2;
  border: 1px solid rgba(201, 164, 92, 0.38);
  border-radius: 5px;
  background: rgba(14, 11, 18, 0.58);
  object-fit: cover;
}

.position-slot:not(.is-filled) .slot-result {
  display: none;
}

.position-slot.is-filled .position-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.preparing {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  background: rgba(14, 11, 18, 0.88);
  text-align: center;
  padding: 24px;
}

.preparing[hidden] {
  display: none;
}

.preparing-orbit {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(201, 164, 92, 0.22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.preparing h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
}

.preparing p {
  color: var(--muted);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  max-width: 1120px;
  margin: 0 auto;
}

.result-hero h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.delivery-card,
.result-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 164, 92, 0.09), transparent 42%),
    rgba(23, 18, 31, 0.76);
}

.delivery-card {
  padding: 20px;
}

.delivery-card span,
.result-card span {
  color: var(--gold);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-card strong {
  color: var(--beige);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 500;
  margin-top: 8px;
}

.delivery-card p,
.result-summary p,
.result-card p {
  color: var(--muted);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  max-width: 1120px;
  margin: 40px auto 0;
}

.result-cards {
  display: grid;
  gap: 16px;
}

.result-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(201, 164, 92, 0.2);
  border-radius: 8px;
  background: rgba(23, 18, 31, 0.62);
  padding: 14px;
}

.result-card img {
  width: 112px;
  aspect-ratio: 2.75 / 4.2;
  border: 1px solid rgba(201, 164, 92, 0.38);
  border-radius: 6px;
  object-fit: cover;
}

.result-card h2,
.result-summary h2 {
  color: var(--beige);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.result-card h2 {
  font-size: 1.8rem;
  margin: 8px 0 8px;
}

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

.result-summary {
  padding: 22px;
}

.result-summary h2 {
  font-size: 1.6rem;
}

.result-summary ol {
  color: var(--beige);
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
  padding-left: 20px;
}

.reading-countdown {
  border: 1px solid rgba(201, 164, 92, 0.24);
  border-radius: 8px;
  background: rgba(14, 11, 18, 0.46);
  margin: 18px 0;
  padding: 16px;
}

.reading-countdown span {
  color: var(--gold);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reading-countdown strong {
  color: var(--beige);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  margin-top: 6px;
}

.check-reading-action {
  width: 100%;
}

.result-disclaimer {
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  margin-top: 18px;
  padding-top: 16px;
}

.final-reading {
  max-width: 1120px;
  margin: 40px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 0%, rgba(201, 164, 92, 0.12), transparent 32rem),
    rgba(23, 18, 31, 0.68);
  padding: clamp(22px, 4vw, 34px);
}

.final-reading h2 {
  color: var(--beige);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 500;
}

.final-reading-body {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.final-reading-body p {
  color: var(--beige);
  font-size: 1.02rem;
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@keyframes floatCard {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -12px;
  }
}

@keyframes breatheCard {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -6px;
  }
}

@keyframes stackDeck {
  to {
    transform: translate3d(var(--stack-x), var(--stack-y), 0) rotate(var(--stack-rotate)) scale(0.88);
  }
}

@keyframes cutDeck {
  0% {
    transform: translate3d(var(--stack-x), var(--stack-y), 0) rotate(var(--stack-rotate)) scale(0.88);
  }
  25% {
    transform: translate3d(calc(var(--stack-x) + var(--cut-x)), calc(var(--stack-y) + var(--cut-y)), 0) rotate(var(--cut-rotate)) scale(0.93);
  }
  50% {
    transform: translate3d(calc(var(--stack-x) - var(--cut-x) * 0.38), calc(var(--stack-y) - 8px), 0) rotate(calc(var(--cut-rotate) * -0.5)) scale(0.9);
  }
  75% {
    transform: translate3d(calc(var(--stack-x) + var(--cut-x) * 0.28), calc(var(--stack-y) + 6px), 0) rotate(calc(var(--cut-rotate) * 0.4)) scale(0.92);
  }
  100% {
    transform: translate3d(var(--stack-x), var(--stack-y), 0) rotate(var(--stack-rotate)) scale(0.88);
  }
}

@keyframes dealCards {
  from {
    transform: translate3d(var(--stack-x), var(--stack-y), 0) rotate(var(--stack-rotate));
    opacity: 0.88;
  }
  to {
    transform: translate3d(0, 0, 0) rotate(0);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@media (max-width: 1060px) {
  .draw-workspace {
    grid-template-columns: minmax(360px, 420px) minmax(250px, 320px);
    gap: 28px;
  }

  .deck-grid {
    grid-template-columns: repeat(3, minmax(94px, 114px));
    max-width: 366px;
  }

  .tarot-card {
    max-height: 176px;
  }
}

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

  .hero {
    min-height: auto;
  }

  .hero-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 32px;
  }

  .mini-card.offset {
    transform: none;
  }

  .steps,
  .cards-grid,
  .positions-strip {
    grid-template-columns: 1fr;
  }

  .draw-workspace {
    display: flex;
    flex-direction: column;
    max-width: 560px;
  }

  .deck-area {
    justify-items: center;
  }

  .deck-grid {
    justify-content: center;
    margin: 0 auto;
  }

  .site-header,
  .site-footer,
  .draw-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
  }

  .draw-toolbar {
    align-items: center;
    margin: 0 0 18px;
    order: 1;
  }

  .reading-panel {
    display: contents;
  }

  .deck-area {
    order: 2;
  }

  .positions-strip {
    order: 3;
  }

  .result-layout {
    margin-top: 28px;
  }

  .result-summary {
    order: -1;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    padding: 16px 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .draw-shell {
    min-height: calc(100vh - 68px);
    padding: 22px 16px 48px;
  }

  .draw-intro {
    max-width: 100%;
  }

  .draw-shell h1 {
    font-size: clamp(2rem, 11vw, 2.55rem);
    line-height: 1.04;
    margin-bottom: 12px;
  }

  .draw-shell .lead {
    max-width: 32rem;
    font-size: 0.96rem;
  }

  .draw-toolbar {
    gap: 12px;
    margin: 20px 0 16px;
  }

  .draw-toolbar .shuffle-card-button {
    grid-template-columns: 52px minmax(0, 1fr);
    width: 100%;
    min-height: 78px;
  }

  .shuffle-button-sigil {
    width: 46px;
  }

  .draw-toolbar p {
    width: 100%;
    min-height: 24px;
  }

  .deck-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 360px);
    max-width: none;
  }

  .tarot-card {
    max-height: none;
    border-radius: 8px;
  }

  .card-face,
  .card-back-generated,
  .card-front-generated {
    border-radius: 8px;
  }

  .positions-strip {
    margin-top: 0;
  }

  .result-shell {
    padding: 28px 16px 48px;
  }

  .result-card {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .result-card img {
    width: 74px;
  }

  .result-card h2 {
    font-size: 1.28rem;
  }

  .delivery-card strong {
    font-size: 1.5rem;
  }
}

@media (max-width: 380px) {
  .draw-shell {
    padding-inline: 14px;
  }

  .deck-grid {
    gap: 8px;
    width: min(100%, 328px);
  }

  .draw-shell h1 {
    font-size: 1.9rem;
  }
}

@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;
  }
}
