/* =========================================================
   Lunar Soopoolleaf — 궁합
   home.css + time.css + zodiac.css 위에 얹습니다.
   ========================================================= */

.cp-main { padding-bottom: 48px; }


/* ---------- 입력 ---------- */

.cp-entry { width: min(100%, 560px); }

.cp-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.cp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.cp-field-label {
  padding-left: 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted);
}

.cp-field .tc-input { font-size: 16.5px; padding: 13px 34px 13px 12px; letter-spacing: .03em; }

.cp-swap {
  width: 40px;
  height: 46px;
  margin-bottom: 3px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cp-swap svg { width: 18px; height: 18px; }
.cp-swap:hover { color: var(--text); border-color: var(--primary); }

.cp-go {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 5px 0 var(--primary-deep);
  transition: transform .16s ease, box-shadow .16s ease;
}

.cp-go svg { width: 20px; height: 20px; }
.cp-go:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--primary-deep); }
.cp-go:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--primary-deep); }


/* ---------- 결과 ---------- */

.cp-result {
  --cp: #52b788;
  width: min(100%, 720px);
  margin: 18px auto 0;
  padding: 22px 20px 16px;
  border: 2px solid var(--surface);
  border-top: 5px solid var(--cp);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 16px;
}

.cp-result[data-band="band_4"] { --cp: #e0607e; }
.cp-result[data-band="band_3"] { --cp: #e8974f; }
.cp-result[data-band="band_2"] { --cp: #52b788; }
.cp-result[data-band="band_1"] { --cp: #6f8fd6; }

.cp-score-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }

.cp-people {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.cp-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--zd) 10%, var(--surface));
  text-decoration: none;
  color: var(--text);
  text-align: center;
  min-width: 0;
}

.cp-person-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.cp-person-symbol { font-size: 34px; line-height: 1.1; color: var(--zd); }
.cp-person b { font-size: 15px; }
.cp-person small { font-size: 10.5px; font-weight: 700; color: var(--muted); }

.cp-score {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cp-score svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }

.cp-ring-bg { fill: none; stroke: var(--soft); stroke-width: 9; }

.cp-ring {
  fill: none;
  stroke: var(--cp);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: calc(326.7 - 326.7 * var(--pct) / 100);
  transition: stroke-dashoffset .9s cubic-bezier(.2, .7, .2, 1);
}

.cp-score-num { font-size: 34px; font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--cp); }
.cp-score-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }

.cp-band-title { margin: 6px 0 0; font-size: clamp(20px, 4.5vw, 26px); font-weight: 900; letter-spacing: -.02em; }
.cp-band-text { margin: 0; font-size: 14px; line-height: 1.75; color: var(--muted); word-break: keep-all; max-width: 540px; }


/* 블록 */

.cp-block {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cp-block h3 { margin: 0; font-size: 13px; font-weight: 800; color: var(--primary-ink); }
.cp-block h4 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.cp-block p { margin: 0; font-size: 14.5px; line-height: 1.8; word-break: keep-all; }

.cp-mini-score {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 900;
  color: var(--cp);
}

.cp-mini-num { color: var(--text); }

.cp-pair { display: flex; align-items: center; gap: 10px; }

.cp-pair-chip {
  --zd: var(--primary);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--zd) 16%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--zd) 45%, var(--surface));
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
}

.cp-pair-num { font-size: 18px; border-radius: 16px; padding: 6px 16px; }
.cp-pair-num small { font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }

.cp-pair-x { font-size: 15px; font-weight: 900; color: var(--muted); }


/* 카드 */

.cp-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.cp-cards .zd-tarot { background: var(--surface); }
.cp-side-card img { width: 72px; }
.cp-main-card img { width: 110px; }
.cp-main-card b { font-size: 15px; }
.cp-main-card small { color: var(--muted); font-weight: 600; }

.cp-card-lead { font-size: 12.5px !important; color: var(--muted); }

.cp-actions { gap: 8px; flex-wrap: wrap; }

.cp-again { text-decoration: none; border-color: var(--line); background: var(--surface); }

.cp-links { margin: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cp-links a { color: var(--primary-ink); text-decoration: none; }
.cp-links a:hover { text-decoration: underline; }


/* ---------- 모바일 ---------- */

@media (max-width: 640px) {
  .cp-result { padding: 18px 14px 14px; border-radius: 20px; gap: 12px; }
  .cp-people { gap: 6px; }
  .cp-person { padding: 10px 4px; }
  .cp-person-symbol { font-size: 28px; }
  .cp-person b { font-size: 13px; }
  .cp-person small { font-size: 9.5px; }
  .cp-score { width: 96px; height: 96px; }
  .cp-score-num { font-size: 28px; }
  .cp-block { padding: 14px 12px 12px; }
  .cp-cards { gap: 4px; }
  .cp-side-card img { width: 56px; }
  .cp-main-card img { width: 88px; }
  .cp-field .tc-input { font-size: 14.5px; padding: 12px 30px 12px 10px; }
  .cp-swap { width: 36px; }
}

@media (max-width: 360px) {
  .cp-fields { grid-template-columns: 1fr; }
  .cp-swap { width: 100%; height: 36px; margin: 0; }
  .cp-field .tc-input { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-ring { transition: none; }
}
