:root {
  --bg-main: #F5F5F7;
  --title-pink: #C95C87;
  --card-grad-start: #FFF5FA;
  --card-grad-end: #FAE8F2;
  --card-border: #EDCCDE;
  --gauge-track: rgba(255, 255, 255, 0.78);
  --gauge-grad-start: #F59EC7;
  --gauge-grad-end: #E373B0;
  --gauge-inner-start: #8A5E87;
  --gauge-inner-end: #634569;
  --title-dark: #262624;
  --desc-gray: #807378;
  --grade-desc-gray: #4C4C47;
  --fortune-content: #40403B;
  --fortune-bg-border: #EDD6E3;
  --fortune-divider: #EDE3EB;
  --grade-badge-text: #C95C87;
  --grade-badge-border: #EBD6E0;
  --divider-general: #F0E3EB;
  --fortune-title2-text: #B08FA1;
  --chemistry-info-icon: #DB7AAB;
  --white-82: rgba(255, 255, 255, 0.82);
  --white-88: rgba(255, 255, 255, 0.88);
  --cta-grad-start: #DE709E;
  --cta-grad-end: #D15C8C;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-main);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Pretendard", Roboto, "Malgun Gothic", sans-serif;
  color: var(--title-dark);
}

.page {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 48px;
}

/* ---------- 별자리 선택 카드 ---------- */
.picker-card {
  background: #fff;
  border: 1px solid var(--fortune-bg-border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.picker-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--desc-gray);
  margin-bottom: 10px;
}

.picker-row {
  display: flex;
  gap: 10px;
}

.picker-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.picker-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--title-pink);
}

.picker-field select {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--fortune-bg-border);
  background: #FFF7FA;
  color: var(--title-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 0 8px;
}

/* ---------- 별자리 오늘케미 카드 ---------- */
.chemistry-card {
  background: linear-gradient(135deg, var(--card-grad-start), var(--card-grad-end));
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 16px;
}

.chemistry-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.chemistry-header-icon {
  font-size: 13px;
  margin-right: 7px;
}

.chemistry-header-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--title-pink);
}

.chemistry-spacer { flex: 1; }

.chemistry-info-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  color: var(--chemistry-info-icon);
  font-weight: 700;
  font-style: italic;
  font-size: 15px;
  cursor: pointer;
}

.chemistry-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.chemistry-gauge {
  flex: 0 0 118px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    from -90deg,
    var(--gauge-grad-start) calc(var(--progress, 0) * 1%),
    var(--gauge-track) calc(var(--progress, 0) * 1%) 100%
  );
  padding: 7px;
}

.chemistry-gauge-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gauge-inner-start), var(--gauge-inner-end));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.chemistry-score {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.chemistry-score-label {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.chemistry-info-area {
  flex: 1;
  min-width: 0;
}

.chemistry-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chemistry-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--title-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chemistry-grade-badge {
  background: var(--white-88);
  border: 1px solid var(--grade-badge-border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--grade-badge-text);
  white-space: nowrap;
}

.chemistry-grade-desc {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--grade-desc-gray);
  text-align: justify;
  text-justify: inter-word;
  word-break: break-all;
}

/* ---------- 운세 박스 (3줄 / 2줄) ---------- */
.fortune-box {
  background: var(--white-82);
  border: 1px solid var(--fortune-bg-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2px;
}

.fortune-row {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  gap: 4px;
  border-bottom: 1px solid var(--fortune-divider);
}

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

.fortune-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fortune-icon {
  font-size: 14px;
  flex: 0 0 18px;
  text-align: center;
}

.fortune-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--title-dark);
  white-space: nowrap;
}

.fortune-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fortune-content);
  white-space: normal;
  word-break: break-all;
}

#lineBasic {
  text-align: justify;
  text-justify: inter-word;
}

.chemistry-divider {
  height: 1px;
  background: var(--divider-general);
  margin: 6px 0 10px;
}

.chemistry-section2-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0 2px;
}

#chemistrySectionTitle,
.chemistry-section2-title span {
  font-size: 12px;
  font-weight: 700;
  color: var(--fortune-title2-text);
}

/* ---------- 오늘 별자리 순위 ---------- */
.ranking-list {
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
}

.ranking-rank {
  flex: 0 0 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fortune-title2-text);
}

.ranking-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--title-dark);
}

.ranking-row-highlight {
  background: var(--white-88);
  border-radius: 10px;
}

.ranking-row-highlight .ranking-rank,
.ranking-row-highlight .ranking-name {
  color: var(--title-pink);
}

/* ---------- 다운로드 CTA ---------- */
.download-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--cta-grad-start), var(--cta-grad-end));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 안내 시트 ---------- */
.info-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}

.info-sheet:not([hidden]) {
  display: flex;
}

.info-sheet-card {
  width: 100%;
  max-width: 420px;
  background: #FFF7FA;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px 28px;
}

.info-sheet-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.info-sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: #3D363D;
  flex: 1;
}

.info-sheet-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #FAF2F7;
  color: #A8949E;
  font-weight: 700;
}

.info-sheet-body {
  font-size: 15px;
  line-height: 1.6;
  color: #5C5459;
  margin: 0;
}
