@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display:ital@0;1&display=swap");

:root {
  --forest-950: #10180f;
  --forest-900: #172117;
  --forest-800: #223021;
  --olive: #657347;
  --gold: #dda52b;
  --gold-bright: #f3c35a;
  --saffron: #b84f20;
  --ivory: #f0ead8;
  --ivory-dim: #cfc7b2;
  --ink: #151b13;
  --line: rgba(221, 165, 43, 0.42);
  --visual-top-offset: 0px;
  --visual-left-offset: 0px;
  --visual-right-inset: 0px;
  --visual-bottom-inset: 0px;
  --visual-width: 100vw;
  --visual-height: 100dvh;
  --visual-center-y: 50dvh;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

body {
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% 42%, rgba(78, 96, 58, 0.22), transparent 34%),
    radial-gradient(circle at 50% 120%, rgba(184, 79, 32, 0.11), transparent 38%),
    var(--forest-950);
  font-family: "DM Sans", Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  content: "";
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orbit {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(72vw, 900px);
  aspect-ratio: 1;
  border: 1px solid rgba(221, 165, 43, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-two {
  width: min(52vw, 650px);
  border-color: rgba(221, 165, 43, 0.09);
}

.sky-star {
  position: absolute;
  color: var(--gold);
  font-size: 16px;
  opacity: 0.7;
  animation: slowPulse 4s ease-in-out infinite;
}

.star-a { left: 12%; top: 31%; }
.star-b { right: 14%; top: 25%; animation-delay: 1.2s; }
.star-c { left: 18%; bottom: 23%; animation-delay: 2.2s; }
.star-d { right: 19%; bottom: 19%; animation-delay: 0.6s; }

@keyframes slowPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.84); }
  50% { opacity: 0.9; transform: scale(1.12); }
}

#container {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100vw;
  height: 100dvh;
}

