/* =============================================
   tarot.css — 타로 페이지 스타일
   ============================================= */

/* --- Step Sections --- */
.tarot-step {
  margin-bottom: 32px;
}
.tarot-step-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 28px;
}

/* --- Back Button --- */
.tarot-back-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
  transition: color 0.2s;
}
.tarot-back-btn:hover { color: var(--text-accent); }

/* ===== STEP 1: Spread Selection ===== */
.tarot-step-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.spread-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}
.spread-card {
  position: relative;
  padding: 28px 20px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(245,240,255,0.9));
  border: 1px solid rgba(167, 139, 250, 0.15);
}
.spread-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--violet-400), var(--gold), var(--violet-400), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.spread-card:hover::before {
  opacity: 1;
}
.spread-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 16px 48px rgba(167, 139, 250, 0.18), 0 0 24px rgba(251, 191, 36, 0.06);
}
.spread-card:active {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.1s ease;
}
.spread-card.selected {
  border-color: var(--violet-500);
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.25);
}

/* 스프레드 일러스트 */
.spread-illust {
  width: 140px;
  height: 140px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.spread-illust img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: high-quality;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.spread-illust::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.2);
  transition: all 0.4s ease;
}
.spread-card:hover .spread-illust {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.2), 0 0 60px rgba(251, 191, 36, 0.08);
}
.spread-card:hover .spread-illust::after {
  border-color: rgba(251, 191, 36, 0.4);
}
.spread-card:hover .spread-illust img {
  transform: scale(1.1);
}

.spread-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  position: relative;
}
.spread-card-count {
  font-size: 13px;
  color: var(--text-accent);
  margin-bottom: 8px;
  position: relative;
}
.spread-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
}

/* Disabled spread */
.spread-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.spread-disabled:hover {
  transform: none;
  border-color: rgba(200, 170, 220, 0.3);
  box-shadow: none;
}
.spread-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  font-weight: 500;
  color: var(--amber-500);
}

/* ===== STEP 2: Question Input ===== */
.tarot-question-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 24px;
}
.tarot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}
.tarot-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 245, 250, 0.6);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.25s;
}
.tarot-chip:hover {
  border-color: rgba(167, 139, 250, 0.4);
  color: var(--text-primary);
}
.tarot-chip.active {
  background: rgba(167, 139, 250, 0.2);
  border-color: var(--violet-500);
  color: var(--text-accent);
}
.tarot-textarea {
  width: 100%;
  min-height: 80px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(245, 235, 250, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.3s;
}
.tarot-textarea::placeholder { color: var(--text-secondary); opacity: 0.6; }
.tarot-textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.1);
}
.tarot-textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.tarot-char-count {
  font-size: 12px;
  color: var(--text-secondary);
}
.tarot-submit-btn {
  padding: 12px 32px;
  font-size: 15px;
}
.tarot-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== STEP 3: Card Drawing ===== */
.tarot-draw-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0 16px;
  overflow: hidden;
  perspective: 1200px;
}

