/* Cosmic Tarot - Design System & Modern CSS Stylesheet */

/* 1. 디자인 시스템 변수 선언 */
:root {
  --bg-space: #07050f;
  --bg-card: rgba(18, 14, 35, 0.8);
  --bg-card-front: rgba(22, 17, 43, 0.95);
  --color-primary: #d4af37;        /* 신비로운 황금빛 (Metallic Gold) */
  --color-primary-rgb: 212, 175, 55;
  --color-secondary: #7f39fb;      /* 깊은 바이올렛 */
  --color-accent: #00f2fe;         /* 코스믹 사이언 (Glow Accent) */
  --color-accent-purple: #bf39fa;  /* 신비로운 마젠타 */
  --text-color: #f1ecff;
  --text-muted: #9f97b5;
  
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', sans-serif;
  
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-bg: rgba(11, 7, 24, 0.65);
  --gold-glow: 0 0 15px rgba(212, 175, 55, 0.35);
  --card-glow: 0 0 25px rgba(127, 57, 251, 0.3);
}

/* 2. 전역 스타일 및 레이아웃 초기화 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-space);
  color: var(--text-color);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 스크롤바 디자인 */
::-webkit-scrollbar {
  width: 8px;
}
.hidden {
  display: none !important;
}
::-webkit-scrollbar-track {
  background: rgba(7, 5, 15, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.6);
}

/* 3. 배경 효과 (별자리 및 성운 효과) */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

/* 반짝이는 별 레이아웃 */
.star {
  position: absolute;
  background-color: #fff;
  border-radius: 50%;
  animation: twinkle infinite ease-in-out;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

.nebula-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 10% 20%, rgba(127, 57, 251, 0.14) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(191, 57, 250, 0.06) 0%, transparent 70%);
  /* 모바일 GPU 발열 및 화면 떨림 방지를 위해 무거운 blur 필터를 부드러운 그라디언트로 최적화 */
}

/* 4. 공통 UI 컴포넌트 */

/* 컨트롤 패널 (헤더 아래 중앙 정렬) */
.top-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 10px;
  z-index: 10;
  width: max-content;
  position: relative;
}

.icon-button {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 8px 16px;
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  /* Identity transforms */
  translate: 0px 0px;
  scale: 1;
}

.icon-button:hover {
  border-color: var(--color-primary);
  box-shadow: var(--gold-glow);
  scale: 1.05;
}

.icon-button:active {
  scale: 0.95;
}

.icon-button.sound-muted {
  opacity: 0.5;
  border-color: rgba(255, 255, 255, 0.1);
}

/* 신비로운 버튼 (Mystic Button) */
.mystic-button {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #561ebc 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 12px 32px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(127, 57, 251, 0.4);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  /* Identity transforms */
  translate: 0px 0px;
  scale: 1;
}

.mystic-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.mystic-button:hover::before {
  left: 100%;
}

.mystic-button:hover {
  box-shadow: 0 6px 20px rgba(127, 57, 251, 0.6), 0 0 10px rgba(0, 242, 254, 0.3);
  scale: 1.05;
  border-color: var(--color-accent);
}

.mystic-button:active {
  scale: 0.98;
}

.mystic-button.outline {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}

.mystic-button.outline:hover {
  background: rgba(212, 175, 55, 0.1);
  box-shadow: var(--gold-glow);
  color: #fff;
}

.mystic-button.danger {
  background: linear-gradient(135deg, #c0392b 0%, #962d22 100%);
  box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}
.mystic-button.danger:hover {
  box-shadow: 0 6px 20px rgba(192, 57, 43, 0.6);
  border-color: #ff7675;
}

.text-button {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  padding: 6px 14px;
  color: #ffd700;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
}
.text-button:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

/* 5. 앱 레이아웃 컨테이너 */
.app-container {
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

/* 헤더 스타일 */
.app-header {
  text-align: center;
  margin-top: 25px;
  margin-bottom: 40px;
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #fff 30%, var(--color-primary) 70%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.3));
  margin-bottom: 8px;
}

.logo-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 300;
}

/* 6. 스프레드 종류 선택 섹션 (1단계) */
.spread-section {
  width: 100%;
  max-width: 900px;
  margin: auto;
  opacity: 1;
  transition: opacity 0.4s var(--transition-smooth);
}

.selection-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  justify-content: center;
}

.spread-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Identity transforms */
  translate: 0px 0px;
  scale: 1;
  rotate: 0deg;
}

.spread-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% -20%, rgba(127, 57, 251, 0.4), transparent 70%);
  opacity: 0.4;
  transition: var(--transition-smooth);
}

.spread-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: var(--transition-smooth);
}

.topic-icon-svg,
.topic-icon-img {
  width: 90px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.4));
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
  pointer-events: none;
}

.topic-card:hover .topic-icon-svg,
.topic-card:hover .topic-icon-img {
  transform: translateY(-5px) scale(1.1);
  filter: drop-shadow(0 8px 22px rgba(212, 175, 55, 0.75));
}

.spread-card-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 1px;
  transition: var(--transition-smooth);
}

.spread-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* 마우스 호버 시 카드 박스 펄럭임/빠른 클릭 흔들림(Flicker Loop) 100% 원천 차단 */
.spread-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--card-glow), var(--gold-glow);
  translate: 0 0 !important;
  transform: none !important;
}

.spread-card:hover .tarot-art-container,
.spread-card:hover .spread-card-icon {
  transform: translateY(-8px) scale(1.06);
}

.spread-card:hover .spread-card-title {
  color: var(--color-primary);
  text-shadow: var(--gold-glow);
  transform: translateY(-2px);
}

.spread-card:hover .spread-card-glow {
  opacity: 0.9;
  background: radial-gradient(circle at 50% -20%, rgba(0, 242, 254, 0.45), transparent 70%);
}

/* 7. 메인 타로 보드 (2단계) */
.tarot-board {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  animation: fadeIn 0.6s ease-out;
}

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

.board-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.board-instruction {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  margin-top: 8px;
  line-height: 1.5;
}

.action-bar {
  margin-bottom: 70px;
  position: relative;
  z-index: 100; /* 카드가 버튼 위로 올라와 덮는 것을 방지 */
}

/* 카드 덱 영역 */
.deck-wrapper {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  touch-action: none;
}

.tarot-deck {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 900px;
  height: 280px;
  position: relative;
  transition: var(--transition-smooth);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 8. 3D 타로 카드 스타일 */
.tarot-card {
  width: 150px;
  height: 260px;
  position: absolute;
  cursor: pointer;
  border-radius: 12px;
  /* Identity transforms for hover states */
  translate: 0px 0px;
  scale: 1;
  rotate: 0deg;
  perspective: 1000px;
  transition: 
    translate 0.6s cubic-bezier(0.25, 0.8, 0.25, 1),
    rotate 0.6s cubic-bezier(0.25, 0.8, 0.25, 1),
    scale 0.3s ease,
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-slow), box-shadow 0.3s ease;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transform: rotateY(0deg);
}

