@import url('https://fonts.googleapis.com/css2?family=Hi+Melody&family=Gowun+Dodum&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-top: #222948;
  --bg-mid: #2d3560;
  --bg-bottom: #3d466f;
  --card: rgba(63, 73, 118, 0.55);
  --card-strong: rgba(70, 80, 126, 0.7);
  --border: rgba(200, 210, 245, 0.18);
  --text: #eaeeff;
  --text-dim: #aab3d9;
  --accent: #aab8e8;
  --gold: #f7e39c;
  --moon: #f9e8a0;
  --good: #a9dfb4;
  --bad: #f5b3a4;
  --neutral: #a9c6f0;
  --title-font: "Hi Melody", "Gowun Dodum", cursive;
  --body-font: "Gowun Dodum", "Apple SD Gothic Neo", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

/* ── 초승달 ── */
.crescent {
  position: fixed;
  top: 64px;
  left: 8vw;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  box-shadow: 16px 8px 0 0 var(--moon);
  transform: rotate(-14deg);
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(249, 232, 160, 0.22));
}
@media (max-width: 680px) {
  .crescent {
    top: 18px;
    left: auto;
    right: 30px;
    width: 46px;
    height: 46px;
    box-shadow: 10px 5px 0 0 var(--moon);
  }
  .crescent::after { left: 10px; top: 5px; }
}

/* ── 달빛 맥동 — 달무리가 커졌다 작아지며 숨쉬듯 빛남 ── */
.crescent::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 232, 160, 0.5) 0%, rgba(249, 232, 160, 0.18) 45%, transparent 68%);
  animation: moonglow 5s ease-in-out infinite;
}
@keyframes moonglow {
  0%, 100% { opacity: 0.25; transform: scale(1.3); }
  50% { opacity: 1; transform: scale(2); }
}

/* ── 별 ── */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
  position: absolute;
  background: #fff7d9;
  border-radius: 50%;
  animation: twinkle 4s infinite ease-in-out;
}

/* ── 별똥별 ── */
.shoot {
  position: absolute;
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 247, 217, 0.95), transparent);
  opacity: 0;
  animation: shoot var(--dur, 14s) linear infinite;
}
@keyframes shoot {
  0% { opacity: 0; transform: rotate(-32deg) translateX(0); }
  1.5% { opacity: 1; }
  9% { opacity: 0; transform: rotate(-32deg) translateX(-46vw); }
  100% { opacity: 0; transform: rotate(-32deg) translateX(-46vw); }
}

/* ── 흘러가는 구름 ── */
.cloud {
  position: absolute;
  left: 0;
  width: 340px;
  height: 64px;
  border-radius: 999px;
  background: rgba(170, 184, 232, 0.14);
  filter: blur(16px);
  transform: scale(var(--cs, 1));
  animation: cloudmove 120s linear infinite;
}
.cloud::after {
  content: "";
  position: absolute;
  left: 22%;
  top: -46%;
  width: 55%;
  height: 110%;
  border-radius: 50%;
  background: rgba(170, 184, 232, 0.12);
}
@keyframes cloudmove {
  from { translate: -30vw 0; }
  to { translate: 115vw 0; }
}

/* ── 반딧불이 ── */
.fly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe9a0;
  box-shadow: 0 0 8px 2px rgba(255, 233, 160, 0.55);
  animation: flyfloat 12s ease-in-out infinite alternate, flyglow 2.4s ease-in-out infinite;
}
@keyframes flyfloat {
  0% { translate: 0 0; }
  25% { translate: 26px -22px; }
  50% { translate: -14px -38px; }
  75% { translate: 20px -12px; }
  100% { translate: -8px -30px; }
}
@keyframes flyglow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.95; }
}
.star.gold {
  background: none;
  border-radius: 0;
  color: #ffd97a;
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 217, 122, 0.6);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.95; }
}

/* ── 마을 실루엣 ── */
.town {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  line-height: 0;
}
.town svg { width: 100%; height: auto; display: block; }
/* 마녀 빗자루를 탄 고양이 — 밤하늘을 좌우로 왕복 비행 */
.witch {
  position: fixed;
  top: 9%;
  left: 0;
  width: clamp(64px, 9vw, 96px);
  height: auto;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  animation: witchFly 30s linear infinite;
}
@keyframes witchFly {
  0%   { transform: translate(-20vw, 6vh); }
  25%  { transform: translate(46vw, 0vh); }
  50%  { transform: translate(120vw, 5vh); }
  75%  { transform: translate(46vw, 1vh); }
  100% { transform: translate(-20vw, 6vh); }
}
/* 진행 방향에 맞춰 좌우 반전(전환은 화면 밖에서 순간 처리) */
.witch-inner {
  transform-box: fill-box;
  transform-origin: center;
  animation: witchFace 30s step-end infinite;
}
@keyframes witchFace {
  0%, 49.9% { transform: scaleX(1); }
  50%, 100% { transform: scaleX(-1); }
}
/* 꼬리 살랑, 눈 깜빡임 */
.witch-tail {
  transform-box: fill-box;
  transform-origin: 100% 100%;
  animation: witchTail 2.8s ease-in-out infinite;
}
@keyframes witchTail {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(9deg); }
}
.witch-eye {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 2px rgba(255, 217, 122, 0.95));
  animation: witchBlink 5s ease-in-out infinite;
}
@keyframes witchBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