/* 안내 문구 */
.tarot-draw-guide {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* 카드 더미 영역 */
.tarot-deck-area {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

/* 카드 더미 (쌓인 카드) */
.tarot-deck-stack {
  width: 140px;
  height: 220px;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.tarot-deck-stack:hover {
  transform: scale(1.05);
}
.tarot-deck-stack:active {
  transform: scale(0.98);
}
.tarot-stack-card {
  width: 140px;
  height: 220px;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
.tarot-stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: high-quality;
  border-radius: var(--radius-md);
}

/* 셔플 Phase 1: 좌우로 카드가 흩어졌다 모이기 */
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(1) { animation: sph1Left 0.3s ease 0s 2 alternate; }
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(2) { animation: sph1Right 0.3s ease 0.05s 2 alternate; }
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(3) { animation: sph1Left 0.3s ease 0.1s 2 alternate; }
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(4) { animation: sph1Right 0.3s ease 0.15s 2 alternate; }
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(5) { animation: sph1Left 0.3s ease 0.2s 2 alternate; }
.tarot-deck-stack.shuffle-phase1 .tarot-stack-card:nth-child(6) { animation: sph1Right 0.3s ease 0.25s 2 alternate; }

@keyframes sph1Left {
  0% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(-70px) rotate(-15deg); }
}
@keyframes sph1Right {
  0% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(70px) rotate(15deg); }
}

/* 셔플 Phase 2: 위아래로 카드가 교차하며 섞이기 */
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(1) { animation: sph2Up 0.2s ease 0s 3 alternate; }
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(2) { animation: sph2Down 0.2s ease 0.04s 3 alternate; }
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(3) { animation: sph2Up 0.2s ease 0.08s 3 alternate; }
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(4) { animation: sph2Down 0.2s ease 0.12s 3 alternate; }
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(5) { animation: sph2Up 0.2s ease 0.16s 3 alternate; }
.tarot-deck-stack.shuffle-phase2 .tarot-stack-card:nth-child(6) { animation: sph2Down 0.2s ease 0.2s 3 alternate; }

@keyframes sph2Up {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  100% { transform: translateY(-40px) translateX(-30px) rotate(-8deg); }
}
@keyframes sph2Down {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  100% { transform: translateY(40px) translateX(30px) rotate(8deg); }
}

/* 셔플 Phase 3: 부채꼴로 펼쳤다 빠르게 모으기 */
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(1) { animation: sph3Fan 0.8s cubic-bezier(0.4,0,0.2,1) forwards; transform-origin: bottom center; }
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(2) { animation: sph3Fan2 0.8s cubic-bezier(0.4,0,0.2,1) 0.05s forwards; transform-origin: bottom center; }
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(3) { animation: sph3Fan3 0.8s cubic-bezier(0.4,0,0.2,1) 0.1s forwards; transform-origin: bottom center; }
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(4) { animation: sph3Fan4 0.8s cubic-bezier(0.4,0,0.2,1) 0.15s forwards; transform-origin: bottom center; }
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(5) { animation: sph3Fan5 0.8s cubic-bezier(0.4,0,0.2,1) 0.2s forwards; transform-origin: bottom center; }
.tarot-deck-stack.shuffle-phase3 .tarot-stack-card:nth-child(6) { animation: sph3Fan6 0.8s cubic-bezier(0.4,0,0.2,1) 0.25s forwards; transform-origin: bottom center; }

@keyframes sph3Fan {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-25deg) translateY(-10px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes sph3Fan2 {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-15deg) translateY(-8px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes sph3Fan3 {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-5deg) translateY(-5px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes sph3Fan4 {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(5deg) translateY(-5px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes sph3Fan5 {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(15deg) translateY(-8px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes sph3Fan6 {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(25deg) translateY(-10px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* 셔플 완료 후 빛 효과 */
.tarot-deck-stack.shuffle-done::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250%;
  height: 250%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, rgba(167, 139, 250, 0.2) 30%, transparent 60%);
  border-radius: 50%;
  animation: deckGlow 1s ease-out forwards;
  pointer-events: none;
}
@keyframes deckGlow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* 카드 딜링 (더미에서 나가는 효과) */
.tarot-stack-card.dealing {
  animation: dealOut 0.4s ease forwards;
}
@keyframes dealOut {
  0% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(80px) translateY(-40px) scale(0.8); }
}

/* 뽑힌 카드 영역 */
.tarot-drawn-area {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  overflow: hidden;
  max-width: 100%;
  padding: 16px 0;
  min-height: 60px;
}

/* 뽑힌 카드 등장 애니메이션 */
.tarot-drawn-card {
  animation: cardDealIn 0.5s ease-out backwards;
}
@keyframes cardDealIn {
  0% { opacity: 0; transform: translateX(-100px) translateY(-50px) scale(0.5) rotate(-20deg); }
  100% { opacity: 1; transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
}

/* 뽑힌 카드 뒤집힐 때 빛 효과 */
.tarot-drawn-card.flipped::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(167, 139, 250, 0.2) 35%, transparent 65%);
  border-radius: 50%;
  animation: drawnGlow 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes drawnGlow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

/* Card container */
.tarot-card {
  width: 140px;
  height: 220px;
  border-radius: var(--radius-md);
  cursor: pointer;
  perspective: 800px;
  position: relative;
}
.tarot-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-md);
}
.tarot-card.flipped .tarot-card-inner {
  animation: cardRevealSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 카드 회전 애니메이션: 캥그르르~ 돌면서 뒤집기 */
@keyframes cardRevealSpin {
  0% { transform: rotateY(0deg) scale(1); }
  30% { transform: rotateY(540deg) scale(1.15); }
  60% { transform: rotateY(720deg) scale(1.1); }
  80% { transform: rotateY(880deg) scale(1.05); }
  100% { transform: rotateY(900deg) scale(1); }
}

/* 빛무리 효과 */
.tarot-card.flipped::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.6) 0%, rgba(167, 139, 250, 0.3) 30%, transparent 70%);
  border-radius: 50%;
  animation: lightBurst 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes lightBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* 빛 파티클 */
.tarot-card.flipped::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(251, 191, 36, 0.9), transparent),
    radial-gradient(2px 2px at 70% 20%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(167, 139, 250, 0.8), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(251, 191, 36, 0.7), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 60% 40%, rgba(251, 191, 36, 0.8), transparent),
    radial-gradient(3px 3px at 30% 50%, rgba(167, 139, 250, 0.9), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255, 255, 255, 0.7), transparent);
  animation: sparkleOut 1.8s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes sparkleOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(0deg); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(60deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(180deg); }
}
.tarot-card:not(.flipped):not(.tarot-chosen-card):hover .tarot-card-inner {
  transform: translateY(-8px);
}
.tarot-card:not(.flipped):not(.tarot-chosen-card) {
  animation: cardFloat 3s ease-in-out infinite;
}
.tarot-card:nth-child(2):not(.flipped) { animation-delay: 0.5s; }
.tarot-card:nth-child(3):not(.flipped) { animation-delay: 1s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Card back / front faces */
.tarot-card-back,
.tarot-card-front {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}
.tarot-card-back {
  background: linear-gradient(135deg, rgba(220, 200, 245, 0.6), rgba(235, 225, 250, 0.8));
  border: 1px solid rgba(167, 139, 250, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tarot-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: high-quality;
  border-radius: var(--radius-md);
}
.tarot-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(255, 245, 250, 0.9), rgba(245, 235, 250, 0.95));
  border: 1px solid rgba(167, 139, 250, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
}
.tarot-card-front-numeral {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.tarot-card-front-icon {
  font-size: 48px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
}
.tarot-card-front-image {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: 6px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
}
.tarot-card-front-name {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Card position label */
.tarot-card-label {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Reveal button */
.tarot-reveal-wrap {
  text-align: center;
  padding: 20px 0 8px;
  animation: fadeInUp 0.5s ease-out;
}

/* Card flip glow effect */
.tarot-card.flipped .tarot-card-inner {
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-md);
}

/* ===== STEP 4: Reading Result ===== */
.tarot-result-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  margin: 0 auto 28px;
}
.tarot-result-card {
  padding: 24px;
  animation: fadeInUp 0.6s ease-out both;
}
.tarot-result-card:nth-child(2) { animation-delay: 0.15s; }
.tarot-result-card:nth-child(3) { animation-delay: 0.3s; }

.tarot-result-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.tarot-result-card-icon {
  font-size: 36px;
  flex-shrink: 0;
}
.tarot-result-card-image {
  width: 60px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.tarot-result-card-info {
  flex: 1;
}
.tarot-result-card-position {
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.tarot-result-card-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.tarot-result-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tarot-keyword-tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  font-size: 12px;
  color: var(--text-accent);
}
.tarot-result-interp {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 사주 연계 분석 (카드별) */
.tarot-result-saju-link {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(167,139,250,0.06);
  border-left: 3px solid var(--violet-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.tarot-saju-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-accent);
  margin-right: 6px;
}

/* 사주 종합 분석 카드 */
.tarot-saju-synthesis {
  border-color: rgba(167,139,250,0.25);
  background: rgba(167,139,250,0.04);
}
.tarot-saju-synthesis .tarot-synthesis-title {
  color: var(--text-accent);
}

/* Synthesis */
.tarot-synthesis {
  max-width: 640px;
  margin: 0 auto 28px;
  padding: 28px 24px;
  border: 1px solid rgba(251, 191, 36, 0.15);
  animation: fadeInUp 0.6s ease-out 0.45s both;
}
.tarot-synthesis-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}
.tarot-synthesis-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Action buttons */
.tarot-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 8px 0;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}
.tarot-action-btn {
  padding: 12px 20px;
  font-size: 13px;
}
.tarot-insta-btn {
  border-color: rgba(225, 48, 108, 0.4);
  color: #E1306C;
}
.tarot-insta-btn:hover {
  background: rgba(225, 48, 108, 0.08);
  border-color: #E1306C;
}

/* ===== 사주타로 Premium Banner ===== */
.sajutarot-banner {
  position: relative;
  padding: 28px 24px;
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(168,85,247,0.08));
  border: 1px solid rgba(245,158,11,0.25);
  overflow: hidden;
}
.sajutarot-badge {
  position: absolute;
  top: 12px;
  right: -24px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 32px;
  letter-spacing: 1px;
}
.sajutarot-banner-content {
  text-align: center;
  margin-bottom: 20px;
}
.sajutarot-banner-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.sajutarot-banner-desc {
  font-size: 14px;
  color: var(--text-accent);
  font-weight: 500;
  margin-bottom: 4px;
}
.sajutarot-banner-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.sajutarot-spreads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.sajutarot-spread-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sajutarot-spread-btn:hover {
  background: rgba(245,158,11,0.15);
  border-color: #F59E0B;
  transform: translateY(-1px);
}
.sajutarot-login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .spread-options {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
    gap: 12px;
  }
  .spread-illust {
    width: 100px;
    height: 100px;
  }
  .spread-card {
    padding: 20px 12px 18px;
  }
  .spread-card-title { font-size: 15px; }
  .spread-card-count { font-size: 12px; }
  .spread-card-desc { font-size: 11px; }

  /* 카드 크기 모바일 최적화 */
  .tarot-card {
    width: 100px;
    height: 160px;
  }
  .tarot-card-front-image {
    max-height: 110px;
  }
  .tarot-card-front-name {
    font-size: 10px !important;
  }

  /* 뽑힌 카드 영역 — 가로 스크롤 방지 */
  .tarot-drawn-area {
    gap: 10px;
    padding: 12px 4px;
  }

  /* 카드 더미 모바일 크기 */
  .tarot-deck-stack {
    width: 110px;
    height: 176px;
  }
  .tarot-stack-card {
    width: 110px;
    height: 176px;
  }

  .tarot-draw-area {
    gap: 12px;
    overflow-x: hidden;
  }
  .tarot-result-card {
    padding: 16px;
  }
  .tarot-result-card-image {
    width: 50px;
    height: 66px;
  }
  .tarot-result-card-name { font-size: 15px; }
  .tarot-synthesis { padding: 20px 16px; }
}
@media (min-width: 521px) and (max-width: 767px) {
  .spread-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .tarot-card {
    width: 120px;
    height: 192px;
  }
}

/* 화면 넘침 방지 */
.tarot-step {
  overflow-x: hidden;
  max-width: 100vw;
}

/* 로딩 오버레이 모바일 중앙 정렬 */
#tarot-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 520px) {
  .tarot-loading-cards {
    width: 150px;
    height: 150px;
  }
  .tarot-loading-card {
    width: 45px;
    height: 70px;
  }
  .tarot-loading-text {
    font-size: 14px;
  }
  /* 궤도 반경 축소 */
  @keyframes orbitCard1 {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(50px) rotate(0deg) scale(0.9); }
    50% { transform: translate(-50%, -50%) rotate(180deg) translateX(50px) rotate(-180deg) scale(1.1); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(50px) rotate(-360deg) scale(0.9); }
  }
  @keyframes orbitCard2 {
    0% { transform: translate(-50%, -50%) rotate(120deg) translateX(50px) rotate(-120deg) scale(0.9); }
    50% { transform: translate(-50%, -50%) rotate(300deg) translateX(50px) rotate(-300deg) scale(1.1); }
    100% { transform: translate(-50%, -50%) rotate(480deg) translateX(50px) rotate(-480deg) scale(0.9); }
  }
  @keyframes orbitCard3 {
    0% { transform: translate(-50%, -50%) rotate(240deg) translateX(50px) rotate(-240deg) scale(0.9); }
    50% { transform: translate(-50%, -50%) rotate(420deg) translateX(50px) rotate(-420deg) scale(1.1); }
    100% { transform: translate(-50%, -50%) rotate(600deg) translateX(50px) rotate(-600deg) scale(0.9); }
  }
}

