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

:root {
  --navy: #0d1638;
  --navy-deep: #050a1c;
  --gold: #ffd98a;
  --gold-soft: #f7d99a;
  --text: #ffffff;
  --text-dim: #cdd8ff;
  --line: rgba(247, 217, 154, .28);
}

html, body {
  min-height: 100%;
  background: var(--navy-deep);
  color: var(--text);
  font-family: "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overscroll-behavior-y: none;
}

/* ── 배경 ── */
#sky, #stars, #glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
#sky { background: radial-gradient(130% 75% at 50% 8%, #2a4a92 0%, #1a2c5c 32%, #0d1638 64%, #050a1c 100%); }
#stars {
  opacity: .9;
  background-image:
    radial-gradient(2px 2px at 12% 8%, #fff 40%, transparent 60%),
    radial-gradient(2.5px 2.5px at 78% 12%, #ffe9b8 40%, transparent 60%),
    radial-gradient(2px 2px at 40% 22%, #fff4d8 40%, transparent 60%),
    radial-gradient(3px 3px at 88% 30%, #ffdca0 40%, transparent 60%),
    radial-gradient(2px 2px at 20% 44%, #fff 40%, transparent 60%),
    radial-gradient(2.5px 2.5px at 62% 52%, #ffe9b8 40%, transparent 60%),
    radial-gradient(2px 2px at 8% 66%, #fff4d8 40%, transparent 60%),
    radial-gradient(3px 3px at 84% 72%, #ffdca0 40%, transparent 60%),
    radial-gradient(2px 2px at 46% 84%, #fff 40%, transparent 60%),
    radial-gradient(2.5px 2.5px at 26% 94%, #ffe9b8 40%, transparent 60%);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45 } to { opacity: 1 } }
#glow {
  background:
    radial-gradient(60% 40% at 50% 18%, rgba(120,170,255,.22), transparent 70%),
    radial-gradient(50% 35% at 80% 70%, rgba(255,205,150,.16), transparent 70%),
    radial-gradient(55% 40% at 15% 85%, rgba(160,120,255,.16), transparent 70%);
}

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 20px 60px; }

/* ── 화면 전환 ── */
.screen { display: none; padding-top: 28px; animation: fade .45s ease both; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

/* ── 홈 ── */
.brand { text-align: center; padding: 44px 0 34px; }
.brand-mark { font-size: 52px; line-height: 1; filter: drop-shadow(0 0 24px rgba(255,217,138,.6)); }
.brand h1 {
  margin-top: 18px;
  font-family: "Noto Serif KR", serif; font-weight: 900; font-size: 40px; line-height: 1.28;
  text-shadow: 0 4px 26px rgba(0,0,0,.6), 0 0 40px rgba(150,190,255,.35);
}
.brand-sub { margin-top: 14px; color: var(--gold); font-size: 16px; letter-spacing: .04em; }

.topics { display: grid; gap: 13px; margin-top: 12px; }
.topic {
  display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 2px 12px;
  padding: 18px 20px; text-align: left; cursor: pointer;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line); border-radius: 18px;
  color: var(--text); font-family: inherit;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.topic:active { transform: scale(.975); background: rgba(255,255,255,.1); border-color: var(--gold); }
.t-icon { grid-row: 1 / 3; font-size: 30px; text-align: center; }
.t-name { font-size: 19px; font-weight: 900; }
.t-desc { font-size: 14px; color: var(--text-dim); font-weight: 500; }

/* ── 버튼 ── */
.main-btn, .ghost-btn {
  width: 100%; padding: 17px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 900;
  transition: transform .15s ease, opacity .15s ease;
}
.main-btn { border: none; background: linear-gradient(180deg, #fff0c4, #e8b95c); color: #16224a; box-shadow: 0 10px 30px rgba(255,217,138,.3); }
.ghost-btn { margin-top: 12px; background: transparent; border: 1px solid var(--line); color: var(--text-dim); font-weight: 700; font-size: 15px; }
.main-btn:active, .ghost-btn:active { transform: scale(.97); }

.back-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; padding: 6px 0;
}

/* ── 카드 고르기 ── */
.ask {
  margin-top: 26px; text-align: center;
  font-family: "Noto Serif KR", serif; font-size: 27px; font-weight: 900; line-height: 1.45;
}
.ask em { font-style: normal; color: var(--gold); }
.ask-sub { margin-top: 10px; text-align: center; color: var(--gold); font-size: 15px; font-weight: 700; }

.deck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 34px; }
.slot { cursor: pointer; text-align: center; }
.slot .num { font-family: "Noto Serif KR", serif; font-size: 20px; font-weight: 900; color: var(--gold); margin-bottom: 8px; }
.slot .back {
  width: 100%; aspect-ratio: 2 / 3; border-radius: 10px;
  background-image: url("cards/love-back-01.jpg"); background-size: cover; background-position: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.6), 0 0 0 1.5px rgba(247,217,154,.5);
  animation: float 3s ease-in-out infinite alternate;
  transition: transform .2s ease, box-shadow .2s ease;
}
.slot:nth-child(2) .back { animation-delay: .4s }
.slot:nth-child(3) .back { animation-delay: .8s }
.slot:nth-child(4) .back { animation-delay: 1.2s }
@keyframes float { from { transform: translateY(0) } to { transform: translateY(-9px) } }
.slot:active .back { transform: scale(.94); box-shadow: 0 0 0 2px var(--gold), 0 0 34px rgba(255,217,138,.6); }

.hint { margin-top: 34px; text-align: center; color: var(--text-dim); font-size: 14px; }

/* ── 결과 ── */
.reveal { text-align: center; margin-top: 18px; }
.r-topic {
  display: inline-block; padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(180deg, #fff0c4, #e8b95c); color: #16224a;
  font-size: 14px; font-weight: 900;
}
.r-card {
  display: block; width: 68%; max-width: 260px; margin: 22px auto 0; border-radius: 16px;
  box-shadow: 0 22px 54px rgba(0,0,0,.75), 0 0 0 2px rgba(247,217,154,.55), 0 0 60px rgba(140,180,255,.35);
  animation: pop .6s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.7) rotateY(-30deg) } to { opacity: 1; transform: none } }
.r-name { margin-top: 20px; font-family: "Noto Serif KR", serif; font-size: 30px; font-weight: 900; }
.r-en { color: var(--text-dim); font-size: 14px; font-style: italic; margin-top: 2px; }
.r-key { margin-top: 10px; color: var(--gold); font-size: 16px; font-weight: 700; }

.oneline {
  margin: 26px 0 6px; padding: 20px 22px; border-radius: 16px;
  background: rgba(255,217,138,.1); border: 1px solid var(--line);
  font-family: "Noto Serif KR", serif; font-size: 19px; font-weight: 700; line-height: 1.6; text-align: center;
}

.blocks { margin-top: 8px; }
.block { margin-top: 16px; padding: 20px 22px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); }
.block h3 { font-size: 15px; font-weight: 900; color: var(--gold); letter-spacing: .03em; }
.block p { margin-top: 9px; font-size: 16px; line-height: 1.75; color: #f2f5ff; }

.actions { margin-top: 30px; }
.foot-note { margin-top: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ── 기록 ── */
.page-title { margin-top: 22px; font-family: "Noto Serif KR", serif; font-size: 28px; font-weight: 900; }
.h-item { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); }
.h-item img { width: 54px; border-radius: 7px; flex: none; }
.h-date { font-size: 13px; color: var(--text-dim); }
.h-name { font-size: 17px; font-weight: 900; margin-top: 2px; }
.h-topic { font-size: 13px; color: var(--gold); }
.empty { margin-top: 40px; text-align: center; color: var(--text-dim); }

@media (max-width: 380px) {
  .brand h1 { font-size: 34px }
  .ask { font-size: 23px }
  .deck { gap: 7px }
}


/* ── 배경음악 버튼 ── */
#music-btn {
  position: fixed; top: 14px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.09); border: 1px solid var(--line);
  color: var(--gold); font-size: 19px; line-height: 1;
  backdrop-filter: blur(6px);
}
#music-btn:active { transform: scale(.92); }

/* ── 오늘의 아이템 ── */
.item-box {
  margin-top: 26px; padding: 20px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,217,138,.13), rgba(255,217,138,.05));
  border: 1px solid var(--line);
}
.item-head { font-size: 15px; font-weight: 900; color: var(--gold); }
.item-link {
  display: block; margin-top: 14px; padding: 16px 18px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  text-decoration: none; color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}
.item-link:active { transform: scale(.98); border-color: var(--gold); }
.item-title { display: block; font-size: 18px; font-weight: 900; }
.item-desc { display: block; margin-top: 6px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.item-go { display: block; margin-top: 12px; font-size: 14px; font-weight: 900; color: var(--gold); }
.item-notice { margin-top: 12px; font-size: 11px; line-height: 1.55; color: #9aa6cc; }

/* 영상 안 보고 프로필 링크로 그냥 들어온 사람용 */
.skip-btn{
  display:block; margin:18px auto 0; padding:11px 20px;
  background:transparent; color:#c9bde8;
  border:1px solid rgba(200,170,255,.35); border-radius:999px;
  font-size:14px; cursor:pointer;
}