.brand-lockup {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.brand-lockup p,
.brand-lockup span,
.ritual-intro p { margin: 0; }

.brand-lockup p {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.18em;
}

.brand-lockup > div > span {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}

.brand-mark i {
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.ritual-intro {
  position: fixed;
  top: 25px;
  left: 50%;
  z-index: 1;
  width: min(620px, 60vw);
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.ritual-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.34em;
}

.ritual-intro h2 {
  margin: 8px 0 4px;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(24px, 3.2vw, 46px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.ritual-intro h2 em { color: var(--gold); font-weight: 400; }

.ritual-note {
  margin-top: 8px !important;
  color: rgba(240, 234, 216, 0.55);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.reading-active .ritual-intro {
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.card-shell { filter: none; }

.card-shell:not(.is-stacked),
.card-shell.is-stack-top {
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}

/* Shadows across 78 independently transformed cards are costly on phones. */
.shuffle-in-motion .card-shell,
.shuffle-in-motion .card-shell:not(.is-stacked),
.shuffle-in-motion .card-shell.is-stack-top {
  filter: none !important;
}

.shuffle-in-motion .card-cover,
.shuffle-in-motion .card-main {
  box-shadow: 0 0 0 1px rgba(240, 234, 216, 0.12) !important;
  transition: none !important;
}

.card-cover,
.card-main {
  position: absolute;
  width: 120px;
  height: 180px;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 6px;
  background: var(--forest-900);
  box-shadow: 0 0 0 1px rgba(240, 234, 216, 0.18);
  backface-visibility: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease, filter 300ms ease, opacity 300ms ease;
}

.card-shell:not(.is-stacked) .card-cover,
.card-shell:not(.is-stacked) .card-main,
.card-shell.is-stack-top .card-cover,
.card-shell.is-stack-top .card-main {
  box-shadow: 0 0 0 1px rgba(240, 234, 216, 0.18), 0 10px 22px rgba(0, 0, 0, 0.3);
}

.card-cover::before,
.card-main::before { display: none; }

.card-shell:hover .card-cover,
.card-shell:hover .card-main {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(240, 234, 216, 0.34), 0 0 22px rgba(221, 165, 43, 0.25), 0 18px 38px rgba(0, 0, 0, 0.52);
}

.card-back-art,
.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.card-back-art { transform: scale(1.025); }

.card-back-frame {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(240, 234, 216, 0.55);
  border-radius: 3px;
}

.card-back-wordmark {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.2em;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.card-art { object-position: center; }

.card-art-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(16, 24, 15, 0.03) 42%, rgba(16, 24, 15, 0.88) 75%, #10180f 100%);
}

.card-number {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(240, 234, 216, 0.65);
  border-radius: 50%;
  color: var(--ivory);
  background: rgba(16, 24, 15, 0.7);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 7px;
  line-height: 20px;
  text-align: center;
  transform: none;
  backdrop-filter: blur(5px);
}

.card-copy {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  text-align: center;
}

.card-eyebrow {
  margin-bottom: 2px;
  color: var(--gold-bright);
  font-size: 5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.card-name {
  position: static;
  width: auto;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.05;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.75);
}

.details {
  position: static;
  display: none;
  width: auto;
  margin-top: 4px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: rgba(240, 234, 216, 0.72);
  background: transparent;
  box-shadow: none;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 5.5px;
  line-height: 1.2;
  text-overflow: clip;
  text-shadow: none;
  white-space: normal;
}

.blurred-card { filter: blur(2px) saturate(0.55); opacity: 0.26; }

#menu {
  position: fixed;
  right: 0;
  bottom: 24px;
  left: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

#menu > * { pointer-events: auto; }

.spread-display {
  margin: 0 0 2px;
  color: rgba(240, 234, 216, 0.56);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.shuffle-card-btn,
#authButtons button {
  position: static;
  right: auto;
  bottom: auto;
  min-width: 210px;
  height: 46px;
  padding: 0 24px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  outline: none;
  color: var(--forest-950);
  background: var(--gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.shuffle-card-btn:hover,
#authButtons button:hover {
  color: var(--forest-950);
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 10px 34px rgba(221, 165, 43, 0.23);
  transform: translateY(-2px);
}

.shuffle-card-btn:disabled { opacity: 0.6; transform: none; }

.secondary-ritual-btn {
  min-width: auto;
  height: auto;
  padding: 3px 8px;
  border: 0;
  color: rgba(240, 234, 216, 0.62);
  background: transparent;
  box-shadow: none;
  font-size: 8px;
  text-decoration: underline;
  text-decoration-color: rgba(221, 165, 43, 0.55);
  text-underline-offset: 4px;
}

.secondary-ritual-btn:hover {
  color: var(--gold-bright);
  background: transparent;
  box-shadow: none;
  transform: none;
}

#pickText {
  position: fixed;
  top: 17%;
  left: 50%;
  z-index: 12;
  display: none;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(20px, 2.4vw, 34px);
  transform: translateX(-50%);
}

#settingsCard {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 100;
  width: 154px;
  max-width: none;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ivory);
  background: rgba(16, 24, 15, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transition: width 400ms ease, height 400ms ease, border-radius 400ms ease;
}

#settingsCard.expanded {
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  border-radius: 18px;
  overflow-y: auto;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: inherit;
  outline: 0;
  color: var(--ivory);
  background: transparent;
  box-shadow: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.card-header:hover {
  color: var(--ivory);
  background: transparent;
  box-shadow: none;
}

.settings-sun { color: var(--gold); font-size: 14px; line-height: 1; }

.card-content,
#settingsContent {
  align-items: stretch;
  gap: 16px;
  width: 100%;
  padding: 2px 16px 18px;
}

.settings-label {
  margin: 6px 5px 8px;
  color: var(--gold);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#spreadSelector { align-items: stretch; }

#spreadSelector button {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: 0;
  color: rgba(240, 234, 216, 0.72);
  background: transparent;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 10px;
  text-align: left;
  transition: background 150ms ease, color 150ms ease, border 150ms ease;
}

#spreadSelector button span {
  color: var(--gold);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 9px;
}

#spreadSelector button:hover {
  color: var(--ivory);
  background: rgba(221, 165, 43, 0.08);
  box-shadow: none;
}

#spreadSelector button.selected {
  border-color: rgba(221, 165, 43, 0.4);
  color: var(--ivory);
  background: rgba(221, 165, 43, 0.12);
  box-shadow: none;
  font-weight: 500;
}

#inversionToggle,
#enableAIToggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 0;
  border-top: 1px solid rgba(221, 165, 43, 0.14);
}

.toggleLabel {
  order: -1;
  margin: 0;
  padding: 0;
  color: rgba(240, 234, 216, 0.67);
  font-size: 9px;
}

.slider { border-color: rgba(221, 165, 43, 0.55); background: rgba(240, 234, 216, 0.06); }
.slider::before { background: var(--gold); }

#welcomeMessage {
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
}

#authButtons button {
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  font-size: 8px;
}

#authButtons p,
#authButtons a { color: rgba(240, 234, 216, 0.45); font-size: 7px; }

#question-container {
  z-index: 92;
  width: min(520px, calc(100vw - 40px));
  max-width: none;
}

