/* ===== Gunghap Page ===== */

.gh-card {
  padding: 26px 24px;
  max-width: 720px;
  margin: 0 auto 18px;
}

.gh-section-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.gh-section-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.gh-back-btn {
  background: none;
  border: none;
  color: #7C3AED;
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 14px;
  font-weight: 600;
}

.gh-back-btn:hover { color: var(--text-accent); }

/* Relation grid */
.gh-relation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gh-relation-btn {
  padding: 20px 12px;
  background: rgba(255, 255, 255, 0.32);
  border: 1.5px solid rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.08);
}

.gh-relation-btn:hover {
  transform: translateY(-2px);
  border-color: #a78bfa;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.22);
  background: rgba(255, 255, 255, 0.75);
}

.gh-relation-icon { font-size: 30px; margin-bottom: 8px; }
.gh-relation-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; color: var(--text-primary); }
.gh-relation-sub { font-size: 11px; color: var(--text-secondary); }

/* Person cards */
.gh-persons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

@media (min-width: 720px) {
  .gh-persons { grid-template-columns: 1fr 1fr; }
}

.gh-person-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
}

.gh-person-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: -0.2px;
}

.gh-field { margin-bottom: 12px; }
.gh-field-half { flex: 1; }
.gh-row { display: flex; gap: 12px; }

.gh-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
}

.gh-optional {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.gh-input {
  width: 100%;
  padding: 11px 12px;
  background: #ffffff;
  border: 1.5px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #1A2B2E;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gh-input::placeholder { color: #9CA3AF; opacity: 1; }

.gh-input:focus {
  outline: none;
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .gh-input {
  background: #2A2240;
  color: #E5DEFF;
  border-color: rgba(167, 139, 250, 0.35);
}
[data-theme="dark"] .gh-input::placeholder { color: #B5ADCF; opacity: 0.85; }
[data-theme="dark"] .gh-input::-webkit-calendar-picker-indicator { filter: invert(0.85); }

.gh-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%234A4461' stroke-width='1.5'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.gh-radio-group {
  display: flex;
  gap: 14px;
  padding: 5px 0;
}

.gh-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
}

.gh-radio input { accent-color: #7C3AED; }

.gh-consent-note {
  margin: 16px 0 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 10px 12px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 10px;
}

.gh-submit-btn {
  width: 100%;
  margin-top: 8px;
}

/* Loading */
.gh-loading-card {
  text-align: center;
  padding: 50px 26px;
  /* 로딩 카드도 기본 luna-glass 투명도(0.75)로 — 배경 보이게 */
}

.gh-loading-orb {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gh-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #7C3AED;
  border-right-color: #EC4899;
  animation: ghSpin 2.4s linear infinite;
}

.gh-orb-ring:nth-child(2) {
  inset: 14px;
  animation-duration: 1.8s;
  animation-direction: reverse;
  border-top-color: #a78bfa;
}

.gh-orb-core {
  position: relative;
  font-size: 28px;
  color: var(--text-accent);
  z-index: 1;
  font-weight: 700;
}

@keyframes ghSpin {
  to { transform: rotate(360deg); }
}

.gh-loading-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.gh-loading-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Result */
.gh-score-hero {
  text-align: center;
  padding: 36px 24px 28px;
}

.gh-score-circle {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
}

.gh-score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gh-score-bg {
  fill: none;
  stroke: rgba(139, 92, 246, 0.18);
  stroke-width: 9;
}

.gh-score-fg {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.gh-score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gh-score-num {
  font-size: 54px;
  font-weight: 700;
  background: linear-gradient(135deg, #EC4899, #7C3AED);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1;
  letter-spacing: -2px;
}

.gh-score-label {
  font-size: 13px;
  color: var(--text-accent);
  margin-top: 4px;
  font-weight: 700;
}

.gh-score-summary {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: -0.2px;
}

.gh-names {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.gh-name-chip {
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-accent);
}

.gh-name-sep {
  font-size: 18px;
  color: #a78bfa;
  font-weight: 700;
}

.gh-section {
  padding: 22px 22px;
}

.gh-section-h {
  margin: 0 0 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.gh-section-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.gh-result-actions {
  display: flex;
  gap: 12px;
  max-width: 720px;
  margin: 24px auto 40px;
}

.gh-result-actions button { flex: 1; }

/* ===== 무료 결정론 미리보기 (두 사람 사주 + 오행) ===== */
.gh-persons-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .gh-persons-preview { grid-template-columns: 1fr 1fr; }
}

.gh-person-preview {
  padding: 16px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 14px;
}
[data-theme="dark"] .gh-person-preview {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

.gh-person-name {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-accent);
}

.gh-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.gh-pillar-col {
  text-align: center;
  padding: 8px 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 9px;
}
[data-theme="dark"] .gh-pillar-col { background: rgba(15, 12, 30, 0.4); }

.gh-pillar-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.gh-pillar-gan, .gh-pillar-ji {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.gh-pillar-hanja {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.55;
  font-family: var(--font-serif, serif);
}

.gh-daystem {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.gh-daystem strong { color: var(--text-accent); font-size: 14px; }

.gh-oheng {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gh-oheng-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.gh-oheng-name {
  width: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  text-align: center;
}
.gh-oheng-bar {
  flex: 1;
  height: 9px;
  background: rgba(167, 139, 250, 0.22);
  border-radius: var(--radius-full, 999px);
  overflow: hidden;
}
[data-theme="dark"] .gh-oheng-bar { background: rgba(167, 139, 250, 0.18); }
.gh-oheng-fill {
  height: 100%;
  border-radius: var(--radius-full, 999px);
  transition: width 0.9s ease-out;
}
.gh-oheng-fill[data-element="wood"]  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.gh-oheng-fill[data-element="fire"]  { background: linear-gradient(90deg, #ef4444, #f87171); }
.gh-oheng-fill[data-element="earth"] { background: linear-gradient(90deg, #eab308, #facc15); }
.gh-oheng-fill[data-element="metal"] { background: linear-gradient(90deg, #475569, #94a3b8); }
.gh-oheng-fill[data-element="water"] { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.gh-oheng-pct {
  width: 38px;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ===== AI 잠금 안내 ===== */
.gh-ai-locked {
  text-align: center;
  border: 1.5px dashed rgba(139, 92, 246, 0.4);
}
[data-theme="dark"] .gh-ai-locked { border-color: rgba(167, 139, 250, 0.45); }
.gh-ai-locked .gh-section-h { margin-bottom: 8px; }
.gh-ai-locked .gh-section-body { margin-bottom: 16px; }

@media (max-width: 480px) {
  .gh-card { padding: 20px 18px; }
  .gh-relation-icon { font-size: 26px; }
  .gh-score-circle { width: 160px; height: 160px; }
  .gh-score-num { font-size: 46px; }
  .gh-section { padding: 18px; }
  .gh-result-actions { flex-direction: column; }
  .gh-pillar-gan, .gh-pillar-ji { font-size: 13px; }
}
