:root {
  --bg-main: #0e1118;
  --bg-card: rgba(22, 27, 39, 0.85);
  --bg-card-elevated: rgba(30, 37, 54, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-color: rgba(212, 175, 55, 0.25);
  --border-glow: rgba(212, 175, 55, 0.6);
  --gold-primary: #d4af37;
  --gold-light: #f7e7a9;
  --text-main: #f0f2f5;
  --text-muted: #9ba3af;
  --text-dim: #6b7280;

  /* 오행 색상 */
  --wood-bg: #1e3a24;
  --wood-border: #4caf50;
  --wood-text: #81c784;

  --fire-bg: #3e1b1b;
  --fire-border: #e53935;
  --fire-text: #ef5350;

  --earth-bg: #3d3118;
  --earth-border: #fbc02d;
  --earth-text: #ffca28;

  --metal-bg: #29323c;
  --metal-border: #cfd8dc;
  --metal-text: #eceff1;

  --water-bg: #152238;
  --water-border: #42a5f5;
  --water-text: #90caf9;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(26, 35, 126, 0.15) 0%, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px 12px 60px 12px;
  line-height: 1.5;
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
}

.title-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.app-header h1 .title-ko {
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 500;
}

.app-header h1 .badge-kasi {
  font-size: 0.65rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.app-sub-slogan {
  font-size: 0.78rem;
  color: rgba(243, 229, 171, 0.82);
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .app-logo {
    width: 42px;
    height: 42px;
    border-radius: 9px;
  }
  .app-header h1 {
    font-size: 1.15rem;
    gap: 5px;
  }
  .app-header h1 .title-ko {
    font-size: 0.88rem;
  }
  .app-header h1 .badge-kasi {
    font-size: 0.58rem;
    padding: 1px 4px;
  }
  .app-sub-slogan {
    font-size: 0.68rem;
    letter-spacing: -0.3px;
  }
  .header-actions {
    gap: 4px;
  }
  .btn-sm {
    padding: 5px 8px;
    font-size: 0.76rem;
    gap: 3px;
  }
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-sm:hover, .btn-sm:active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.btn-primary {
  background: linear-gradient(135deg, #d4af37, #aa8214);
  color: #12141d;
  font-weight: 600;
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f7e7a9, #d4af37);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

/* Options & Control Panel */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 0.82rem;
  color: var(--gold-light);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Segmented Buttons */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.segmented-control button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.segmented-control button:active {
  transform: scale(0.96);
}

.segmented-control button.active {
  background: var(--bg-card-elevated);
  color: var(--gold-light);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 지금 실시간 버튼 전용 고급 골드 & 클릭 반응 액션 */
#btn-realtime {
  position: relative;
  overflow: hidden;
}

#btn-realtime.active {
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.15), inset 0 0 12px rgba(212, 175, 55, 0.08);
}

#btn-realtime:hover {
  color: var(--gold-light);
}

/* 누를 때 생생하게 눌리는 물리적 액션 효과 */
#btn-realtime:active,
#btn-realtime.btn-pressed {
  transform: scale(0.92) translateY(1px);
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold-primary);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.5);
  color: #ffffff;
}

/* 리프레시 아이콘 및 회전 애니메이션 */
.refresh-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--gold-light);
  stroke: var(--gold-light);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#btn-realtime.refreshing .refresh-icon {
  animation: spin-refresh 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  stroke: #ffffff;
}

@keyframes spin-refresh {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Time & Location Sub controls */
.sub-panel {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px dashed rgba(212, 175, 55, 0.2);
}

.city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover, .chip.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

input[type="text"], input[type="number"], input[type="datetime-local"], input[type="date"], input[type="time"], select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

select option {
  background: #161b26;
  color: var(--text-main);
}

input:focus, select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.time-input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
  animation: pulse-gold 1.6s infinite;
}

@keyframes pulse-gold {
  0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 4px var(--gold-primary); }
  50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 10px var(--gold-light); }
  100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 4px var(--gold-primary); }
}

.info-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-banner strong {
  color: var(--gold-light);
}

/* 5 Pillars (오주 카드) 영역 */
.oju-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-action-btn,
.order-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.toggle-action-btn:hover,
.order-toggle-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.15);
}

