/* ══════════════════════════════════════════════════════
   타로점 독립 SPA — tarot-style.css
   참조: Aetheris Oracle (타로홈.html)
   ══════════════════════════════════════════════════════ */

/* ── 리셋 + 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 배경 */
  --t-bg: #12121f;
  --t-bg-mid: #1a1a28;
  --t-bg-card: rgba(18, 18, 31, 0.6);
  --t-bg-card-hover: rgba(18, 18, 31, 0.8);

  /* 골드 계열 */
  --t-gold: #e9c349;
  --t-gold-dim: rgba(233, 195, 73, 0.6);
  --t-gold-glow: rgba(233, 195, 73, 0.15);
  --t-gold-border: rgba(233, 195, 73, 0.1);
  --t-gold-border-hover: rgba(233, 195, 73, 0.4);

  /* 텍스트 */
  --t-text: #e3e0f4;
  --t-text-dim: rgba(203, 213, 225, 0.8);
  --t-text-muted: rgba(203, 213, 225, 0.5);

  /* 표면 */
  --t-surface: #1e1e2c;
  --t-surface-high: #292937;
  --t-surface-low: #1a1a28;
  --t-border: rgba(255, 255, 255, 0.05);

  /* 사이즈 */
  --t-header-h: 56px;
  --t-radius: 12px;
}

html {
  font-size: 10px;
}

body {
  font-family: 'Manrope', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  background: var(--t-bg);
  color: var(--t-text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ── 별 배경 (fixed) ── */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, var(--t-bg-mid) 0%, var(--t-bg) 100%);
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.3;
  animation: twinkle var(--duration, 4s) infinite ease-in-out;
}

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

.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(90deg, var(--t-gold) 0%, rgba(233, 195, 73, 0) 100%);
  animation: shoot-right var(--s-duration, 8s) infinite linear;
  opacity: 0;
}

.shooting-star.from-left {
  background: linear-gradient(-90deg, var(--t-gold) 0%, rgba(233, 195, 73, 0) 100%);
  animation: shoot-left var(--s-duration, 8s) infinite linear;
}

@keyframes shoot-right {
  0% { transform: translateX(0) translateY(0) rotate(-45deg); opacity: 0; width: 0; }
  10% { opacity: 1; width: 100px; }
  30% { transform: translateX(-500px) translateY(500px) rotate(-45deg); opacity: 0; width: 0; }
  100% { transform: translateX(-500px) translateY(500px) rotate(-45deg); opacity: 0; }
}

@keyframes shoot-left {
  0% { transform: translateX(0) translateY(0) rotate(45deg); opacity: 0; width: 0; }
  10% { opacity: 1; width: 100px; }
  30% { transform: translateX(500px) translateY(500px) rotate(45deg); opacity: 0; width: 0; }
  100% { transform: translateX(500px) translateY(500px) rotate(45deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .star { animation: none; opacity: 0.5; }
  .shooting-star { display: none; }
  .tarot-card-back { animation: none !important; }
}

/* ── 세리프 헤드라인 ── */
.serif-headline {
  font-family: 'Newsreader', 'Noto Serif KR', serif;
  letter-spacing: 0.02em;
}

/* ── 모바일 헤더 ── */
.tarot-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--t-header-h);
  padding: 0 16px;
  background: transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--t-border);
}

.tarot-header-title {
  font-family: 'Newsreader', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--t-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.header-back-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--t-text);
  z-index: 51;
}

#hamburger-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--t-text);
  z-index: 51;
}

/* 모바일: 뷰 내부 뒤로가기 텍스트 숨김 (헤더 '<' 아이콘 사용) */
@media (max-width: 480px) {
  .view-back-header { display: none; }
}

/* ── PC 상단 네비게이션 (481px+) ── */
#top-nav {
  display: none;
}

@media (min-width: 481px) {
  .tarot-header { display: none; }
  #hamburger-btn { display: none; }
  .header-back-btn { display: none !important; }
  .view-back-header { display: none; }

  #top-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--t-border);
  }

  .top-nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 24px;
    max-width: 900px;
    margin: 0 auto;
  }

  .top-nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .top-nav-item {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 1.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(203, 213, 225, 0.7);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
    text-decoration: none;
    white-space: nowrap;
  }

  .top-nav-item:hover {
    color: var(--t-gold);
  }

  .top-nav-item.active {
    color: var(--t-gold);
    border-bottom-color: var(--t-gold);
  }

  /* 드롭다운 컨테이너 */
  .top-nav-dropdown {
    position: relative;
  }

  .top-nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    min-width: 160px;
    background: var(--t-surface);
    border: 1px solid var(--t-gold-border);
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 110;
  }
  /* margin-top 갭을 투명 브릿지로 채워 hover 끊김 방지 */
  .top-nav-sub::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
  }

  .top-nav-dropdown:hover > .top-nav-sub {
    display: block;
  }

  .top-nav-sub-item {
    display: block;
    width: 100%;
    padding: 10px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 1.4rem;
    color: rgba(203, 213, 225, 0.8);
    text-align: left;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
  }

  .top-nav-sub-item:hover {
    background: rgba(233, 195, 73, 0.1);
    color: var(--t-gold);
  }

  #content-wrap {
    padding-top: 60px;
  }
}

/* ── 사이드 메뉴 (모바일 햄버거) ── */
#side-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  backdrop-filter: blur(4px);
}

#side-menu-overlay.open { display: block; }

#side-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--t-surface);
  z-index: 210;
  transition: right 0.3s ease;
  overflow-y: auto;
  border-left: 1px solid var(--t-gold-border);
}

#side-menu.open { right: 0; }

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--t-border);
}

.side-menu-title {
  font-family: 'Newsreader', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--t-gold);
  letter-spacing: 0.1em;
}

#side-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  color: var(--t-text-muted);
  padding: 4px 8px;
}

.side-menu-items {
  padding: 12px 0;
}

.side-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-size: 1.6rem;
  color: var(--t-text-dim);
  text-align: left;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.side-menu-item:hover,
.side-menu-item:active {
  background: rgba(233, 195, 73, 0.08);
  color: var(--t-gold);
}

.side-menu-item.active {
  color: var(--t-gold);
  background: rgba(233, 195, 73, 0.1);
  font-weight: 600;
}

@media (min-width: 481px) {
  #side-menu, #side-menu-overlay, #hamburger-btn { display: none !important; }
}

/* ── 뷰 전환 ── */
.view { display: none; }
.view.active { display: block; }

/* ── 메인 콘텐츠 영역 ── */
.tarot-main {
  padding: 12px 20px 32px;
  max-width: 800px;
  margin: 0 auto;
}