/* 창문 불빛 — 일부는 꺼졌다 켜짐 */
.town rect.wf.wa { animation: winflick 9s step-end infinite; }
.town rect.wf.wb { animation: winflick 13s step-end infinite; animation-delay: 4s; }
.town rect.wf.wc { animation: winflick 17s step-end infinite; animation-delay: 8s; }
.town rect.wf.won { animation: winon 15s step-end infinite; }
@keyframes winflick {
  0%, 100% { opacity: 1; }
  44% { opacity: 1; }
  48% { opacity: 0.12; }
  64% { opacity: 0.12; }
  68% { opacity: 1; }
}
@keyframes winon {
  0% { opacity: 0.12; }
  38% { opacity: 0.12; }
  42% { opacity: 1; }
  88% { opacity: 1; }
  92% { opacity: 0.12; }
  100% { opacity: 0.12; }
}

/* 움직임 최소화 설정 사용자는 모든 장식 모션 정지 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star, .shoot, .cloud, .fly, .crescent::after,
  .witch, .witch-inner, .witch-tail, .witch-eye, .town rect.wf,
  header.site > *, .select-card, .select-card .icon,
  .btn::after, #result.show > *, #result.show .fortune-card,
  #result.show .lucky-item, .verdict::after, .verdict .emoji,
  .fstar.on, .lucky-item::after, .tarot-step, .t-card,
  #result.show .t-result, #aiSection .ai-card, .ai-loading,
  .dream-loading::after,
  .ai-orbit, .ai-orbit::after, .ai-loading-text,
  .s-card { animation: none !important; }
  .select-card, .btn, .chip, .t-card, .t-inner,
  .cut-pile, .back-link { transition: none !important; }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 20px 230px;
}

/* ── 헤더 ── */
header.site { text-align: center; margin-bottom: 38px; }
header.site > * {
  animation: headerReveal 0.8s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
}
header.site .moon { animation-delay: 0.04s; }
header.site .site-title { animation-delay: 0.15s; }
header.site .subtitle { animation-delay: 0.27s; }
@keyframes headerReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.site .moon {
  font-size: 50px;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 14px rgba(249, 232, 160, 0.4));
}
.site .moon.big { font-size: 92px; margin-bottom: 16px; }
@media (max-width: 680px) { .site .moon.big { font-size: 72px; } }
h1.site-title {
  font-family: var(--title-font);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #fdf6dd;
  text-shadow: 0 0 24px rgba(249, 232, 160, 0.25);
}
.subtitle {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
}

/* ── 뒤로가기 ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 16px;
  margin-bottom: 26px;
  border: 1.5px dashed var(--border);
  border-radius: 999px;
  padding: 7px 17px;
  background: var(--card);
  transition: color 0.2s, border-color 0.2s;
}
.back-link:hover { color: var(--gold); border-color: var(--gold); }

/* ── 오늘의 한 줄 + 출석 도장 ── */
.daily-panel {
  display: none;
  background: var(--card-strong);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 24px 26px;
  text-align: center;
  margin-top: 8px;
}
.daily-panel.show { display: block; animation: fadeUp 0.7s ease both; }
.daily-date { font-size: 13px; color: var(--text-dim); letter-spacing: 1px; }
.daily-line {
  font-family: var(--title-font);
  font-size: 23px;
  line-height: 1.6;
  color: #fdf6dd;
  margin-top: 8px;
  text-shadow: 0 0 20px rgba(249, 232, 160, 0.2);
}
.streak {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.stamps { display: flex; justify-content: center; gap: 7px; }
.stamp {
  font-size: 17px;
  filter: grayscale(1) brightness(0.6);
  opacity: 0.4;
  transition: all 0.3s;
}
.stamp.on {
  filter: none;
  opacity: 1;
  text-shadow: 0 0 8px rgba(249, 232, 160, 0.5);
}
.stamp.on:last-of-type,
.stamp.on:nth-last-of-type(1) { animation: stampPop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.3s backwards; }
@keyframes stampPop {
  from { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.3); }
  to { transform: scale(1); opacity: 1; }
}
.streak-text { margin-top: 10px; font-size: 13.5px; color: var(--text-dim); }
.streak-text b { color: var(--gold); font-size: 15px; }

/* ── 홈 화면에 추가 ── */
.install-btn {
  display: block;
  margin: 22px auto 0;
  padding: 13px 22px;
  border: 1.5px dashed rgba(247, 227, 156, 0.5);
  border-radius: 999px;
  background: var(--card);
  color: var(--gold);
  font-family: var(--title-font);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.install-btn:hover { background: var(--card-strong); transform: translateY(-2px); }
.ios-hint {
  margin: 20px auto 0;
  max-width: 420px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}
.ios-hint b { color: var(--gold); }

/* ── 배경음악 토글 ── */
.bgm-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(28, 34, 62, 0.7);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.bgm-toggle:hover { transform: scale(1.08); border-color: var(--gold); }
.bgm-toggle.on {
  border-color: rgba(247, 227, 156, 0.6);
  box-shadow: 0 0 14px rgba(247, 227, 156, 0.35);
  animation: bgmPulse 2.5s ease-in-out infinite;
}
@keyframes bgmPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(247, 227, 156, 0.25); }
  50% { box-shadow: 0 0 20px rgba(247, 227, 156, 0.5); }
}
@media (prefers-reduced-motion: reduce) {
  .bgm-toggle.on { animation: none !important; }
}

/* ── 홈 선택 카드 ── */
.select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
@media (max-width: 560px) { .select-grid { grid-template-columns: 1fr; } }