.tarot-card.flipped .card-inner,
.tarot-card.selected .card-inner {
  transform-style: preserve-3d;
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  backface-visibility: hidden !important; /* 상시 뒷면 감춤 적용으로 WebKit 하위 호환 확보 */
  -webkit-backface-visibility: hidden !important; /* 상시 뒷면 감춤 적용으로 WebKit 하위 호환 확보 */
}

/* 평소 뒤집히지 않았을 때는 앞면을 숨겨 뒷면이 2D 평면 위에 완벽히 노출되도록 제어 */
.tarot-card:not(.selected):not(.flipped) .card-front {
  display: none !important;
}

/* 카드 뒷면 스타일 (사용자 지정 실물 타로 카드 그래픽 이미지 사용) */
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(0deg) translateZ(0px);
  border-radius: 12px;
  overflow: hidden;
  background-image: url('./assets/tarot_card_back.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.card-back::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.1), transparent 85%);
  pointer-events: none;
}

/* 카드 앞면 (3D 카드 회전을 위해 overflow: hidden 및 masking 처리 원복) */
.card-front {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg) translateZ(1px); /* translateZ(1px)로 Z축 우선 배치 보증 */
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card-front);
  border: 2px solid var(--color-primary);
  display: block;
}

/* 카드 내부 테두리 데코레이션 */
.card-border-deco {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

/* SVG 및 이미지 일러스트 컨테이너 (카드 크기에 맞게 100% 꽉 채움) */
.card-artwork {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  z-index: 1;
}

.card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   카드 하단 정보 영역 (.card-info-under) 
   ========================================================================== */

/* 카드 정보 영역 (카드가 뒤집혔을 때만 서서히 노출) */
.card-info-under {
  position: absolute;
  bottom: -100px; /* 카드 바깥 아래쪽 영역 */
  left: 0;
  width: 100%;
  height: 90px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

/* 카드가 selected 되었거나 flipped 되었을 때만 설명 텍스트 노출 */
.tarot-card.flipped .card-info-under,
.tarot-card.selected .card-info-under {
  opacity: 1;
  pointer-events: auto;
}

/* 로마 숫자 */
.card-numeral {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
}

/* 한국어 카드 이름 */
.card-name-ko {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.5px;
  text-align: center;
}

/* 영어 카드 이름 */
.card-name-en {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

/* 방향 뱃지 */
.card-direction-badge {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--color-primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.card-direction-badge.reversed {
  background: rgba(191, 57, 250, 0.15);
  border-color: var(--color-accent-purple);
  color: #e585ff;
}

/* 카드 상호작용 상태 정의 */

/* 셔플 시 가운데로 모으는 레이아웃 정의 */
.tarot-deck.shuffling .tarot-card {
  left: 50% !important;
  translate: -50% 0px !important;
  rotate: 0deg !important;
  z-index: 1;
}

/* 셔플 애니메이션 4n 최적화 (전체 카드의 50%를 징검다리식으로 섞어 렉을 없애면서 전체가 섞이는 비주얼 유지) */
.tarot-deck.shuffling .tarot-card:nth-child(4n+1) {
  animation: shuffle-riffle-up 0.65s ease-in-out infinite;
}

.tarot-deck.shuffling .tarot-card:nth-child(4n+3) {
  animation: shuffle-riffle-down 0.65s ease-in-out infinite;
}

@keyframes shuffle-riffle-up {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-15px, -80px, 40px) rotate(-4deg);
    z-index: 100;
  }
}

@keyframes shuffle-riffle-down {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(15px, 80px, -40px) rotate(4deg);
    z-index: -100;
  }
}

/* 마우스 호버 시 카드 들뜨는 효과 */
.tarot-card::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -40px; /* 카드가 위로 들려 올라갈 때 마우스 커서 영역을 잡고 있도록 연장 */
  background: transparent;
  pointer-events: auto;
  z-index: -1;
}

/* 마우스 호버를 지원하는 데스크톱 환경에서만 카드 솟구침 호버 효과 적용 */
@media (hover: hover) {
  .tarot-deck .tarot-card:not(.selected):not(.inactive):hover {
    translate: -50% calc(var(--card-y, 0px) - 45px) !important;
    rotate: 0deg !important;
    scale: 1.15 !important;
    z-index: 1000 !important;
  }

  .tarot-card:hover .card-inner {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), var(--gold-glow);
  }
}

/* 모바일 터치 드래그 훑어보기용 호버 스타일 */
.tarot-deck .tarot-card.mobile-hover {
  translate: -50% calc(var(--card-y, 0px) - 45px) !important;
  rotate: 0deg !important;
  scale: 1.15 !important;
  z-index: 1000 !important;
}
.tarot-card.mobile-hover .card-inner {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), var(--gold-glow);
}

/* 비활성화된 카드 (선택이 끝난 후 선택되지 않은 카드들) */
.tarot-card.inactive {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(40%);
}

/* 선택된 카드 */
.tarot-card.selected {
  scale: 1.05;
  z-index: 50 !important;
}
.tarot-card.selected .card-inner {
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.6), var(--gold-glow);
}

/* 9. 스프레드 슬롯 가이드 (3카드 점을 볼 때 위치) */
.spread-slots-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-top: 30px;
  margin-bottom: 110px; /* 카드 바깥 아래쪽 텍스트를 위한 공간 확보 */
  width: 100%;
  max-width: 900px;
  animation: fadeIn 0.5s ease-out;
}

.spread-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 154px;
}

.slot-label {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.slot-placeholder {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 150px;
  height: 260px;
  border: 2px dashed rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

.slot-placeholder .tarot-card {
  width: 100% !important;
  height: 100% !important;
}

.slot-placeholder.active {
  border-color: var(--color-primary);
  background: rgba(212, 175, 55, 0.05);
  box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.1);
}

.slot-connector {
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.1));
  flex-grow: 1;
  max-width: 80px;
  margin-top: 130px;
}

/* 10. 해석 결과 패널 (Glassmorphism - 3단계) */
.reading-result-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  
  /* @starting-style 및 allow-discrete 애니메이션 */
  display: flex;
  opacity: 1;
  transition: 
    display 0.5s, 
    opacity 0.5s ease-out, 
    overlay 0.5s;
  transition-behavior: allow-discrete;
}

/* 진입 시작 상태 */
@starting-style {
  .reading-result-panel {
    opacity: 0;
  }
  .reading-result-panel .panel-content-wrapper {
    scale: 0.9;
    translate: 0 30px;
  }
}

/* 퇴장 및 숨김 상태 */
.reading-result-panel.hidden {
  display: none;
  opacity: 0;
}
.reading-result-panel.hidden .panel-content-wrapper {
  scale: 0.9;
  translate: 0 30px;
}

.panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 3, 10, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.panel-content-wrapper {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 30px;
  z-index: 10;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--card-glow);
  display: flex;
  flex-direction: column;
  gap: 25px;
  
  /* 개별 트랜지션 바인딩 */
  scale: 1;
  translate: 0px 0px;
  transition: scale 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), translate 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.close-panel-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.close-panel-btn:hover {
  color: #fff;
  transform: rotate(90deg);
}

.result-header {
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.result-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-primary);
  letter-spacing: 2px;
  font-weight: 700;
}

.result-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* 카드별 상세 해석 레이아웃 */
.result-cards-display {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 15px 0;
}

.result-card-detail {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px;
  gap: 24px;
  align-items: center;
  transition: var(--transition-smooth);
}

.result-card-detail:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.2);
}

/* 결과창 내 카드 미니어처 */
.result-card-preview {
  flex-shrink: 0;
  width: 120px;
  height: 208px;
  perspective: 1000px;
  margin-bottom: 75px; /* 하단 텍스트 공간 확보를 위해 여백 확보 */
}

.result-card-preview .tarot-card {
  position: relative;
  width: 100%;
  height: 100%;
  left: auto !important;
  translate: none !important;
  rotate: none !important;
  cursor: default;
  pointer-events: none;
}


/* 결과 프리뷰용 카드 하단 정보 영역 오프셋 튜닝 */
.result-card-preview .card-info-under {
  bottom: -80px !important;
  height: 75px !important;
  gap: 2px !important;
}

.result-card-preview .card-numeral {
  font-size: 0.65rem !important;
}

.result-card-preview .card-direction-badge {
  font-size: 0.55rem !important;
  padding: 2px 6px !important;
}

.result-card-preview .card-name-ko {
  font-size: 0.75rem !important;
}

.result-card-preview .card-name-en {
  font-size: 0.55rem !important;
}

/* 해석 텍스트 콘텐츠 */
.result-card-text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-badge {
  align-self: flex-start;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
  border-left: 3px solid var(--color-primary);
  letter-spacing: 0.5px;
}

.card-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.card-full-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.card-keywords {
  font-size: 0.9rem;
  color: var(--color-accent);
  font-weight: 500;
}

.card-interpretation {
  font-size: 0.98rem;
  color: #e2dcf2;
  line-height: 1.7;
  font-weight: 300;
  margin-top: 5px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

/* 11. 기록 보관함 모달 패널 (4단계) */
.history-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
  
  /* @starting-style 및 allow-discrete 애니메이션 */
  display: flex;
  opacity: 1;
  transition: 
    display 0.4s, 
    opacity 0.4s ease-out, 
    overlay 0.4s;
  transition-behavior: allow-discrete;
}

@starting-style {
  .history-panel {
    opacity: 0;
  }
  .history-panel .history-content-wrapper {
    translate: 100% 0px;
  }
}

.history-panel.hidden {
  display: none;
  opacity: 0;
}

.history-panel.hidden .history-content-wrapper {
  translate: 100% 0px;
}

.history-content-wrapper {
  position: relative;
  background: var(--glass-bg);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 100%;
  max-width: 480px;
  height: 100%;
  padding: 40px 30px;
  z-index: 10;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 25px;
  
  /* Identity transforms */
  translate: 0px 0px;
  transition: translate 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.history-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--color-primary);
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
  margin-top: 15px;
  font-weight: 700;
}

.history-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 5px;
}

.empty-history-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 40px;
  line-height: 1.6;
  font-weight: 300;
}

/* 저장 내역 카드 */
.history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 175, 55, 0.2);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-item-type {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
}

.history-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.history-card-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.history-card-chip.gold-badge {
  border-color: rgba(212, 175, 55, 0.3);
  color: #ffeaa7;
}

.btn-delete-item {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  opacity: 0;
}

.history-item:hover .btn-delete-item {
  opacity: 1;
}

.btn-delete-item:hover {
  color: #ff7675;
}

.history-footer-actions {
  display: flex;
  justify-content: center;
}

/* 12. 푸터 스타일 */
.app-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
}

.app-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-note {
  font-weight: 300;
  font-style: italic;
  font-size: 0.75rem !important;
}

/* 13. 반응형 미디어 쿼리 (반응형 최적화) */
/* 태블릿 및 일반 모바일 기기 (max-width: 768px) */
@media (max-width: 768px) {
  .top-controls {
    margin-top: 15px;
    margin-bottom: 5px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 10px;
  }

  .app-container {
    padding-top: 15px;
  }

  .logo-title {
    font-size: 2.2rem;
  }
  
  .logo-subtitle {
    font-size: 0.9rem;
  }

  /* 스프레드 선택 그리드 세로 1열 개편 */
  #spread-selection .selection-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 320px;
    margin: 0 auto;
  }

  .spread-card {
    padding: 20px 15px;
  }

  /* 고민 주제 선택 그리드 가로 2열 개편 */
  #topic-selection .selection-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
  }

  .topic-card {
    padding: 20px 10px;
  }

  .topic-card .spread-card-icon {
    margin-bottom: 8px;
  }

  .topic-card .topic-icon-svg,
  .topic-card .topic-icon-img {
    width: 72px;
    height: 54px;
  }

  .topic-card .spread-card-title {
    font-size: 1rem;
  }

  /* 타로 보드 모바일 레이아웃 */
  .tarot-board {
    padding: 10px;
    gap: 20px;
  }

  /* 섞기 전/섞는 중 기본 덱 높이 (카드가 크므로 270px로 확대) */
  .tarot-deck {
    height: 270px;
    margin-bottom: 10px;
    transition: height 0.5s ease;
  }

  /* 부채꼴로 펼쳐졌을 때 덱 높이 (기존 190px로 축소) */
  .tarot-deck.fanned {
    height: 190px;
  }

  /* 모바일용 셔플 애니메이션 진폭 축소 대응 (4n 패턴으로 50% 카드를 교차 셔플하여 렉 예방 및 전체 셔플 비주얼 유지) */
  .tarot-deck.shuffling .tarot-card:nth-child(4n+1) {
    animation: shuffle-riffle-up-mobile 0.65s ease-in-out infinite !important;
  }

  .tarot-deck.shuffling .tarot-card:nth-child(4n+3) {
    animation: shuffle-riffle-down-mobile 0.65s ease-in-out infinite !important;
  }

  /* 섞기 전 & 섞는 동안 모바일 카드 크기 (140px x 242px 시원하고 크게 확대!) */
  .tarot-card {
    width: 140px;
    height: 242px;
    transition: 
      width 0.5s ease,
      height 0.5s ease,
      left 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
      translate 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
      rotate 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
      scale 0.3s ease,
      transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  /* 부채꼴로 펼쳐졌을 때 (fanned): 기존 사이즈 (100px x 173px)로 자연스럽게 전환 */
  .tarot-deck.fanned .tarot-card {
    width: 100px;
    height: 173px;
  }

  /* 카드 내부 메타데이터 텍스트 스케일 조율 (모바일용 하단 간격 최적화) */
  .card-name-ko {
    font-size: 0.75rem !important;
    bottom: -56px !important;
  }

  .card-name-en {
    font-size: 0.55rem !important;
    bottom: -70px !important;
  }

  .card-numeral {
    font-size: 0.65rem !important;
    bottom: -20px !important;
  }

  .card-direction-badge {
    font-size: 0.55rem !important;
    padding: 2px 6px !important;
    bottom: -38px !important;
  }

  /* 슬롯 가로 3열 유지 및 폭 세이브 (모바일용 하단 여백 추가) */
  .spread-slots-container {
    gap: 12px;
    padding: 10px;
    margin-bottom: 120px;
  }

  .spread-slot {
    width: 105px;
  }

  .slot-placeholder {
    width: 100px;
    height: 173px;
  }

  .slot-label {
    font-size: 0.75rem;
  }

  /* 화살표 가로 연결선 숨겨서 슬롯 공간 극대화 확보 */
  .slot-connector {
    display: none !important;
  }

  /* 모달 리포트 본문 모바일화 */
  .modal-content {
    width: 95% !important;
    max-height: 90vh;
    padding: 20px 15px;
  }

  .modal-header h2 {
    font-size: 1.4rem;
  }

  .result-card-detail {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px;
  }

  .result-card-preview {
    margin: 0 auto 75px auto;
  }

  .result-card-text {
    width: 100%;
    align-items: center;
  }

  .card-full-name {
    font-size: 1.15rem;
    text-align: center;
  }

  .card-keywords {
    font-size: 0.75rem;
    text-align: center;
  }

  .premium-report-container {
    padding: 12px !important;
  }

  .report-sub-title {
    font-size: 0.95rem !important;
  }

  .report-text {
    font-size: 0.88rem !important;
    line-height: 1.65;
  }

  .report-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .result-actions {
    flex-direction: column;
    gap: 10px;
  }

  .panel-content-wrapper {
    padding: 25px 15px;
  }

  .result-title {
    font-size: 1.6rem;
  }

  /* 모바일 Riffle 셔플 키프레임 정의 */
  @keyframes shuffle-riffle-up-mobile {
    0%, 100% {
      transform: translate3d(0, 0, 0) rotate(0deg);
    }
    50% {
      transform: translate3d(-10px, -45px, 20px) rotate(-4deg);
      z-index: 100;
    }
  }

  @keyframes shuffle-riffle-down-mobile {
    0%, 100% {
      transform: translate3d(0, 0, 0) rotate(0deg);
    }
    50% {
      transform: translate3d(10px, 45px, -20px) rotate(4deg);
      z-index: -100;
    }
  }
}