/* ── 오늘의 타로 섹션 ── */
.tarot-daily-section,
.spread-view-section {
  text-align: center;
  padding: 8px 20px 8px;
}

.tarot-daily-title {
  font-family: 'Newsreader', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--t-gold);
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(233, 195, 73, 0.2);
}

.tarot-daily-subtitle {
  font-size: 1.6rem;
  color: var(--t-text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  line-height: 1.7;
}

/* ══════════════════════════════════════
   ① 대기 카드 (단일 뒷면, 터치 유도)
   ══════════════════════════════════════ */
.tarot-card-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  perspective: 1000px;
}

.tarot-card-wrapper.hidden { display: none; }

.tarot-card-glow {
  position: absolute;
  inset: -24px;
  background: radial-gradient(circle, rgba(233, 195, 73, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tarot-card-wrapper:hover .tarot-card-glow { opacity: 0.7; }

.tarot-card-back-single {
  width: 160px;
  height: 280px;
  border-radius: 16px;
  background: transparent url('/static/cards/CardBack.webp') center/100% 100% no-repeat;
  border: none;
  box-shadow: 0 0 15px var(--t-gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tarotFloat 3s ease-in-out infinite;
  transition: box-shadow 0.3s;
  overflow: hidden;
}

.tarot-card-wrapper:hover .tarot-card-back-single {
  box-shadow: 0 0 25px rgba(233, 195, 73, 0.5);
}

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

.tarot-card-back-inner {
  position: relative;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.tarot-card-back-text,
.card-corner { display: none; }

.tarot-card-back-text {
  color: var(--t-gold);
  font-family: 'Newsreader', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

/* ── 뒷면 모서리 장식 ── */
.card-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--t-gold-dim);
}

.card-corner-tl { top: 6px; left: 6px; border-top: 2px solid; border-left: 2px solid; border-top-left-radius: 4px; }
.card-corner-tr { top: 6px; right: 6px; border-top: 2px solid; border-right: 2px solid; border-top-right-radius: 4px; }
.card-corner-bl { bottom: 6px; left: 6px; border-bottom: 2px solid; border-left: 2px solid; border-bottom-left-radius: 4px; }
.card-corner-br { bottom: 6px; right: 6px; border-bottom: 2px solid; border-right: 2px solid; border-bottom-right-radius: 4px; }

/* ── 가이드 텍스트 ── */
.tarot-card-guide {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--t-gold-dim);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse 2s infinite;
  transition: opacity 0.4s, max-height 0.4s, margin 0.4s;
  max-height: 60px;
  overflow: hidden;
}

.tarot-card-guide.hidden {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ══════════════════════════════════════
   ② 카드 스프레드 (7장 가로 배열)
   ══════════════════════════════════════ */
.spread-area {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  padding: 20px 0;
  perspective: 800px;
}

.spread-area.active { display: flex; }

/* 6열 그리드 모드 */
.spread-area.spread-grid {
  display: none;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 16px 8px;
  min-height: auto;
}

.spread-area.spread-grid.active { display: grid; }

.spread-grid .spread-card {
  width: 100%;
  aspect-ratio: 1 / 1.72;
  height: auto;
  margin-left: 0;
}

@media (max-width: 480px) {
  .spread-area.spread-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 12px 8px;
  }
}

.spread-grid .spread-card-face { border-radius: 6px; }
.spread-grid .spread-card-back-inner { border-radius: 4px; width: calc(100% - 6px); height: calc(100% - 6px); }
.spread-grid .spread-mini-corner { width: 6px; height: 6px; }
.spread-grid .spread-card-back-label { font-size: 0.7rem; }

.spread-card {
  position: relative;
  width: 100px;
  height: 172px;
  flex-shrink: 0;
  margin-left: -12px;
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  transform: scale(0.6) translateY(20px);
  z-index: 1;
  background: #12121f;
  border-radius: 12px;
}

.spread-card:first-child { margin-left: 0; }

.spread-card.dealt {
  opacity: 1;
  transform: translateY(0);
}

.spread-card:hover,
.spread-card:active {
  transform: translateY(-4px) scale(1.08);
  z-index: 10;
}

.spread-card.selected {
  z-index: 20;
  transform: translateY(-8px) scale(1.1);
}
.spread-card.selected .spread-card-back {
  box-shadow: 0 0 0 2.5px #7eb8f7, 0 0 22px 6px rgba(126,184,247,0.7);
}

/* 멀티 포지션 스프레드: 이미 선택된 카드 */
.spread-card.picked {
  z-index: 5;
  pointer-events: none;
}
.spread-card.picked .spread-card-back {
  box-shadow: 0 0 0 2.5px #7eb8f7, 0 0 22px 6px rgba(126,184,247,0.7);
}

/* ── 셔플 애니메이션 ── */

/* Phase 1: 카드가 중앙으로 모여들며 뒤집힘 */
@keyframes shuffle-gather {
  0%   { transform: translateY(0) translateX(0) scale(1) rotateY(0deg); opacity: 1; }
  50%  { transform: translateY(var(--gather-y, -30px)) translateX(var(--gather-x, 0px)) scale(0.5) rotateY(90deg); opacity: 0.4; }
  100% { transform: translateY(var(--gather-y, -30px)) translateX(var(--gather-x, 0px)) scale(0.3) rotateY(180deg); opacity: 0; }
}

/* Phase 2: 새 카드가 퍼져나옴 */
@keyframes shuffle-scatter {
  0%   { transform: scale(0.2) rotateY(180deg); opacity: 0; }
  40%  { transform: scale(0.7) rotateY(90deg); opacity: 0.6; }
  70%  { transform: scale(1.1) rotateY(20deg); opacity: 0.9; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.spread-card.shuffle-gather {
  animation: shuffle-gather 0.45s ease-in forwards;
  animation-delay: calc(var(--card-index, 0) * 15ms);
  pointer-events: none;
}

.spread-card.shuffle-scatter {
  animation: shuffle-scatter 0.4s ease-out forwards;
  animation-delay: calc(var(--card-index, 0) * 20ms);
  pointer-events: none;
}

.shuffle-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.shuffle-btn-wrap .tarot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spread-card.exiting-left {
  transform: translateX(-120px) rotate(-15deg) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease-in, opacity 0.3s ease;
}

.spread-card.exiting-right {
  transform: translateX(120px) rotate(15deg) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease-in, opacity 0.3s ease;
}

.spread-card.centering {
  transition: transform 0.45s ease, margin 0.45s ease;
  margin-left: 0;
}

/* 스프레드 카드 3D 플립 컨테이너 */
.spread-card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
}

.spread-card.flipped .spread-card-flipper {
  transform: rotateY(180deg);
}

/* 스프레드 카드 면 공통 */
.spread-card-face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

/* 스프레드 카드 뒷면 */
.spread-card-back {
  background: transparent url('/static/cards/CardBack.webp') center/100% 100% no-repeat;
  border: none;
  box-shadow: 0 0 10px var(--t-gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.spread-card:not(.picked):hover .spread-card-back {
  box-shadow: 0 0 20px rgba(233, 195, 73, 0.5);
}

.spread-card-back-inner {
  position: relative;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spread-card-back-label,
.spread-mini-corner { display: none; }

.spread-card-back-label {
  color: var(--t-gold);
  font-family: 'Newsreader', serif;
  font-size: 1.0rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.spread-mini-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--t-gold-dim);
}
.spread-mini-corner.tl { top: 4px; left: 4px; border-top: 1.5px solid; border-left: 1.5px solid; border-top-left-radius: 3px; }
.spread-mini-corner.tr { top: 4px; right: 4px; border-top: 1.5px solid; border-right: 1.5px solid; border-top-right-radius: 3px; }
.spread-mini-corner.bl { bottom: 4px; left: 4px; border-bottom: 1.5px solid; border-left: 1.5px solid; border-bottom-left-radius: 3px; }
.spread-mini-corner.br { bottom: 4px; right: 4px; border-bottom: 1.5px solid; border-right: 1.5px solid; border-bottom-right-radius: 3px; }

/* 스프레드 카드 앞면 */
.spread-card-front {
  transform: rotateY(180deg);
  border: 1.5px solid rgba(233, 195, 73, 0.4);
  box-shadow: 0 0 20px rgba(233, 195, 73, 0.25);
  padding: 0;
  overflow: hidden;
}

.spread-card-front-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

/* 카드 이미지 */
.card-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.card-face-img-reversed {
  transform: rotate(180deg);
}

/* 역방향 뱃지 */
.card-reversed-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 60, 60, 0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  pointer-events: none;
  white-space: nowrap;
}

/* 확대 상태 */
.spread-card.enlarged {
  width: 180px;
  height: 315px;
  transition: width 0.4s ease-out, height 0.4s ease-out;
}

/* 모바일 반응형: 카드 크기 자동 조정 */
@media (max-width: 480px) {
  .spread-card {
    width: calc((100vw - 80px) / 5.5 * 1.1);
    height: calc((100vw - 80px) / 5.5 * 1.1 * 1.72);
    margin-left: -10px;
  }
  .spread-card:first-child { margin-left: 0; }
  .spread-card.enlarged {
    width: 160px;
    height: 280px;
  }

  /* 오늘의 타로 카드 선택: 4+3 두 줄 배열 */
  #spread-area.active {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
    max-width: calc((100vw - 80px) / 5.5 * 1.1 * 4 - 10px * 3 + 8px);
    margin: 0 auto;
    padding: 20px 0;
  }

  /* 5번째 카드: 두 번째 줄 시작이므로 왼쪽 여백 리셋 */
  #spread-area .spread-card:nth-child(5) {
    margin-left: 0;
  }
}

/* ══════════════════════════════════════
   ④ 스파클 효과
   ══════════════════════════════════════ */
.sparkle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 30;
}

.sparkle-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t-gold);
  box-shadow: 0 0 6px var(--t-gold), 0 0 12px rgba(233, 195, 73, 0.4);
  animation: sparkleOut 0.9s ease-out forwards;
}