.select-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 26px;
  padding: 40px 26px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
  animation: cardFloat 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
}
.select-card:nth-child(1) { animation-delay: 0.1s; }
.select-card:nth-child(2) { animation-delay: 0.22s; }
.select-card:nth-child(3) { animation-delay: 0.34s; }
.select-card:nth-child(4) { animation-delay: 0.46s; }
@keyframes cardFloat {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; }
}
.select-card:hover {
  transform: translateY(-5px);
  border-color: rgba(247, 227, 156, 0.55);
  background: var(--card-strong);
}
/* 아이콘이 은은하게 떠 있는 느낌 */
.select-card .icon {
  font-size: 52px;
  display: block;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 12px rgba(249, 232, 160, 0.3));
  animation: iconBob 4s ease-in-out infinite;
}
.select-card:nth-child(2) .icon { animation-delay: 0.6s; }
.select-card:nth-child(3) .icon { animation-delay: 1.2s; }
.select-card:nth-child(4) .icon { animation-delay: 1.8s; }
@keyframes iconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.select-card h2 {
  font-family: var(--title-font);
  font-size: 30px;
  font-weight: 400;
  color: var(--gold);
}
.select-card p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.85;
}
.select-card .enter {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--title-font);
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--accent);
  border-bottom: 1.5px dashed rgba(170, 184, 232, 0.5);
  padding-bottom: 2px;
}

/* ── 입력 카드 ── */
.input-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 26px;
}
textarea, input[type="date"], select {
  width: 100%;
  background: rgba(28, 34, 62, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  color: var(--text);
  font-size: 15.5px;
  font-family: var(--body-font);
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 135px; resize: vertical; }
textarea:focus, input[type="date"]:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(247, 227, 156, 0.13);
}
textarea::placeholder { color: #8890b8; }
input[type="date"] { color-scheme: dark; }

label.field-label {
  display: block;
  font-family: var(--title-font);
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-size: 21px;
  font-weight: 400;
  font-family: var(--title-font);
  letter-spacing: 2px;
  cursor: pointer;
  color: #4a3d1e;
  background: linear-gradient(180deg, #fdedb0, #f6d98c);
  box-shadow: 0 4px 18px rgba(246, 217, 140, 0.28);
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(246, 217, 140, 0.4); }
.btn:active { transform: translateY(0); }
/* 버튼 위로 지나가는 광택 */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn:hover::after { animation: btnShine 0.75s ease; }
@keyframes btnShine { from { left: -80%; } to { left: 130%; } }

/* AI 심층 분석 — 크고 눈에 띄는 보조 버튼 */
.btn-ai {
  margin-top: 10px;
  padding: 18px;
  font-size: 23px;
  color: #2c2450;
  background: linear-gradient(180deg, #d7defc, #aab8e8);
  box-shadow: 0 4px 18px rgba(170, 184, 232, 0.3);
}
.btn-ai:hover { box-shadow: 0 8px 26px rgba(170, 184, 232, 0.45); }

.examples { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: rgba(28, 34, 62, 0.5);
  border: 1.5px dashed var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: var(--body-font);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s,
    box-shadow 0.2s, transform 0.2s;
}
.chip:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--card);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}
.btn:focus-visible, .chip:focus-visible, .back-link:focus-visible,
.select-card:focus-visible, .cut-pile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── 결과 공통 ── */
#result { margin-top: 32px; display: none; }
#result.show { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 결과 항목이 위에서 하나씩 순차적으로 떠오름 */
#result.show > *,
#result.show .fortune-card,
#result.show .lucky-item {
  animation: revealUp 0.6s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#result.show > *:nth-child(1) { animation-delay: 0.05s; }
#result.show > *:nth-child(2) { animation-delay: 0.16s; }
#result.show > *:nth-child(3) { animation-delay: 0.27s; }
#result.show > *:nth-child(4) { animation-delay: 0.38s; }
#result.show > *:nth-child(5) { animation-delay: 0.49s; }
#result.show > *:nth-child(6) { animation-delay: 0.60s; }
#result.show > *:nth-child(n+7) { animation-delay: 0.68s; }
/* 운세 카드·행운 항목은 격자 안에서 다시 순차 등장 */
#result.show .fortune-card:nth-child(1) { animation-delay: 0.30s; }
#result.show .fortune-card:nth-child(2) { animation-delay: 0.40s; }
#result.show .fortune-card:nth-child(3) { animation-delay: 0.50s; }
#result.show .fortune-card:nth-child(4) { animation-delay: 0.60s; }
#result.show .lucky-item:nth-child(1) { animation-delay: 0.55s; }
#result.show .lucky-item:nth-child(2) { animation-delay: 0.63s; }
#result.show .lucky-item:nth-child(3) { animation-delay: 0.71s; }
#result.show .lucky-item:nth-child(4) { animation-delay: 0.79s; }

.verdict {
  text-align: center;
  background: var(--card-strong);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 30px 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
/* 판정 카드 위로 달빛이 한 번 스침 */
.verdict::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 247, 217, 0.14), transparent);
  transform: skewX(-18deg);
  animation: sweep 1.5s ease 0.5s backwards;
}
@keyframes sweep { from { left: -70%; } to { left: 150%; } }
/* 판정 이모지가 콩 튀며 등장 */
.verdict .emoji {
  font-size: 44px;
  display: block;
  margin-bottom: 8px;
  animation: emojiPop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.35s backwards;
}
@keyframes emojiPop {
  from { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.2); }
  to { opacity: 1; transform: scale(1); }
}
.verdict .label {
  font-family: var(--title-font);
  font-size: 32px;
  font-weight: 400;
}
.verdict .label.good { color: var(--good); }
.verdict .label.bad { color: var(--bad); }
.verdict .label.neutral { color: var(--neutral); }
.verdict .summary { margin-top: 10px; color: #c6cdec; font-size: 14.5px; line-height: 1.85; }

.symbol-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 14px;
}
.symbol-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.symbol-head .icon { font-size: 26px; }
.symbol-head .name {
  font-family: var(--title-font);
  font-size: 25px;
  font-weight: 400;
  color: var(--gold);
}
.tag {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 1px;
}
.tag.good { background: rgba(169, 223, 180, 0.16); color: var(--good); }
.tag.bad { background: rgba(245, 179, 164, 0.16); color: var(--bad); }
.tag.neutral { background: rgba(169, 198, 240, 0.16); color: var(--neutral); }