/* 초소형 스마트폰 대응 (max-width: 480px) */
@media (max-width: 480px) {
  .logo-title {
    font-size: 1.8rem;
  }

  .logo-subtitle {
    font-size: 0.8rem;
  }

  /* 초소형 전용 카드 및 슬롯 미세화 */
  .tarot-deck {
    height: 250px;
  }

  .tarot-deck.fanned {
    height: 160px;
  }

  .tarot-card {
    width: 125px;
    height: 216px;
  }

  .tarot-deck.fanned .tarot-card {
    width: 85px;
    height: 147px;
  }

  .spread-slot {
    width: 90px;
  }

  .slot-placeholder {
    width: 85px;
    height: 147px;
  }

  .slot-label {
    font-size: 0.7rem;
  }

  /* 리포트 모달 너비 확보 */
  .modal-content {
    width: 98% !important;
    padding: 15px 10px;
  }

  .card-full-name {
    font-size: 1.05rem;
  }

  .report-text {
    font-size: 0.85rem !important;
  }
}

/* 사용자 접근성 (움직임 최소화 설정 반영) */
@media (prefers-reduced-motion: reduce) {
  .tarot-card {
    transition-duration: 0.1s !important;
    animation: none !important;
  }
  
  .spread-card:hover {
    translate: none !important;
  }

  .icon-button:hover, .mystic-button:hover {
    scale: 1 !important;
  }

  .card-inner {
    transition-duration: 0.1s !important;
  }

  .panel-content-wrapper, .history-content-wrapper {
    translate: none !important;
    scale: 1 !important;
    transition-duration: 0.1s !important;
  }
}

/* 14. 고민 주제 선택 카드 (Topic Card) 스타일 */
.topic-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 35px 25px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Reset default button styling */
  color: var(--text-color);
  font-family: var(--font-sans);
  scale: 1;
}

.topic-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--card-glow), var(--gold-glow);
  transform: none !important;
  translate: 0 0 !important;
}

.topic-card:hover .tarot-art-container,
.topic-card:hover .spread-card-icon {
  transform: translateY(-8px) scale(1.08);
}

.topic-card:hover .spread-card-title {
  color: var(--color-primary);
  text-shadow: var(--gold-glow);
  transform: translateY(-2px);
}

/* 14.5. 선택 활성화 상태 스타일 (Active State) */
.spread-card.active, .topic-card.active {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), var(--card-glow) !important;
  scale: 1.05 !important;
  background: rgba(212, 175, 55, 0.08) !important;
  transition: all 0.2s ease-out !important;
}

.spread-card.active .spread-card-title, .topic-card.active .spread-card-title {
  color: var(--color-primary) !important;
  text-shadow: var(--gold-glow) !important;
}

.spread-card.active .spread-card-icon, .topic-card.active .spread-card-icon {
  transform: scale(1.22) rotate(8deg) !important;
}

/* 15. 천기문 Flat-rate Premium Report 스타일 */
.premium-report-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(212, 175, 55, 0.03);
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: 18px;
  padding: 24px;
  margin-top: 15px;
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.report-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.report-sub-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-text {
  font-size: 0.96rem;
  color: #e2dcf2;
  line-height: 1.7;
  font-weight: 300;
  text-align: left;
}

.report-core-meaning {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  text-align: left;
  border-left: 2px solid rgba(212, 175, 55, 0.3);
  padding-left: 8px;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.report-badge-gold {
  background: linear-gradient(135deg, #d4af37 0%, #aa8412 100%);
  color: #07050f;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: var(--gold-glow);
}

.report-keywords-line {
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* ==========================================================================
   16. 모바일 전용 카드 포커스 및 확정 플로팅 버튼 스타일
   ========================================================================== */

/* 모바일 카드 선택 탭 시 솟구치는 포커스 스타일 */
.tarot-card.focused {
  translate: -50% calc(var(--card-y, 0px) - 80px) !important;
  rotate: 0deg !important;
  scale: 1.2 !important;
  z-index: 10000 !important;
}

.tarot-card.focused .card-inner {
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.95), 0 0 15px rgba(0, 242, 254, 0.8), var(--gold-glow) !important;
  animation: pulseGlowCard 2s infinite ease-in-out;
}

@keyframes pulseGlowCard {
  0%, 100% {
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.95), 0 0 15px rgba(0, 242, 254, 0.8), var(--gold-glow);
  }
  50% {
    box-shadow: 0 0 45px rgba(212, 175, 55, 1), 0 0 25px rgba(0, 242, 254, 1), var(--gold-glow);
  }
}

/* 모바일 전용 카드 선택 확정 플로팅 버튼 */
.btn-confirm-card {
  position: fixed;
  bottom: max(25px, env(safe-area-inset-bottom, 25px));
  left: 50%;
  translate: -50% 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #07050f;
  border: none;
  padding: 14px 35px;
  border-radius: 40px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), var(--gold-glow);
  cursor: pointer;
  z-index: 2000;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: pulseConfirm 1.8s infinite;
}