/* ====================================================
   고퀄 애니메이션 시스템
   ==================================================== */

/* --- 스텝 전환 애니메이션 --- */
.step-fade-out {
  animation: stepOut 0.25s ease-in forwards;
}
.step-fade-in {
  animation: stepIn 0.4s ease-out forwards;
}
@keyframes stepOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}
@keyframes stepIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- 스프레드 카드 stagger 입장 --- */
.spread-card {
  animation: spreadCardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.spread-card:nth-child(1) { animation-delay: 0.05s; }
.spread-card:nth-child(2) { animation-delay: 0.12s; }
.spread-card:nth-child(3) { animation-delay: 0.19s; }
.spread-card:nth-child(4) { animation-delay: 0.26s; }
@keyframes spreadCardIn {
  0% { opacity: 0; transform: translateY(40px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 스프레드 카드 hover 강화 */
.spread-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 40px rgba(167, 139, 250, 0.15), 0 0 20px rgba(251, 191, 36, 0.08);
}
.spread-card:active {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.1s ease;
}

/* --- 카테고리 칩 선택 바운스 --- */
.tarot-chip {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tarot-chip:hover {
  transform: translateY(-2px);
}
.tarot-chip.active {
  animation: chipBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chipBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* --- 제출 버튼 고급 효과 --- */
.tarot-submit-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tarot-submit-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.25);
}
.tarot-submit-btn:not(:disabled):active {
  transform: translateY(0);
}
/* 버튼 빛 번짐 효과 */
.tarot-submit-btn:not(:disabled)::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  animation: btnShimmer 3s ease-in-out infinite;
}
@keyframes btnShimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* --- 해석 보기 버튼 로딩 상태 --- */
.tarot-reveal-btn.loading {
  animation: btnPulseGlow 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnPulseGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.4), 0 0 60px rgba(251, 191, 36, 0.15);
    transform: scale(1.03);
  }
}