#question-container label {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#questionInput {
  width: 100%;
  height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ivory);
  background: rgba(16, 24, 15, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 16px;
  text-align: center;
  backdrop-filter: blur(18px);
}

#questionInput::placeholder { color: rgba(240, 234, 216, 0.36); }
#questionInput:focus { border-color: var(--gold); }
.centered-question-bar {
  top: var(--visual-center-y);
  left: 50%;
  transform: translate(-50%, -50%);
}

#question-container.top-question-bar {
  top: 66px;
  left: 50%;
  flex-direction: row;
  width: min(560px, calc(100vw - 460px)) !important;
  min-width: 360px;
  overflow: hidden;
  border: 1px solid rgba(221, 165, 43, 0.38);
  border-radius: 999px;
  background: rgba(16, 24, 15, 0.9);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.top-question-bar label {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 16px;
  white-space: nowrap;
}

.top-question-bar #questionInput {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid rgba(221, 165, 43, 0.2);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  text-align: left;
  backdrop-filter: none;
}

.top-question-bar #questionInput:focus {
  border-color: rgba(221, 165, 43, 0.42);
  background: rgba(221, 165, 43, 0.035);
}

.top-question-bar #askAiBtn {
  flex: 0 0 auto;
  height: 28px;
  margin: 0 7px 0 0;
  padding: 0 12px;
  border-color: rgba(221, 165, 43, 0.35);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(221, 165, 43, 0.08);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.reset-camera-btn {
  position: fixed;
  right: 24px;
  bottom: 25px;
  left: auto;
  z-index: 95;
  padding: 8px 12px;
  border: 1px solid rgba(221, 165, 43, 0.25);
  border-radius: 999px;
  outline: 0;
  color: rgba(240, 234, 216, 0.48);
  background: rgba(16, 24, 15, 0.6);
  box-shadow: none;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 7px;
  letter-spacing: 0.15em;
  backdrop-filter: blur(12px);
}

.reset-camera-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(16, 24, 15, 0.82);
  box-shadow: none;
}

.beta {
  position: fixed;
  right: 26px;
  bottom: 66px;
  top: auto;
  left: auto;
  z-index: 90;
  color: rgba(240, 234, 216, 0.35);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notification-banner {
  position: fixed;
  top: calc(var(--visual-top-offset) + 56px);
  bottom: auto;
  left: 50%;
  z-index: 96;
  width: max-content;
  max-width: calc(100vw - 32px);
  max-height: 0;
  margin: 0;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ivory);
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 26px;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  pointer-events: none !important;
  user-select: none;
  transition: max-height 220ms ease, margin 220ms ease, opacity 220ms ease;
}

.ai-guided .notification-banner {
  top: calc(var(--visual-top-offset) + 116px);
}

.notification-banner.show {
  max-height: 28px;
  margin: 0;
  border-color: var(--line);
  background: rgba(16, 24, 15, 0.92);
  animation: menuHintIn 260ms ease both;
}

.notification-banner.hide {
  animation: menuHintOut 220ms ease both;
}

@keyframes menuHintIn {
  from { max-height: 0; opacity: 0; transform: translate(-50%, 4px); }
  to { max-height: 28px; opacity: 1; transform: translate(-50%, 0); }
}

@keyframes menuHintOut {
  from { max-height: 28px; opacity: 1; transform: translate(-50%, 0); }
  to { max-height: 0; opacity: 0; transform: translate(-50%, 4px); }
}

.modal {
  top: var(--visual-top-offset);
  left: var(--visual-left-offset);
  width: var(--visual-width);
  height: var(--visual-height);
  padding: 34px;
  background:
    radial-gradient(circle at 50% 18%, rgba(101, 115, 71, 0.18), transparent 38%),
    rgba(9, 14, 9, 0.9);
  backdrop-filter: blur(16px);
}

.modal-content {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 68px));
  max-width: none;
  height: min(82vh, 760px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(221, 165, 43, 0.4);
  border-radius: 24px;
  color: var(--ivory);
  background:
    linear-gradient(145deg, rgba(34, 48, 33, 0.74), rgba(16, 24, 15, 0.96) 54%),
    var(--forest-900);
  box-shadow: 0 44px 120px rgba(0, 0, 0, 0.64);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.65;
  text-align: left;
}

.modal-content::before {
  position: absolute;
  inset: 8px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(240, 234, 216, 0.055);
  border-radius: 17px;
  content: "";
}

.reading-result-header {
  position: relative;
  z-index: 1;
  min-height: 144px;
  padding: 31px 76px 26px 132px;
  border-bottom: 1px solid rgba(221, 165, 43, 0.17);
  background: radial-gradient(circle at 75px 55%, rgba(221, 165, 43, 0.09), transparent 16%);
}

