/* =========================================================================
   사주꿈 (SajuKkum) — 스타일
   신비로운 밤하늘 × 금빛 테마. 반응형.
   ========================================================================= */
:root {
  --bg:        #0b0a19;
  --bg-2:      #12102b;
  --card:      rgba(26, 21, 58, 0.55);
  --card-solid:#171236;
  --line:      rgba(180, 165, 255, 0.12);
  --line-soft: rgba(180, 165, 255, 0.07);
  --gold:      #f3c968;
  --gold-2:    #e0a83a;
  --purple:    #9d7bff;
  --purple-2:  #6f4bd8;
  --text:      #f1ecff;
  --muted:     #9d92bd;
  --shadow:    0 24px 60px rgba(0,0,0,0.38);

  --wood:  #4ea777;
  --fire:  #e8615a;
  --earth: #d3a24a;
  --metal: #cfd3dc;
  --water: #4f8bd6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(157,123,255,0.14), transparent 60%),
    radial-gradient(900px 460px at 100% -4%, rgba(243,201,104,0.07), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.container { width: min(1000px, 90vw); margin: 0 auto; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 별 배경 ---------- */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #fff; opacity: 0.4; animation: twinkle 4.5s infinite ease-in-out;
}
@keyframes twinkle { 0%,100%{opacity:.1; transform:scale(.7)} 50%{opacity:.55; transform:scale(1.1)} }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(13, 11, 31, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 12px; height: 72px; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-sel {
  width: auto; padding: 8px 12px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: var(--card); color: var(--text); border: 1px solid var(--line); cursor: pointer;
  backdrop-filter: blur(8px);
}
.lang-sel:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,196,81,.18); }
.lang-sel option { background: var(--card-solid); color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; margin-right: auto; }
.brand .logo {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(245,196,81,.6));
}
.brand small { display:block; font-size: .68rem; color: var(--muted); font-weight: 500; letter-spacing:.02em; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: .92rem; color: var(--muted);
  transition: .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(157,123,255,.16); }
.nav-toggle { display:none; background:none; border:none; color:var(--text); font-size:1.5rem; cursor:pointer; }

/* ---------- 히어로 ---------- */
.hero { position: relative; z-index: 1; text-align: center; padding: 96px 0 52px; }
.hero .moon {
  width: 78px; height: 78px; margin: 0 auto 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--gold) 42%, var(--gold-2) 76%, #a97e26 100%);
  box-shadow: 0 0 48px rgba(243,201,104,.4), inset -10px -10px 26px rgba(0,0,0,.28);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 800; letter-spacing:-.03em; line-height:1.2; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--gold), #ffe9a8 40%, var(--purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); margin-top: 18px; font-size: 1.05rem; font-weight: 400; }

/* ---------- 탭 ---------- */
.tabs { position: relative; z-index: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 20px 0 8px; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 11px 20px; border-radius: 999px; cursor: pointer; font-size: .98rem; font-weight: 600;
  transition: .2s; backdrop-filter: blur(8px);
}
.tab:hover { color: var(--text); border-color: rgba(245,196,81,.4); }
.tab.active {
  color: #1a1440; background: linear-gradient(100deg, var(--gold), var(--gold-2));
  border-color: transparent; box-shadow: 0 8px 24px rgba(245,196,81,.35);
}

/* ---------- 패널/카드 ---------- */
.panel { position: relative; z-index: 1; display: none; padding: 32px 0 10px; }
.panel.active { display: block; animation: rise .4s ease; }
@keyframes rise { from{opacity:0; transform:translateY(12px)} to{opacity:1; transform:none} }

.card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 18px;
  padding: 32px; box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 1.28rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.card .sub { color: var(--muted); font-size: .92rem; margin-bottom: 24px; line-height: 1.6; }