@keyframes sparkleOut {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  70% { opacity: 0.8; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* ══════════════════════════════════════
   ⑤ Reveal 영역 (확대 카드 + 버튼)
   ══════════════════════════════════════ */
.reveal-area {
  display: none;
  text-align: center;
}

.reveal-area.active { display: block; }

.reveal-card-wrap {
  display: inline-block;
  position: relative;
  margin-bottom: 24px;
}

.reveal-direction {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.reveal-direction.upright {
  color: var(--t-gold);
  background: rgba(233, 195, 73, 0.1);
  border: 1px solid rgba(233, 195, 73, 0.25);
}

.reveal-direction.reversed {
  color: #ff8a80;
  background: rgba(255, 138, 128, 0.1);
  border: 1px solid rgba(255, 138, 128, 0.25);
}

.reveal-card-name {
  font-family: 'Newsreader', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--t-text);
  margin-bottom: 4px;
}

.reveal-card-name-ko {
  font-size: 2.0rem;
  font-weight: 600;
  color: var(--t-gold);
  margin-bottom: 24px;
}

/* ── reveal 키워드 ── */
.reveal-keywords {
  max-width: 360px;
  margin: 0 auto 24px;
  text-align: left;
}

.reveal-kw-section {
  margin-bottom: 24px;
}

.reveal-kw-label {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--t-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.reveal-kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── reveal 카드 정보 ── */
.reveal-card-info {
  max-width: 360px;
  margin: 0 auto 24px;
  padding: 16px;
  background: rgba(26, 26, 40, 0.5);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius);
  text-align: left;
}

.reveal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

/* 포지션별 결과 버튼 — 세로 1열, 다시뽑기와 동일 크기 */
.spread-result-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
}

/* ── 공통 버튼 ── */
.tarot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 28px;
  border: 1px solid;
  font-family: 'Manrope', sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 320px;
}

.tarot-btn-primary {
  background: rgba(39, 29, 0, 0.8);
  border-color: rgba(233, 195, 73, 0.4);
  color: var(--t-gold);
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.tarot-btn-primary:hover {
  background: rgba(233, 195, 73, 0.15);
  border-color: rgba(233, 195, 73, 0.6);
  transform: scale(1.03);
}

.tarot-btn-secondary {
  background: transparent;
  border-color: rgba(233, 195, 73, 0.2);
  color: var(--t-text-dim);
  backdrop-filter: blur(12px);
}

.tarot-btn-secondary:hover {
  background: rgba(233, 195, 73, 0.08);
  border-color: rgba(233, 195, 73, 0.4);
  color: var(--t-gold);
  transform: scale(1.03);
}

/* Fade-in 애니메이션 */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

/* ══════════════════════════════════════
   ⑥ 바텀시트
   ══════════════════════════════════════ */
.bs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
}

.bs-overlay.open { display: block; }

.bs-sheet {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  background: var(--t-surface);
  border-radius: 0;
  z-index: 310;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: scale(0.97) translateY(6px);
}

.bs-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 195, 73, 0.25) transparent;
}