.reading-result-sigil {
  position: absolute;
  top: 38px;
  left: 48px;
  width: 52px;
  height: 52px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.reading-result-sigil i {
  position: absolute;
  inset: 9px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.reading-result-sigil::after {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--gold);
  content: "✦";
  font-size: 10px;
  transform: translate(-50%, -50%);
}

.reading-result-kicker {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.reading-result-header h2 {
  margin: 0;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(29px, 3.4vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
}

.reading-result-question {
  margin: 12px 0 0;
  color: rgba(240, 234, 216, 0.6);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 14px;
  font-style: italic;
}

.reading-result-question::before { content: "“"; color: var(--gold); }
.reading-result-question::after { content: "”"; color: var(--gold); }

.reading-result-scroll {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  padding: 28px 48px 46px;
  scrollbar-color: rgba(221, 165, 43, 0.35) transparent;
  scrollbar-width: thin;
}

.reading-result-scroll::-webkit-scrollbar { width: 5px; }
.reading-result-scroll::-webkit-scrollbar-track { background: transparent; }
.reading-result-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(221, 165, 43, 0.35);
}

#answerText > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  column-gap: 30px;
}

#answerText h1 { display: none; }

#answerText h2 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 13px;
  color: var(--gold);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

#answerText .card {
  position: relative;
  min-width: 0;
  padding: 23px 0 29px 34px;
  border-top: 1px solid rgba(221, 165, 43, 0.18);
}

#answerText .card::before {
  position: absolute;
  top: 26px;
  left: 0;
  color: rgba(221, 165, 43, 0.68);
  content: attr(data-index);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

#answerText .card-name-analysis {
  margin: 0 0 9px;
  color: var(--ivory);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.1;
}

#answerText .card-position {
  margin: 0 0 7px;
  color: rgba(221, 165, 43, 0.78);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.45;
  text-transform: uppercase;
}

#answerText .meaning {
  margin: 0;
  color: rgba(240, 234, 216, 0.68);
  font-size: 12px;
  line-height: 1.72;
}

#answerText h2:nth-of-type(2) {
  margin-top: 8px;
  padding-top: 27px;
  border-top: 1px solid rgba(221, 165, 43, 0.24);
}

#answerText .analysis {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 22px 24px;
  border-left: 2px solid var(--gold);
  border-radius: 0 12px 12px 0;
  color: rgba(240, 234, 216, 0.83);
  background: rgba(221, 165, 43, 0.055);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 17px;
  font-style: normal;
  line-height: 1.7;
}

.reading-result-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 48px;
  border-top: 1px solid rgba(221, 165, 43, 0.17);
  background: rgba(11, 18, 11, 0.86);
}

