/* ==========================================================================
   Tarot Card Reading Styles - 3D Flip & Interactive Deck
   ========================================================================== */

.tarot-experience {
  position: relative;
  margin: 2rem auto;
  max-width: 1100px;
}

/* Category Spread Selector */
.spread-selector {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.spread-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.6rem;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.spread-tab:hover {
  border-color: var(--gold-300);
  color: var(--gold-200);
}

.spread-tab.active {
  background: var(--gold-gradient);
  color: #0b0d18;
  border-color: var(--gold-400);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

/* Question Prompt Input */
.tarot-question-box {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

.tarot-input-wrap {
  position: relative;
  display: flex;
  margin-top: 1rem;
}

.tarot-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 1rem 1.6rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  transition: var(--transition);
}

.tarot-input:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.2);
}

/* Shuffling Deck Stage */
.deck-stage {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
  margin-bottom: 3rem;
}

.deck-container {
  position: relative;
  width: 220px;
  height: 350px;
  cursor: pointer;
}

.deck-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  background-size: cover;
  background-position: center;
}

.deck-card:nth-child(1) { transform: rotate(-3deg) translate(-4px, -2px); }
.deck-card:nth-child(2) { transform: rotate(2deg) translate(3px, 1px); }
.deck-card:nth-child(3) { transform: rotate(-1deg) translate(-2px, 3px); }
.deck-card:nth-child(4) { transform: rotate(4deg) translate(2px, -3px); }
.deck-card:nth-child(5) { transform: rotate(0deg) translate(0, 0); }

.deck-container:hover .deck-card:nth-child(1) { transform: rotate(-8deg) translate(-15px, -5px); }
.deck-container:hover .deck-card:nth-child(2) { transform: rotate(7deg) translate(12px, 3px); }
.deck-container:hover .deck-card:nth-child(4) { transform: rotate(12deg) translate(20px, -6px); }

.deck-container.shuffling .deck-card {
  animation: shuffleAnimation 1.2s ease-in-out infinite;
}

@keyframes shuffleAnimation {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-60px, -20px) rotate(-15deg); }
  50% { transform: translate(60px, 20px) rotate(15deg); }
  75% { transform: translate(-30px, 10px) rotate(-8deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shuffle-instructions {
  margin-top: 1.5rem;
  font-family: var(--font-accent);
  font-size: 1.25rem;
  color: var(--gold-200);
  font-style: italic;
  text-align: center;
}

/* 3-Card Spread Display */
.spread-display {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3.5rem;
  perspective: 1200px;
}

.spread-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slot-label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Flip Card 3D Setup */
.tarot-card-flip {
  width: 100%;
  max-width: 240px;
  height: 380px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.tarot-card-flip.flipped {
  transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.tarot-card-back {
  background-color: #0b0d18;
  border: 2px solid var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tarot-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tarot-card-front {
  transform: rotateY(180deg);
  background: #0f1326;
  border: 2px solid var(--gold-400);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.25);
  padding: 1.2rem 1rem;
}

.tarot-card-art {
  height: 200px;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at center, #232a52, #101429);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  position: relative;
  overflow: hidden;
}

.card-numeral {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold-300);
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.card-icon-emblem {
  width: 72px;
  height: 72px;
  color: var(--gold-200);
  margin: 0.5rem 0;
}

.card-name-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-200);
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.card-orientation-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  text-align: center;
  margin-bottom: 0.5rem;
}

.card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
}

.card-keywords span {
  font-size: 0.7rem;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--gold-100);
}

/* Detailed Reading Synthesis Box */
.reading-synthesis {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--gold-400);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.6s ease-in-out;
}

.reading-synthesis h3 {
  color: var(--gold-200);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.reading-synthesis p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.card-interpretation-item {
  border-left: 3px solid var(--gold-400);
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}

.card-interpretation-item h4 {
  font-size: 1.15rem;
  color: var(--gold-300);
  margin-bottom: 0.4rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 868px) {
  .spread-display {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .tarot-card-flip {
    max-width: 220px;
    height: 350px;
  }
}
