/* ============================================================
   oracle-spread.css - Premium overlapping tarot spread
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.oracle-spread__wrapper {
  position: relative;
  width: 100%;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 24px 0 44px;
}

/* ── Particles canvas ────────────────────────────────────── */
.oracle-spread__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Ambient mouse light ─────────────────────────────────── */
.oracle-spread__ambient-light {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient( circle, rgba(246,184,46,0.12) 0%, transparent 70% );
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: left 0.08s linear, top 0.08s linear;
}

/* ── Stage ───────────────────────────────────────────────── */
.oracle-spread__stage {
  position: relative;
  width: 100%;
  max-width: 940px;
  height: 520px;
  z-index: 2;
  margin: 0 auto;
  isolation: isolate;
}

.oracle-spread__stage::after {
  content: none;
}

.oracle-spread__stage.is-locked {
  height: min(760px, 78vh);
  min-height: 580px;
}

@media (max-width: 768px) {
  .oracle-spread__stage { height: 300px; min-height: 300px; }
  .oracle-spread__stage.is-locked {
    height: min(680px, 78vh);
    min-height: 540px;
  }
  .oracle-spread__wrapper {
    min-height: 360px;
    padding-bottom: 28px;
  }
}
@media (max-width: 480px) {
  .oracle-spread__stage { height: 270px; min-height: 270px; }
  .oracle-spread__stage.is-locked {
    height: min(620px, 80vh);
    min-height: 520px;
  }
  .oracle-spread__wrapper { min-height: 300px; }
}

/* ── Loading state ───────────────────────────────────────── */
.oracle-spread__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #F5F5F5;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.oracle-spread__loading-shimmer {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e8c9b8 0%, #9B5E4A 50%, #e8c9b8 100%);
  background-size: 200% 100%;
  animation: spreadShimmer 1.6s ease-in-out infinite;
}
@keyframes spreadShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Individual card ─────────────────────────────────────── */
.oracle-spread__card {
  position: absolute;
  border-radius: 16px;
  aspect-ratio: 2 / 3;
  transform-origin: bottom center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  filter: none;
}
.oracle-spread__card:focus-visible {
  outline: 2px solid rgba(246,184,46,0.9);
  outline-offset: 3px;
}

.oracle-spread__card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
}

.oracle-spread__card.is-flipped .oracle-spread__card-inner {
  transform: rotateY(180deg);
}

.oracle-spread__card-face {
  position: absolute;
  inset: 0;
  border: 0 !important;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: var(--oracle-shadow, 0 0 10px rgba(0,0,0,0.82), 0 6px 18px rgba(0,0,0,0.68), 0 0 24px rgba(246,184,46,0.20));
}
.oracle-spread__card-face svg,
.oracle-spread__card-face img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
  object-fit: var(--oracle-image-fit, contain);
  object-position: center;
}
.oracle-spread__card-face--front {
  transform: rotateY(180deg);
  background: #030725;
}

/* ── Picked / locked card ────────────────────────────────── */
.oracle-spread__locked-card {
  position: absolute;
  inset: 0;
  width: min(320px, 80vw);
  aspect-ratio: 2 / 3;
  margin: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #1b1530;
  box-shadow:
    0 0 22px rgba(0,0,0,0.72),
    0 12px 30px rgba(0,0,0,0.56),
    0 0 18px rgba(246,184,46,0.14);
  animation: oracleLockedCardIn 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.oracle-spread__locked-media {
  position: absolute;
  inset: 0;
}

.oracle-spread__locked-media img,
.oracle-spread__locked-media svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--oracle-image-fit, contain);
  object-position: center;
  transform: none;
}

.oracle-spread__locked-media img {
  filter: blur(12px) brightness(0.68) saturate(0.92);
}

.oracle-spread__locked-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 27, 0.2) 0%, rgba(10, 10, 16, 0.54) 58%, rgba(5, 5, 8, 0.78) 100%),
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.1) 0%, transparent 42%);
  pointer-events: none;
}

