/* ════════════════════════════════════════════════════════════════
   만세력 — 갈색/주황 다크 + 라이트 토글
   ════════════════════════════════════════════════════════════════ */
.ms-page {
  min-height: calc(100vh - 56px);
  padding-top: 56px;
}

/* 히어로 — 만세력 책 배경 분위기 */
.ms-hero {
  position: relative;
  padding: 80px 24px 100px;
  text-align: center;
  overflow: hidden;
}
.ms-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #2a1808 0%, #1a0d04 100%);
}
.ms-hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent 0px, transparent 28px, rgba(245, 158, 11, 0.04) 28px, rgba(245, 158, 11, 0.04) 30px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 50px, rgba(245, 158, 11, 0.05) 50px, rgba(245, 158, 11, 0.05) 52px);
  opacity: 0.6;
}
.ms-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(245, 158, 11, 0.15), transparent 60%),
    radial-gradient(circle at 80% 30%, rgba(217, 119, 6, 0.12), transparent 60%);
}
.ms-hero .container { position: relative; z-index: 2; }

.ms-pin {
  display: inline-block;
  padding: 7px 18px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 22px;
  letter-spacing: 0.04em;
}
.ms-title {
  font-size: 56px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}
.ms-sub {
  font-size: 15px;
  color: #d4a877;
  max-width: 560px;
  margin: 0 auto;
}

/* What is */
.ms-explain {
  text-align: center;
  padding: 70px 24px 50px;
}
.ms-h2 {
  font-size: 26px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
}
.ms-text {
  font-size: 14px;
  color: #c5c4d6;
  line-height: 1.7;
  margin-bottom: 36px;
}

.ms-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 940px;
  margin: 0 auto;
}
@media (max-width: 800px) { .ms-pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ms-pillars { grid-template-columns: 1fr; } }