.bs-body::-webkit-scrollbar {
  width: 5px;
}

.bs-body::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.bs-body::-webkit-scrollbar-thumb {
  background: rgba(233, 195, 73, 0.2);
  border-radius: 10px;
}

.bs-body::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 195, 73, 0.35);
}

.bs-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--t-text-muted);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s;
}

.bs-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.bs-sheet.open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (min-width: 481px) {
  .bs-sheet {
    left: 50%;
    max-width: 560px;
    transform: translateX(-50%) scale(0.97) translateY(6px);
  }
  .bs-sheet.open {
    transform: translateX(-50%);
  }
}

.bs-handle { display: none; }

.bs-header {
  text-align: center;
  padding: 8px 20px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bs-header-pos-label {
  font-size: 1.6rem;
  color: #7eb8f7;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.bs-header-name {
  font-family: 'Newsreader', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--t-text);
}

.bs-header-name-ko {
  font-size: 1.6rem;
  color: var(--t-gold);
  margin-bottom: 4px;
}

.bs-header-dir {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

.bs-header-dir.upright {
  color: var(--t-gold);
  background: rgba(233, 195, 73, 0.1);
  border: 1px solid rgba(233, 195, 73, 0.2);
}

.bs-header-dir.reversed {
  color: #ff8a80;
  background: rgba(255, 138, 128, 0.1);
  border: 1px solid rgba(255, 138, 128, 0.2);
}

/* ── 콘텐츠 ── */
.bs-content {
  padding: 20px;
  font-size: 1.6rem;
  color: var(--t-text-dim);
  line-height: 1.8;
  word-break: keep-all;
}

.bs-section {
  margin-bottom: 24px;
}

.bs-section p {
  font-size: 1.6rem;
  color: var(--t-text-dim);
  line-height: 1.8;
  margin: 0;
}

.bs-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--t-gold);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(233, 195, 73, 0.15);
}

.bs-yes-no {
  text-align: center;
  padding: 24px 0;
}

.bs-yes-no-text {
  font-family: 'Newsreader', serif;
  font-size: 4.0rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bs-yes-no-text.yes { color: var(--t-gold); text-shadow: 0 0 20px rgba(233, 195, 73, 0.3); }
.bs-yes-no-text.no { color: #ff8a80; text-shadow: 0 0 20px rgba(255, 138, 128, 0.3); }

/* ── 키워드 ── */
.bs-kw-section {
  margin-bottom: 12px;
}

.bs-kw-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--t-text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.bs-kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bs-kw-tag {
  padding: 4px 12px;
  font-size: 1.4rem;
  color: var(--t-text-dim);
  background: rgba(41, 41, 55, 0.5);
  border: 1px solid var(--t-border);
  border-radius: 16px;
  white-space: nowrap;
}

/* ── 카드 정보 ── */
.bs-card-info-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--t-text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.bs-card-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.bs-card-info-row:last-child { border-bottom: none; }

.bs-card-info-label { color: var(--t-text-muted); font-size: 1.4rem; }
.bs-card-info-value { color: var(--t-text-dim); font-weight: 500; font-size: 1.4rem; }

/* ── 토스트 알림 ── */
.tarot-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--t-surface-high);
  color: var(--t-text);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
  pointer-events: none;
  border: 1px solid var(--t-gold-border);
}

.tarot-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── prefers-reduced-motion 추가 ── */
@media (prefers-reduced-motion: reduce) {
  .spread-card { transition: none !important; }
  .spread-card-flipper { transition: none !important; }
  .sparkle-particle { animation: none !important; display: none; }
  .tarot-card-back-single { animation: none !important; }
  .bs-sheet { transition: none !important; }
}

/* ── 구분선 장식 ── */
.tarot-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 40px 0;
  color: var(--t-gold-dim);
  font-size: 1.6rem;
  opacity: 0.5;
}

.tarot-divider-line {
  width: 40px;
  height: 1px;
  background: var(--t-gold-dim);
}

/* ── 스프레드 선택 섹션 ── */
.tarot-spread-header {
  text-align: center;
  margin-bottom: 24px;
}

.tarot-spread-header h2 {
  font-family: 'Newsreader', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 8px;
}

.tarot-spread-header-line {
  width: 48px;
  height: 1px;
  background: var(--t-gold-dim);
  margin: 0 auto;
}

.tarot-spread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}

@media (min-width: 481px) {
  .tarot-spread-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Glass Card (스프레드 버튼) ── */
.glass-card {
  background: var(--t-bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--t-gold-border);
  border-radius: var(--t-radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.glass-card:hover {
  border-color: var(--t-gold-border-hover);
  background: var(--t-bg-card-hover);
  box-shadow: 0 0 20px var(--t-gold-glow);
  transform: translateY(-2px);
}

.glass-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.glass-card-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--t-gold);
  margin-bottom: 2px;
}

.glass-card-name {
  font-family: 'Newsreader', serif;
  font-size: 2.0rem;
  font-weight: 600;
  color: var(--t-text);
}

.glass-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(41, 41, 55, 0.5);
  color: var(--t-gold);
  font-size: 2.0rem;
  transition: background 0.3s, color 0.3s;
  flex-shrink: 0;
}

.glass-card:hover .glass-card-icon {
  background: var(--t-gold);
  color: var(--t-bg);
}

.glass-card-desc {
  font-size: 1.3rem;
  color: var(--t-text-dim);
  line-height: 1.6;
}

/* ── 카드 선택 컨트롤 (셔플 버튼 + 광고) ── */
.spread-controls {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px 16px;
}

/* ── 광고 슬롯 ── */
.tarot-ad-container {
  width: 100%;
  max-width: 560px;
  margin: 16px auto;
  min-height: 100px;
  background: rgba(26, 26, 40, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tarot-ad-container::before {
  content: 'AD';
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 1.0rem;
  color: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* ── 준비중 Placeholder ── */
.tarot-view-placeholder {
  text-align: center;
  padding: 80px 20px;
}

.tarot-view-placeholder-icon {
  font-size: 5.0rem;
  margin-bottom: 16px;
}

.tarot-view-placeholder-title {
  font-family: 'Newsreader', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 8px;
}

.tarot-view-placeholder-desc {
  font-size: 1.4rem;
  color: var(--t-text-dim);
  margin-bottom: 24px;
}

.tarot-view-placeholder-badge {
  display: inline-block;
  padding: 6px 20px;
  background: var(--t-bg-card);
  border: 1px solid var(--t-gold-border);
  border-radius: 20px;
  font-size: 1.2rem;
  color: var(--t-gold);
  letter-spacing: 0.1em;
}

/* ── 정보 페이지 ── */
.tarot-info-wrap {
  padding: 32px 20px;
  max-width: 560px;
  margin: 0 auto;
}

.tarot-info-wrap h2 {
  font-family: 'Newsreader', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--t-gold);
  margin-bottom: 8px;
}

.tarot-info-wrap > p {
  font-size: 1.4rem;
  color: var(--t-text-dim);
  margin-bottom: 32px;
  line-height: 1.7;
}

.tarot-info-section {
  margin-bottom: 28px;
}

.tarot-info-section h3 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--t-border);
}

