/* ============================================
   별이 들려주는 나의 이야기 - 메인 스타일시트
   v2.0 - Phase 5 최종 다듬기
   모바일 퍼스트 반응형 디자인
   ============================================ */

/* --- CSS Variables (우주적 컬러 시스템) --- */
:root {
  /* 기존 컬러 */
  --primary: #8B7FD6;
  --secondary: #B8A5E8;
  --accent: #FFD4E5;
  --dark: #2D1B4E;
  --bg-gradient: linear-gradient(135deg, #1a0933, #2d1b4e, #4a2c6f);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --error: #FF6B8A;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(184, 165, 232, 0.3);
  --input-focus: var(--secondary);
  --radius: 16px;
  --radius-sm: 10px;

  /* 4단계: 우주적 컬러 추가 */
  --bg-dark: #0a0a0f;
  --bg-card: rgba(20, 20, 30, 0.6);
  --text-dim: #8b8b9a;
  --accent-cosmic: #a8a0d7;
  --accent-glow: rgba(168, 160, 215, 0.2);
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 안전 영역 (노치 대응) */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  /* 스크롤 개선 */
  -webkit-overflow-scrolling: touch;
}

/* 터치 영역 최적화 */
button,
.expand-toggle {
  min-height: 44px;
  min-width: 44px;
}

/* --- 화면 전환 --- */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 0;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- 배경 별 --- */
#stars-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}

/* --- 메인 타이틀 --- */
.main-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* --- 카드 --- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.input-card {
  position: relative;
  z-index: 1;
}

/* datalist 드롭다운 스타일 (모바일) */
datalist,
#city-list {
  border-radius: 0 !important;
}

input::-webkit-calendar-picker-indicator {
  display: none;
}

input[list]::-webkit-list-button {
  display: none;
}

/* --- 입력 그룹 --- */
.input-group {
  margin-bottom: 22px;
}

.input-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.label-icon {
  margin-right: 4px;
  font-size: 1.1rem;
}

/* --- 입력 필드 --- */
.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.25s, box-shadow 0.25s;
  appearance: none;
  -webkit-appearance: none;
}

.input-field:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(184, 165, 232, 0.2);
}

/* date/select 컬러 스킴 */
.input-field::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

select.input-field {
  cursor: pointer;
}

select.input-field option {
  background: var(--dark);
  color: var(--text-primary);
}

/* --- 날짜 선택 행 --- */
.date-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-select {
  flex: 1;
  text-align: center;
}

.date-select:first-child {
  flex: 1.5;
}

/* --- 시간 선택 행 --- */
.time-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-select {
  flex: 1;
}

.time-separator {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary);
}

/* --- 체크박스 --- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--input-border);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* --- 에러 메시지 --- */
.error-message {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 6px;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.error-message.visible {
  opacity: 1;
}

/* --- 버튼 --- */
.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s;
  letter-spacing: 0.02em;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:hover {
  box-shadow: 0 4px 24px rgba(139, 127, 214, 0.4);
}

.btn-submit {
  margin-top: 8px;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ========== 로딩 화면 (점성술 레슨) ========== */

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;
  overflow-y: auto;
}

#loading-screen.hidden {
  display: none;
}

/* 로딩 헤더 */
.loading-header {
  text-align: center;
  margin-bottom: 3rem;
}

.loading-stars {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.loading-stars .star {
  width: 12px;
  height: 12px;
  background: var(--accent-cosmic);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-stars .star:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-stars .star:nth-child(3) {
  animation-delay: 0.4s;
}

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

.loading-main-text {
  font-size: 1rem;
  color: var(--text-dim);
}

/* 레슨 카드 */
.astro-lesson {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 160, 215, 0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lesson-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.3s ease-out;
}

.lesson-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  margin-bottom: 1rem;
  transition: opacity 0.3s ease-out;
}

.lesson-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-line;
  transition: opacity 0.3s ease-out;
}

