/* ============================================================
   SajuType — Design System
   Classical Oriental × Modern Data Aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@400;700;800&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ─── CSS Variables ───────────────────────────────────────── */
:root {
  --bg-deep: #0f0e0d;
  --bg-card: #1a1815;
  --bg-card2: #201e1a;
  --border: #3a3228;
  --border-gold: #5a4a28;
  --gold: #c5a059;
  --gold-light: #e8c87a;
  --gold-dim: #7a6030;
  --red: #b24c3d;
  --text-primary: #e8e0d0;
  --text-dim: #8a7a60;
  --text-muted: #5a5040;

  /* Ohaeng */
  --wood: #3a6b40;
  --fire: #b24c3d;
  --earth: #c5a059;
  --metal: #b0b8c0;
  --water: #2d5070;

  --radius: 4px;
  --radius-lg: 8px;
  --glow: 0 0 20px rgba(197, 160, 89, 0.15);
}

/* ─── Reset & Base ────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Hanji Texture & Star Background ────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(197, 160, 89, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(45, 80, 112, 0.06) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ─── Screen System ───────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow-y: auto;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.6s ease forwards;
}

.screen.fade-out {
  animation: fadeOut 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ─── Lucky Color/Direction/Number Cards ───────────────────── */
.lucky-bar {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  width: 100%;
}

.lucky-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.lucky-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
}

.lucky-card-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.lucky-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

/* ─── Reveal Animations ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 별자리 Star Canvas ─────────────────────────────────── */
#star-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   SCREEN 1: SPLASH
   ============================================================ */
#screen-splash {
  background: var(--bg-deep);
  z-index: 20;
  gap: 32px;
}

.splash-emblem {
  position: relative;
  width: 160px;
  height: 160px;
  z-index: 30;
}

.splash-emblem svg {
  width: 100%;
  height: 100%;
  animation: rotateSlow 20s linear infinite;
  filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.4));
}

.splash-title {
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-align: center;
  z-index: 30;
  text-shadow: 0 0 40px rgba(197, 160, 89, 0.5);
  animation: fadeInUp 1.2s ease forwards;
}

.splash-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-align: center;
  z-index: 30;
  animation: fadeInUp 1.5s ease forwards;
}

.splash-hanja {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 11px;
  color: var(--gold-dim);
  letter-spacing: 0.3em;
  text-align: center;
  z-index: 30;
}

.btn-start {
  margin-top: 16px;
  padding: 14px 48px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Nanum Myeongjo', serif;
  font-size: 16px;
  letter-spacing: 0.2em;
  cursor: pointer;
  z-index: 30;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: -1;
}

.btn-start:hover {
  color: var(--bg-deep);
}

.btn-start:hover::before {
  transform: scaleX(1);
}

/* ============================================================
   SCREEN 2: INPUT
   ============================================================ */
#screen-input {
  background: var(--bg-deep);
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.input-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  z-index: 10;
}

.input-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.input-header-hanja {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}

.input-header-text h2 {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 700;
}

.input-header-text p {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* Form sections */
.form-section {
  margin-bottom: 32px;
}

.form-section-title {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 13px;
  color: var(--gold-dim);
  letter-spacing: 0.25em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Toggle: Solar / Lunar */
.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.toggle-btn {
  flex: 1;
  padding: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
}

.toggle-btn.active {
  background: rgba(197, 160, 89, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

/* Date/Time inputs */
.date-row,
.time-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.date-row {
  grid-template-columns: 2fr 1fr 1fr;
}

.time-row {
  grid-template-columns: 1fr 1fr 2fr;
}

.form-input,
.form-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* City search */
.city-search-wrapper {
  position: relative;
}

.city-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.city-results.open {
  display: block;
}

.city-result-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.city-result-item:hover {
  background: rgba(197, 160, 89, 0.08);
}

.city-result-item:last-child {
  border-bottom: none;
}

.city-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gold);
  margin-top: 8px;
  display: none;
}

.city-selected.visible {
  display: flex;
}

.city-selected-icon {
  font-size: 16px;
}

.city-selected-name {
  flex: 1;
}

.city-selected-coords {
  font-size: 11px;
  color: var(--text-dim);
}

.city-clear {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

/* ─── Leaflet Custom ─────────────────────────────────────── */
#map {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
  margin-top: 10px;
  border: 1px solid var(--border);
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.leaflet-container {
  background: var(--bg-deep) !important;
}

/* Birth map */
.birth-map {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border-gold);
  margin-top: 8px;
}

.map-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Override Leaflet controls for dark theme */
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--gold) !important;
  border-color: var(--border-gold) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
}

/* MBTI grid */
.mbti-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

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

.mbti-btn {
  padding: 10px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-align: center;
}

.mbti-btn:hover {
  border-color: var(--gold-dim);
  color: var(--text-primary);
}