.section {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1.5px dashed rgba(200, 210, 245, 0.14);
}
.section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.section h4 {
  font-family: var(--title-font);
  font-size: 17px;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 400;
  letter-spacing: 1px;
}
.section p { color: #d3d9f2; font-size: 14.5px; line-height: 1.9; }

.variant { display: flex; gap: 9px; margin-top: 8px; font-size: 14px; line-height: 1.8; }
.variant .v-cond { flex-shrink: 0; color: var(--gold); }
.variant .v-mean { color: #c6cdec; }

.no-match {
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  color: var(--text-dim);
  line-height: 1.95;
  font-size: 14.5px;
}
.no-match b { color: var(--gold); }

/* ── 운세 페이지 ── */
.saved-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  margin-bottom: 18px;
  font-size: 14.5px;
  color: var(--text-dim);
}
.saved-bar button {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--title-font);
  font-size: 16px;
  cursor: pointer;
  border-bottom: 1.5px dashed rgba(170, 184, 232, 0.5);
  padding-bottom: 1px;
  transition: color 0.15s;
}
.saved-bar button:hover { color: var(--gold); }

.remember-note {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #8890b8;
}

.zodiac-banner {
  text-align: center;
  background: var(--card-strong);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 28px 26px;
  margin-bottom: 18px;
}
.zodiac-banner .z-icon { font-size: 48px; display: block; margin-bottom: 6px; filter: drop-shadow(0 0 12px rgba(249, 232, 160, 0.35)); }
.zodiac-banner .z-name {
  font-family: var(--title-font);
  font-size: 30px;
  color: var(--gold);
}
.zodiac-banner .z-date { margin-top: 4px; font-size: 13px; color: var(--text-dim); letter-spacing: 1px; }
.zodiac-banner .z-overall { margin-top: 13px; font-size: 15px; line-height: 1.95; color: #dde2f7; }

.fortune-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .fortune-grid { grid-template-columns: 1fr; } }