/* 프로그레스 바 */
.loading-progress {
  width: 100%;
  max-width: 400px;
}

.loading-progress .progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cosmic), #b8b0e7);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease-out;
  margin-bottom: 0.5rem;
  box-shadow: 0 0 10px var(--accent-glow);
}

.progress-text {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: monospace;
}

/* 결과보기 버튼 */
.btn-view-result {
  margin-top: 2rem;
  padding: 1.2rem 2.5rem;
  background: linear-gradient(135deg, var(--accent-cosmic) 0%, #8b7fd6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.3s ease;
  animation: pulse-glow 2s ease-in-out infinite;
  font-family: inherit;
}

.btn-view-result.hidden {
  display: none;
}

.btn-view-result:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-view-result:active {
  transform: translateY(0);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 20px var(--accent-glow);
  }
  50% {
    box-shadow: 0 4px 30px rgba(168, 160, 215, 0.4);
  }
}

/* 로딩 화면 반응형 */
@media (max-width: 640px) {
  .astro-lesson {
    padding: 2rem 1.5rem;
    min-height: 260px;
  }

  .lesson-icon {
    font-size: 3rem;
  }

  .lesson-title {
    font-size: 1.2rem;
  }

  .lesson-content {
    font-size: 0.95rem;
  }

  .btn-view-result {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

/* ============================================
   결과 화면 스타일 (기존 - 4단계로 통합)
   ============================================ */

/* 기존 스타일은 4단계 우주적 스타일로 대체됨 */

/* --- 에러 상태 --- */
.error-state {
  text-align: center;
  padding: 40px 20px;
}

.error-state .error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.error-state .error-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--error);
}

.error-state .error-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ============================================
   랜딩 화면 스타일
   ============================================ */

.landing-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
}

.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.landing-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.landing-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.landing-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.btn-start {
  padding: 18px 48px;
  font-size: 1.15rem;
}

.btn-last-result {
  margin-top: 12px;
  padding: 14px 36px;
  font-size: 1rem;
  background: transparent;
  border: 1px solid rgba(184, 165, 232, 0.5);
  color: var(--text-primary);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-last-result:hover {
  background: rgba(184, 165, 232, 0.15);
  border-color: var(--accent-purple);
}

.btn-last-result.hidden {
  display: none;
}

.landing-footer {
  padding-bottom: 40px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 12px;
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--secondary);
}

/* ============================================
   보관함 화면 스타일
   ============================================ */

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 20px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

.screen-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.archive-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.archive-item:active {
  transform: scale(0.98);
}

.archive-info {
  flex: 1;
}

.archive-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.archive-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.archive-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon.delete:hover {
  color: var(--error);
}

.archive-empty {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ============================================
   설정 화면 스타일
   ============================================ */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
}