.msp {
  background: rgba(20, 14, 8, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.msp:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.15);
}
.msp-icon {
  width: 48px; height: 48px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 22px;
  margin-bottom: 12px;
}
.msp-green { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.msp-blue  { background: linear-gradient(135deg, #06b6d4, #0891b2); color: white; }
.msp-pink  { background: linear-gradient(135deg, #ec4899, #db2777); color: white; }
.msp-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }

.msp h4 {
  font-size: 15px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}
.msp-han {
  font-size: 12px;
  color: #fcd34d;
  font-weight: 600;
  margin-bottom: 6px;
}
.msp-meta {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
}

/* 폼 카드 */
.ms-form-section {
  padding: 0 24px 80px;
}
.ms-form-card {
  max-width: 580px;
  margin: 0 auto;
  background: rgba(20, 14, 8, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.ms-form-title {
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}
.ms-form-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 22px;
}

.ms-form { text-align: left; }
.ms-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ms-field {
  margin-bottom: 16px;
}
.ms-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #d4a877;
  margin-bottom: 6px;
}
.ms-field select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.ms-field select:focus { outline: none; border-color: #f59e0b; }

.ms-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a0d04;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.3);
  opacity: 0.5;
  pointer-events: none;
  transition: all 0.2s;
}
.ms-submit.ready {
  opacity: 1;
  pointer-events: auto;
}
.ms-submit.ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.5);
}

/* ─── 라이트 모드 ─── */
body.light .ms-hero-bg {
  background: linear-gradient(180deg, #fef3c7 0%, #fed7aa 100%);
}
body.light .ms-hero-bg::after {
  background:
    radial-gradient(circle at 20% 50%, rgba(245, 158, 11, 0.25), transparent 60%),
    radial-gradient(circle at 80% 30%, rgba(217, 119, 6, 0.2), transparent 60%);
}
body.light .ms-pin {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}
body.light .ms-title { color: #1f1937; }
body.light .ms-sub { color: #92400e; }
body.light .ms-h2 { color: #1f1937; }
body.light .ms-text { color: #4b5563; }
body.light .msp {
  background: white;
  border-color: rgba(245, 158, 11, 0.2);
}
body.light .msp h4 { color: #1f1937; }
body.light .msp-han { color: #92400e; }
body.light .msp-meta { color: #6b7280; }
body.light .ms-form-card {
  background: white;
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 12px 36px rgba(245, 158, 11, 0.1);
}
body.light .ms-form-title { color: #1f1937; }
body.light .ms-form-sub { color: #6b7280; }
body.light .ms-field label { color: #92400e; }
body.light .ms-field select {
  background: #fffbeb;
  border-color: #fde68a;
  color: #1f1937;
}

/* ════════════════════════════════════════════════════════════════
   추가: 사주(四柱) 결과 카드 (Mock API 응답 표시 영역)
   - 입력 카드(.ms-form-card)와 동일 폭/스타일 톤
   - 4기둥 가로 그리드 + 오행 막대 + 십신 + 일간 해설
   - 추가/업데이트 시 이 블록 안에 주석으로 표기할 것
   ════════════════════════════════════════════════════════════════ */
.ms-result-card {
  max-width: 700px;
  margin: 24px auto 0;
  background: rgba(20, 14, 8, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: msResultIn 0.45s ease-out both;
}
@keyframes msResultIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 헤드 */
.ms-result-head {
  padding: 22px 26px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #92400e 100%);
  color: #1a0d04;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
}
.msr-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(26, 13, 4, 0.85);
  color: #fbbf24;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.msr-head-body h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}
.msr-head-body p {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 600;
}
.msr-pin {
  padding: 6px 12px;
  background: rgba(26, 13, 4, 0.85);
  color: #fbbf24;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.ms-result-body {
  padding: 26px 24px 28px;
  display: flex; flex-direction: column;
  gap: 22px;
}

/* 4기둥 그리드 (年-月-日-時) */
.msr-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.msr-pillar {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 16px 10px 14px;
  text-align: center;
  position: relative;
}
.msr-pillar.day {
  background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(0,0,0,0.4));
  border-color: rgba(251, 191, 36, 0.5);
}
.msr-pillar .pl-label {
  font-size: 11px;
  color: #d4a877;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.msr-pillar.day .pl-label { color: #fde047; }
.msr-pillar .pl-stem {
  font-size: 30px;
  font-weight: 800;
  font-family: 'Inter', serif;
  line-height: 1;
  margin-bottom: 4px;
}
.msr-pillar .pl-branch {
  font-size: 30px;
  font-weight: 800;
  font-family: 'Inter', serif;
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.85;
}
.msr-pillar .pl-han {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 4px;
}
.msr-pillar .pl-element {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
/* 오행 색상 — 木火土金水 */
.el-wood  { background: rgba(34,197,94,0.2);  color: #86efac; }
.el-fire  { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.el-earth { background: rgba(202,138,4,0.25); color: #fde047; }
.el-metal { background: rgba(229,229,229,0.2); color: #e5e5e5; }
.el-water { background: rgba(59,130,246,0.2);  color: #93c5fd; }

/* 일간 해설 박스 */
.msr-daymaster {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(146,64,14,0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
}
.msr-dm-glyph {
  width: 64px; height: 64px;
  background: rgba(0,0,0,0.45);
  border: 2px solid #fbbf24;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #fbbf24;
}
.msr-dm-meta h4 {
  font-size: 16px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}
.msr-dm-meta .dm-tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.msr-dm-meta p {
  font-size: 12.5px;
  line-height: 1.6;
  color: #d1d5db;
}

/* 오행 분포 (5요소 막대) */
.msr-section {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
}
.msr-section h5 {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.msr-elements {
  display: grid;
  grid-template-columns: 90px 1fr 32px;
  gap: 10px;
  align-items: center;
  row-gap: 10px;
}
.msr-el-name {
  font-size: 13px;
  font-weight: 700;
}
.msr-el-bar {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.msr-el-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.8s ease-out;
}
.msr-el-bar > span.el-wood  { background: linear-gradient(90deg, #22c55e, #16a34a); }
.msr-el-bar > span.el-fire  { background: linear-gradient(90deg, #ef4444, #dc2626); }
.msr-el-bar > span.el-earth { background: linear-gradient(90deg, #ca8a04, #a16207); }
.msr-el-bar > span.el-metal { background: linear-gradient(90deg, #d4d4d4, #737373); }
.msr-el-bar > span.el-water { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.msr-el-num {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  text-align: right;
}

/* 십신 그리드 */
.msr-tenstars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.msr-ts-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 10px;
  font-size: 12.5px;
}
.msr-ts-item .ts-name {
  color: white;
  font-weight: 700;
}
.msr-ts-item .ts-han {
  font-size: 10px;
  color: #9ca3af;
  margin-left: 4px;
}
.msr-ts-item .ts-val {
  color: #fbbf24;
  font-weight: 800;
}

/* 대운 (10년 단위) */
.msr-luck {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.msr-luck-item {
  text-align: center;
  padding: 10px 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 8px;
}
.msr-luck-item.now {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.25), rgba(0,0,0,0.25));
  border-color: rgba(251, 191, 36, 0.6);
}
.msr-luck-item .lk-age {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 700;
  margin-bottom: 4px;
}
.msr-luck-item .lk-pillar {
  font-size: 16px;
  font-weight: 800;
  color: white;
  font-family: 'Inter', serif;
}
.msr-luck-item.now .lk-age { color: #fde047; }

/* 종합 해설 */
.msr-advice {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(146,64,14,0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #d1d5db;
}
.msr-advice strong {
  display: block;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 6px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* 액션 버튼 */
.msr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.msr-btn {
  padding: 13px;
  font-size: 13px; font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.2s;
}
.msr-btn-primary {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0d04; border: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.msr-btn-primary:hover { transform: translateY(-1px); }
.msr-btn-ghost {
  background: rgba(0,0,0,0.3);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.msr-btn-ghost:hover { border-color: #fbbf24; }

/* 로딩 */
.msr-loading {
  padding: 40px 22px;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
}
.msr-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #fbbf24;
  border-right-color: #d97706;
  border-radius: 50%;
  animation: msSpin 0.9s linear infinite;
}
@keyframes msSpin { to { transform: rotate(360deg); } }
.msr-loading-text {
  font-size: 13px;
  color: #d4a877;
  font-weight: 600;
}

/* ─── 라이트 모드 ─── */
body.light .ms-result-card {
  background: white;
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 12px 36px rgba(245, 158, 11, 0.15);
}
body.light .msr-pillar {
  background: #fffbeb;
  border-color: #fde68a;
}
body.light .msr-pillar.day {
  background: linear-gradient(180deg, #fef3c7, #fffbeb);
  border-color: #f59e0b;
}
body.light .msr-pillar .pl-label { color: #92400e; }
body.light .msr-pillar.day .pl-label { color: #b45309; }
body.light .msr-pillar .pl-stem,
body.light .msr-pillar .pl-branch { color: #1f1937; }
body.light .msr-pillar .pl-han { color: #6b7280; }
body.light .msr-daymaster {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: rgba(245, 158, 11, 0.3);
}
body.light .msr-dm-glyph {
  background: white;
  color: #d97706;
}
body.light .msr-dm-meta h4 { color: #1f1937; }
body.light .msr-dm-meta .dm-tag { background: rgba(245,158,11,0.15); color: #b45309; }
body.light .msr-dm-meta p { color: #4b5563; }
body.light .msr-section {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.25);
}
body.light .msr-section h5 { color: #b45309; }
body.light .msr-el-name { color: #1f1937; }
body.light .msr-el-bar { background: #fde68a; }
body.light .msr-el-num { color: #b45309; }
body.light .msr-ts-item {
  background: white;
  border-color: rgba(245, 158, 11, 0.2);
}
body.light .msr-ts-item .ts-name { color: #1f1937; }
body.light .msr-ts-item .ts-val { color: #b45309; }
body.light .msr-luck-item {
  background: white;
  border-color: rgba(245, 158, 11, 0.2);
}
body.light .msr-luck-item.now {
  background: linear-gradient(180deg, #fef3c7, white);
  border-color: #f59e0b;
}
body.light .msr-luck-item .lk-age { color: #6b7280; }
body.light .msr-luck-item .lk-pillar { color: #1f1937; }
body.light .msr-luck-item.now .lk-age { color: #b45309; }
body.light .msr-advice {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #4b5563;
}
body.light .msr-advice strong { color: #b45309; }
body.light .msr-btn-ghost {
  background: white;
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
}
body.light .msr-loading-text { color: #92400e; }

@media (max-width: 700px) {
  .msr-pillars { grid-template-columns: repeat(2, 1fr); }
  .msr-tenstars { grid-template-columns: 1fr; }
  .msr-luck { grid-template-columns: repeat(4, 1fr); }
  .msr-actions { grid-template-columns: 1fr; }
  .msr-elements { grid-template-columns: 70px 1fr 28px; }
}
@media (max-width: 480px) {
  .msr-pillar .pl-stem,
  .msr-pillar .pl-branch { font-size: 24px; }
}
