:root {
  --bg0: #070612;
  --bg1: #0e0b20;
  --bg2: #16122e;
  --ink: #efecff;
  --muted: #a49cce;
  --faint: #6f67a0;
  --gold: #e7c378;
  --gold2: #f6dfa6;
  --glass: rgba(32, 26, 64, 0.55);
  --glass-brd: rgba(160, 140, 230, 0.16);
  --mok: #5bc48a; --hwa: #e8766f; --to: #e3b25a; --geum: #dcd6ea; --su: #6a9cf0;
  --radius: 20px;
  --serif: "Noto Serif KR", serif;
  --sans: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 50% -15%, #2a2066 0%, transparent 58%),
    radial-gradient(900px 600px at 85% 12%, #3b2060 0%, transparent 55%),
    radial-gradient(700px 500px at 10% 30%, #151b4d 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  padding: 0 16px 72px;
  overflow-x: hidden;
}

/* 별빛 레이어 */
.starfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff 50%, transparent),
    radial-gradient(1px 1px at 40% 60%, #e9d9ff 50%, transparent),
    radial-gradient(1.5px 1.5px at 85% 70%, #fff 50%, transparent),
    radial-gradient(1px 1px at 15% 80%, #cfe0ff 50%, transparent),
    radial-gradient(1px 1px at 55% 85%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 92% 40%, #fff 50%, transparent),
    radial-gradient(1px 1px at 33% 15%, #fff 50%, transparent);
  opacity: 0.5;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.32; } to { opacity: 0.6; } }

header, main, footer { position: relative; z-index: 1; }

/* 헤더 */
.site-head { text-align: center; padding: 56px 0 26px; }
.crest { color: var(--gold); font-size: 20px; letter-spacing: 8px; opacity: 0.85; margin-bottom: 10px; }
.logo {
  font-family: var(--serif); font-weight: 700; margin: 0;
  font-size: clamp(44px, 12vw, 72px); letter-spacing: 6px; line-height: 1;
  background: linear-gradient(180deg, #fff 0%, var(--gold2) 55%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 8px 40px rgba(231, 195, 120, 0.25);
}
.sublogo { font-family: var(--serif); letter-spacing: 10px; color: var(--ink); margin: 10px 0 0; font-size: 15px; opacity: 0.9; }
.tagline { color: var(--muted); margin: 14px 0 0; font-size: 14px; letter-spacing: 0.5px; }

main { max-width: 760px; margin: 0 auto; }

/* 카드(글래스) */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -30px #000, inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 입력 폼 */
.form-card { animation: rise 0.5s ease both; }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 72px; letter-spacing: 0.3px; }
label.check, label.leap-wrap { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); align-self: end; }
input, select {
  background: rgba(10, 8, 24, 0.7); border: 1px solid var(--glass-brd); color: var(--ink);
  border-radius: 12px; padding: 12px 13px; font-size: 15px; width: 100%; font-family: var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"] { width: auto; accent-color: var(--gold); }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 195, 120, 0.18); }
input::placeholder { color: var(--faint); }

.go {
  width: 100%; margin-top: 8px; padding: 15px; border: 0; border-radius: 14px;
  font-size: 16px; font-weight: 700; color: #241a05; cursor: pointer; font-family: var(--sans);
  background: linear-gradient(100deg, var(--gold2), var(--gold));
  box-shadow: 0 12px 30px -12px rgba(231, 195, 120, 0.6);
  transition: transform 0.12s, filter 0.12s;
}
.go:hover { filter: brightness(1.06); transform: translateY(-1px); }
.go:active { transform: translateY(0); }
.err { color: #ff9b9b; margin: 12px 0 0; font-size: 14px; }

/* 결과 */
.result { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.result > * { animation: rise 0.5s ease both; }
.result > *:nth-child(2) { animation-delay: 0.04s; }
.result > *:nth-child(3) { animation-delay: 0.08s; }
.result > *:nth-child(4) { animation-delay: 0.12s; }
.result > *:nth-child(n+5) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.sec-title {
  font-family: var(--serif); font-size: 13px; color: var(--gold); margin: 0 0 14px;
  letter-spacing: 3px; font-weight: 600; text-transform: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.sec-title::before { content: "✦"; font-size: 10px; opacity: 0.7; }

/* 명식 기둥 */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillar {
  background: linear-gradient(180deg, rgba(20, 15, 46, 0.8), rgba(12, 9, 30, 0.8));
  border: 1px solid var(--glass-brd); border-radius: 14px; padding: 14px 8px; text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.pillar:hover { transform: translateY(-3px); border-color: rgba(231, 195, 120, 0.35); }
.pillar h3 { margin: 0 0 10px; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 1px; }
.gz { font-family: var(--serif); font-size: clamp(28px, 8vw, 38px); font-weight: 700; line-height: 1.08; }
.gz .stem { color: var(--gold2); display: block; }
.gz .branch { color: var(--ink); display: block; }
.pillar .tg { font-size: 10.5px; color: var(--faint); margin-top: 8px; letter-spacing: 0.3px; }

/* 오행 바 */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 28px 1fr 26px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.bar { height: 10px; border-radius: 6px; background: rgba(42, 33, 86, 0.6); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.el-목 { background: linear-gradient(90deg, #3c9c6b, var(--mok)); }
.el-화 { background: linear-gradient(90deg, #c85850, var(--hwa)); }
.el-토 { background: linear-gradient(90deg, #c08f3a, var(--to)); }
.el-금 { background: linear-gradient(90deg, #b9b2cc, var(--geum)); }
.el-수 { background: linear-gradient(90deg, #487ad0, var(--su)); }

/* 해석 카드 */
.interp-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.interp-head .sec-title { margin: 0; }
.interp-lines { margin: 0; padding-left: 4px; list-style: none; }
.interp-lines li { margin: 9px 0; color: var(--ink); line-height: 1.65; font-size: 14.5px; padding-left: 16px; position: relative; }
.interp-lines li::before { content: "·"; position: absolute; left: 2px; color: var(--gold); font-weight: 700; }
.score { display: flex; align-items: center; gap: 9px; min-width: 128px; }
.score-bar { flex: 1; height: 7px; border-radius: 5px; background: rgba(42, 33, 86, 0.7); overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); border-radius: 5px; }
.score-num { font-family: var(--serif); font-size: 15px; color: var(--gold2); font-weight: 700; min-width: 26px; text-align: right; }

/* 오늘의 운세 강조 */
.today {
  border-color: rgba(231, 195, 120, 0.4);
  background: linear-gradient(180deg, rgba(60, 44, 20, 0.35), rgba(32, 26, 64, 0.55));
  box-shadow: 0 0 0 1px rgba(231, 195, 120, 0.25) inset, 0 24px 60px -30px #000;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: rgba(42, 33, 86, 0.6); border: 1px solid var(--glass-brd); color: var(--gold2); padding: 7px 13px; border-radius: 999px; font-size: 13px; }

.daeun { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.daeun .d { min-width: 66px; text-align: center; background: rgba(20, 15, 46, 0.8); border: 1px solid var(--glass-brd); border-radius: 12px; padding: 10px 6px; }
.daeun .d .age { font-size: 11px; color: var(--muted); }
.daeun .d .dg { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--gold2); margin-top: 5px; }

.disclaimer { text-align: center; color: var(--faint); font-size: 12px; margin: 4px 4px 0; letter-spacing: 0.3px; }

footer { max-width: 760px; margin: 32px auto 0; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.7; }