.tarot-info-section ul {
  list-style: none;
  padding: 0;
}

.tarot-info-section li {
  padding: 8px 0;
  font-size: 1.4rem;
  color: var(--t-text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  line-height: 1.6;
}

.tarot-info-section li::before {
  content: '✦ ';
  color: var(--t-gold-dim);
}

.tarot-info-section p {
  font-size: 1.4rem;
  color: var(--t-text-dim);
  line-height: 1.7;
}

.tarot-info-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--t-border);
  text-align: center;
}

.tarot-info-footer p {
  font-size: 1.4rem;
  color: var(--t-text-muted);
  margin-bottom: 12px;
}

.tarot-info-footer a {
  color: var(--t-gold);
  text-decoration: none;
  font-size: 1.4rem;
}

.tarot-info-footer a:hover {
  text-decoration: underline;
}

/* ── 푸터 ── */
.tarot-footer {
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid rgba(233, 195, 73, 0.1);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  margin-top: 60px;
}

.tarot-footer-brand {
  font-family: 'Newsreader', serif;
  font-size: 1.6rem;
  color: var(--t-gold);
  margin-bottom: 6px;
}

.tarot-footer-copy {
  font-size: 1.0rem;
  color: var(--t-text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════
   뒤로가기 헤더
   ══════════════════════════════════════ */
.view-back-header {
  padding: 4px 0 12px;
}

.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-size: 1.3rem;
  color: var(--t-gold);
  padding: 8px 0;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}

.back-btn:hover {
  opacity: 0.7;
}

/* ══════════════════════════════════════
   Home 허브
   ══════════════════════════════════════ */
.home-hero {
  height: clamp(280px, 57vw, 470px);
  background-image: url('/static/tarot_bg_S2.png');
  background-size: 408px auto;
  background-position: center top;
  background-repeat: no-repeat;
  margin: 0 -16px;
  width: calc(100% + 32px);
}
@media (min-width: 480px) {
  .home-hero {
    background-size: 85%;
  }
}

/* ── 카드 선택 화면 설명 문장 ── */
.pick-card-desc {
  font-size: 1.6rem;
  color: var(--t-text-muted);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════
   포지션 선택 인디케이터
   ══════════════════════════════════════ */
.pick-indicator {
  text-align: center;
  margin-bottom: 16px;
}

.pick-indicator-text {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #7eb8f7;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.pick-topic-card-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.pick-topic-card-wrap .topic-card-btn {
  pointer-events: none;
  opacity: 1;
}

/* ══════════════════════════════════════
   스프레드 레이아웃 (결과 배치)
   ══════════════════════════════════════ */
.spread-result-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px 0;
}

.layout-card-slot {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.layout-card-pos-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7eb8f7;
  flex-shrink: 0;
}

.layout-card-meaning {
  font-size: 1.5rem;
  color: var(--t-text-muted);
  max-width: 120px;
  line-height: 1.4;
}

/* 레이아웃별 카드 크기 조정 */
.spread-result-layout .spread-card.enlarged {
  width: 100px;
  height: 172px;
}

.spread-result-layout .spread-card-front .card-front-number { font-size: 1.4rem; }
.spread-result-layout .spread-card-front .card-front-name { font-size: 0.9rem; }
.spread-result-layout .spread-card-front .card-front-name-ko { font-size: 1.0rem; }
.spread-result-layout .spread-card-front .card-front-category { font-size: 0.65rem; }
.spread-result-layout .spread-card-front .card-front-keyword { font-size: 0.75rem; }
.spread-result-layout .spread-card-front .card-front-reversed { font-size: 0.65rem; }

/* 3장 가로 */
.spread-layout-horizontal {
  flex-wrap: nowrap;
  gap: 20px;
}

/* 5장 십자 */
.spread-layout-cross {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
  justify-items: center;
}

.spread-layout-cross .layout-card-slot:nth-child(1) { grid-column: 2; grid-row: 2; }
.spread-layout-cross .layout-card-slot:nth-child(2) { grid-column: 2; grid-row: 1; }
.spread-layout-cross .layout-card-slot:nth-child(3) { grid-column: 2; grid-row: 3; }
.spread-layout-cross .layout-card-slot:nth-child(4) { grid-column: 1; grid-row: 2; }
.spread-layout-cross .layout-card-slot:nth-child(5) { grid-column: 3; grid-row: 2; }

/* 7장 호스슈 */
.spread-layout-horseshoe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
  justify-items: center;
}

.spread-layout-horseshoe .layout-card-slot:nth-child(1) { grid-column: 1; grid-row: 3; }
.spread-layout-horseshoe .layout-card-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.spread-layout-horseshoe .layout-card-slot:nth-child(3) { grid-column: 1; grid-row: 1; }
.spread-layout-horseshoe .layout-card-slot:nth-child(4) { grid-column: 2; grid-row: 1; }
.spread-layout-horseshoe .layout-card-slot:nth-child(5) { grid-column: 3; grid-row: 1; }
.spread-layout-horseshoe .layout-card-slot:nth-child(6) { grid-column: 3; grid-row: 2; }
.spread-layout-horseshoe .layout-card-slot:nth-child(7) { grid-column: 3; grid-row: 3; }

/* 10장 켈틱 크로스 */
.spread-layout-celtic_cross {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  justify-items: center;
}

