:root {
  --bg: #120d18;
  --panel: rgba(255, 255, 255, .075);
  --panel-strong: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .16);
  --text: #fff8ea;
  --muted: rgba(255, 248, 234, .74);
  --soft: rgba(255, 248, 234, .55);
  --gold: #f2cc7b;
  --gold-2: #fff1b8;
  --wine: #6f2c59;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(242, 204, 123, .13), transparent 34rem),
    radial-gradient(circle at 90% 18%, rgba(111, 44, 89, .52), transparent 30rem),
    linear-gradient(145deg, #0b0910 0%, #120d18 52%, #211227 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.bg-orb {
  position: fixed;
  width: 24rem;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(36px);
  pointer-events: none;
  opacity: .32;
}
.bg-orb-a { left: -10rem; bottom: 12%; background: #d99259; }
.bg-orb-b { right: -12rem; top: 8%; background: #7f4fd7; }

.shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 max(22px, env(safe-area-inset-bottom));
  position: relative;
}

.hero,
.result-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.055));
  backdrop-filter: blur(18px);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero {
  min-height: calc(100vh - 82px);
  padding: clamp(22px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid rgba(242, 204, 123, .42);
  background: linear-gradient(145deg, rgba(242,204,123,.26), rgba(111,44,89,.28));
  color: var(--gold-2);
  font-size: 26px;
  box-shadow: 0 16px 46px rgba(0,0,0,.22);
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 9vw, 76px);
  line-height: .92;
  letter-spacing: -.06em;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(18px, 2.6vw, 24px);
  line-height: 1.52;
  margin-bottom: 0;
}

.deck-panel {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.16);
  border-radius: 28px;
  padding: clamp(16px, 3vw, 24px);
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.panel-head h2 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.panel-head p, .soft-note, .footer {
  color: var(--soft);
  line-height: 1.5;
}
.panel-head p { margin-bottom: 0; }

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

.deck-option,
.loading-card {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 22px;
  min-height: 172px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  color: var(--text);
}

.deck-option {
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: center;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.deck-option:hover { transform: translateY(-2px); }
.deck-option.active {
  border-color: rgba(242,204,123,.76);
  background: linear-gradient(145deg, rgba(242,204,123,.16), rgba(255,255,255,.045));
}

.deck-cover {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 15%, rgba(242,204,123,.34), transparent 55%), #17101d;
  border: 1px solid rgba(242,204,123,.24);
  box-shadow: 0 14px 32px rgba(0,0,0,.24);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 24px;
}
.deck-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-text b { display: block; font-size: 17px; margin-bottom: 6px; }
.deck-text span { color: var(--muted); line-height: 1.35; font-size: 14px; }

.main-action,
.share-btn,
.ghost-btn,
.back-link {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.main-action {
  align-self: flex-start;
  min-width: min(100%, 320px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 999px;
  color: #24140b;
  background: linear-gradient(135deg, #fff2b8, #f2cc7b 55%, #c48945);
  font-weight: 900;
  box-shadow: 0 22px 64px rgba(242, 204, 123, .23);
  transition: transform .18s ease, filter .18s ease;
}
.main-action:hover { transform: translateY(-2px); filter: brightness(1.04); }
.main-action:disabled { cursor: wait; opacity: .72; transform: none; filter: grayscale(.08); }
.main-action small {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  opacity: .72;
}
.soft-note { max-width: 640px; margin-bottom: 0; }

.hidden { display: none !important; }
.result { padding-top: 12px; }
.back-link {
  margin: 0 0 14px;
  color: var(--muted);
  background: transparent;
  padding: 10px 2px;
}

.result-card {
  padding: clamp(18px, 4vw, 38px);
  display: block;
}
.result-card::after {
  content: "";
  display: block;
  clear: both;
}

.card-stage {
  float: left;
  width: clamp(210px, 29vw, 292px);
  margin: 2px clamp(18px, 4vw, 34px) 16px 0;
  padding: clamp(12px, 1.8vw, 18px);
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 25%, rgba(242,204,123,.18), transparent 55%),
    rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
}

.tarot-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #18101f;
  border: 1px solid rgba(242,204,123,.22);
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
  transform: rotate(var(--card-rotation, -1.4deg));
}
.tarot-card.reversed { transform: rotate(178.6deg); }
.tarot-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; text-align: center;
  padding: 22px; background: radial-gradient(circle at 50% 20%, rgba(242,204,123,.22), transparent 50%), linear-gradient(160deg,#24152c,#0d0912);
}
.card-fallback span { display:block; color: var(--gold); font-size: 44px; margin-bottom: 12px; }
.card-fallback b { font-size: 18px; line-height: 1.25; }

.reading-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}
.reading h2 {
  font-size: clamp(30px, 5.2vw, 48px);
  letter-spacing: -.045em;
  line-height: 1.03;
  margin-bottom: 8px;
}
.orientation {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 11px;
  font-size: 14px;
  border-radius: 999px;
  color: var(--gold-2);
  border: 1px solid rgba(242,204,123,.28);
  background: rgba(242,204,123,.08);
}
.reading-blocks {
  display: grid;
  gap: 12px;
}
.reading-blocks article {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
}
.reading-blocks h3 {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--gold-2);
}
.reading-blocks p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}
.actions-row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.share-btn, .ghost-btn {
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
}
.share-btn {
  color: #24140b;
  background: linear-gradient(135deg, #fff2b8, #f2cc7b);
}
.ghost-btn {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
}
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 18px 0 0;
}
.footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { min-height: auto; margin-top: 8px; }
  .deck-grid { grid-template-columns: 1fr; }
  .deck-option { min-height: 126px; }
  .card-stage { width: clamp(190px, 34vw, 250px); margin-right: 22px; }
}

@media (max-width: 640px) {
  .card-stage {
    float: none;
    width: min(74vw, 270px);
    margin: 2px auto 22px;
  }
  .reading-kicker, .reading h2, .orientation { text-align: left; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 18px, 1040px); }
  .hero, .result-card { border-radius: 24px; }
  .main-action { width: 100%; }
  .deck-option { grid-template-columns: 62px 1fr; padding: 13px; border-radius: 18px; }
  .deck-cover { width: 62px; }
  .actions-row > * { flex: 1 1 100%; }
  .footer { flex-wrap: wrap; }
}

/* lite-1.0.11: flowing interpretation layout */
.reading-text-card {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.reading-text-card p {
  white-space: pre-line;
  color: var(--muted);
  line-height: 1.62;
  font-size: clamp(15.5px, 1.75vw, 17px);
  letter-spacing: .005em;
  margin: 0;
}
.ai-source {
  display: block;
  margin-top: 12px;
  color: rgba(255,248,234,.42);
  font-size: 12px;
}

/* lite-1.0.12: moderation-safe privacy screen and copy-only sharing */
.footer-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.footer-link:hover { color: var(--gold-2); }
.privacy-screen {
  min-height: 70vh;
  display: grid;
  place-items: start center;
  padding-top: 12px;
}
.privacy-card {
  width: min(100%, 860px);
  padding: clamp(22px, 4vw, 42px);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.privacy-card h2 {
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -.045em;
  margin: 0 0 14px;
}
.privacy-card p {
  color: var(--muted);
  line-height: 1.62;
  margin: 0 0 14px;
}