.mbti-btn.selected {
  background: rgba(197, 160, 89, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

.mbti-skip {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  text-align: right;
}

.mbti-skip:hover {
  color: var(--text-primary);
}

/* Gender radio */
.gender-row {
  display: flex;
  gap: 8px;
}

.gender-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-align: center;
}

.gender-btn.active {
  background: rgba(197, 160, 89, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

/* Submit */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.2), rgba(197, 160, 89, 0.08));
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Nanum Myeongjo', serif;
  font-size: 18px;
  letter-spacing: 0.2em;
  cursor: pointer;
  border-radius: var(--radius-lg);
  margin-top: 8px;
  transition: all 0.3s;
}

.btn-submit:hover {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.35), rgba(197, 160, 89, 0.15));
  box-shadow: var(--glow);
}

/* ============================================================
   SCREEN 3: LOADING
   ============================================================ */
#screen-loading {
  background: var(--bg-deep);
  z-index: 30;
  gap: 40px;
}

.compass-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.compass-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.compass-ring:nth-child(1) {
  animation: spinCW 8s linear infinite;
  border-top-color: var(--gold);
}

.compass-ring:nth-child(2) {
  inset: 15px;
  animation: spinCCW 12s linear infinite;
  border-right-color: rgba(197, 160, 89, 0.6);
}

.compass-ring:nth-child(3) {
  inset: 30px;
  animation: spinCW 6s linear infinite;
  border-bottom-color: rgba(197, 160, 89, 0.4);
}

.compass-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Nanum Myeongjo', serif;
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(197, 160, 89, 0.8);
}

.loading-text {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-align: center;
  min-height: 24px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-dim);
  margin: 0 3px;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ============================================================
   SCREEN 4: RESULT
   ============================================================ */
#screen-result {
  background: var(--bg-deep);
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.result-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 100px;
  z-index: 10;
}

/* Result header */
.result-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.result-header::after {
  content: '✦';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-deep);
  padding: 0 12px;
  color: var(--gold-dim);
  font-size: 14px;
}

.result-summary-container {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.result-name {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.result-ilju {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 56px;
  color: var(--gold);
  letter-spacing: 0.1em;
  line-height: 1;
  text-shadow: 0 0 40px rgba(197, 160, 89, 0.3);
  margin-bottom: 8px;
}

.result-identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  font-size: 13px;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  background: rgba(197, 160, 89, 0.05);
}

.result-summary {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.8;
}

/* Saju pillar table (원광만세력 style) */
.saju-table-wrapper {
  margin-bottom: 32px;
}

.saju-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pillar-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  position: relative;
}

.pillar-col:last-child {
  border-right: none;
}

.pillar-label {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.pillar-stem {
  padding: 24px 8px 12px;
  text-align: center;
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1;
  border-bottom: 1px solid var(--border);
}

.pillar-branch {
  padding: 12px 8px 24px;
  text-align: center;
  font-family: 'Nanum Myeongjo', serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1;
}

/* 십신 labels (above stem, below branch) */
.pillar-sipsin-top,
.pillar-sipsin-bot {
  text-align: center;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 10px;
  color: var(--text-dim);
  padding: 4px 4px 2px;
  letter-spacing: 0.05em;
}

.pillar-sipsin-top {
  border-bottom: 1px dashed var(--border);
}

.pillar-sipsin-bot {
  border-top: 1px dashed var(--border);
}

/* 지장간 (hidden stems inside branch) */
.pillar-jijanggan {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 4px 10px;
  letter-spacing: 0.05em;
}

/* Empty Pillar state for unknown time */
.pillar-empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 40px 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.05em;
  opacity: 0.5;
  line-height: 1.5;
}