.spread-layout-celtic_cross .layout-card-slot:nth-child(1) { grid-column: 2; grid-row: 2; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(2) { grid-column: 2; grid-row: 3; z-index: 2; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(3) { grid-column: 2; grid-row: 4; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(4) { grid-column: 1; grid-row: 2; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(5) { grid-column: 2; grid-row: 1; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(6) { grid-column: 3; grid-row: 2; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(7) { grid-column: 4; grid-row: 4; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(8) { grid-column: 4; grid-row: 3; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(9) { grid-column: 4; grid-row: 2; }
.spread-layout-celtic_cross .layout-card-slot:nth-child(10) { grid-column: 4; grid-row: 1; }

@media (max-width: 480px) {
  .spread-result-layout .spread-card.enlarged {
    width: 80px;
    height: 138px;
  }
  .spread-result-layout .spread-card-front .card-front-number { font-size: 1.2rem; }
  .spread-result-layout .spread-card-front .card-front-name { font-size: 0.75rem; }
  .spread-result-layout .spread-card-front .card-front-name-ko { font-size: 0.85rem; }
  .spread-result-layout .spread-card-front .card-front-keyword { display: none; }
  .layout-card-meaning { font-size: 1.5rem; max-width: 80px; }
}

/* ══════════════════════════════════════
   바텀시트 다중 포지션
   ══════════════════════════════════════ */
.bs-position-section {
  margin-bottom: 12px;
}

.bs-position-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bs-position-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--t-gold);
  color: var(--t-bg);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.bs-position-meaning {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--t-text);
  line-height: 1.4;
}

.bs-position-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bs-position-card-name {
  font-family: 'Newsreader', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--t-gold);
}

.bs-position-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 195, 73, 0.3), transparent);
  margin: 24px 0;
}

/* ══════════════════════════════════════
   타로 배우기 — 학습 콘텐츠
   ══════════════════════════════════════ */
.learn-content {
  padding-bottom: 32px;
}

.learn-section {
  margin-bottom: 28px;
}

.learn-section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--t-gold);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(233, 195, 73, 0.15);
}

.learn-section p {
  font-size: 1.4rem;
  color: var(--t-text-dim);
  line-height: 1.8;
  word-break: keep-all;
}

.learn-highlight {
  background: rgba(233, 195, 73, 0.06);
  border: 1px solid rgba(233, 195, 73, 0.12);
  border-radius: var(--t-radius);
  padding: 16px;
  margin: 12px 0;
  font-size: 1.4rem;
  color: var(--t-text-dim);
  line-height: 1.7;
}

.learn-highlight strong {
  color: var(--t-text);
}

/* ── 타로란? 탭 UI ── */
.learn-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--t-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.learn-tabs-bar::-webkit-scrollbar { display: none; }
.learn-tab-btn {
  flex: 1 0 auto;
  padding: 12px 14px;
  font-size: 1.4rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--t-text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  min-height: 44px;
}
.learn-tab-btn.active {
  color: var(--t-gold);
  border-bottom-color: var(--t-gold);
}
.learn-tab-panel { display: none; }
.learn-tab-panel.active { display: block; }

/* ── 타로란? 표 ── */
.learn-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 1.4rem;
}
.learn-table th,
.learn-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--t-border);
  color: var(--t-text-dim);
  line-height: 1.5;
  vertical-align: top;
}
.learn-table th {
  color: var(--t-gold);
  font-weight: 600;
  background: rgba(233, 195, 73, 0.06);
}

/* ── 서브 섹션 타이틀 ── */
.learn-subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--t-text);
  margin: 16px 0 8px;
}

/* ── 전면 광고 오버레이 ── */
.tarot-interstitial-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10, 8, 20, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.tarot-interstitial-overlay.open { display: flex; }
.tarot-interstitial-content {
  max-width: 420px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.tarot-interstitial-label {
  font-family: 'Newsreader', serif;
  font-size: 2.0rem;
  color: var(--t-gold);
  letter-spacing: 0.1em;
}
.tarot-interstitial-slot {
  width: 100%;
  min-height: 260px;
  border: 1px dashed var(--t-gold-border);
  border-radius: 12px;
  background: rgba(233, 195, 73, 0.04);
  display: flex; align-items: center; justify-content: center;
  color: var(--t-text-muted);
  font-size: 1.4rem;
}
.tarot-interstitial-slot::after { content: '광고 영역'; }

.learn-list {
  list-style: none;
  padding: 0;
}

.learn-list li {
  padding: 8px 0;
  font-size: 1.4rem;
  color: var(--t-text-dim);
  line-height: 1.6;
}

.learn-list li::before {
  content: '\2726 ';
  color: var(--t-gold-dim);
}

.learn-suit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 360px) {
  .learn-suit-grid { grid-template-columns: 1fr; }
}

.learn-suit-card {
  background: rgba(233, 195, 73, 0.04);
  border: 1px solid rgba(233, 195, 73, 0.1);
  border-radius: var(--t-radius);
  padding: 14px;
  text-align: center;
}

.learn-suit-icon {
  font-size: 2.4rem;
  margin-bottom: 6px;
}

.learn-suit-card strong {
  display: block;
  font-size: 1.3rem;
  color: var(--t-text);
  margin-bottom: 4px;
}

.learn-suit-card span {
  font-size: 1.3rem;
  color: var(--t-text-muted);
  line-height: 1.4;
}

/* ══════════════════════════════════════
   타로 배우기 — 아코디언 카드 리스트
   ══════════════════════════════════════ */
.learn-card-list {
  margin-top: 16px;
}

.learn-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--t-border);
}

.learn-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.learn-dir-btn {
  padding: 8px 14px;
  font-size: 1.2rem;
  font-weight: 500;
  border-radius: 16px;
  border: 1px solid var(--t-gold-border);
  background: transparent;
  color: var(--t-gold);
  cursor: pointer;
  min-height: 36px;
  transition: background 0.2s, border-color 0.2s;
}

.learn-dir-btn-rev {
  color: #ff8a80;
  border-color: rgba(255, 138, 128, 0.35);
}

.learn-dir-btn:hover {
  background: rgba(233, 195, 73, 0.1);
}

.learn-dir-btn-rev:hover {
  background: rgba(255, 138, 128, 0.1);
}

/* 배우기 팝업 — 모든 스프레드 포지션 섹션 */
.bs-spread-pos-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--t-border);
}

.bs-spread-pos-item:last-child { border-bottom: none; }

.bs-spread-pos-label {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--t-gold);
  margin-bottom: 4px;
}

.bs-spread-pos-text {
  font-size: 1.4rem;
  color: var(--t-text);
  line-height: 1.6;
}

.learn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--t-text);
  transition: background 0.15s;
}

.learn-card-header:hover {
  background: rgba(233, 195, 73, 0.04);
}

.learn-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.learn-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  background: rgba(233, 195, 73, 0.1);
  border-radius: 6px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--t-gold);
  padding: 0 6px;
}

.learn-card-name {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--t-text);
}

.learn-card-name-en {
  font-size: 1.4rem;
  color: var(--t-text-muted);
  margin-top: 2px;
}

