/* ─────────────────────────────────────────────────────────
   내팔자 — 사주 & 운세 사이트 스타일시트
   ───────────────────────────────────────────────────────── */

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

body {
  font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
  background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #e0d4f7;
}

#root { max-width: 900px; margin: 0 auto; padding: 20px; }

/* ── 헤더 ── */
.header { text-align: center; padding: 30px 0 20px; }
.header h1 {
  font-size: 2.2rem;
  background: linear-gradient(90deg, #f5c518, #e8a0bf, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header p { color: #a78bfa; font-size: 0.95rem; }

/* ── 탭 네비 ── */
.tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; justify-content: center; }
.tab-btn {
  padding: 10px 18px;
  border: 1px solid #4a3f6b;
  background: rgba(255,255,255,0.05);
  color: #c4b5fd;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
}
.tab-btn:hover { background: rgba(167,139,250,0.2); }
.tab-btn.active {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  border-color: #7c3aed;
}

/* ── 카드 ── */
.card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 1.2rem;
  color: #c4b5fd;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 폼 ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.form-group label { display: block; font-size: 0.82rem; color: #a78bfa; margin-bottom: 6px; }
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 10px;
  color: #e0d4f7;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.form-group select option { background: #1a0a2e; }

/* ── 버튼 ── */
.btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── 결과 박스 애니메이션 ── */
.result-box { margin-top: 22px; animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 사주 기둥 ── */
.saju-pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px,1fr)); gap: 10px; margin-bottom: 20px; }
.pillar {
  background: linear-gradient(180deg, rgba(124,58,237,0.3), rgba(79,70,229,0.2));
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.pillar-today {
  background: linear-gradient(180deg, rgba(245,197,24,0.28), rgba(217,119,6,0.18));
  border: 1px solid rgba(245,197,24,0.6);
}
.pillar-label  { font-size: 0.75rem; color: #a78bfa; margin-bottom: 8px; }
.pillar-today .pillar-label { color: #f5c518; font-weight: bold; }
.pillar-hanja  { font-size: 1.4rem; color: #f5c518; font-weight: bold; }
.pillar-korean { font-size: 0.85rem; color: #c4b5fd; margin-top: 4px; }
.pillar-element {
  font-size: 0.75rem;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

/* ── 오행 ── */
.ohaeng-bar { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.ohaeng-item { flex: 1; min-width: 80px; padding: 10px; border-radius: 10px; text-align: center; }
.ohaeng-name  { font-size: 0.85rem; font-weight: bold; }
.ohaeng-count { font-size: 1.3rem; font-weight: bold; }
.ohaeng-desc  { color: #ddd6fe; font-size: 0.9rem; line-height: 1.6; }

/* ── 운세 아이템 ── */
.fortune-item {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid #7c3aed;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 0 10px 10px 0;
}
.fortune-item h4 { font-size: 0.85rem; color: #a78bfa; margin-bottom: 5px; }
.fortune-item p  { font-size: 0.9rem; line-height: 1.6; color: #ddd6fe; }

/* ── 오늘의 운세 그리드 ── */
.today-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.today-item { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 14px; text-align: center; }
.today-item .icon  { font-size: 1.5rem; }
.today-item .label { font-size: 0.75rem; color: #a78bfa; margin: 4px 0; }

/* ── 별점 ── */
.star-row  { display: flex; gap: 4px; justify-content: center; margin: 4px 0; }
.star       { color: #f5c518; font-size: 1rem; }
.star-empty { color: #4a3f6b; font-size: 1rem; }

/* ── 뱃지 & 구분선 ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: bold;
  margin: 2px;
}
.divider { border: none; border-top: 1px solid rgba(167,139,250,0.2); margin: 16px 0; }

/* ── 레이아웃 유틸 ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.text-center { text-align: center; }
.text-gold   { color: #f5c518; }
.text-purple { color: #a78bfa; }
.text-light  { color: #c4b5fd; }
.text-muted  { color: #ddd6fe; }
.text-green  { color: #4ade80; }
.text-red    { color: #f87171; }

/* ── 궁합 점수 ── */
.compat-score {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(90deg, #f5c518, #e8a0bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0;
}
.compat-msg   { color: #c4b5fd; margin-bottom: 12px; }
.compat-arrow { color: #a78bfa; margin: 0 8px; }

/* ── 프로필 패널 ── */
.profile-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(167,139,250,0.4);
  background: rgba(255,255,255,0.06);
  color: #c4b5fd;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.profile-panel {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}
.profile-hint  { color: #a78bfa; font-size: 0.82rem; margin-bottom: 8px; }
.profile-empty { color: #6b5e8a; font-size: 0.85rem; }
.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(124,58,237,0.15);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(167,139,250,0.2);
  transition: background 0.15s;
}
.profile-item:hover { background: rgba(124,58,237,0.25); }
.profile-name { font-weight: bold; color: #f5c518; }
.profile-meta { color: #a78bfa; font-size: 0.82rem; margin-left: 10px; }
.profile-del  {
  background: rgba(239,68,68,0.2);
  border: none;
  color: #f87171;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
}
.profile-close {
  margin-top: 4px;
  background: none;
  border: none;
  color: #6b5e8a;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
}

/* ── 저장 행 ── */
.save-row   { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.save-input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 10px;
  color: #e0d4f7;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}
.save-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #059669, #047857);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  white-space: nowrap;
}

/* ── 메시지 ── */
.error-msg   { color: #f87171; font-size: 0.85rem; margin-bottom: 10px; }
.save-msg    { font-size: 0.85rem; margin-bottom: 10px; }
.ilgan-desc  { color: #a78bfa; font-size: 0.85rem; margin-bottom: 14px; }
.meta-info   { text-align: center; color: #a78bfa; margin-bottom: 8px; }
.loading-msg { text-align: center; padding: 20px; color: #a78bfa; }

/* ── 오늘의 운세 큰 점수 ── */
.today-score-label { color: #a78bfa; font-size: 0.9rem; }
.today-score-big   { font-size: 3rem; font-weight: bold; color: #f5c518; }
.lucky-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.9rem;
}

/* ── 띠 탭 ── */
.ddi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.ddi-btn {
  padding: 14px 8px;
  border-radius: 12px;
  cursor: pointer;
  color: #e0d4f7;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(167,139,250,0.2);
}
.ddi-btn:hover { background: rgba(124,58,237,0.2); border-color: rgba(167,139,250,0.4); }
.ddi-btn.active { background: rgba(124,58,237,0.35); border-color: #a78bfa; }
.ddi-emoji { font-size: 1.6rem; }
.ddi-label { font-size: 0.85rem; margin-top: 4px; color: #a0899e; }
.ddi-btn.active .ddi-label { font-weight: bold; color: #c4b5fd; }
.ddi-header { text-align: center; }
.ddi-score  { font-size: 2.5rem; font-weight: bold; color: #f5c518; }
.ddi-years  { font-size: 0.8rem; color: #a78bfa; margin-bottom: 12px; }
.ddi-char   { font-size: 0.9rem; color: #ddd6fe; line-height: 1.6; max-width: 400px; margin: 0 auto 16px; }
.ddi-lucky-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.88rem;
}

/* ── 혈액형·별자리 ── */
.zodiac-meta   { text-align: center; margin-bottom: 12px; }
.zodiac-date   { font-size: 0.85rem; color: #a78bfa; }
.zodiac-badges { margin-top: 8px; }
.blood-compat  { margin-top: 12px; font-size: 0.85rem; color: #a78bfa; }

/* ── 푸터 ── */
.footer { text-align: center; padding: 20px 0; color: rgba(167,139,250,0.4); font-size: 0.8rem; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .two-col      { grid-template-columns: 1fr; }
  .today-grid   { grid-template-columns: repeat(2,1fr); }
  .saju-pillars { grid-template-columns: repeat(2,1fr); }
  .ddi-grid     { grid-template-columns: repeat(3,1fr); }
  .lucky-row    { gap: 12px; font-size: 0.85rem; }
}