/* Daewun 지장간 */
.daewun-jijanggan {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Sewun (歲運 annual) table */
.sewun-table {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.sewun-cell {
  flex: 0 0 70px;
  padding: 10px 6px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.sewun-cell:last-child {
  border-right: none;
}

.sewun-cell.active {
  background: rgba(197, 160, 89, 0.10);
}

.sewun-year {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.sewun-cell.active .sewun-year {
  color: var(--gold);
  font-weight: 700;
}

.sewun-hanja {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 18px;
  line-height: 1.2;
}

.sewun-age {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Ohaeng coloring */
.el-목 {
  color: var(--wood);
}

.el-화 {
  color: var(--fire);
}

.el-토 {
  color: var(--earth);
}

.el-금 {
  color: var(--metal);
}

.el-수 {
  color: var(--water);
}

/* Ohaeng chart */
.ohaeng-section {
  margin-bottom: 32px;
}

.ohaeng-chart-wrapper {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.ohaeng-radar {
  flex: 0 0 180px;
  height: 180px;
}

.ohaeng-bars {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ohaeng-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ohaeng-bar-label {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.ohaeng-bar-label.el-목 {
  color: var(--wood);
}

.ohaeng-bar-label.el-화 {
  color: var(--fire);
}

.ohaeng-bar-label.el-토 {
  color: var(--earth);
}

.ohaeng-bar-label.el-금 {
  color: var(--metal);
}

.ohaeng-bar-label.el-수 {
  color: var(--water);
}

.ohaeng-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.ohaeng-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.ohaeng-bar-fill.el-목 {
  background: var(--wood);
}

.ohaeng-bar-fill.el-화 {
  background: var(--fire);
}

.ohaeng-bar-fill.el-토 {
  background: var(--earth);
}

.ohaeng-bar-fill.el-금 {
  background: var(--metal);
}

.ohaeng-bar-fill.el-수 {
  background: var(--water);
}

.ohaeng-bar-count {
  font-size: 13px;
  color: var(--text-dim);
  width: 20px;
  text-align: right;
}

.ohaeng-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.ohaeng-meta span {
  color: var(--gold);
}

/* Daewun table */
.daewun-table {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.daewun-cell {
  flex: 0 0 80px;
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  font-size: 12px;
}

.daewun-cell:last-child {
  border-right: none;
}

.daewun-cell.active {
  background: rgba(197, 160, 89, 0.08);
}

.daewun-hanja {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 20px;
  line-height: 1.2;
}

.daewun-age {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* Section cards */
.result-section {
  margin-bottom: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
}

.result-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.section-title-kr {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.section-title-hanja {
  font-size: 11px;
  color: var(--gold-dim);
  letter-spacing: 0.2em;
}

.section-body {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-primary);
}

.section-body strong,
.section-body b {
  color: var(--gold-light);
  font-weight: 500;
}

/* Premium sections */
.result-section.premium .section-body {
  position: relative;
}

.premium-blur {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

.premium-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 14, 13, 0.7);
  border-radius: var(--radius);
  gap: 12px;
}

.premium-lock-icon {
  font-size: 28px;
}

.premium-cta-text {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}

.btn-premium-cta {
  padding: 10px 28px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Nanum Myeongjo', serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-premium-cta:hover {
  background: rgba(197, 160, 89, 0.15);
}

/* Lucky info bar */
.lucky-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.lucky-item {
  flex: 1;
  min-width: 100px;
  padding: 14px 10px;
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.08), rgba(197, 160, 89, 0.03));
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  text-align: center;
}

.lucky-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.lucky-value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  font-family: 'Nanum Myeongjo', serif;
}

/* Quote Card (명언 부적 스타일) */
.quote-card {
  margin-bottom: 20px;
  padding: 40px 30px;
  background: linear-gradient(135deg, #1a1510, #0f0f0c 50%, #1a1510);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quote-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}

.quote-ornament-top {
  font-size: 18px;
  color: rgba(197, 160, 89, 0.3);
  letter-spacing: 1em;
  margin-bottom: 16px;
}

.quote-element {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 0 20px currentColor;
  opacity: 0.9;
}

.quote-text {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.quote-author {
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.quote-ornament-bottom {
  font-size: 11px;
  color: rgba(197, 160, 89, 0.25);
  letter-spacing: 0.3em;
}

/* Detail (상세 보기) Button */
.detail-btn-wrapper {
  margin-top: 12px;
  text-align: right;
}

.btn-detail {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.btn-detail:hover {
  background: rgba(197, 160, 89, 0.1);
}

.detail-content {
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

.detail-body {
  padding: 16px;
  background: rgba(197, 160, 89, 0.04);
  border: 1px solid rgba(197, 160, 89, 0.1);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-main);
}

.detail-locked {
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
}

/* Monthly Fortune Tabs */
.monthly-fortune {
  margin-bottom: 20px;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.monthly-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(197, 160, 89, 0.04);
}

.monthly-tab {
  flex: 1;
  padding: 12px 6px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.monthly-tab:hover {
  color: var(--gold);
  background: rgba(197, 160, 89, 0.06);
}

.monthly-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(197, 160, 89, 0.08);
}

.monthly-content {
  padding: 20px;
}

.monthly-pane {
  display: none;
  line-height: 1.8;
  font-size: 14px;
  color: var(--text-main);
}

.monthly-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Back button */
.btn-back {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  z-index: 50;
  letter-spacing: 0.1em;
}

.btn-back:hover {
  border-color: var(--gold-dim);
  color: var(--text-primary);
}

/* Section labels */
.section-label {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 13px;
  color: var(--gold-dim);
  letter-spacing: 0.25em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '◈';
  font-size: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Gyeokguk & info row */
.info-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.info-chip {
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.info-chip span {
  color: var(--text-primary);
}

/* ─── Animations ──────────────────────────────────────────── */
@keyframes rotateSlow {
  to {
    transform: rotate(360deg);
  }
}

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

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes starTwinkle {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .mbti-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ohaeng-chart-wrapper {
    flex-direction: column;
  }

  .result-ilju {
    font-size: 40px;
  }

  .daewun-cell {
    flex: 0 0 60px;
  }
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Fortune Timeline Graph */
.timeline-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.timeline-chart-wrapper {
  width: 100%;
  height: 200px;
  position: relative;
  background: rgba(197, 160, 89, 0.03);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

#timeline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.timeline-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  opacity: 0.7;
}