.reading-result-actions > p {
  margin: 0;
  color: rgba(240, 234, 216, 0.42);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.download-btn {
  position: static;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid rgba(221, 165, 43, 0.48);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(221, 165, 43, 0.08);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: none;
}

.download-btn:hover {
  color: var(--forest-950);
  background: var(--gold);
}

.download-btn:active { transform: scale(0.97); }

.close {
  position: absolute;
  top: 19px;
  right: 22px;
  z-index: 5;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(221, 165, 43, 0.28);
  border-radius: 50%;
  outline: 0;
  color: var(--gold);
  background: rgba(16, 24, 15, 0.62);
  box-shadow: none;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  place-items: center;
}

.close:hover {
  border-color: var(--gold);
  color: var(--ivory);
  background: rgba(221, 165, 43, 0.09);
}

.quota-info {
  margin-top: 26px;
  color: rgba(240, 234, 216, 0.44);
  font-size: 10px;
  text-align: center;
}

.quota-info hr {
  height: 1px;
  margin: 0 0 18px;
  border: 0;
  background: rgba(221, 165, 43, 0.17);
}

@media (max-width: 760px) {
  .notification-banner {
    top: calc(var(--visual-top-offset) + 64px);
  }

  .ai-guided .notification-banner {
    top: calc(var(--visual-top-offset) + 120px);
  }

  .brand-lockup {
    top: calc(var(--visual-top-offset) + max(16px, env(safe-area-inset-top)));
    left: calc(var(--visual-left-offset) + max(16px, env(safe-area-inset-left)));
  }
  .brand-lockup p { font-size: 11px; }
  .brand-lockup > div > span { font-size: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .ritual-intro {
    top: calc(var(--visual-top-offset) + 72px);
    width: calc(100vw - 52px);
  }
  .ritual-intro h2 { font-size: 26px; }
  .ritual-note { display: none; }
  #settingsCard {
    top: calc(var(--visual-top-offset) + max(14px, env(safe-area-inset-top)));
    right: calc(var(--visual-right-inset) + max(14px, env(safe-area-inset-right)));
    width: 42px;
    height: 42px;
  }
  #settingsCard:not(.expanded) .card-header span:last-child { display: none; }
  .card-header { justify-content: center; padding: 13px 9px; }
  #settingsCard.expanded .card-header { justify-content: flex-start; padding-right: 16px; padding-left: 16px; }
  #settingsCard.expanded .card-header span:last-child { display: inline; }
  #menu {
    bottom: calc(var(--visual-bottom-inset) + max(18px, env(safe-area-inset-bottom)));
  }
  .shuffle-card-btn { height: 44px; font-size: 9px; }
  .secondary-ritual-btn { height: auto; }
  .reset-camera-btn,
  .beta { display: none; }
  #question-container.top-question-bar {
    top: calc(var(--visual-top-offset) + 72px);
    width: calc(100vw - 32px) !important;
    min-width: 0;
    transform: translateX(-50%);
  }
  .top-question-bar label { display: none; }
  .top-question-bar #questionInput {
    border-left: 0;
    font-size: 16px;
    text-align: center;
  }
  .modal { padding: 12px; }
  .modal-content {
    width: 100%;
    height: calc(100dvh - 24px);
    border-radius: 18px;
  }
  .reading-result-header {
    min-height: 0;
    padding: 25px 58px 21px 24px;
  }
  .reading-result-sigil { display: none; }
  .reading-result-header h2 { font-size: 30px; }
  .reading-result-question { font-size: 12px; }
  .reading-result-scroll { padding: 22px 24px 30px; }
  #answerText > div { grid-template-columns: 1fr; }
  .reading-result-actions { padding: 11px 20px; }
  .reading-result-actions > p { display: none; }
  .download-btn { margin-left: auto; }
  .orbit { width: 120vw; }
  .orbit-two { width: 86vw; }
}

@media (max-height: 500px) {
  .notification-banner,
  .ai-guided .notification-banner {
    top: calc(var(--visual-top-offset) + 54px);
  }

  .brand-lockup {
    top: calc(var(--visual-top-offset) + max(10px, env(safe-area-inset-top)));
    left: calc(var(--visual-left-offset) + max(14px, env(safe-area-inset-left)));
    transform: scale(0.86);
    transform-origin: top left;
  }

  .ritual-intro {
    top: 18px;
    width: min(420px, calc(100vw - 360px));
  }

  .ritual-intro h2 {
    margin-top: 5px;
    font-size: 24px;
  }

  .ritual-note { display: none; }

  #settingsCard {
    top: calc(var(--visual-top-offset) + max(10px, env(safe-area-inset-top)));
    right: calc(var(--visual-right-inset) + max(14px, env(safe-area-inset-right)));
    width: 42px;
    height: 42px;
  }

  #settingsCard:not(.expanded) .card-header span:last-child { display: none; }
  .card-header { justify-content: center; padding: 13px 9px; }
  #settingsCard.expanded .card-header { justify-content: flex-start; }
  #settingsCard.expanded .card-header span:last-child { display: inline; }

  #menu {
    bottom: calc(var(--visual-bottom-inset) + max(8px, env(safe-area-inset-bottom)));
    gap: 3px;
  }

  .spread-display { margin-bottom: 0; font-size: 7px; }
  .shuffle-card-btn { height: 40px; }
  .secondary-ritual-btn { height: auto; padding: 1px 8px; }
  .reset-camera-btn,
  .beta { display: none; }

  .reading-active .brand-lockup { opacity: 0.38; }

  #question-container.top-question-bar {
    top: calc(var(--visual-top-offset) + 9px);
    width: min(500px, calc(100vw - 280px)) !important;
    min-width: 260px;
  }

  .top-question-bar label { display: none; }
  .top-question-bar #questionInput {
    height: 38px;
    border-left: 0;
    text-align: center;
  }

  .modal { padding: 8px; }
  .modal-content {
    width: 100%;
    height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .reading-result-header { padding: 18px 54px 14px 20px; }
  .reading-result-header h2 { font-size: 26px; }
  .reading-result-scroll { padding: 16px 20px 22px; }
  .reading-result-actions { padding: 8px 16px; }
}

@media (max-height: 640px) {
  .ritual-intro h2 { font-size: 24px; }
  .ritual-note { display: none; }
  #menu { bottom: calc(var(--visual-bottom-inset) + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .sky-star { animation: none; }
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