/* --- AI 해석 로딩 오버레이 --- */
#tarot-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 10, 30, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: overlayIn 0.4s ease-out;
}
#tarot-loading-overlay.fade-out {
  animation: overlayOut 0.4s ease-in forwards;
}
@keyframes overlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes overlayOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.tarot-loading-content {
  text-align: center;
}

/* 로딩 중 궤도 회전 카드 */
.tarot-loading-cards {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
}
.tarot-loading-card {
  position: absolute;
  width: 60px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 15px rgba(167, 139, 250, 0.3);
}
.tarot-loading-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.tarot-loading-card.lc1 {
  top: 50%;
  left: 50%;
  animation: orbitCard1 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.tarot-loading-card.lc2 {
  top: 50%;
  left: 50%;
  animation: orbitCard2 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.tarot-loading-card.lc3 {
  top: 50%;
  left: 50%;
  animation: orbitCard3 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes orbitCard1 {
  0% { transform: translate(-50%, -50%) rotate(0deg) translateX(70px) rotate(0deg) scale(0.9); }
  50% { transform: translate(-50%, -50%) rotate(180deg) translateX(70px) rotate(-180deg) scale(1.1); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateX(70px) rotate(-360deg) scale(0.9); }
}
@keyframes orbitCard2 {
  0% { transform: translate(-50%, -50%) rotate(120deg) translateX(70px) rotate(-120deg) scale(0.9); }
  50% { transform: translate(-50%, -50%) rotate(300deg) translateX(70px) rotate(-300deg) scale(1.1); }
  100% { transform: translate(-50%, -50%) rotate(480deg) translateX(70px) rotate(-480deg) scale(0.9); }
}
@keyframes orbitCard3 {
  0% { transform: translate(-50%, -50%) rotate(240deg) translateX(70px) rotate(-240deg) scale(0.9); }
  50% { transform: translate(-50%, -50%) rotate(420deg) translateX(70px) rotate(-420deg) scale(1.1); }
  100% { transform: translate(-50%, -50%) rotate(600deg) translateX(70px) rotate(-600deg) scale(0.9); }
}

/* 궤도 빛 링 */
.tarot-loading-cards::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 50%;
  animation: ringPulse 2s ease-in-out infinite;
}
.tarot-loading-cards::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 50%;
  animation: ringPulse 2s ease-in-out 0.5s infinite;
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.08); }
}