.toggle-action-btn.active {
  color: #12141d;
  background: linear-gradient(135deg, #d4af37, #aa8214);
  border-color: var(--gold-primary);
  font-weight: 600;
}

/* 5개 기둥 집중형 컴팩트 레이아웃 (폭 축소 및 한눈에 쏙 들어오게 개선) */
.oju-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .oju-cards-wrapper {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-width: 100%;
  }
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.pillar-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
}

.pillar-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  cursor: help;
}

@media (max-width: 600px) {
  .pillar-badge {
    font-size: 0.68rem;
    padding: 1px 3px;
    margin-bottom: 4px;
  }
}

/* 심플 모드 (오주 한자 10글자 집중 보기 모드) */
.oju-cards-wrapper.mode-simple .row-stem-god,
.oju-cards-wrapper.mode-simple .row-branch-god,
.oju-cards-wrapper.mode-simple .row-hidden-stems {
  display: none !important;
}

.oju-cards-wrapper.mode-simple .pillar-card {
  padding: 12px 4px;
}

.oju-cards-wrapper.mode-simple .char-cell {
  height: 92px;
}

.oju-cards-wrapper.mode-simple .char-cell .hanja {
  font-size: 2.9rem;
}

@media (max-width: 600px) {
  .oju-cards-wrapper.mode-simple .char-cell {
    height: 72px;
  }
  .oju-cards-wrapper.mode-simple .char-cell .hanja {
    font-size: 2.2rem;
  }
}

/* 전통 간명표식 5개 행(Row) 정렬 레이아웃 */
.myeongshik-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* 1열 (상단): 천간 육친 행 */
.row-stem-god {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  width: 100%;
}

/* 4열 (하단): 지지 육친 행 */
.row-branch-god {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  margin-bottom: 6px;
  width: 100%;
}