/* ---------- 폼 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 14px; }
label { display:block; font-size:.82rem; color: var(--muted); margin-bottom: 6px; font-weight:600; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 1rem; font-family: inherit;
  background: rgba(10,8,26,.6); border: 1px solid var(--line); color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,196,81,.18); }
.btn {
  margin-top: 20px; width: 100%; padding: 15px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 1.06rem; font-weight: 800; color: #1a1440;
  background: linear-gradient(100deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 28px rgba(245,196,81,.35); transition: .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(245,196,81,.45); }
.radio-row { display:flex; gap:10px; }
.radio-row label {
  flex:1; text-align:center; padding:11px; border:1px solid var(--line); border-radius:12px;
  cursor:pointer; color:var(--muted); margin:0; transition:.2s;
}
.radio-row input { display:none; }
.radio-row input:checked + span { color: var(--gold); font-weight:800; }
.radio-row label:has(input:checked) { border-color: var(--gold); background: rgba(245,196,81,.1); }

/* ---------- 사주판 ---------- */
.saju-board { display:grid; grid-template-columns: repeat(4,1fr); gap:12px; margin-top: 6px; }
.pillar { text-align:center; }
.pillar .plabel { font-size:.8rem; color:var(--muted); margin-bottom:8px; }
.gz {
  border-radius:14px; padding:16px 6px; font-weight:800; border:1px solid var(--line);
  display:flex; flex-direction:column; align-items:center; gap:2px;
}
.gz .h { font-size:1.9rem; line-height:1; }
.gz .ko { font-size:.82rem; opacity:.85; }
.gz.gan { margin-bottom:10px; }
.oh-wood  { background: rgba(78,167,119,.18);  border-color: rgba(78,167,119,.5);  color:#8ff0b6; }
.oh-fire  { background: rgba(232,97,90,.18);   border-color: rgba(232,97,90,.5);   color:#ffb0ab; }
.oh-earth { background: rgba(211,162,74,.18);  border-color: rgba(211,162,74,.5);  color:#ffdd9c; }
.oh-metal { background: rgba(207,211,220,.16); border-color: rgba(207,211,220,.5); color:#eef1f7; }
.oh-water { background: rgba(79,139,214,.18);  border-color: rgba(79,139,214,.5);  color:#a7cbff; }

/* ---------- 오행 막대 ---------- */
.ohaeng-bars { display:grid; gap:10px; margin-top:6px; }
.obar { display:grid; grid-template-columns: 64px 1fr 34px; align-items:center; gap:12px; }
.obar .name { font-weight:700; font-size:.92rem; }
.obar .track { height:12px; background: rgba(255,255,255,.07); border-radius:99px; overflow:hidden; }
.obar .fill { height:100%; border-radius:99px; transition: width .8s cubic-bezier(.2,.9,.2,1); }
.f-wood{background:var(--wood)} .f-fire{background:var(--fire)} .f-earth{background:var(--earth)}
.f-metal{background:var(--metal)} .f-water{background:var(--water)}
.obar .num { text-align:right; color:var(--muted); font-weight:700; }

.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.chip { padding:6px 12px; border-radius:99px; background:rgba(157,123,255,.14); border:1px solid var(--line); font-size:.86rem; }
.chip b { color: var(--gold); }

.interp { margin-top:18px; padding:18px; border-radius:14px; background:rgba(10,8,26,.45); border:1px solid var(--line); }
.interp p { margin: 6px 0; }
.interp .em { color: var(--gold); font-weight:700; }

/* ---------- 운세 ---------- */
.score-ring { display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.ring {
  --p:70; width:120px; height:120px; border-radius:50%; display:grid; place-items:center;
  background: conic-gradient(var(--gold) calc(var(--p)*1%), rgba(255,255,255,.08) 0);
  position:relative; flex-shrink:0;
}
.ring::before { content:""; position:absolute; inset:10px; border-radius:50%; background: var(--card-solid); }
.ring span { position:relative; font-size:1.8rem; font-weight:900; color:var(--gold); }
.fortune-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-top:18px; }
.fitem { padding:16px; border-radius:14px; background:rgba(10,8,26,.45); border:1px solid var(--line); }
.fitem h4 { font-size:.92rem; color:var(--gold); margin-bottom:6px; }
.fitem p { font-size:.92rem; color:var(--text); }
.lucky { display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
.lucky .l { flex:1; min-width:110px; text-align:center; padding:14px; border-radius:12px; background:rgba(157,123,255,.12); border:1px solid var(--line); }
.lucky .l small { display:block; color:var(--muted); font-size:.76rem; margin-bottom:4px; }
.lucky .l b { font-size:1.15rem; color:var(--gold); }

/* ---------- 꿈해몽 ---------- */
.dream-list { display:grid; gap:12px; margin-top:16px; }
.dream {
  padding:18px; border-radius:14px; background:rgba(10,8,26,.45); border:1px solid var(--line);
  transition:.2s;
}
.dream:hover { border-color: rgba(245,196,81,.4); transform: translateY(-2px); }
.dream .top { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.dream .top h4 { font-size:1.05rem; }
.dream .tag { font-size:.72rem; padding:3px 9px; border-radius:99px; background:rgba(245,196,81,.16); color:var(--gold); font-weight:700; }
.dream p { color:var(--muted); font-size:.94rem; }
.empty { text-align:center; color:var(--muted); padding:30px; }

/* ---------- 광고 ---------- */
.ad-slot {
  margin: 26px auto; text-align: center; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-slot small { color: rgba(169,158,201,.4); font-size:.72rem; }

/* ---------- 안내/푸터 ---------- */
.notice {
  position:relative; z-index:1; text-align:center; color:var(--muted); font-size:.82rem;
  margin: 20px auto; max-width: 720px;
}
.site-footer {
  position:relative; z-index:1; border-top:1px solid var(--line); margin-top:40px;
  padding: 30px 0; text-align:center; color:var(--muted); font-size:.86rem;
}
.site-footer a { color: var(--purple); }

/* ---------- 프리미엄(결제) 카드 ---------- */
.prem-card {
  margin-top: 20px; border-radius: 20px; padding: 26px;
  border: 1px solid rgba(245,196,81,.35);
  background: linear-gradient(160deg, rgba(245,196,81,.10), rgba(157,123,255,.10));
  box-shadow: var(--shadow); text-align: center;
}
.prem-card.locked { position: relative; overflow: hidden; }
.prem-card .prem-lock { font-size: 2rem; margin-bottom: 6px; filter: drop-shadow(0 0 12px rgba(245,196,81,.5)); }
.prem-card h3 { font-size: 1.2rem; margin: 4px 0 8px; }
.prem-card .prem-sub { color: var(--muted); font-size: .95rem; margin-bottom: 18px; line-height: 1.6; }
.prem-btn { max-width: 380px; margin-left: auto; margin-right: auto; }
.prem-card.unlocked { text-align: left; border-color: rgba(78,167,119,.4);
  background: linear-gradient(160deg, rgba(78,167,119,.10), rgba(245,196,81,.08)); }
.prem-card.unlocked h3 { color: var(--gold); text-align: center; margin-bottom: 16px; }
.prem-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.prem-item { padding: 14px 8px; border-radius: 12px; background: rgba(10,8,26,.45);
  border: 1px solid var(--line); text-align: center; }
.prem-item b { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.prem-item span { font-size: 1rem; color: var(--gold); font-weight: 800; }
.prem-p { margin: 12px 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(10,8,26,.4); border: 1px solid var(--line); line-height: 1.7; }
.prem-p b { color: var(--gold); }
.prem-langnote { color: var(--muted); font-size: .8rem; margin: -8px 0 14px; }
@media (max-width: 720px) { .prem-grid { grid-template-columns: 1fr; } }

/* --- AI 전문가 풀이 --- */
.ai-reading { margin-top: 18px; }
.ai-title { font-size: 1.02rem; color: var(--gold); margin: 6px 0 12px;
  display: flex; align-items: center; gap: 6px; }
.ai-body { line-height: 1.85; font-size: 1rem; }
.ai-body p { margin: 12px 0; }
.ai-body .ai-h { font-size: 1.02rem; color: var(--gold); margin: 20px 0 8px; font-weight: 800; }
.ai-body b { color: #ffe0a0; }
.ai-note { color: var(--muted); text-align: center; margin: 14px 0; }
.ai-note.ai-err { color: #e8918a; }
.ai-loading { display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); padding: 26px 12px; text-align: center; line-height: 1.5; }
.ai-spin { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  border: 3px solid rgba(245,196,81,.25); border-top-color: var(--gold);
  animation: aispin 1s linear infinite; }
@keyframes aispin { to { transform: rotate(360deg); } }
[dir="rtl"] .ai-body { text-align: right; }

@media (max-width: 720px) {
  .nav-links { display:none; }
  .nav-toggle { display:block; }
  .nav-links.open {
    display:flex; position:absolute; top:66px; left:0; right:0; flex-direction:column; gap:0;
    background: var(--card-solid); border-bottom:1px solid var(--line); padding:8px;
  }
  .nav-links.open a { padding:12px; border-radius:10px; }
  .saju-board { grid-template-columns: repeat(4,1fr); gap:6px; }
  .gz { padding:12px 2px; } .gz .h { font-size:1.4rem; }
  .hero { padding: 48px 0 26px; }
}

/* ---------- 내 꿈 풀이 + 로또 ---------- */
#dt-input {
  width: 100%; padding: 14px; border-radius: 12px; font-size: 1rem; font-family: inherit;
  background: rgba(10,8,26,.6); border: 1px solid var(--line); color: var(--text); resize: vertical;
  line-height: 1.6;
}
#dt-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,196,81,.18); }
.dt-interp { margin-top: 18px; }
.dt-lead { color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.dt-sym { padding: 14px 16px; border-radius: 12px; margin-bottom: 10px;
  background: rgba(10,8,26,.45); border: 1px solid var(--line); line-height: 1.7; }
.dt-sym b { color: var(--gold); }
.dt-tag { font-size: .72rem; padding: 2px 8px; border-radius: 99px;
  background: rgba(245,196,81,.16); color: var(--gold); font-weight: 700; }
.dt-synth { margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: rgba(157,123,255,.12); border: 1px solid var(--line); line-height: 1.7; }
.dt-synth b { color: var(--gold); }

.lotto-box { margin-top: 20px; padding: 20px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(78,167,119,.10), rgba(245,196,81,.08));
  border: 1px solid rgba(78,167,119,.3); }
.lotto-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.lotto-head span { font-weight: 800; font-size: 1.02rem; }
.lotto-redraw { padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .88rem;
  color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--line); transition: .2s; }
.lotto-redraw:hover { border-color: var(--gold); color: var(--gold); }
.lotto-balls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lotto-ball {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 1.15rem; color: #1a1440;
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset -3px -4px 8px rgba(0,0,0,.18);
  animation: pop .4s cubic-bezier(.2,.9,.3,1.4) both;
}
.lotto-balls .lotto-ball:nth-child(2){animation-delay:.06s}
.lotto-balls .lotto-ball:nth-child(3){animation-delay:.12s}
.lotto-balls .lotto-ball:nth-child(4){animation-delay:.18s}
.lotto-balls .lotto-ball:nth-child(5){animation-delay:.24s}
.lotto-balls .lotto-ball:nth-child(6){animation-delay:.30s}
@keyframes pop { from{opacity:0; transform:scale(.3) translateY(10px)} to{opacity:1; transform:none} }
@media (max-width: 720px) { .lotto-ball { width: 44px; height: 44px; font-size: 1rem; } }