.fortune-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
}
.fortune-card .f-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fortune-card .f-icon { font-size: 21px; }
.fortune-card .f-name {
  font-family: var(--title-font);
  font-size: 21px;
  color: var(--accent);
}
.fortune-card .f-stars { margin-left: auto; font-size: 13.5px; color: var(--gold); letter-spacing: 2px; }
.fstar { display: inline-block; transform-origin: 50% 80%; }
.fstar.on {
  animation: starPop 0.48s cubic-bezier(0.2, 1.45, 0.35, 1) backwards;
}
@keyframes starPop {
  from { opacity: 0; transform: scale(0.25) translateY(5px); }
  65% { opacity: 1; transform: scale(1.25) translateY(-1px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.fortune-card p { font-size: 13.8px; line-height: 1.85; color: #c6cdec; }

.lucky-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
}
@media (max-width: 620px) { .lucky-row { grid-template-columns: repeat(2, 1fr); } }
.lucky-item {
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 17px;
  padding: 15px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.lucky-item::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: linear-gradient(100deg, transparent, var(--gold), transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-180%) skewX(-18deg);
}
#result.show .lucky-item::after {
  animation: luckyShimmer 1.15s ease-out backwards;
}
#result.show .lucky-item:nth-child(1)::after { animation-delay: 0.72s; }
#result.show .lucky-item:nth-child(2)::after { animation-delay: 0.80s; }
#result.show .lucky-item:nth-child(3)::after { animation-delay: 0.88s; }
#result.show .lucky-item:nth-child(4)::after { animation-delay: 0.96s; }
@keyframes luckyShimmer {
  0% { opacity: 0; transform: translateX(-180%) skewX(-18deg); }
  25% { opacity: 0.13; }
  75% { opacity: 0.13; }
  100% { opacity: 0; transform: translateX(420%) skewX(-18deg); }
}
.lucky-item .l-label { font-size: 11.5px; letter-spacing: 1.5px; color: var(--text-dim); }
.lucky-item .l-value {
  margin-top: 6px;
  font-family: var(--title-font);
  font-size: 19px;
  color: var(--gold);
}

/* ── 타로 ── */
.tarot-step {
  animation: tarotStepReveal 0.5s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
}
@keyframes tarotStepReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.tarot-status {
  text-align: center;
  font-family: var(--title-font);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 16px;
}
/* 카드를 손에 쥔 부채처럼 겹쳐 펼치되, 스크롤 없이 여러 줄로 감싸 한눈에 보이게 */
.tarot-board {
  display: flex;
  flex-wrap: wrap;
  row-gap: 14px;
  padding: 24px 14px 14px 74px; /* 왼쪽 여백 = 겹침 마진(60px) + 기본 14px */
  margin-bottom: 18px;
}
.t-card {
  position: relative;
  flex: 0 0 116px;
  height: 174px; /* flex 배치에서는 aspect-ratio가 stretch에 눌리므로 높이를 못박음 */
  margin-left: -60px;
  perspective: 700px;
  cursor: pointer;
  animation: tarotDeal 0.55s cubic-bezier(0.2, 0.78, 0.25, 1) backwards;
  animation-delay: calc(var(--card-order, 0) * 35ms);
  transition: transform 0.32s ease, filter 0.32s ease;
  transform-origin: 50% 100%;
}
.t-card:hover, .t-card.chosen { z-index: 2; }
@media (max-width: 680px) {
  .tarot-board { padding-left: 70px; }
  .t-card { flex-basis: 104px; height: 156px; margin-left: -56px; }
}
@keyframes tarotDeal {
  from { opacity: 0; transform: translateY(24px) scale(0.86) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.t-card.flipped {
  cursor: default;
  z-index: 3;
  transform: translateY(-10px);
  filter: drop-shadow(0 9px 10px color-mix(in srgb, var(--gold) 24%, transparent));
}
.t-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.82s cubic-bezier(0.22, 0.8, 0.25, 1);
  will-change: transform;
}
.t-card:not(.flipped):hover { transform: translateY(-10px); }
.t-card.flipped .t-inner { transform: rotateY(180deg); }
.t-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.t-back {
  background: linear-gradient(150deg, #333b64, #232948);
  border: 1.5px solid var(--border);
  color: var(--gold);
  font-size: 22px;
  text-shadow: 0 0 8px rgba(247, 227, 156, 0.5);
}
.t-front {
  transform: rotateY(180deg);
  background: var(--card-strong);
  border: 1.5px solid rgba(247, 227, 156, 0.55);
  overflow: hidden;
}
.t-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.t-front.t-rev { transform: rotateY(180deg) rotate(180deg); }

/* 카드 뒷면 — 실제 타로 카드 뒷면 느낌의 이중 테두리 (.t-face의 absolute를 덮지 않도록 position 지정 금지) */
.t-back::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(247, 227, 156, 0.35);
  border-radius: 6px;
}

/* 1단계: 질문 안내 */
.t-guide { font-size: 14px; color: #c9cfe8; line-height: 1.85; margin-bottom: 15px; }
.t-guide b { color: var(--gold); }
.chip.topic.on { color: var(--gold); border-color: var(--gold); border-style: solid; }

/* 2단계: 셔플 애니메이션 */
.shuffle-stage {
  position: relative;
  height: 170px;
  margin: 10px auto 20px;
  width: 220px;
}
.s-card {
  position: absolute;
  left: 60px;
  top: 10px;
  width: 96px;
  height: 144px;
  border-radius: 10px;
  background: linear-gradient(150deg, #333b64, #232948);
  border: 1.5px solid var(--border);
}
.s-card::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(247, 227, 156, 0.5);
}
.s-card.s1 { animation: shuf1 0.7s infinite ease-in-out; }
.s-card.s2 { animation: shuf2 0.7s infinite ease-in-out; animation-delay: 0.12s; }
.s-card.s3 { animation: shuf3 0.7s infinite ease-in-out; animation-delay: 0.24s; }
@keyframes shuf1 { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(-52px) rotate(-9deg); } }
@keyframes shuf2 { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(52px) rotate(9deg); } }
@keyframes shuf3 { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(3deg); } }

/* 3단계: 커트 더미 */
.cut-piles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 440px;
  margin: 6px auto 20px;
}
.cut-pile {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--title-font);
  font-size: 17px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: color 0.2s, transform 0.2s;
}
.cut-pile:hover { color: var(--gold); transform: translateY(-4px); }
.cut-pile .pile {
  display: block;
  width: 82px;
  height: 122px;
  border-radius: 10px;
  background: linear-gradient(150deg, #333b64, #232948);
  border: 1.5px solid var(--border);
  box-shadow: 3px 3px 0 rgba(35, 41, 72, 0.9), 6px 6px 0 rgba(29, 35, 66, 0.8);
  position: relative;
}
.cut-pile .pile::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.cut-pile:hover .pile { border-color: rgba(247, 227, 156, 0.55); }

/* 5단계: 결과 카드 (이미지 + 해석) */
.symbol-card.t-result { display: flex; gap: 16px; align-items: flex-start; }
#result.show .t-result {
  animation: tarotResultReveal 0.68s cubic-bezier(0.2, 0.78, 0.25, 1) backwards;
}
#result.show .t-result:nth-child(2) { animation-delay: 0.18s; }
#result.show .t-result:nth-child(3) { animation-delay: 0.32s; }
#result.show .t-result:nth-child(4) { animation-delay: 0.46s; }
@keyframes tarotResultReveal {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.t-thumb {
  width: 86px;
  border-radius: 8px;
  border: 1.5px solid rgba(247, 227, 156, 0.45);
  flex-shrink: 0;
}
.t-thumb.rev { transform: rotate(180deg); }
.t-result .t-info { flex: 1; min-width: 0; }
.t-result .symbol-head { flex-wrap: wrap; gap: 8px; }
.t-en { font-size: 11.5px; letter-spacing: 2px; color: var(--text-dim); margin: 2px 0 10px; }
.t-hint {
  margin-top: 9px;
  padding: 9px 12px;
  background: rgba(247, 227, 156, 0.07);
  border-left: 2px solid rgba(247, 227, 156, 0.45);
  border-radius: 0 8px 8px 0;
  color: #e2dcc4 !important;
  font-size: 13.5px !important;
}
.t-flow { margin-top: 12px !important; text-align: left; }
.t-flow b { color: var(--gold); }
@media (max-width: 500px) {
  .symbol-card.t-result { flex-direction: column; }
  .t-thumb { width: 110px; margin: 0 auto; }
}

/* ── 띠별 한 줄 운세 ── */
.zodiac-daily { margin-top: 40px; }
.z-daily-title {
  font-family: var(--title-font);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 15px;
}
.z-daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .z-daily-grid { grid-template-columns: 1fr; } }
.z-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 13px 15px;
}
.z-item .z-emoji { font-size: 22px; line-height: 1.3; }
.z-item .z-body { flex: 1; }
.z-item .z-head { display: flex; align-items: baseline; gap: 8px; }
.z-item .z-nm {
  font-family: var(--title-font);
  font-size: 17px;
  color: var(--gold);
}
.z-item .z-score { font-size: 10.5px; color: var(--gold); letter-spacing: 1.5px; opacity: 0.85; }
.z-item .z-msg { margin-top: 3px; font-size: 13px; color: #c9cfe8; line-height: 1.65; }

/* ── AI 심층 해몽 ── */
.ai-settings { margin-top: 15px; text-align: center; }
.ai-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--body-font);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1.5px dashed rgba(170, 184, 232, 0.5);
  padding-bottom: 2px;
}
.ai-toggle:hover { color: var(--gold); }
.key-panel {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background: rgba(28, 34, 62, 0.55);
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  text-align: left;
}
.key-panel.open { display: block; }
.key-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.8; margin-bottom: 11px; }
.key-panel input {
  width: 100%;
  background: rgba(20, 25, 48, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
  outline: none;
}
.key-panel input:focus { border-color: var(--gold); }
.key-actions { margin-top: 10px; display: flex; gap: 8px; }
.key-actions button {
  flex: 1;
  padding: 9px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 13px;
  cursor: pointer;
}
.key-actions button:hover { border-color: var(--gold); color: var(--gold); }
.key-status { margin-top: 9px; font-size: 12px; color: var(--good); text-align: center; }

.ai-card {
  background: var(--card-strong);
  border: 1.5px solid rgba(247, 227, 156, 0.4);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 15px;
}
.ai-card .ai-head {
  font-family: var(--title-font);
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 10px;
}
.ai-card p { color: #d8ddf3; font-size: 14.5px; line-height: 1.9; margin-bottom: 9px; }
.ai-card p:last-child { margin-bottom: 0; }
.ai-card.off { color: var(--text-dim); font-size: 13.5px; line-height: 1.85; }
.ai-card.off b { color: var(--accent); }
.ai-loading {
  color: var(--text-dim) !important;
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.ai-loading.dream-loading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  margin: 4px 0 0 !important;
  padding: 12px 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  animation: none;
}
.dream-loading::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  background: linear-gradient(100deg, transparent, var(--accent), transparent);
  opacity: 0.1;
  pointer-events: none;
  transform: translateX(-180%) skewX(-16deg);
  animation: aiShimmer 2.6s ease-in-out infinite;
}
.ai-orbit {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border);
  border-top-color: var(--gold);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: aiOrbit 2.1s linear infinite;
}
.ai-orbit::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
  animation: aiMoonPulse 1.4s ease-in-out infinite;
}
.ai-loading-text {
  position: relative;
  z-index: 1;
  color: var(--text-dim);
  animation: aiTextBreath 1.8s ease-in-out infinite;
}
#aiSection .ai-card {
  animation: aiCardReveal 0.52s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
}
@keyframes aiShimmer {
  0%, 20% { transform: translateX(-180%) skewX(-16deg); }
  75%, 100% { transform: translateX(430%) skewX(-16deg); }
}
@keyframes aiOrbit { to { transform: rotate(360deg); } }
@keyframes aiMoonPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}
@keyframes aiTextBreath {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 1; }
}
@keyframes aiCardReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 손금 보기 ── */
.palm-stage {
  position: relative;
  max-width: 340px;
  margin: 0 auto 16px;
  aspect-ratio: 3 / 4;
  border: 1.5px dashed var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(20, 25, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.palm-placeholder {
  text-align: center;
  font-size: 44px;
  color: var(--text-dim);
  line-height: 1.4;
}
.palm-placeholder span { font-size: 14px; display: block; margin-top: 6px; }
#palmPreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.palm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.palm-album {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.palm-album:hover { border-color: var(--gold); color: var(--gold); box-shadow: none; }
.palm-tip {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #8890b8;
}
@media (max-width: 560px) { .palm-buttons { grid-template-columns: 1fr; } }

/* ── 모바일 공통 보강 ── */
@media (max-width: 680px) {
  .container { padding: 40px 16px 200px; }
  h1.site-title { font-size: 34px; }
  .site .moon { font-size: 42px; }
  .subtitle { font-size: 14px; }
  .btn { font-size: 19px; padding: 14px; }
  .btn-ai { font-size: 20px; padding: 15px; }
  .input-card { padding: 20px 16px; }
  .verdict { padding: 24px 18px; }
  .verdict .label { font-size: 26px; }
  .symbol-card { padding: 18px 16px; }
  .tarot-status { font-size: 18px; }
  .z-daily-title { font-size: 21px; }
}

/* ── 광고 슬롯 ── */
.ad-slot { margin-top: 36px; }
.ad-box {
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
}
.ad-label {
  font-family: var(--title-font);
  font-size: 17px;
  color: var(--accent);
  margin-bottom: 10px;
}
.ad-content { display: flex; justify-content: center; overflow: hidden; }
.ad-content iframe { max-width: 100%; border-radius: 10px; }
.ad-disclosure {
  margin-top: 10px;
  font-size: 11px;
  color: #8890b8;
  line-height: 1.6;
}

footer {
  margin-top: 48px;
  text-align: center;
  color: #9aa2c8;
  font-size: 12.5px;
  line-height: 1.9;
}

/* ── 오늘의 타로 한 장 (홈) ── */
.daily-tarot {
  margin-top: 26px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px 26px;
  text-align: center;
  animation: fadeUp 0.7s ease 0.5s both;
}
.dt-title { font-family: var(--title-font); font-size: 22px; color: var(--gold); font-weight: 400; }
.dt-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.dt-card {
  display: block;
  position: relative; /* 바닥 그림자(::after) 기준점 */
  width: 150px;
  height: 240px;
  margin: 18px auto 0;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  padding: 0;
}
.dt-inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease; /* 누를 때 눌림 반응용 */
  transform-style: preserve-3d;
}
/* 누르는 순간 살짝 눌렸다가 — */
.dt-card:not(.flip):active .dt-inner { transform: scale(0.96) rotateY(-8deg); }
/* 들어 올려 훽 뒤집히는 리얼 플립 (translateZ로 카드가 화면 쪽으로 떠오름) */
.dt-card.flip .dt-inner { animation: dtFlip 1.15s cubic-bezier(0.3, 0.75, 0.26, 1) forwards; }
@keyframes dtFlip {
  0%   { transform: rotateY(0deg) translateZ(0) scale(1); }
  14%  { transform: rotateY(-14deg) translateZ(26px) scale(1.04); } /* 반동을 주며 집어 듦 */
  62%  { transform: rotateY(168deg) translateZ(74px) scale(1.13); } /* 공중에서 회전 */
  100% { transform: rotateY(180deg) translateZ(0) scale(1); }       /* 내려놓기 */
}
/* 카드 아래 바닥 그림자 — 떠오를 때 퍼졌다가 다시 모임 */
.dt-card::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -13px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(8, 11, 28, 0.6), transparent 70%);
  pointer-events: none;
}
.dt-card.flip::after { animation: dtShadow 1.15s ease forwards; }
@keyframes dtShadow {
  0%   { transform: scale(1); opacity: 0.9; }
  62%  { transform: scale(1.45); opacity: 0.3; }
  100% { transform: scale(1); opacity: 0.9; }
}
/* 뒤집히며 카드 면을 스치는 달빛 광택 */
.dt-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.30) 48%, transparent 64%);
  transform: translateX(-130%) skewX(-8deg);
  pointer-events: none;
}
.dt-card.flip .dt-front::after { animation: dtGlare 0.75s ease-out 0.6s forwards; }
@keyframes dtGlare { to { transform: translateX(130%) skewX(-8deg); } }
.dt-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(247, 227, 156, 0.4);
  box-shadow: 0 8px 24px rgba(10, 14, 34, 0.5);
}
.dt-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 30%, rgba(247, 227, 156, 0.16), transparent 60%),
    linear-gradient(160deg, #2c3563, #1d2344);
}
.dt-back .dt-moon { font-size: 40px; filter: drop-shadow(0 0 10px rgba(249, 232, 160, 0.5)); animation: dtGlow 2.4s ease-in-out infinite; }
@keyframes dtGlow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.dt-back .dt-tap { font-size: 12.5px; color: var(--text-dim); font-family: var(--body-font); }
.dt-front { display: block; transform: rotateY(180deg); background: #1d2344; }
.dt-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-result { display: none; margin-top: 16px; }
.dt-result.show { display: block; animation: fadeUp 0.7s ease 0.9s both; } /* 플립이 끝날 무렵 등장 */
.dt-name { font-family: var(--title-font); font-size: 21px; color: #fdf6dd; }
.dt-name small { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; display: block; margin-top: 2px; }
.dt-msg { margin-top: 8px; font-size: 14.5px; line-height: 1.75; color: var(--text); }

/* ── 궁합 보기 ── */
.select-card:nth-child(5) { animation-delay: 0.58s; }
.select-card:nth-child(5) .icon { animation-delay: 2.4s; }
.gh-second { margin-top: 14px; }
.gh-banner {
  background: var(--card-strong);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 26px 22px;
  text-align: center;
  margin-bottom: 14px;
}
.gh-pair { display: flex; justify-content: center; align-items: center; gap: 18px; }
.gh-z {
  font-size: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 0 12px rgba(249, 232, 160, 0.3));
}
.gh-z small { font-size: 12.5px; color: var(--text-dim); font-family: var(--body-font); }
.gh-heart { font-size: 30px; animation: dtGlow 2s ease-in-out infinite; }
.gh-score {
  margin-top: 14px;
  font-family: var(--title-font);
  font-size: 52px;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 24px rgba(247, 227, 156, 0.35);
}
.gh-score small { font-size: 20px; margin-left: 2px; }
.gh-grade { margin-top: 8px; font-family: var(--title-font); font-size: 22px; color: #fdf6dd; }
.gh-stars { margin-top: 6px; letter-spacing: 4px; color: var(--gold); font-size: 16px; }

/* ── 별자리 운세 ── */
.select-card:nth-child(6) { animation-delay: 0.70s; }
.select-card:nth-child(6) .icon { animation-delay: 3.0s; }
.bz-sym { font-family: var(--body-font); }
.bz-rank-badge { min-width: 34px; text-align: center; font-size: 15px; color: var(--gold); }
.z-item.bz-me {
  border-color: rgba(247, 227, 156, 0.55);
  background: rgba(247, 227, 156, 0.07);
  box-shadow: 0 0 14px rgba(247, 227, 156, 0.12);
}

/* ── 궁합 양력/음력 토글 ── */
.cal-toggle { display: flex; gap: 6px; margin-bottom: 8px; }
.cal-opt {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: rgba(28, 34, 62, 0.6);
  color: var(--text-dim);
  font-family: var(--body-font);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.cal-opt.on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(247, 227, 156, 0.08);
}
.gh-dates { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); letter-spacing: 0.5px; }

/* ── 년/월/일 드롭다운 (birth-picker) ── */
.bp-row { display: flex; gap: 8px; }
.bp-row select { flex: 1; min-width: 0; padding: 13px 8px; text-align: center; }
.bp-row .bp-y { flex: 1.35; }

/* ── 타로: 고른 카드 표시 (공개 전, 뒷면 유지) ── */
.t-card.chosen { transform: translateY(-18px); }
.t-card.chosen .t-face { border-color: rgba(247, 227, 156, 0.75); box-shadow: 0 0 16px rgba(247, 227, 156, 0.4); }

/* ── 결과 공유 버튼 ── */
.share-btn {
  display: block;
  margin: 18px auto 0;
  padding: 12px 26px;
  border: 1.5px solid rgba(247, 227, 156, 0.55);
  border-radius: 999px;
  background: rgba(247, 227, 156, 0.08);
  color: var(--gold);
  font-family: var(--title-font);
  font-size: 17px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(247, 227, 156, 0.2); }

/* ── 별똥별에 소원 빌기 (홈) ── */
.wish-box {
  margin-top: 26px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px 22px;
  text-align: center;
  animation: fadeUp 0.7s ease 0.6s both;
}
.wish-title { font-family: var(--title-font); font-size: 22px; color: var(--gold); font-weight: 400; }
.wish-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.wish-row { display: flex; gap: 8px; margin-top: 14px; }
.wish-row input {
  flex: 1;
  min-width: 0;
  background: rgba(28, 34, 62, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 14.5px;
  font-family: var(--body-font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wish-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247, 227, 156, 0.13); }
.wish-row input::placeholder { color: #8890b8; }
.wish-row button {
  padding: 0 22px;
  border: none;
  border-radius: 14px;
  font-family: var(--title-font);
  font-size: 18px;
  letter-spacing: 1px;
  color: #4a3d1e;
  background: linear-gradient(180deg, #fdedb0, #f6d98c);
  cursor: pointer;
  transition: transform 0.18s;
}
.wish-row button:hover { transform: translateY(-2px); }
.wish-done { display: none; margin-top: 12px; font-size: 13.5px; color: var(--gold); }
.wish-done.show { display: block; animation: fadeUp 0.5s ease both; }
.wish-star {
  position: fixed;
  z-index: 50;
  color: #fdf6dd;
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(249, 232, 160, 0.8), 0 0 26px rgba(249, 232, 160, 0.4);
}
.wish-open {
  display: block;
  margin: 14px auto 0;
  padding: 8px 18px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--body-font);
  font-size: 12.5px;
  cursor: pointer;
}
.wish-open:hover { color: var(--gold); border-color: var(--gold); }
.wish-list { margin-top: 12px; text-align: left; }
.wish-item {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(28, 34, 62, 0.45);
  font-size: 13.5px;
  color: var(--text);
  margin-top: 6px;
  line-height: 1.6;
}
.wish-item .wish-date { color: var(--text-dim); font-size: 11.5px; margin-right: 8px; }

/* ── 터치 별가루 · 궁합 하트 팡 · 고양이 말풍선 ── */
.sdust {
  position: fixed;
  z-index: 60;
  color: #ffe9a0;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(255, 233, 160, 0.8);
}
.gh-heart-p { position: fixed; z-index: 60; font-size: 20px; pointer-events: none; }
.gh-late { opacity: 0; transform: translateY(6px); transition: opacity 0.5s ease, transform 0.5s ease; }
.gh-late.on { opacity: 1; transform: none; }
.meow-bubble {
  position: fixed;
  z-index: 60;
  transform: translate(-50%, -100%);
  background: rgba(28, 34, 62, 0.85);
  border: 1px solid rgba(247, 227, 156, 0.5);
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--gold);
  font-family: var(--title-font);
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
  animation: meowUp 1.5s ease forwards;
}
@keyframes meowUp {
  0% { opacity: 0; margin-top: 6px; }
  15% { opacity: 1; }
  100% { opacity: 0; margin-top: -26px; }
}

/* ── 페이지 전환 디졸브 (소프트 이동) ── */
.container { transition: opacity 0.22s ease, transform 0.22s ease; }
.container.page-leave { opacity: 0; transform: translateY(10px); }
.container.page-enter { opacity: 0; transform: translateY(-10px); transition: none; }

/* ── 오로라 ── */
.aurora {
  position: fixed;
  left: -20vw;
  top: -10vh;
  width: 140vw;
  height: 44vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 52% at 28% 45%, rgba(118, 219, 189, 0.11), transparent 72%),
    radial-gradient(52% 48% at 62% 36%, rgba(151, 132, 233, 0.10), transparent 72%),
    radial-gradient(44% 42% at 84% 52%, rgba(94, 182, 235, 0.09), transparent 72%);
  animation: auroraFlow 26s ease-in-out infinite alternate;
}
@keyframes auroraFlow {
  0%   { transform: translateX(-5vw) skewX(-5deg) scaleY(1); opacity: 0.7; }
  50%  { transform: translateX(3vw) skewX(3deg) scaleY(1.12); opacity: 1; }
  100% { transform: translateX(7vw) skewX(-2deg) scaleY(0.95); opacity: 0.8; }
}

/* 움직임 최소화 사용자 — 전환·오로라 정지 */
@media (prefers-reduced-motion: reduce) {
  .container { transition: none !important; }
  .aurora { animation: none !important; }
}