/* 육친 태그 스타일: 작고 은은하게 */
.ten-god-tag {
  font-size: 0.74rem;
  font-weight: 500;
  color: #94a3b8; /* 은은한 톤 */
  padding: 2px 4px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  line-height: 1.2;
  background: transparent;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ten-god-tag.is-me {
  color: #ffd700;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.5);
  padding: 2px 6px;
}

@media (max-width: 600px) {
  .row-stem-god,
  .row-branch-god {
    height: 22px;
  }
  .ten-god-tag {
    font-size: 0.62rem;
    padding: 1px 2px;
    letter-spacing: -0.6px;
  }
}

/* 2열 & 3열 (핵심): 천간 한자 & 지지 한자 셀 - 폰트 크기 대폭 확대, 압도적 가독성 */
.char-cell {
  width: 100%;
  max-width: 76px;
  height: 84px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: rgba(18, 24, 38, 0.95);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  color: #ffffff;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7), 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

/* 천간 셀과 지지 셀 사이의 간격 */
.row-branch-char {
  margin-top: 5px;
}

.char-cell .hanja {
  font-size: 2.6rem; /* 2rem -> 2.6rem 대폭 확대 */
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  margin-top: -8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.char-cell .sub-element {
  font-size: 0.66rem;
  position: absolute;
  bottom: 5px;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

@media (max-width: 600px) {
  .char-cell {
    max-width: 58px;
    height: 66px;
    border-radius: 8px;
  }
  .char-cell .hanja {
    font-size: 1.95rem; /* 모바일에서도 1.45rem -> 1.95rem로 대폭 확대 */
    margin-top: -6px;
  }
  .char-cell .sub-element {
    font-size: 0.55rem;
    bottom: 3px;
  }
}

/* 5열 (최하단): 지장간 행 */
.row-hidden-stems {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* 개별 오행 색상 오버라이드 제거: 단일 색상으로 통일 */
.elem-wood,
.elem-fire,
.elem-earth,
.elem-metal,
.elem-water {
  background: rgba(18, 24, 38, 0.95);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  color: #ffffff;
}

/* 지장간(地藏干) 영역 스타일 - 차분한 화이트톤 통일 */
.hidden-stems-wrapper {
  width: 100%;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hidden-stems-title {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.hidden-stems-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.hidden-stem-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 3px 2px 2px 2px;
  min-width: 17px;
  cursor: default;
  transition: all 0.2s ease;
}

.hidden-stem-chip.is-main {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
}

.hidden-stem-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.hidden-stem-chip .hs-hanja {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.1;
  color: #f0f6fc; /* 차분한 화이트 */
}

.hidden-stem-chip.is-main .hs-hanja {
  font-weight: 800;
  color: #ffffff;
}

.hidden-stem-chip .hs-god {
  font-size: 0.56rem;
  color: #8b949e; /* 은은한 딤 화이트/그레이 */
  line-height: 1.1;
  margin-top: 1px;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.hidden-stem-chip.is-main .hs-god {
  color: #c9d1d9;
}

@media (max-width: 600px) {
  .hidden-stems-wrapper {
    margin-top: 4px;
    padding-top: 4px;
    gap: 2px;
  }
  .hidden-stems-title {
    font-size: 0.52rem;
  }
  .hidden-stems-list {
    gap: 2px;
  }
  .hidden-stem-chip {
    padding: 2px 1px 1px 1px;
    min-width: 13px;
    border-radius: 3px;
  }
  .hidden-stem-chip .hs-hanja {
    font-size: 0.72rem;
  }
  .hidden-stem-chip .hs-god {
    font-size: 0.48rem;
    letter-spacing: -0.8px;
  }
}

.pillar-footer {
  margin-top: 10px;
  text-align: center;
}

.pillar-name-ko {
  display: none; /* 한글 60갑자 제거 */
}

.pillar-detail-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 세운(12개년) & 월운(12개월) 흐름 영역 */
.fortune-flow-section {
  margin-top: 18px;
  margin-bottom: 24px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.flow-title {
  font-size: 0.85rem;
  font-weight: 500; /* 가는 폰트로 변경 */
  color: var(--gold-light);
  letter-spacing: -0.2px;
}

.flow-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

.flow-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}

@media (max-width: 600px) {
  .flow-grid-12 {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
}

.flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 2px 4px 2px;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.flow-item:hover {
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
}

.flow-num {
  font-size: 0.65rem;
  color: #8b949e;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 2px;
}

.flow-hanja {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f0f6fc;
  line-height: 1.1;
}

.flow-ko {
  font-size: 0.58rem;
  color: #8b949e;
  line-height: 1.1;
  margin-top: 1px;
}

.flow-item.is-current {
  border-color: var(--gold-primary) !important;
  background: rgba(212, 175, 55, 0.16);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
}

.flow-item.is-current .flow-num {
  color: var(--gold-light);
  font-weight: 700;
}

.flow-item.is-current .flow-hanja {
  color: #ffd700;
}

.flow-item.is-current .flow-ko {
  color: #f3e5ab;
}

/* 당해년도가 아닌 다른 연도를 클릭하여 선택했을 때: 선명한 순백색 테두리 */
.flow-item.is-selected:not(.is-current) {
  border-color: #ffffff !important;
  border-width: 1.5px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.flow-item.is-selected:not(.is-current) .flow-num {
  color: #ffffff;
  font-weight: 700;
}

.flow-item.is-selected:not(.is-current) .flow-hanja {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.flow-item.is-selected:not(.is-current) .flow-ko {
  color: #e2e8f0;
  font-weight: 600;
}

.flow-current-badge {
  position: absolute;
  top: -5px;
  right: -2px;
  font-size: 0.5rem;
  background: var(--gold-primary);
  color: #12141d;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 800;
  line-height: 1.1;
}

/* 상세 정보 및 절기 카드 */
.meta-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .meta-info-grid {
    grid-template-columns: 1fr;
  }
}

.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.85rem;
}

.meta-card-title {
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  color: var(--text-muted);
}

.meta-value {
  color: var(--text-main);
  font-weight: 500;
}

/* 분주 산출 근거 하이라이트 배너 */
.minute-detail-box {
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.minute-explain {
  font-size: 0.85rem;
  color: var(--text-main);
}

.minute-explain span {
  color: var(--gold-light);
  font-weight: 600;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #161b26;
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.15rem;
  color: var(--gold-light);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* 분주표 테이블 스타일 */
.table-responsive {
  overflow-x: auto;
}

.minute-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.82rem;
}

.minute-table th, .minute-table td {
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 6px 4px;
}

.minute-table th {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  font-weight: 600;
}

.minute-table .th-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.minute-table td.cell-match {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), rgba(212, 175, 55, 0.2)) !important;
  color: #fff !important;
  font-weight: 800;
  box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.8);
  position: relative;
}

.minute-table td.cell-match::after {
  content: '👈 현재';
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 0.6rem;
  background: #d4af37;
  color: #000;
  border-radius: 2px;
  padding: 1px 3px;
  font-weight: bold;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(22, 27, 39, 0.95);
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  z-index: 2000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Scroll Select Listbox Styles */
.picker-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

/* Scroll Wheel Picker Styles */
.picker-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

.scroll-picker-box {
  display: flex;
  position: relative;
  height: 150px; /* 헤더 30px + 휠 영역 120px(정확히 40px * 3개) */
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.picker-center-highlight {
  position: absolute;
  top: 70px; /* 헤더 30px + 상단 40px = 정확히 70px~110px 중앙 위치 */
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.2) 50%, rgba(212, 175, 55, 0.05) 100%);
  border-top: 1px solid var(--gold-primary);
  border-bottom: 1px solid var(--gold-primary);
  pointer-events: none;
  z-index: 1;
}

.picker-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
  height: 100%;
}

.picker-column:last-child {
  border-right: none;
}

/* 연도 컬럼 좌우 폭 확대 */
.picker-column.col-year {
  flex: 1.45;
}

/* 시 컬럼 좌우 폭 확대 */
.picker-column.col-hour {
  flex: 1.25;
}

.picker-column.col-month,
.picker-column.col-day,
.picker-column.col-minute {
  flex: 0.9;
}

.column-header {
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 2;
  white-space: nowrap;
  box-sizing: border-box;
}

.wheel-scroll {
  height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-top: 40px;    /* 정확히 1개 높이(40px) */
  padding-bottom: 40px; /* 정확히 1개 높이(40px) */
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.wheel-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.wheel-item {
  height: 40px;
  line-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  font-size: 0.92rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap !important;
  overflow: visible;
  padding: 0 4px;
  box-sizing: border-box;
  margin: 0;
  transition: color 0.15s ease, font-size 0.15s ease;
}

.wheel-item span {
  pointer-events: none;
}

.wheel-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.wheel-item.selected {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  white-space: nowrap !important;
}

/* App Footer (버전 0.1 및 이메일 문의) */
.app-footer {
  margin-top: 32px;
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.version-badge-btn {
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.version-badge-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.version-badge-btn:active {
  transform: scale(0.95);
}

.footer-contact {
  font-size: 0.85rem;
  color: var(--text-main);
}

.footer-email {
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-email:hover {
  color: #ffffff;
}

.footer-notice {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 오주 명식 카드 새로고침 반짝임 피드백 */
@keyframes ojuFlashUpdate {
  0% {
    opacity: 0.55;
    filter: brightness(1.3);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

.oju-cards-wrapper.flash-update {
  animation: ojuFlashUpdate 0.4s ease-out;
}

/* 버전 정보 모달 전용 스타일 */
.version-modal-content {
  max-width: 580px;
  background: #141824;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), 0 0 15px rgba(212, 175, 55, 0.2);
}

.version-modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  line-height: 1.7;
}

.version-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.version-block.update-block {
  background: rgba(212, 175, 55, 0.07);
  border: 1px solid var(--gold-primary);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.version-tag {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.version-tag.update-tag {
  background: linear-gradient(135deg, #d4af37, #aa8214);
  color: #12141d;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.version-text-content p {
  margin-bottom: 8px;
  color: #e0e4ec;
  font-size: 0.88rem;
  word-break: keep-all;
}

.version-text-content p strong {
  color: var(--gold-light);
}

.version-text-content p.highlight-line {
  margin-top: 14px;
  font-weight: 500;
  color: var(--gold-light);
  border-left: 3px solid var(--gold-primary);
  padding-left: 8px;
}

.version-feature-title {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
}

.version-feature-list {
  padding-left: 20px;
  margin: 0;
  color: #c9d1d9;
  font-size: 0.84rem;
}

.version-feature-list li {
  margin-bottom: 6px;
  line-height: 1.5;
  word-break: keep-all;
}

.version-modal-footer {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}