.settings-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.settings-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.settings-btn-danger {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: rgba(255, 107, 138, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-btn-danger:hover {
  background: rgba(255, 107, 138, 0.2);
}

.settings-link {
  display: block;
  padding: 12px 0;
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.settings-footer {
  text-align: center;
  padding: 40px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================
   하단 네비게이션
   ============================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 9, 51, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.bottom-nav.hidden {
  display: none;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  padding: 8px 20px;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--secondary);
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
}

/* ============================================
   토스트 메시지
   ============================================ */

.toast-message {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(45, 27, 78, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 12px 24px;
  color: var(--text-primary);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  white-space: nowrap;
}

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

/* ============================================
   유틸리티 클래스
   ============================================ */

.hidden {
  display: none !important;
}

/* ============================================
   반응형 (태블릿 이상)
   ============================================ */

@media (min-width: 601px) {
  .main-title {
    font-size: 2.2rem;
  }

  .card {
    padding: 36px 32px;
  }

  .landing-title {
    font-size: 3rem;
  }

  .landing-subtitle {
    font-size: 1.25rem;
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
  }
}

/* ============================================
   모바일 화면
   ============================================ */

@media (max-width: 640px) {
  .main-title {
    font-size: 1.4rem;
  }

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

  .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .input-field {
    border-radius: 8px;
  }

  /* 지역 입력 리스트 라운드 제거 */
  #birth-city {
    border-radius: 0;
  }

  input[list] {
    border-radius: 0;
  }
}

/* ============================================
   작은 화면 (iPhone SE 등)
   ============================================ */

@media (max-width: 374px) {
  .main-title {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .landing-title {
    font-size: 2rem;
  }

  .landing-subtitle {
    font-size: 1rem;
  }

  .card {
    padding: 20px 16px;
  }

  .input-field {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .btn-primary {
    padding: 14px;
    font-size: 1rem;
  }
}

/* ============================================
   가로 모드 대응
   ============================================ */

@media (orientation: landscape) and (max-height: 500px) {
  .screen {
    min-height: auto;
    padding: 20px 0;
  }

  .landing-content {
    padding: 20px 0;
  }

  .landing-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }

  .landing-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }
}

/* ============================================
   4단계: 우주적 결과 화면 스타일
   깊은 우주의 신비로움을 담은 디자인
   ============================================ */

/* --- 별 배경 애니메이션 --- */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* 반짝이는 별 */
.stars-bg .star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}

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

/* --- 결과 화면 컨테이너 (4단계) --- */
#result-screen {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 4rem 0;
  background: linear-gradient(180deg, var(--bg-dark) 0%, #1a1a2e 100%);
  min-height: 100vh;
}

#result-screen.active {
  display: block;
}

/* --- 한 줄 요약 섹션 --- */
.summary-section {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(168, 160, 215, 0.1) 0%, transparent 70%);
}

.main-summary {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent-cosmic);
  text-shadow: 0 0 20px var(--accent-glow);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.summary-section .birth-info {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- 결과 섹션 공통 스타일 (통일) --- */
#result-screen section {
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#result-screen section h2 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
}

.section-icon-large {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}

.sub-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-cosmic);
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* --- 겉과 속 (dual-self) 섹션 --- */
.dual-self {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.outer-mask,
.inner-truth,
.contradiction {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.8rem;
  border-radius: 12px;
  border: 1px solid rgba(168, 160, 215, 0.1);
}

.dual-self .label {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-cosmic);
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.5rem;
  padding: 0.5rem 0;
}

.divider svg {
  opacity: 0.5;
}

/* --- 전생 섹션 --- */
.past-life h2 {
  margin-bottom: 2rem;
}

.past-life > div {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  border-left: 3px solid var(--accent-cosmic);
}

.role-summary {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-cosmic);
  margin-bottom: 0;
  line-height: 1.85;
}

/* --- 카드 리스트 (빛/상처) --- */
.gift-list,
.wound-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.gift-card,
.wound-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(168, 160, 215, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gift-card.visible,
.wound-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.gift-card h3,
.wound-card h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: var(--accent-cosmic);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.gift-card .card-core,
.wound-card .card-pattern {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.gift-card .card-reality,
.wound-card .card-why,
.wound-card .card-truth {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.75;
}

/* --- 관계, 올해, 목적 섹션 --- */
.relationships > div,
.this-year > div,
.purpose > div {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  border-left: 3px solid var(--accent-cosmic);
}

/* 함정 경고 스타일 */
.purpose .why-trap {
  border-left-color: var(--error);
  background: rgba(255, 107, 138, 0.05);
}

/* --- 결과 화면 문단 스타일 (통일) --- */
#result-screen p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-primary);
  margin: 0;
  word-break: keep-all;
  letter-spacing: -0.01em;
}

/* --- 액션 버튼 영역 (4단계) --- */
#result-screen .action-buttons {
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: none;
}

#result-screen .action-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

#result-screen .btn-primary {
  background: linear-gradient(135deg, var(--accent-cosmic) 0%, #8b7fd6 100%);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

#result-screen .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

#result-screen .btn-secondary {
  background: rgba(168, 160, 215, 0.1);
  color: var(--accent-cosmic);
  border: 1px solid var(--accent-cosmic);
}