.btn-confirm-card.hidden {
  display: none !important;
}

.btn-confirm-card:active {
  scale: 0.95 !important;
}

@keyframes pulseConfirm {
  0%, 100% {
    translate: -50% 0;
    scale: 1;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), var(--gold-glow);
  }
  50% {
    translate: -50% -3px;
    scale: 1.04;
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.9), var(--gold-glow);
  }
}

/* ==========================================================================
   17. 별자리/점성술 (Astrology/Horoscope) 전용 스타일
   ========================================================================== */

/* 폼 컨테이너 내 입력 필드 스타일 */
.mystic-form-container input,
.mystic-form-container select {
  transition: all 0.3s ease;
}
.mystic-form-container input:focus,
.mystic-form-container select:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4), var(--gold-glow) !important;
  background: #191435 !important;
}

/* 네이탈 차트 SVG 스타일 및 링 회전 */
.chart-wheel-svg {
  width: 100%;
  height: 100%;
  max-width: 280px;
  max-height: 280px;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.15));
}

.chart-ring-rotate {
  transform-origin: 150px 150px;
  animation: rotateZodiac 3s cubic-bezier(0.12, 0.9, 0.2, 1) forwards;
}

@keyframes rotateZodiac {
  from {
    transform: rotate(-360deg);
    opacity: 0.2;
  }
  to {
    transform: rotate(0deg);
    opacity: 1;
  }
}

/* 행성 마커 라인 그리기 페이드인 */
.chart-line-draw {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 2s ease-out 1.2s forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

.chart-fade-in {
  opacity: 0;
  animation: fadeInSlow 1.2s ease-out 2s forwards;
}

@keyframes fadeInSlow {
  to {
    opacity: 1;
  }
}

/* 성운 게이지 진행 바 */
.energy-bar-group {
  display: flex;
  flex-direction: column;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 별자리 대시보드 구조 반응형 분기 */
@media (min-width: 769px) {
  .astro-row-main {
    flex-direction: row !important;
  }
  .astro-dashboard-wrapper {
    max-width: 900px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .astro-row-main {
    flex-direction: column !important;
    gap: 20px !important;
  }
  .chart-wheel-container,
  .astro-signs-summary {
    width: 100%;
  }
  .astro-safeguards {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .mystic-form-container {
    padding: 20px 15px !important;
  }
}

/* 다국어 카드 명칭 렌더링 분기 대응 */
body.lang-en .card-name-ko {
  display: none !important;
}

body.lang-en .card-name-en {
  display: block !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin-top: 4px;
  text-align: center !important;
}

body.lang-ko .card-name-en {
  /* 한국어 모드일 때는 영어를 서브로 작게 노출 */
  font-size: 0.7rem;
  color: var(--color-primary);
  text-align: center;
}


/* ==========================================================================
   15. 수익화 결제 유도 시스템 (Paywall & Interactive Blur)
   ========================================================================== */

/* 결과 텍스트 블러 및 그라데이션 가림 처리 */
.report-text-blur-wrapper {
  position: relative;
  max-height: 250px;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  mask-image: linear-gradient(to bottom, black 25%, rgba(0, 0, 0, 0.9) 45%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 25%, rgba(0, 0, 0, 0.9) 45%, transparent 95%);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: max-height;
}

/* 잠금 해제 완료 시 Wrapper 높이 제한 해제 및 마스킹 제거 */
.report-text-blur-wrapper.unlocked {
  max-height: 2000px !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  will-change: auto;
}

.report-text.locked {
  filter: blur(5px);
  opacity: 0.35;
  user-select: none;
  pointer-events: none;
  transition: filter 0.8s ease, opacity 0.8s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: filter, opacity;
}

.report-text.unlocked {
  filter: blur(0px) !important;
  opacity: 1 !important;
  user-select: auto !important;
  pointer-events: auto !important;
  will-change: auto;
}

/* 자물쇠 인터랙티브 컨테이너 */
.lock-container {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.5s ease, transform 0.3s ease;
}

.lock-container.unlocked {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -60%) scale(0.8) !important;
}

.lock-icon {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle, #1a1333 30%, #0d0a1b 90%);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), var(--gold-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lock-container:hover .lock-icon {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), var(--gold-glow);
}

.lock-label {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
  background: rgba(13, 10, 27, 0.85);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* 자물쇠 진동 애니메이션 */
@keyframes shakeLock {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  15% { transform: translate(-54%, -48%) rotate(-5deg); }
  30% { transform: translate(-46%, -52%) rotate(5deg); }
  45% { transform: translate(-53%, -51%) rotate(-3deg); }
  60% { transform: translate(-47%, -49%) rotate(3deg); }
  75% { transform: translate(-51%, -50%) rotate(-1deg); }
  90% { transform: translate(-49%, -50%) rotate(1deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.lock-container.shake {
  animation: shakeLock 0.4s ease-in-out;
}

/* 결제 모달 팝업 오버레이 */
.paywall-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.paywall-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 5, 15, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: backdrop-filter, -webkit-backdrop-filter;
}

.paywall-card {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: linear-gradient(135deg, rgba(23, 17, 45, 0.85) 0%, rgba(13, 9, 27, 0.95) 100%);
  border: 2px solid rgba(212, 175, 55, 0.35);
  border-radius: 28px;
  padding: 35px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.15);
  z-index: 10;
  text-align: center;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform, opacity;
}

/* 닫기 버튼 */
.paywall-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  z-index: 100;
  pointer-events: auto;
}

.paywall-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

/* 페이월 헤더 */
.paywall-badge {
  display: inline-block;
  background: linear-gradient(90deg, #d4af37, #f3e5ab, #d4af37);
  background-size: 200% auto;
  color: #07050f;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.68rem;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1.5px;
  margin-bottom: 15px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  animation: shimmerSweep 3s linear infinite;
}

.paywall-card h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.paywall-subtitle {
  font-size: 0.9rem;
  color: #ffeaa7;
  line-height: 1.5;
  margin-bottom: 25px;
}

.paywall-options-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

/* 구독 카드 (Primary CTA - 고대비 골드 3D 디자인) */
.paywall-premium-option {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(184, 134, 11, 0.95) 100%);
  border: none;
  border-radius: 20px;
  padding: 22px 24px;
  color: #07050f;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s ease;
}

.paywall-premium-option:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 15px 30px rgba(212, 175, 55, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.option-glow-glow {
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: shineSweep 4s infinite linear;
}

@keyframes shineSweep {
  0% { left: -150%; }
  35% { left: 150%; }
  100% { left: 150%; }
}

.option-meta {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #573e00;
  margin-bottom: 4px;
}

.option-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.option-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.2px;
}

.option-price {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.25rem;
  border-left: 1px solid rgba(87, 62, 0, 0.2);
  padding-left: 12px;
}

.option-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #2b1f00;
  font-weight: 500;
}

/* 단일 결제 옵션 (Secondary CTA - 저대비 고스트 디자인) */
.paywall-single-option {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 15px 20px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-align: left;
}

.paywall-single-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
  color: #fff;
}

.single-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.single-price {
  font-size: 0.9rem;
  font-weight: 700;
}

/* 페이월 푸터 */
.paywall-footer-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 15px;
}

/* 골드 쉬머 스위프 애니메이션 */
@keyframes shimmerSweep {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 로딩 인디케이터 연출 */
.paywall-loading {
  pointer-events: none;
  opacity: 0.7;
}

.paywall-loading .paywall-premium-option {
  background: #b8860b !important;
}

/* 리텐션 훅 알림 배너 스타일 */
.retention-hook-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 242, 254, 0.05) 100%);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: fadeInUp 0.6s ease-out;
  text-align: left;
}