.learn-card-arrow {
  font-size: 1.3rem;
  color: var(--t-text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.learn-card-item.expanded .learn-card-arrow {
  transform: rotate(180deg);
}

.learn-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 4px;
}

.learn-card-item.expanded .learn-card-detail {
  max-height: 2000px;
  padding: 0 4px 20px;
}

.learn-detail-section {
  margin-bottom: 14px;
}

.learn-detail-section p {
  font-size: 1.3rem;
  color: var(--t-text-dim);
  line-height: 1.7;
  word-break: keep-all;
}

.learn-detail-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--t-text-muted);
  margin-bottom: 6px;
}

.learn-affirmation {
  font-family: 'Newsreader', serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--t-gold);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   카드 앞면 세부 스타일 (기존 보강)
   ══════════════════════════════════════ */
.card-front-deco {
  color: var(--t-gold-dim);
  font-size: 1.2rem;
}

.card-front-deco-bottom {
  margin-top: auto;
}

.card-front-category {
  font-size: 0.8rem;
  color: var(--t-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.card-front-number {
  font-family: 'Newsreader', serif;
  font-size: 2.0rem;
  font-weight: 700;
  color: var(--t-gold);
}

.card-front-line {
  width: 24px;
  height: 1px;
  background: var(--t-gold-dim);
  margin: 4px 0;
}

.card-front-name {
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--t-text);
  line-height: 1.2;
}

.card-front-name-ko {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--t-gold);
}

.card-front-keyword {
  font-size: 0.9rem;
  color: var(--t-text-muted);
  letter-spacing: 0.08em;
}

.card-front-reversed {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 138, 128, 0.15);
  border: 1px solid rgba(255, 138, 128, 0.3);
  border-radius: 10px;
  font-size: 0.8rem;
  color: #ff8a80;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════
   v1.17 UX 개선 — 탭 UI, 줌 팝업, 주제 선택, 폰트 최소 1.3rem
   ══════════════════════════════════════════════════════ */

/* ── 바텀시트 내 p 태그 간격 ── */
.bs-content p, .bs-tab-panel p { margin-bottom: 1em; }
.bs-content p:last-child, .bs-tab-panel p:last-child { margin-bottom: 0; }

