:root {
  --night: #1F1630;
  --night2: #43295A;
  --fg: #FFF1F5;
  --sub: #D6C2DA;
  --line: rgba(255, 241, 245, .18);
  --glass: rgba(255, 255, 255, .07);
  --lamp: #FF9EBB;
  --cream: #FFF8F6;
  --ink: #2E2030;
  --ink2: #6E5A6A;
  --accent: #E2557F;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --round: "Jua", "Pretendard Variable", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(70% 40% at 85% 6%, rgba(255, 158, 187, .18), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night2) 100%);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

main { position: relative; z-index: 1; max-width: 440px; margin: 0 auto; padding: 24px 20px 8px; min-height: calc(100dvh - 72px); }
[hidden] { display: none !important; }
.screen { display: flex; flex-direction: column; gap: 14px; text-align: center; animation: in .35s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

h1, .question, .type-name { font-family: var(--round); font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
.catch, .lead { text-wrap: balance; }
h1 { font-size: 34px; line-height: 1.3; margin: 0; }
#s-landing h1 { font-size: 42px; }
.eyebrow { margin: 0; color: var(--lamp); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.lead { margin: 0 0 8px; color: var(--sub); font-size: 16px; line-height: 1.7; }
.meta, .hint { margin: 0; color: var(--sub); font-size: 13px; }

/* 랜딩: 달빛 언덕 위에 모인 캐릭터들 */
.scene { position: relative; height: 250px; margin: 4px -20px 0; overflow: hidden; }
.scene::before {
  content: ''; position: absolute; left: 50%; top: 30px; width: 300px; height: 240px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 158, 187, .3), transparent 65%);
}
.moon {
  position: absolute; right: 22px; top: 6px; width: 40px; height: 40px; border-radius: 50%;
  box-shadow: inset -12px 6px 0 0 #FFF1C9; transform: rotate(-20deg); animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .7; } }
.hill {
  position: absolute; left: 50%; bottom: -60px; width: 460px; height: 130px; transform: translateX(-50%); z-index: 2;
  background: linear-gradient(180deg, #6A4581, #4A2E5E); border-radius: 50%;
  box-shadow: inset 0 6px 0 rgba(255, 158, 187, .35);
}
.crowd { position: absolute; inset: 0; z-index: 1; }
.crowd .art { position: absolute; width: 76px; height: 76px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }

.art { display: inline-block; flex: none; line-height: 0; }
.art svg { width: 100%; height: 100%; }
.art.big { width: 176px; height: 176px; align-self: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, #fff), transparent 70%); }
.art.mid { width: 112px; height: 112px; }
.art.mini { width: 48px; height: 48px; }
.mystery {
  display: inline-grid; place-items: center; width: 108px; height: 108px; border-radius: 50%;
  background: var(--glass); border: 2px dashed var(--line); font: 52px var(--round); color: var(--sub);
}

.btn {
  appearance: none; border: 1.5px solid var(--line); background: var(--glass); color: var(--fg);
  font: inherit; font-size: 16px; font-weight: 700; padding: 14px 16px; border-radius: 18px;
  cursor: pointer; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #FFB8CC, #FF7FA3); border: 0; color: #4A1428; box-shadow: 0 6px 0 #C24C72, 0 12px 30px -10px rgba(255, 127, 163, .8); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #C24C72; }
.btn.big { font-size: 18px; padding: 18px 16px; }
.btn.ghost { background: transparent; }
.btn.text { border: 0; background: none; color: var(--sub); font-weight: 600; text-decoration: underline; }
.row { display: flex; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.duo { display: flex; align-items: flex-start; justify-content: center; gap: 22px; margin: 18px 0 4px; }

/* 질문 */
.quiz-top { display: flex; align-items: center; gap: 10px; }
.back { border: 0; background: none; font-size: 32px; line-height: 1; padding: 0 6px; color: var(--fg); cursor: pointer; }
.back:disabled { opacity: .2; }
.progress { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#q-bar { height: 100%; width: 0; background: linear-gradient(90deg, #FFFFFF, var(--lamp)); transition: width .25s; }
.count { font-size: 14px; color: var(--sub); font-weight: 700; min-width: 44px; text-align: right; }
.question { font-size: 27px; line-height: 1.4; margin: 40px 0 20px; min-height: 2.8em; }
.options { display: flex; flex-direction: column; gap: 10px; }
.options .btn { text-align: left; font-weight: 600; font-size: 17px; line-height: 1.45; padding: 17px 18px; }
@media (hover: hover) { .options .btn:hover { border-color: var(--lamp); } }

/* 결과 카드: 크림색 카드 위 진한 글씨 */
.card {
  position: relative; border-radius: 28px; padding: 22px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent), 0 20px 50px -20px rgba(0,0,0,.6);
}
.card .eyebrow { color: color-mix(in srgb, var(--accent) 80%, #000); }
.type-name { font-size: 31px; line-height: 1.25; margin: 0; }
.catch { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink2); line-height: 1.6; }
.desc { margin: 4px 0 0; padding: 0; list-style: none; text-align: left; font-size: 15px; line-height: 1.7; display: flex; flex-direction: column; gap: 4px; }
.desc li { padding-left: 16px; position: relative; }
.desc li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.info { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.info div { padding: 12px 14px; border-radius: 16px; background: #fff; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); text-align: left; display: flex; flex-direction: column; gap: 3px; }
.info span { font-size: 12px; font-weight: 800; color: color-mix(in srgb, var(--accent) 80%, #000); letter-spacing: .04em; }
.info strong { font-size: 15px; font-weight: 600; line-height: 1.5; }
.friend { display: flex; align-items: center; gap: 12px; background: #F6E9EE; border-radius: 16px; padding: 10px 14px; text-align: left; }
.friend p { margin: 0; font-size: 13px; color: var(--ink2); display: flex; flex-direction: column; gap: 2px; }
.friend strong { font-size: 16px; color: var(--ink); }

.invite-box { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 6px; }
.nick-label { font-size: 13px; font-weight: 700; color: var(--sub); }
#nick { font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--glass); color: var(--fg); width: 100%; }
#nick::placeholder { color: rgba(214, 194, 218, .7); }

/* 우리 둘의 조합 */
.card.pair { box-shadow: 0 0 0 6px rgba(255, 158, 187, .35), 0 20px 50px -20px rgba(0,0,0,.6); }
.card.pair .eyebrow { color: #C9506E; }
.who-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 140px; }
.who { font-size: 12px; font-weight: 700; color: var(--ink2); background: #F6E9EE; padding: 3px 10px; border-radius: 99px; }
.who-col strong { font-size: 14px; line-height: 1.4; }
.badge { align-self: center; margin: 0; background: var(--night); color: var(--lamp); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }

/* 공용 "다른 테스트도 해보기"를 밤 배경에 맞춘다 */
main more-tests a { background: var(--glass); border-color: var(--line); color: var(--fg); }
main more-tests span { color: var(--sub); }

.disclaimer { position: relative; z-index: 1; max-width: 440px; margin: 0 auto; padding: 18px 20px 28px; text-align: center; font-size: 12px; color: var(--sub); line-height: 1.6; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 5;
  background: var(--fg); color: var(--night); padding: 12px 18px; border-radius: 99px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#img-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 20px; z-index: 10;
}
#img-overlay img { max-width: 100%; max-height: 72vh; border-radius: 12px; -webkit-touch-callout: default; }
#img-overlay p { color: #fff; margin: 0; font-weight: 700; }
#img-overlay .btn { max-width: 200px; }

@media (min-width: 700px) { main { padding-top: 48px; } }
@media (prefers-reduced-motion: reduce) { .moon, .crowd .art, .screen { animation: none; } }