.retention-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
}

.retention-body {
  flex-grow: 1;
}

.retention-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 2px;
}

.retention-desc {
  font-size: 0.78rem;
  color: #ffeaa7;
  line-height: 1.4;
}

/* ==========================================================================
   16. 모바일 대응 반응형 페이월
   ========================================================================== */
@media (max-width: 768px) {
  .paywall-card {
    padding: 30px 20px;
    width: 92%;
  }

  .paywall-card h2 {
    font-size: 1.35rem;
  }

  .paywall-subtitle {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .paywall-premium-option {
    padding: 16px 18px;
  }

  .option-title {
    font-size: 1rem;
  }

  .option-price {
    font-size: 1.05rem;
    padding-left: 8px;
  }

  .option-desc {
    font-size: 0.72rem;
  }

  .paywall-single-option {
    padding: 12px 15px;
  }

  .single-title {
    font-size: 0.78rem;
  }

  .single-price {
    font-size: 0.82rem;
  }
}

/* --- 9. 회원가입 및 결제/별가루 시스템 관련 신규 스타일 --- */
.star-icon-img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.star-icon-silver {
  filter: drop-shadow(0 0 5px rgba(220, 220, 255, 0.7));
}

.star-icon-gold {
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
}

.star-icon-lg {
  width: 24px;
  height: 24px;
}

.user-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(25, 18, 48, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  cursor: pointer;
}
.user-stars:hover {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
  transform: translateY(-1px);
}

.user-stars.hidden {
  display: none !important;
}

.star-silver, .star-gold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.star-silver {
  color: #e0e0e0;
}

.star-gold {
  color: #ffd700;
}

.tab-btn {
  transition: color 0.3s ease, border-color 0.3s ease;
}

.tab-btn:hover {
  color: #fff !important;
}

.auth-form-container {
  animation: fadeIn 0.4s ease;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}

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

.auth-tabs button.active {
  color: #fff !important;
  border-bottom: 2px solid var(--color-primary) !important;
}

.auth-tabs button:not(.active) {
  color: var(--text-muted) !important;
  border-bottom: 2px solid transparent !important;
}

/* 모바일 전용 top-controls 스택 튜닝 */
@media (max-width: 600px) {
  .top-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .user-stars {
    order: -1; /* 모바일에서 별가루 개수를 최상단 중앙에 잘 보이도록 순서 조절 */
    width: 100%;
    justify-content: center;
  }
}

/* 언어 선택 드롭다운 스타일 */
.lang-dropdown-menu.hidden {
  display: none !important;
}
.lang-opt-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
.lang-opt-btn.active {
  background: rgba(255, 215, 0, 0.15) !important;
  color: #ffd700 !important;
}

/* 우측 상단 네비게이션 & 3줄(☰) 햄버거 메뉴 패널 */
.top-right-nav {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  max-width: calc(100% - 30px);
  justify-content: flex-end;
}

#auth-btn-label {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.header-auth-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 8px 16px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  flex-shrink: 1;
  min-width: 0;
}

.header-auth-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--gold-glow);
  transform: scale(1.05);
}

.hamburger-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hamburger-toggle-btn, .hamburger-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  color: var(--text-color);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  flex-shrink: 0;
  box-sizing: border-box;
}

.hamburger-bar {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.hamburger-toggle-btn:hover, .hamburger-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--gold-glow);
  transform: scale(1.06);
}

.hamburger-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(18, 14, 35, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  animation: fadeInDown 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hamburger-dropdown-menu.hidden {
  display: none !important;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-item-wrapper {
  width: 100%;
}

.menu-action-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.menu-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border);
  color: var(--color-primary);
}

/* 고품격 타로 앱 전문 아트워크 스타일 (기존 110px 크기 원복) */
.tarot-art-container {
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarot-art-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.3));
  transition: filter 0.4s ease;
}

.tarot-theme-card {
  border: 1px solid var(--glass-border) !important;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.tarot-theme-card:hover .tarot-art-container {
  transform: translateY(-4px) scale(1.08);
}

.tarot-theme-card:hover .tarot-art-svg {
  filter: drop-shadow(0 8px 24px rgba(212, 175, 55, 0.5));
}

/* 모바일 전용 반응형 헤더 여백 최적화 (겹침 및 우측 짤림 방지 완벽 반영) */
@media (max-width: 600px) {
  .app-header {
    margin-top: 52px !important;
    margin-bottom: 20px !important;
  }
  .logo-title {
    font-size: 1.85rem !important;
    letter-spacing: 3px !important;
    margin-bottom: 4px !important;
  }
  .logo-subtitle {
    font-size: 0.82rem !important;
    letter-spacing: 1px !important;
  }
  .top-right-nav {
    top: 8px !important;
    right: 8px !important;
    gap: 5px !important;
    max-width: calc(100% - 16px) !important;
  }
  .icon-button {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
  }
  #auth-btn-label {
    max-width: 70px !important;
    font-size: 0.8rem !important;
  }
  .user-stars {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
    gap: 4px !important;
  }
  .hamburger-toggle-btn, .hamburger-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    gap: 3px !important;
  }
  .hamburger-bar {
    width: 15px !important;
    height: 2px !important;
  }
}

/* ==========================================================================
   루나(Luna) 1:1 꼬리질문 대화창 스타일
   ========================================================================== */
