/* 점 — 사주 풀이 */
:root {
  --bg: #f7f3ec;       /* 한지 톤 */
  --bg-soft: #efe9dd;
  --paper: #faf6ee;
  --ink: #2a2419;       /* 묵 */
  --ink-soft: #6b5f4d;
  --ink-faint: #a39785;
  --line: #e0d8c5;
  --line-soft: #ece5d2;
  --accent: #8b1a1a;    /* 인주 */
  --accent-soft: #f7e8e2;
  --accent-deep: #6a0f0f;
  --gold: #b89968;
  --shadow: 0 1px 3px rgba(42, 36, 25, 0.05), 0 8px 24px rgba(42, 36, 25, 0.06);
  --radius: 4px;
  --sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', system-ui, sans-serif;
  --serif: 'Noto Serif KR', 'Pretendard Variable', 'Pretendard', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.01em;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }

.page { min-height: 100vh; padding: 0; position: relative; }
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 헤더 ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-back {
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.topbar-back:hover { color: var(--accent); }
.topbar-brand {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.topbar-brand small {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 4px;
}

/* ===== 랜딩 hero ===== */
.hero {
  text-align: center;
  padding: 80px 0 56px;
}
.hero .seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(139, 26, 26, 0.25);
  letter-spacing: -0.05em;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 14px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero .lead {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  letter-spacing: -0.015em;
}

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  height: 52px;
  padding: 0 28px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover, .btn:active { background: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover, .btn-ghost:active {
  background: var(--bg-soft);
  border-color: var(--ink);
}
.btn-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 32px 0;
}

/* ===== 입력 폼 (사주 정보) ===== */
.form-section {
  background: var(--paper);
  border-radius: 4px;
  padding: 24px 20px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.form-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.form-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.field input,
.field select {
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field select:focus { outline: none; border-color: var(--ink); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radio-row {
  display: flex;
  gap: 8px;
}
.radio-row input[type="radio"] { display: none; }
.radio-row label {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: -0.02em;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.radio-row input[type="radio"]:checked + label {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.field-help {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: -0.01em;
}

/* ===== 결과지 ===== */
.result-cover {
  background: var(--paper);
  border-radius: 4px;
  padding: 32px 22px;
  text-align: center;
  margin-top: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.result-eyebrow {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.result-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}
.result-subtitle {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}

/* 8자 표 */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 22px 0;
}
.pillar {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 6px;
  text-align: center;
}
.pillar-label {
  font-family: var(--serif);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.pillar-stem,
.pillar-branch {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin: 4px 0;
}
.pillar-ko {
  font-size: 10.5px;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}
.pillar-element {
  display: inline-block;
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* 오행 막대 */
.elements {
  margin: 26px 0 8px;
}
.elements-title {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.elements-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.element-bar {
  text-align: center;
}
.element-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.element-name.목 { color: #486a3a; }
.element-name.화 { color: #b03a2e; }
.element-name.토 { color: #a47148; }
.element-name.금 { color: #6e7079; }
.element-name.수 { color: #2c4f6b; }
.element-count {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-feature-settings: "tnum" 1;
}
.element-count small {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-left: 1px;
}

/* 결과 섹션 */
.result-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--paper);
  border-radius: 4px;
}
.result-section h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-section h3::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--accent);
}
.result-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

/* 푸터 */
.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 32px 0 20px;
  line-height: 1.7;
}

/* ===== 신토정비결 스타일 결과지 ===== */
.birth-info {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: -0.015em;
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 4px;
}

.pillars-section { padding-bottom: 16px; }

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 14px 0 18px;
}
.pillar {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11.5px;
}
.pillar-label {
  font-family: var(--serif);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-weight: 700;
}
.pillar-stem-row,
.pillar-tg-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0;
}
.pillar-stem-row.branch { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.pillar-stem-row .yy {
  font-size: 9px;
  color: var(--ink-faint);
  font-weight: 700;
}
.pillar-stem-row .ko {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
}
.pillar-stem-row .ch {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin: 2px 0;
}
.pillar-stem-row .el {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  margin-top: 2px;
}
.pillar-stem-row .el.목 { background: #e3eedb; color: #486a3a; }
.pillar-stem-row .el.화 { background: #f4d8d3; color: #b03a2e; }
.pillar-stem-row .el.토 { background: #ede0cc; color: #8a5e35; }
.pillar-stem-row .el.금 { background: #dcdee2; color: #4d4f56; }
.pillar-stem-row .el.수 { background: #d3dde6; color: #2c4f6b; }
.pillar-tg-row {
  font-size: 10px;
  color: var(--accent);
  margin: 1px 0;
  font-weight: 600;
}
.pillar-hidden {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.hs-label {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.hs-list {
  display: flex;
  justify-content: center;
  gap: 3px;
}
.hs-list .hs {
  font-family: var(--serif);
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 600;
}
.hs-list .hs.empty { color: var(--ink-faint); }

/* 오행 표 */
.elements { margin-top: 16px; }
.elements-title {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.elements-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  text-align: center;
  font-feature-settings: "tnum" 1;
}
.elements-table .el-th {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 0;
  border-radius: 3px;
}
.elements-table .el-th.목 { background: #e3eedb; color: #486a3a; }
.elements-table .el-th.화 { background: #f4d8d3; color: #b03a2e; }
.elements-table .el-th.토 { background: #ede0cc; color: #8a5e35; }
.elements-table .el-th.금 { background: #dcdee2; color: #4d4f56; }
.elements-table .el-th.수 { background: #d3dde6; color: #2c4f6b; }
.elements-table .el-td {
  font-size: 18px;
  font-weight: 800;
  padding: 8px 0;
  background: var(--bg);
  border-radius: 3px;
}

/* 일주 강약 */
.strength-block {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: 4px;
}
.sb-label {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}
.sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.sb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.sb-tag {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-deep);
  font-feature-settings: "tnum" 1;
}
.sb-tag small {
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 500;
  margin-left: 2px;
}
.sb-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  letter-spacing: -0.01em;
}

/* 대운 */
.dae-basis {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px !important;
}
.daeun-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px;
  padding: 0 20px;
}
.daeun-table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 11.5px;
  margin-top: 4px;
  font-feature-settings: "tnum" 1;
  min-width: 100%;
}
.daeun-table th, .daeun-table td {
  padding: 6px 4px;
  text-align: center;
  background: var(--bg);
  border-radius: 3px;
  white-space: nowrap;
  min-width: 48px;
}
.daeun-table th { font-size: 10.5px; color: var(--ink-soft); font-weight: 700; }
.daeun-table th.now, .daeun-table td.now { background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; }
.daeun-table .rh { font-weight: 700; color: var(--ink-soft); background: var(--bg-soft); }
.daeun-table .dae-stem,
.daeun-table .dae-branch {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

/* 월별 세운 */
.wolun-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-feature-settings: "tnum" 1;
}
.wolun-table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.wolun-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.wolun-table tr:last-child td { border-bottom: none; }

/* 풀이 섹션 lead */
.result-section .lead {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* 토정비결 괘 시구 */
.gwa-verse {
  text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--gold);
}
.gwa-verse .gwa-no {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
}
.gwa-verse .verse {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.7;
  font-style: italic;
}

/* 월별 세운 카드 그리드 */
.months-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.month-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 10px;
}
.month-card .month-no {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.month-card .month-meta {
  font-size: 10.5px;
  color: var(--ink-faint);
  margin: 2px 0 6px;
  font-weight: 600;
}
.month-card .month-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0;
}

/* 320 미세 조정 */
@media (max-width: 360px) {
  .hero h1 { font-size: 26px; }
  .pillar-stem, .pillar-branch { font-size: 22px; }
  .field-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 481px) {
  body { background: var(--bg-soft); }
  .page { max-width: 480px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 32px rgba(0,0,0,0.06); }
}