/* 중앙 글로우 */
.tarot-loading-cards .center-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4), transparent);
  border-radius: 50%;
  animation: centerGlow 2s ease-in-out infinite;
}
@keyframes centerGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
}

/* 로딩 문구 */
.tarot-loading-text {
  font-family: var(--font-serif);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* 로딩 도트 */
.tarot-loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.tarot-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.6);
  animation: dotBounce 1.4s ease-in-out infinite;
}
.tarot-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.tarot-loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* --- 결과 카드 hover 효과 --- */
.tarot-result-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tarot-result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(167, 139, 250, 0.12), 0 0 20px rgba(251, 191, 36, 0.06);
}

/* 결과 카드 이미지 hover 효과 */
.tarot-result-card-image {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tarot-result-card:hover .tarot-result-card-image {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- 액션 버튼 hover --- */
.tarot-action-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.tarot-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.15);
}
.tarot-action-btn:active {
  transform: translateY(0) scale(0.97);
}

/* --- 종합 해석 등장 효과 --- */
.tarot-synthesis {
  position: relative;
  overflow: hidden;
}
.tarot-synthesis::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: synthLineIn 1.5s ease-out 0.5s forwards;
}
@keyframes synthLineIn {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* --- 사주타로 배너 빛 효과 --- */
.sajutarot-banner {
  position: relative;
  overflow: hidden;
}
.sajutarot-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(245,158,11,0.04) 50%, transparent 60%);
  animation: bannerShimmer 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bannerShimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}