.luna-chat-card {
  margin-top: 24px;
  margin-bottom: 20px;
  background: rgba(18, 12, 38, 0.75);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 215, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.luna-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.luna-avatar-container {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, rgba(15, 9, 35, 0.9) 70%);
  border: 1.5px solid #ffd700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.luna-avatar-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
}

.luna-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #00ff88;
  border-radius: 50%;
  border: 2px solid #0f0923;
  box-shadow: 0 0 6px #00ff88;
  animation: lunaPulse 2s infinite ease-in-out;
}

@keyframes lunaPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.luna-header-info {
  flex: 1;
  min-width: 0;
}

.luna-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.luna-name {
  font-weight: 700;
  font-size: 1rem;
  color: #ffd700;
  letter-spacing: 0.5px;
}

.luna-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 242, 254, 0.12);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.35);
  white-space: nowrap;
}

.luna-badge.vip {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.4);
}

.luna-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.luna-messages-container {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.luna-messages-container::-webkit-scrollbar {
  width: 4px;
}
.luna-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.25);
  border-radius: 4px;
}

.luna-msg {
  display: flex;
  max-width: 88%;
  animation: fadeIn 0.3s ease;
}

.luna-msg-bot {
  align-self: flex-start;
}

.luna-msg-user {
  align-self: flex-end;
}

.luna-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.luna-msg-bot .luna-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.22);
  color: #f0e6ff;
  border-top-left-radius: 2px;
}

.luna-msg-user .luna-msg-bubble {
  background: linear-gradient(135deg, rgba(142, 45, 226, 0.6) 0%, rgba(74, 0, 224, 0.6) 100%);
  border: 1px solid rgba(142, 45, 226, 0.5);
  color: #ffffff;
  border-top-right-radius: 2px;
}

.luna-input-form {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.luna-input-form:focus-within {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.luna-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
}

.luna-input-field::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.luna-send-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #0f0923;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
}

.luna-send-button:hover {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.luna-send-button:active {
  transform: scale(0.94);
}

.luna-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.luna-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.luna-typing-dot {
  width: 5px;
  height: 5px;
  background: #ffd700;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.luna-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.luna-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}



/* 14. Yes/No 운명 나침반 게이지 컴포넌트 스타일 */
.yesno-verdict-box {
  background: rgba(11, 7, 24, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 20px;
  padding: 24px 20px;
  margin-bottom: 25px;
  text-align: center;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.yesno-verdict-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.yesno-verdict-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

/* 4단계 상태별 색상 테마 */
.verdict-strong-yes .yesno-verdict-badge {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #ffd700;
}
.verdict-strong-yes .yesno-verdict-title {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.verdict-yes-but .yesno-verdict-badge {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.5);
  color: #00f2fe;
}
.verdict-yes-but .yesno-verdict-title {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.verdict-wait .yesno-verdict-badge {
  background: rgba(186, 104, 200, 0.15);
  border: 1px solid rgba(186, 104, 200, 0.5);
  color: #ce93d8;
}
.verdict-wait .yesno-verdict-title {
  background: linear-gradient(135deg, #ce93d8, #ab47bc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(206, 147, 216, 0.3);
}

.verdict-no .yesno-verdict-badge {
  background: rgba(255, 107, 129, 0.15);
  border: 1px solid rgba(255, 107, 129, 0.5);
  color: #ff8fab;
}
.verdict-no .yesno-verdict-title {
  background: linear-gradient(135deg, #ff758c, #ff7eb3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 117, 140, 0.3);
}

.yesno-gauge-outer {
  background: rgba(255, 255, 255, 0.06);
  height: 12px;
  border-radius: 6px;
  margin: 14px auto 16px auto;
  max-width: 320px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.yesno-gauge-inner {
  height: 100%;
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.verdict-strong-yes .yesno-gauge-inner {
  background: linear-gradient(90deg, #ffaa00, #ffd700);
}
.verdict-yes-but .yesno-gauge-inner {
  background: linear-gradient(90deg, #4facfe, #00f2fe);
}
.verdict-wait .yesno-gauge-inner {
  background: linear-gradient(90deg, #ab47bc, #ce93d8);
}
.verdict-no .yesno-gauge-inner {
  background: linear-gradient(90deg, #ff758c, #ff7eb3);
}

.yesno-verdict-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}


/* 15. 78장 타로 카드 백과 도감 (Encyclopedia) 스타일 */
.encyclopedia-container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 15px 50px 15px;
  box-sizing: border-box;
}

.encyclopedia-header {
  text-align: center;
  margin-bottom: 25px;
}

.encyclopedia-main-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.encyclopedia-main-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.encyclopedia-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
  background: rgba(11, 7, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px 20px;
  backdrop-filter: blur(15px);
}

.encyclopedia-search-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.encyclopedia-search-wrapper input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.encyclopedia-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.encyclopedia-filter-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.encyclopedia-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.encyclopedia-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.encyclopedia-tab-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

.encyclopedia-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .encyclopedia-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.encyclopedia-card-item {
  background: rgba(11, 7, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(10px);
}

.encyclopedia-card-item:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.15);
}

.encyclopedia-card-thumb-box {
  width: 100%;
  aspect-ratio: 3 / 5;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: #0f0923;
}

.encyclopedia-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.encyclopedia-card-item:hover .encyclopedia-card-thumb-img {
  transform: scale(1.05);
}

.encyclopedia-card-numeral {
  font-size: 0.72rem;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.encyclopedia-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.encyclopedia-card-tags {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* 타로 백과 상세 모달 스타일 */
.encyclopedia-modal-card {
  max-width: 820px !important;
  width: 92% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 30px !important;
}

@media (max-width: 768px) {
  .encyclopedia-modal-card {
    padding: 20px 15px !important;
  }
}

.encyclopedia-detail-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.encyclopedia-card-badge {
  display: inline-block;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  color: #ffd700;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.encyclopedia-card-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 6px 0;
}

.encyclopedia-card-keywords {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin: 0;
}

.encyclopedia-detail-content {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 25px;
  align-items: start;
}

@media (max-width: 768px) {
  .encyclopedia-detail-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.encyclopedia-card-image-box {
  width: 100%;
  aspect-ratio: 3 / 5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  background: #0f0923;
  margin-bottom: 12px;
}

.encyclopedia-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.encyclopedia-modal-img.reversed {
  transform: rotate(180deg);
}

.card-direction-toggle-group {
  display: flex;
  gap: 6px;
  width: 100%;
}

.dir-toggle-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dir-toggle-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  color: #ffd700;
  font-weight: 700;
}

.card-meaning-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.meaning-section-title {
  font-size: 0.95rem;
  color: #ffd700;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.meaning-text {
  font-size: 0.92rem;
  color: #e0d8f5;
  line-height: 1.6;
  margin: 0;
}

.card-context-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 500px) {
  .card-context-grid {
    grid-template-columns: 1fr;
  }
}

.context-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.context-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.context-item-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.cta-reading-button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: 12px;
  margin-top: 10px;
}

/* 🌟 해금된 VIP/프리미엄 심층 처방전 차별화 스타일 */
.report-text-blur-wrapper.unlocked {
  max-height: 3000px !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, rgba(26, 18, 52, 0.65) 100%) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.45) !important;
  border-radius: 16px !important;
  padding: 18px !important;
  margin-top: 14px !important;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.18), inset 0 0 15px rgba(255, 215, 0, 0.06) !important;
  animation: unlockGlowPulse 1.2s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  position: relative;
}

.unlocked-vip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(127, 57, 251, 0.35));
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  letter-spacing: 0.5px;
}

.report-text-blur-wrapper.unlocked .report-sub-title {
  color: #ffd700 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}

.report-text-blur-wrapper.unlocked .report-text {
  color: #f1f2f6 !important;
  font-size: 0.96rem !important;
  line-height: 1.75 !important;
  margin-bottom: 16px !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
}

@keyframes unlockGlowPulse {
  0% {
    border-color: #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.7), inset 0 0 25px rgba(255, 215, 0, 0.3);
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.015);
  }
  100% {
    border-color: rgba(255, 215, 0, 0.45);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.18), inset 0 0 15px rgba(255, 215, 0, 0.06);
    transform: scale(1);
  }
}

/* ==========================================================================
   이용 가이드(Guide) 및 1:1 고객 문의(Q&A) 모달 스타일
   ========================================================================== */

.guide-modal-overlay,
.qna-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 2, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 16px;
  box-sizing: border-box;
}

.guide-modal-card,
.qna-modal-card {
  background: linear-gradient(145deg, rgba(20, 14, 38, 0.95), rgba(10, 6, 22, 0.98));
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 24px;
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(127, 57, 251, 0.15);
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.guide-modal-header,
.qna-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.guide-header-title,
.qna-header-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-modal-close,
.qna-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.guide-modal-close:hover,
.qna-modal-close:hover {
  color: #fff;
  transform: scale(1.1);
}

/* 가이드 탭 네비게이션 - 상하 높이(54px) 및 3개 탭 규격 100% 완벽 고정 */
.guide-tab-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  padding: 0 6px !important;
  gap: 0 !important;
  overflow: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.guide-tab-btn {
  flex: 1 1 33.333% !important;
  width: 33.333% !important;
  max-width: 33.333% !important;
  height: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #94a3b8 !important;
  padding: 0 2px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  text-align: center !important;
  transition: color 0.2s ease !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  box-sizing: border-box !important;
  transform: none !important;
}

.guide-tab-btn:hover {
  color: #ffffff !important;
  background: transparent !important;
}

.guide-tab-btn.active {
  color: #ffd700 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-weight: 800 !important;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.7) !important;
  transform: none !important;
}

.guide-content-body,
.qna-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  color: #e2e8f0;
}

.guide-tab-panel {
  display: none;
}

.guide-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.guide-section-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px;
}

.guide-section-card h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1rem;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-feature-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.guide-feature-item:last-child {
  margin-bottom: 0;
}

.feature-badge {
  background: rgba(127, 57, 251, 0.25);
  border: 1px solid rgba(127, 57, 251, 0.4);
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  margin-top: 2px;
}

.guide-feature-item strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 3px;
}

.guide-feature-item p {
  margin: 0;
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* 별가루 정책 테이블 */
.policy-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.policy-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.policy-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.policy-table tr:last-child td {
  border-bottom: none;
}

/* FAQ 아코디언 */
.faq-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.faq-item.open {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.02);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  gap: 10px;
}

.faq-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.25s ease;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
  color: #ffd700;
}