.oracle-spread__locked-overlay {
  position: absolute;
  inset: auto 24px 42px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

h3.oracle-spread__locked-title,
.oracle-spread__locked-title {
  margin: 0;
  color: #ffffff !important;
  font-family: inherit;
  font-size: clamp(2.1rem, 8vw, 3.55rem);
  font-weight: 400;
  line-height: 0.98;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.42);
}

.oracle-spread__locked-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(163, 133, 232, 0.2);
  border: 1px solid rgba(163, 133, 232, 0.4);
  backdrop-filter: blur(8px);
  color: #E0D4FF;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(1.28rem, 4.5vw, 2rem);
  font-weight: 400;
  line-height: 1;
  min-height: 58px;
  max-width: 100%;
  padding: 10px 18px 13px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.oracle-spread__locked-button:hover,
.oracle-spread__locked-button:focus-visible {
  background: rgba(163, 133, 232, 0.35);
  box-shadow: 0 0 20px rgba(163, 133, 232, 0.4);
  transform: translateY(-2px);
}

.oracle-spread__locked-button:focus-visible {
  outline: 2px solid rgba(239, 255, 214, 0.9);
  outline-offset: 4px;
}

@keyframes oracleLockedCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .oracle-spread__locked-card {
    width: min(280px, 78vw);
  }

  .oracle-spread__locked-overlay {
    inset: auto 18px 34px;
    gap: 18px;
  }
}

/* ── Subtitle ────────────────────────────────────────────── */
.oracle-spread__subtitle {
  font-family: inherit;
  font-size: 1rem;
  color: #fffaf0;
  letter-spacing: 0.01em;
  margin-top: 8px;
}

/* ── Reveal Modal ────────────────────────────────────────── */
.oracle-spread__reveal-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.oracle-spread__reveal-modal.is-open {
  display: flex;
  animation: spreadModalIn 0.3s ease;
}
@keyframes spreadModalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.oracle-spread__reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 26, 72, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.oracle-spread__reveal-inner {
  position: relative;
  z-index: 1;
  background: #1E1E1E;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: none;
  animation: spreadCardReveal 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes spreadCardReveal {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.oracle-spread__reveal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #F5F5F5;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.oracle-spread__reveal-close:hover {
  background: rgba(255,255,255,0.15);
  color: #FFFFFF;
}

/* ── Reveal card flip ────────────────────────────────────── */
.oracle-spread__reveal-card-wrap {
  perspective: 900px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}
#oracleRevealCard {
  width: 320px;
  height: 480px;
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
#oracleRevealCard.is-flipped {
  transform: rotateY(180deg);
}
.oracle-spread__reveal-card-front,
.oracle-spread__reveal-card-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.oracle-spread__reveal-card-front {
  background: #9B5E4A;
}
.oracle-spread__reveal-card-front .oracle-spread__card-svg--front svg {
  width: 100%; height: 100%;
}
.oracle-spread__reveal-card-back {
  transform: rotateY(180deg);
  background: #1E1E1E;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(155,94,74,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
}

/* ── Reveal content ──────────────────────────────────────── */
.oracle-spread__reveal-content {
  text-align: center;
}
.oracle-spread__reveal-title {
  font-family: var(--serif, "Instrument Serif", serif);
  font-size: 32px;
  font-weight: 400;
  color: #c69d52;
  margin: 0 0 15px;
}
.oracle-spread__reveal-keywords {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.1em;
  color: #F5F5F5;
  margin-bottom: 16px;
}
.oracle-spread__reveal-text {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #DDDDDD;
  min-height: 60px;
}

.oracle-spread__reveal-inner.glow-pulse {
  animation: none;
}

/* ── Body lock when modal open ───────────────────────────── */
body.oracle-modal-open { overflow: hidden; }

/* ── Responsive card scaling ─────────────────────────────── */
@media (max-width: 768px) {
  .oracle-spread__card { transform-origin: bottom center; }
  .oracle-spread__reveal-inner { padding: 28px 20px; }
}