#result-screen .btn-tertiary {
  background: transparent;
  color: var(--text-dim);
}

#result-screen .action-buttons button:active {
  transform: scale(0.98);
}

/* --- 페이드인 애니메이션 --- */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

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

/* --- 섹션 순차 등장 애니메이션 --- */
#result-screen section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#result-screen section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 반응형 (태블릿 이상) --- */
@media (min-width: 601px) {
  .main-summary {
    font-size: 1.8rem;
  }

  #result-screen section {
    padding: 4rem 2rem;
  }

  .outer-mask,
  .inner-truth,
  .contradiction {
    padding: 2.2rem;
  }

  .gift-card,
  .wound-card {
    padding: 2.5rem;
  }
}

/* --- 작은 화면 (iPhone SE 등) --- */
@media (max-width: 374px) {
  .main-summary {
    font-size: 1.25rem;
  }

  .section-icon-large {
    font-size: 2rem;
  }

  #result-screen section {
    padding: 2rem 1rem;
  }

  .outer-mask,
  .inner-truth,
  .contradiction {
    padding: 1.4rem;
  }

  .gift-card,
  .wound-card {
    padding: 1.5rem;
  }
}

/* ============================================
   Phase 1: 별이 들려주는 나의 이야기
   Chapter 기반 스타일 (Phase 1.9 개선)
   ============================================ */

/* ========== Chapter 구조 ========== */

.chapter {
  padding: 3rem 0;
  max-width: 800px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Chapter 헤더 */
.chapter-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(168, 160, 215, 0.2);
}

.chapter-number {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.chapter-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  margin: 0;
  line-height: 1.3;
}

/* Chapter 내용 */
.chapter-content {
  padding: 0 1.5rem;
  line-height: 1.9;
}

/* 긴 텍스트 줄바꿈 */
.chapter-content p {
  word-break: keep-all;
  overflow-wrap: break-word;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.chapter-content h3,
.chapter-content h4 {
  color: var(--accent-cosmic);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* 소제목 */
.section-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin: 2.5rem 0;
  line-height: 1.5;
  position: relative;
}

.section-subtitle::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--accent-cosmic);
  margin: 1rem auto 0;
}

/* 섹션 */
.section {
  margin-bottom: 2.5rem;
}

/* 섹션 레이블 */
.section-label {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cosmic);
  margin-bottom: 1rem;
  padding: 0.4rem 1rem;
  background: rgba(168, 160, 215, 0.12);
  border-radius: 16px;
  border-left: 3px solid var(--accent-cosmic);
  letter-spacing: 0.03em;
}

/* 섹션 내용 */
.section-content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.section-content p {
  margin-bottom: 1.2rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* 강조 텍스트 */
.section-content strong,
.section-content b {
  color: var(--accent-cosmic);
  font-weight: 600;
}

/* 인용구 스타일 */
.section-quote {
  padding: 1.5rem;
  margin: 2rem 0;
  background: rgba(168, 160, 215, 0.08);
  border-left: 3px solid var(--accent-cosmic);
  border-radius: 0 10px 10px 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-style: italic;
}

/* 구분선 */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(168, 160, 215, 0.25) 50%,
    transparent
  );
  margin: 2.5rem 0;
}

/* 강조 박스 */
.highlight-box {
  padding: 1.25rem;
  background: rgba(168, 160, 215, 0.1);
  border-radius: 10px;
  margin: 1.5rem 0;
  border: 1px solid rgba(168, 160, 215, 0.2);
}

/* 프롤로그/에필로그 */
.prologue,
.epilogue {
  padding: 4rem 1.5rem;
  text-align: center;
}

.story-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  margin-bottom: 2rem;
  line-height: 1.4;
}

.birth-moment {
  margin-top: 2rem;
}