/* ── Yes/No maybe 스타일 (가능성 있음/글쎄요) ── */
.bs-yes-no-text.maybe { color: var(--t-gold-dim, #c4a94d); text-shadow: 0 0 20px rgba(196, 169, 77, 0.3); }

/* ── 바텀시트 탭 바 (단일/다중 공용) ── */
.bs-tabs { display:flex; border-bottom:1px solid var(--t-border); overflow-x:auto; scrollbar-width:none; flex-shrink:0; }
.bs-tabs::-webkit-scrollbar { display:none; }
.bs-tabs:empty { display:none; }
.bs-tab-btn { flex:1; min-width:60px; padding:12px 6px; font-size:1.6rem; color:var(--t-text-muted); border:none; background:transparent; cursor:pointer; border-bottom:2px solid transparent; transition:color .2s,border-color .2s; white-space:nowrap; }
.bs-tab-btn.active { color:var(--t-gold); border-bottom-color:var(--t-gold); }
.bs-tab-panel { display:none; }
.bs-tab-panel.active { display:block; }

/* ── 해석 탭: sections_ko ── */
.bs-section-ko-title { font-size:1.6rem; font-weight:600; color:var(--t-gold); margin:16px 0 6px; }
.bs-section-ko-body { font-size:1.6rem; color:var(--t-text-dim); line-height:1.8; margin-bottom:10px; }

/* ── 상징 탭 (sections_ko) ── */
.bs-symbol-section { margin-bottom:4px; }
.bs-symbol-label {
  font-size:1.6rem; font-weight:600; color:var(--t-gold);
  margin:16px 0 4px;
  padding-bottom:4px;
  border-bottom:1px solid rgba(233,195,73,.15);
}
.bs-symbol-desc {
  font-size:1.6rem; color:var(--t-text-dim); line-height:1.8;
  margin-bottom:6px; padding-left:2px;
}

/* ── 실천 탭 ── */
.bs-actions-group-title { font-size:1.6rem; font-weight:600; color:var(--t-gold); margin:14px 0 6px; }
.bs-actions-list { padding-left:18px; margin:0 0 8px; }
.bs-actions-list li { font-size:1.6rem; color:var(--t-text-dim); line-height:1.7; margin-bottom:4px; }
.bs-journaling-box { background:rgba(255,255,255,0.04); border-left:3px solid var(--t-gold-border); padding:12px 14px; border-radius:0 8px 8px 0; font-style:italic; font-size:1.6rem; color:var(--t-text-dim); line-height:1.7; margin:8px 0; }
.bs-affirmation-box { background:rgba(233,195,73,.06); border:1px solid var(--t-gold-border); border-radius:10px; padding:12px 14px; font-size:1.6rem; color:var(--t-text-dim); line-height:1.7; margin:8px 0; text-align:center; }

/* ── 조합 탭 ── */
.bs-combination-item { padding:10px 0; border-bottom:1px solid var(--t-border); cursor:pointer; }
.bs-combination-item:last-child { border-bottom:none; }
.bs-combination-header { display:flex; justify-content:space-between; align-items:center; }
.bs-combination-partner { font-size:1.4rem; color:var(--t-gold-dim, #c4a94d); }
.bs-combination-arrow { display:inline-flex; align-items:center; color:var(--t-text-muted); transition:transform .2s; }
.bs-combination-item.open .bs-combination-arrow { transform:rotate(90deg); }
.bs-combination-text { font-size:1.4rem; color:var(--t-text-dim); line-height:1.7; display:none; padding-top:8px; }
.bs-combination-item.open .bs-combination-text { display:block; }
.bs-related-section { margin-top:12px; }

/* 상징 탭 카드 이미지 */
.bs-symbol-card-img {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  cursor: pointer;
}
.bs-symbol-card-img img {
  width: 120px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* 해석 탭 조합 (아코디언 없이 직접 노출) */
.bs-combo-plain {
  padding: 10px 0;
  border-bottom: 1px solid var(--t-border);
}
.bs-combo-plain:last-child { border-bottom: none; }
.bs-combo-plain-partner {
  font-size: 1.4rem;
  color: var(--t-gold-dim, #c4a94d);
  font-weight: 600;
  margin-bottom: 6px;
}
.bs-combo-plain-text {
  font-size: 1.4rem;
  color: var(--t-text-dim);
  line-height: 1.7;
}
.bs-related-label { font-size:1.3rem; font-weight:600; color:var(--t-text-muted); margin-bottom:6px; }
.bs-related-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.bs-related-tag { padding:4px 10px; font-size:1.3rem; border-radius:14px; border:1px solid; }
.bs-related-tag.reinforcing { color:var(--t-gold); border-color:rgba(233,195,73,.3); background:rgba(233,195,73,.06); }
.bs-related-tag.opposing { color:#ff8a80; border-color:rgba(255,138,128,.3); background:rgba(255,138,128,.06); }

/* ── 정보 탭 ── */
.bs-meta-table { width:100%; border-collapse:collapse; margin:8px 0; }
.bs-meta-table td { padding:6px 8px; font-size:1.3rem; color:var(--t-text-dim); border-bottom:1px solid var(--t-border); }
.bs-meta-table td:first-child { color:var(--t-text-muted); width:35%; }

/* ── 다중 카드 포지션 탭 내용 ── */
.bs-pos-card-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; padding-bottom:8px; border-bottom:1px solid var(--t-border); }
.bs-pos-card-name { font-size:1.4rem; font-weight:600; color:var(--t-text-primary); }
.bs-pos-dir-badge { font-size:1.3rem; padding:2px 8px; border-radius:10px; }
.bs-pos-dir-badge.upright { color:var(--t-gold); background:rgba(233,195,73,.1); }
.bs-pos-dir-badge.reversed { color:#ff8a80; background:rgba(255,138,128,.1); }

/* ── 종합 탭 썸네일 그리드 ── */
.bs-spread-summary { display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:12px; padding:8px 0; }
.bs-summary-card { display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; }
.bs-summary-card img { width:70px; height:auto; border-radius:6px; border:1px solid var(--t-border); }
.bs-summary-card img.reversed { transform:rotate(180deg); }
.bs-summary-pos { font-size:1.3rem; color:var(--t-text-muted); text-align:center; }
.bs-summary-name { font-size:1.3rem; color:var(--t-text-dim); text-align:center; }

/* ── 고민 주제 선택 ── */
.spread-topic-area { padding:12px 0 8px; }
.spread-topic-label { font-size:1.6rem; color:#7eb8f7; margin-bottom:24px; text-align:center; }
.spread-topic-btns { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.spread-topic-btn { padding:8px 14px; font-size:1.3rem; border:1px solid var(--t-border); border-radius:20px; background:transparent; color:var(--t-text-muted); cursor:pointer; transition:all .2s; min-height:44px; }
.spread-topic-btn.active { border-color:var(--t-gold); color:var(--t-gold); background:rgba(233,195,73,.08); }

/* ── 카드형 고민 버튼 ── */
.card-topic-btns { display:flex; gap:6px; justify-content:center; flex-wrap:nowrap; padding:4px 0; }
.topic-card-btn {
  flex:1; min-width:0; max-width:100px;
  height:172px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  padding:0;
  border:1px solid var(--t-gold-border); border-radius:12px;
  background:var(--t-bg-card); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  color:var(--t-text-muted); cursor:pointer;
  box-shadow:0 0 8px var(--t-gold-glow);
  transition:all .25s ease; position:relative; overflow:hidden;
}
.topic-card-btn::before {
  content:''; position:absolute; inset:5px;
  border:1px solid rgba(233,195,73,.15); border-radius:6px; pointer-events:none;
}
.topic-card-btn:hover {
  border-color:var(--t-gold-border-hover);
  box-shadow:0 0 15px rgba(233,195,73,.25);
}
.topic-card-btn.active {
  border-color:var(--t-gold);
  box-shadow:0 0 20px rgba(233,195,73,.4);
  color:var(--t-gold);
  background:rgba(18,18,31,.85);
}
.topic-card-btn.active::before { border-color:rgba(233,195,73,.4); }
.topic-card-icon { font-size:2rem; line-height:1; position:relative; z-index:1; }
.topic-card-text { font-size:1.6rem; line-height:1.2; text-align:center; word-break:keep-all; position:relative; z-index:1; }

@media (max-width: 480px) {
  .topic-card-btn {
    max-width: calc((100vw - 64px) / 5);
    height: calc((100vw - 64px) / 5 * 1.72);
  }
  .topic-card-icon { font-size:1.6rem; }
  .topic-card-text { font-size:1.3rem; }
}

/* ── 카드 선택 화면 고민 표시 ── */
.current-topic-display {
  text-align:center; padding:8px 0 4px;
  font-size:1.2rem; color:var(--t-text-muted);
}
.current-topic-text { color:var(--t-gold); font-weight:600; }
.topic-change-btn {
  display:block; margin:4px auto 0; padding:8px 20px;
  font-size:1.2rem; border:1px solid var(--t-gold-border); border-radius:20px;
  background:transparent; color:var(--t-text-muted); cursor:pointer;
  transition:all .2s; min-height:40px;
}
.topic-change-btn:hover { border-color:var(--t-gold-border-hover); color:var(--t-gold); }
.topic-selector-inline { padding:8px 0; display:none; }
.topic-selector-inline.open { display:block; }
.topic-selector-inline .card-topic-btns { margin-top:8px; }

/* ── 고민 선택 알럿 팝업 ── */
.spread-alert-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:900;
  display:flex; align-items:center; justify-content:center;
}
.spread-alert-box {
  background:var(--t-bg-card); border:1px solid var(--t-gold-border);
  border-radius:16px; padding:28px 32px; text-align:center;
  color:var(--t-text-primary); font-size:1.5rem; line-height:1.6;
  box-shadow:0 0 30px var(--t-gold-glow); max-width:280px; width:90%;
  backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
}
.spread-alert-close {
  display:inline-block; margin-top:20px;
  padding:10px 28px; border:1px solid var(--t-gold-border); border-radius:20px;
  background:transparent; color:var(--t-gold); cursor:pointer; font-size:1.3rem;
  transition:all .2s;
}
.spread-alert-close:hover { border-color:var(--t-gold); background:rgba(233,195,73,.08); }

/* ── 카드 줌 팝업 ── */
.card-zoom-overlay { position:fixed; inset:0; background:rgba(0,0,0,.85); z-index:1100; display:none; }
.card-zoom-overlay.open { display:block; }
.card-zoom-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:1101; display:none; flex-direction:column; align-items:center; gap:12px; max-width:280px; width:90%; }
.card-zoom-modal.open { display:flex; }
.card-zoom-img { width:100%; border-radius:12px; box-shadow:0 8px 32px rgba(0,0,0,.5); }
.card-zoom-label { font-size:1.6rem; color:#fff; text-align:center; }
.card-zoom-close { position:absolute; top:-40px; right:0; background:none; border:none; color:#fff; font-size:2rem; cursor:pointer; padding:4px 10px; }