.faq-answer {
  display: none;
  padding: 0 16px 14px 16px;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Q&A 폼 스타일 */
.qna-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.qna-form-group label {
  font-size: 0.85rem;
  color: #c4b5fd;
  font-weight: 600;
}

.qna-form-group input,
.qna-form-group select,
.qna-form-group textarea {
  background: #110c22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
}

.qna-form-group input:focus,
.qna-form-group select:focus,
.qna-form-group textarea:focus {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

/* ==========================================================================
   🔒 개인정보처리방침 및 푸터 고도화 스타일
   ========================================================================== */
.footer-company-info {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-company-info .company-row {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 3px 0;
  line-height: 1.5;
}

.footer-company-info .company-row strong {
  color: #e2e8f0;
}

.footer-company-info .company-row span {
  color: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.footer-email-link {
  color: #ffd700;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-email-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.footer-links-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 12px 0 14px 0;
  flex-wrap: wrap;
}

.footer-policy-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.footer-policy-btn:hover {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.footer-links-row .divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

/* 🔒 개인정보처리방침 및 📜 이용약관 모달 공통 스타일 */
.privacy-modal-overlay,
.terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 2, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease-out;
}

.privacy-modal-card,
.terms-modal-card {
  background: linear-gradient(180deg, #18122B 0%, #0F091F 100%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 18px;
  width: 100%;
  max-width: 620px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 215, 0, 0.15);
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.privacy-modal-header,
.terms-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 215, 0, 0.03);
}

.privacy-header-title,
.terms-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-modal-close,
.terms-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.privacy-modal-close:hover,
.terms-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.privacy-modal-body,
.terms-modal-body {
  padding: 20px;
  overflow-y: auto;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.7;
  scroll-behavior: smooth;
}

.privacy-modal-body::-webkit-scrollbar,
.terms-modal-body::-webkit-scrollbar {
  width: 6px;
}
.privacy-modal-body::-webkit-scrollbar-thumb,
.terms-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 3px;
}

.privacy-content-meta,
.terms-content-meta {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.privacy-content-meta strong,
.terms-content-meta strong {
  color: #ffd700;
}

.privacy-subtext,
.terms-subtext {
  font-size: 0.84rem;
  color: #94a3b8;
  margin-top: 6px;
}

.privacy-sec,
.terms-sec {
  margin-bottom: 22px;
}

.privacy-sec h4,
.terms-sec h4 {
  font-size: 0.96rem;
  color: #f1f2f6;
  margin-bottom: 8px;
  font-weight: 700;
  border-left: 3px solid #ffd700;
  padding-left: 8px;
}

.privacy-sec p,
.terms-sec p {
  margin-bottom: 6px;
}

.privacy-sec ul,
.terms-sec ul {
  padding-left: 18px;
  margin: 6px 0;
}

.privacy-sec li,
.terms-sec li {
  margin-bottom: 5px;
}

.privacy-contact-box,
.terms-appendix-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 14px;
}

.privacy-contact-box p,
.terms-appendix-box p {
  margin: 3px 0;
  font-size: 0.85rem;
}

.privacy-contact-box strong,
.terms-appendix-box strong {
  color: #ffd700;
}

.privacy-contact-box a {
  color: #ffd700;
  text-decoration: none;
}

.privacy-modal-footer,
.terms-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