.birth-date {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.birth-message {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.epilogue-text {
  font-size: 1rem;
  line-height: 2;
  color: var(--text-primary);
  margin: 2rem 0;
}

.signature {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2rem;
}

/* 정체성 카드 */
.identity-card {
  background: linear-gradient(135deg, #8E24AA, #4A148C);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.zodiac-symbol {
  position: absolute;
  top: -30px;
  right: -30px;
  font-size: 180px;
  opacity: 0.1;
}

.identity-card .keyword {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-align: center;
  margin-bottom: 2rem;
}

.trinity {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.trinity-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.trinity-item .label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.trinity-item .value {
  display: block;
  font-size: 0.9rem;
  color: white;
  font-weight: 600;
}

.combo-text {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: white;
  font-style: italic;
  text-align: center;
}

/* 펼치기 버튼 */
.expand-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(168, 160, 215, 0.1);
  border: 1px solid rgba(168, 160, 215, 0.3);
  border-radius: 12px;
  color: var(--accent-cosmic);
  font-size: 0.95rem;
  cursor: pointer;
  margin: 1rem 0;
  transition: all 0.3s;
  font-family: inherit;
}

.expand-toggle:hover {
  background: rgba(168, 160, 215, 0.2);
}

.expand-toggle.open .toggle-icon {
  transform: rotate(180deg);
}

.toggle-icon {
  transition: transform 0.3s;
}

.expandable {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.expandable:not(.hidden) {
  max-height: 3000px;
}

/* 별자리 가이드 */
.guide-intro {
  margin-bottom: 2rem;
  text-align: center;
}

.zodiac-guide {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--accent-cosmic);
}

.guide-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.zodiac-guide h4 {
  color: var(--accent-cosmic);
  margin-bottom: 1rem;
}

.guide-simple,
.guide-deep {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.your-placement {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.your-placement .label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.your-placement .value {
  color: var(--accent-cosmic);
  font-weight: 600;
}

/* 이중성 (두 얼굴) */
.duality {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.outer-face,
.inner-face {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent-cosmic);
}

.outer-face .label,
.inner-face .label {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-cosmic);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.truth-text {
  text-align: center;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 2rem;
}

/* 전생 섹션 */
.pastlife-title {
  font-size: 1.2rem;
  color: var(--accent-cosmic);
  margin-bottom: 1.5rem;
}

.pastlife-section {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--accent-cosmic);
}

.pastlife-section h4 {
  color: var(--accent-cosmic);
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

/* 선물/숙제 카드 (새 구조) */
.gifts-list,
.wounds-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.gift-card,
.wound-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent-cosmic);
}

.gift-card h4,
.wound-card h4 {
  font-size: 1.2rem;
  color: var(--accent-cosmic);
  margin: 0 0 1rem 0;
}

.gift-card .gift-number,
.wound-card .wound-number {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.wound-card .why,
.wound-card .truth {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wound-card .why::before {
  content: "왜 그럴까? ";
  font-weight: 600;
  color: var(--accent-cosmic);
}

.wound-card .truth::before {
  content: "근데 말이야 ";
  font-weight: 600;
  color: var(--accent-cosmic);
}

/* 사랑/올해/미션 섹션 */
.love-section,
.year-section,
.mission-section {
  margin: 2.5rem 0;
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent-cosmic);
}

.love-section h4,
.year-section h4,
.mission-section h4 {
  color: var(--accent-cosmic);
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
}

/* 섹션 내 본문 여백 통일 */
.love-section p,
.year-section p,
.mission-section p,
.pastlife-section p {
  margin: 0;
  line-height: 1.8;
}

/* 섹션 내 마지막 요소 여백 제거 */
.love-section p:last-child,
.year-section p:last-child,
.mission-section p:last-child,
.pastlife-section p:last-child,
.zodiac-guide p:last-child,
.gift-card p:last-child,
.wound-card p:last-child,
.outer-face p:last-child,
.inner-face p:last-child {
  margin-bottom: 0;
}

.year-intro {
  text-align: center;
  margin-bottom: 2rem;
}

/* 미션 파이널 */
.mission-final {
  margin-top: 3rem;
  text-align: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(168, 160, 215, 0.1) 0%, transparent 70%);
  border-radius: 16px;
}

.final-message {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.final-truth {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* 별 아이콘 */
.star-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* 인트로 텍스트 */
.intro-text {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* 에센스 요약 */
.essence-summary {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

/* Chapter 반응형 - 태블릿 */
@media (max-width: 768px) {
  .chapter {
    padding: 2.5rem 0;
  }

  .chapter-header {
    margin-bottom: 2.5rem;
  }

  .chapter-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1.25rem;
    margin: 2rem 0;
  }

  .section-content {
    font-size: 1rem;
    line-height: 1.8;
  }
}

/* Chapter 반응형 - 모바일 */
@media (max-width: 640px) {
  .chapter {
    padding: 2rem 0;
  }

  .chapter-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
  }

  .chapter-number {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .chapter-title {
    font-size: 1.5rem;
  }

  .chapter-content {
    padding: 0 1rem;
  }

  .section-subtitle {
    font-size: 1.15rem;
    margin: 1.5rem 0;
  }

  .section-subtitle::after {
    width: 40px;
    margin-top: 0.75rem;
  }

  .section {
    margin-bottom: 2rem;
  }

  .section-label {
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 0.75rem;
  }

  .section-content {
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .section-quote {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
  }

  .section-divider {
    margin: 2rem 0;
  }

  .identity-card .keyword {
    font-size: 2rem;
  }

  .trinity {
    grid-template-columns: 1fr;
  }

  .story-title {
    font-size: 1.3rem;
  }
}

/* Chapter 반응형 - 작은 모바일 */
@media (max-width: 374px) {
  .chapter {
    padding: 1.5rem 0;
  }

  .chapter-content {
    padding: 0 0.75rem;
  }

  .chapter-title {
    font-size: 1.3rem;
  }

  .section-subtitle {
    font-size: 1.05rem;
  }

  .section-content {
    font-size: 0.9rem;
  }

  .section-quote {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .identity-card {
    padding: 1.5rem 1rem;
  }

  .identity-card .keyword {
    font-size: 1.6rem;
  }
}

/* ============================================
   Phase 5: 에러 토스트 애니메이션
   ============================================ */

.error-toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 68, 68, 0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  z-index: 9999;
  animation: slideDown 0.3s ease-out;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
}

/* ============================================
   Phase 1.7: 원형 출생 차트 & 행성 요약
   ============================================ */

/* 차트 섹션 */
.birth-chart-section {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.8) 0%, rgba(26, 26, 46, 0.8) 100%);
  border-radius: 16px;
  border: 1px solid rgba(168, 160, 215, 0.2);
  position: relative;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  margin-bottom: 2rem;
  text-align: center;
}

/* 차트 컨테이너 */
.birth-chart-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  touch-action: manipulation;
}

.birth-chart {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(168, 160, 215, 0.2));
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chart-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 1rem;
  font-style: italic;
}

/* SVG 스타일 */
.birth-chart .outer-circle {
  fill: rgba(20, 20, 30, 0.6);
  stroke: var(--accent-cosmic);
  stroke-width: 2;
}

.birth-chart .inner-circle {
  fill: rgba(10, 10, 20, 0.8);
  stroke: rgba(168, 160, 215, 0.3);
  stroke-width: 1;
}

.birth-chart .house-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.birth-chart .house-number {
  fill: #555;
  font-size: 12px;
}

.birth-chart .zodiac-symbol-chart {
  fill: var(--accent-cosmic);
  font-size: 14px;
  opacity: 0.6;
}

/* 하우스 라벨 */
.birth-chart .house-number {
  font-size: 16px;
  fill: #ffffff;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}

.birth-chart .house-meaning {
  font-size: 11px;
  fill: #999999;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: middle;
}

.birth-chart .house-label-group:hover .house-number,
.birth-chart .house-label-group:active .house-number {
  fill: var(--accent-cosmic);
}

.birth-chart .house-label-group:hover .house-meaning,
.birth-chart .house-label-group:active .house-meaning {
  fill: var(--accent-cosmic);
}

.birth-chart .house-hit-area {
  cursor: pointer;
  transition: fill 0.2s ease;
}

.birth-chart .house-label-group:hover .house-hit-area {
  fill: rgba(168, 160, 215, 0.15);
}

/* 하우스 툴팁 - 컴팩트 버전 */
.house-tooltip {
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid var(--accent-cosmic);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.house-tooltip.hidden {
  display: none !important;
}

.house-tooltip-title {
  display: inline;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cosmic);
}

.house-tooltip-keywords {
  display: inline;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

.house-tooltip-desc {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-top: 0.5rem;
}


/* ========== 모바일 바텀 시트 ========== */

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #0a0a0f 100%);
  border-radius: 20px 20px 0 0;
  max-height: 70vh;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(168, 160, 215, 0.2);
  border-bottom: none;
  visibility: hidden;
}

.bottom-sheet.active {
  transform: translateY(0);
  visibility: visible;
}

.bottom-sheet.hidden {
  visibility: hidden;
  transform: translateY(100%);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(168, 160, 215, 0.4);
  border-radius: 2px;
  margin: 12px auto 8px;
  cursor: grab;
  touch-action: none;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-content {
  padding: 0 1.5rem 2rem;
  overflow-y: auto;
  max-height: calc(70vh - 40px);
}

.planet-detail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 1rem;
}

.bottom-sheet-close {
  position: absolute;
  top: -8px;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(168, 160, 215, 0.2);
  color: var(--text-primary);
  font-size: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.bottom-sheet-close:hover,
.bottom-sheet-close:active {
  background: rgba(168, 160, 215, 0.3);
}

.planet-detail-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.planet-detail-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  text-align: center;
  margin: 0;
}

.planet-detail-position {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 1.5rem;
}

.planet-detail-oneliner {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.7;
  padding: 1.25rem;
  background: rgba(168, 160, 215, 0.1);
  border-radius: 12px;
  font-style: italic;
  margin-bottom: 1.5rem;
  text-align: center;
  border: 1px solid rgba(168, 160, 215, 0.2);
}

.planet-detail-aspects {
  margin-top: 1rem;
}

.planet-detail-aspects h4 {
  font-size: 1rem;
  color: var(--accent-cosmic);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.planet-detail-aspects .aspect-item {
  padding: 0.75rem 1rem;
  background: rgba(168, 160, 215, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(168, 160, 215, 0.1);
}

.planet-detail-aspects .aspect-item span:first-child {
  font-size: 1.2rem;
}

/* 바텀 시트 배경 오버레이 */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bottom-sheet-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ========== 반응형: 모바일 바텀시트 vs 데스크톱 툴팁 ========== */

/* 모바일 (~ 767px): 바텀 시트 사용, 툴팁 숨김 */
@media (max-width: 767px) {
  .planet-tooltip {
    display: none !important;
  }

  .house-tooltip {
    display: none !important;
  }
}

/* 태블릿/데스크톱 (768px+): 기존 툴팁 사용 */
@media (min-width: 768px) {
  .bottom-sheet {
    display: none !important;
  }

  .bottom-sheet-overlay {
    display: none !important;
  }
}

/* 아주 작은 모바일 */
@media (max-width: 374px) {
  .bottom-sheet-content {
    padding: 0 1rem 1.5rem;
  }

  .planet-detail-icon {
    font-size: 3rem;
  }

  .planet-detail-name {
    font-size: 1.4rem;
  }

  .planet-detail-oneliner {
    font-size: 1rem;
    padding: 1rem;
  }
}

.birth-chart .planet-dot {
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: all;
  touch-action: manipulation;
}

.birth-chart .planet-dot:hover,
.birth-chart .planet-dot:active {
  filter: drop-shadow(0 0 10px currentColor);
}

.birth-chart .planet-icon-svg {
  font-size: 18px;
  pointer-events: none;
}

.birth-chart .aspect-line {
  stroke-width: 1;
  opacity: 0.4;
}

.birth-chart .aspect-line.harmony {
  stroke: #4a9;
}

.birth-chart .aspect-line.tension {
  stroke: #c66;
}

/* 툴팁 영역 */
.tooltip-area {
  margin-top: 1.5rem;
}

/* 행성 툴팁 (데스크톱용) - 컴팩트 버전 */
.planet-tooltip {
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid var(--accent-cosmic);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.planet-tooltip.hidden {
  display: none !important;
}

/* 헤더: 아이콘 + 이름 + 위치를 가로로 */
.tooltip-planet-icon {
  display: inline;
  font-size: 1.2rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.tooltip-planet-name {
  display: inline;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cosmic);
  vertical-align: middle;
}

.tooltip-planet-position {
  display: inline;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tooltip-oneliner {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: rgba(168, 160, 215, 0.1);
  border-radius: 6px;
  border-left: 2px solid var(--accent-cosmic);
}

.tooltip-aspects {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.tooltip-aspects-title {
  display: none;
}

.tooltip-aspects .aspect-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: rgba(168, 160, 215, 0.1);
  border-radius: 4px;
  font-size: 0.75rem;
}

.aspect-item .aspect-icon {
  font-size: 0.85rem;
}


/* 행성별 색상 */
.planet-sun { color: #FFD700; }
.planet-moon { color: #E8E8E8; }
.planet-mercury { color: #FFA500; }
.planet-venus { color: #FFB6C1; }
.planet-mars { color: #FF6347; }
.planet-jupiter { color: #DAA520; }
.planet-saturn { color: #CD853F; }
.planet-uranus { color: #40E0D0; }
.planet-neptune { color: #4169E1; }
.planet-pluto { color: #9370DB; }

/* 반응형 */
@media (max-width: 640px) {
  .birth-chart-section {
    padding: 1.5rem 1rem;
    margin: 2rem 0;
  }

  .birth-chart-container {
    max-width: 100%;
  }

  .planet-tooltip {
    min-width: 240px;
    max-width: 280px;
    padding: 1rem;
  }

  .tooltip-planet-icon {
    font-size: 2rem;
  }

  .planet-summary-card {
    padding: 1rem;
  }

  .planet-summary-icon {
    font-size: 1.5rem;
    width: 36px;
  }
}

@media (max-width: 374px) {
  .section-title {
    font-size: 1.1rem;
  }

  .planet-tooltip {
    min-width: 200px;
    font-size: 0.9rem;
  }
}

/* ============================================
   입력 정보 확인 모달
   ============================================ */

.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal.hidden {
  display: none;
}

.confirm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.confirm-modal-content {
  position: relative;
  background: linear-gradient(135deg, #2d1b4e 0%, #1a0933 100%);
  border: 1px solid rgba(184, 165, 232, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s ease-out;
}

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

.confirm-title {
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.confirm-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.confirm-info {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.confirm-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.confirm-warning {
  text-align: center;
  color: var(--accent-pink);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
}

.confirm-buttons .btn-secondary {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(184, 165, 232, 0.5);
  color: var(--text-primary);
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-buttons .btn-secondary:hover {
  background: rgba(184, 165, 232, 0.1);
}

.confirm-buttons .btn-primary {
  flex: 1;
  padding: 14px;
  background: var(--accent-gradient);
  border: none;
  color: white;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-buttons .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(168, 160, 215, 0.4);
}

@media (max-width: 480px) {
  .confirm-modal-content {
    padding: 1.5rem;
    margin: 10px;
  }

  .confirm-title {
    font-size: 1.3rem;
  }

  .confirm-buttons {
    flex-direction: column;
  }
}
