:root {
  --bg: #FFF8EF;
  --ink: #1D1D1F;
  --sub: #6B6B70;
  --line: #ECE6DD;
  --c1: #FFE9D6;
  --c2: #FFB59E;
  --accent: #FF6B4A;
  --font: Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
main { 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 .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

h1 { font-size: 34px; line-height: 1.25; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.eyebrow { margin: 0; color: var(--sub); font-size: 15px; font-weight: 600; }
.lead { margin: 0 0 8px; color: var(--sub); font-size: 16px; line-height: 1.6; }
.meta, .hint { margin: 0; color: var(--sub); font-size: 13px; }
.mascot-row { font-size: 40px; letter-spacing: 4px; margin: 28px 0 8px; }
#s-landing h1 { font-size: 40px; }

.btn {
  appearance: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 700; padding: 14px 16px; border-radius: 16px;
  cursor: pointer; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.big { font-size: 19px; 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; }

/* 초대 랜딩 / 2인 결과의 두 마리 */
.duo { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 20px 0 4px; }
.blob {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px dashed #D9CFC2; font-size: 56px; font-weight: 800; color: #C9BBAA;
}
.card .blob { border: 0; background: rgba(255,255,255,.75); }
.x { font-size: 28px; color: var(--sub); font-weight: 700; }

/* 질문 */
.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(--ink); 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: var(--accent); transition: width .2s; }
.count { font-size: 14px; color: var(--sub); font-weight: 700; min-width: 44px; text-align: right; }
.question { font-size: 23px; line-height: 1.45; margin: 36px 0 18px; font-weight: 800; min-height: 3em; }
.options { display: flex; flex-direction: column; gap: 10px; }
.options .btn { text-align: left; font-weight: 600; font-size: 17px; line-height: 1.45; padding: 16px 18px; }
.options .btn.emoji { text-align: center; font-size: 32px; padding: 10px; }

/* 결과 카드 */
.card {
  background: linear-gradient(170deg, var(--c1), var(--c2)); border-radius: 28px;
  padding: 24px 20px 22px; display: flex; flex-direction: column; gap: 10px;
}
.card .eyebrow { color: rgba(29,29,31,.65); }
.emoji-big { font-size: 96px; line-height: 1.1; }
.type-name { font-size: 32px; }
.catch { margin: 0; font-size: 17px; font-weight: 700; color: var(--accent); }
.desc { margin: 0; font-size: 15px; line-height: 1.7; text-align: left; background: rgba(255,255,255,.7); padding: 14px 16px; border-radius: 16px; }
.gauge { background: rgba(255,255,255,.7); padding: 12px 16px 14px; border-radius: 16px; }
.gauge-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--sub); font-weight: 700; margin-bottom: 8px; }
.gauge-label strong { color: var(--ink); font-size: 17px; }
.gauge-track { height: 12px; background: rgba(0,0,0,.08); border-radius: 99px; overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .8s ease-out; }
.best { margin: 0; font-size: 15px; color: var(--sub); }
.best strong { 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: #fff; width: 100%; }

.badge { align-self: center; margin: 0; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }
.score { margin: 0; font-size: 64px; font-weight: 800; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.pair-types { display: flex; gap: 8px; }
.pair-types > div { flex: 1; background: rgba(255,255,255,.7); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.who { font-size: 12px; color: var(--sub); font-weight: 700; }
.pair-types strong { font-size: 15px; }
#p-after-quiz, #p-viewer { display: flex; flex-direction: column; gap: 10px; }

.disclaimer { max-width: 440px; margin: 0 auto; padding: 18px 20px 28px; text-align: center; font-size: 12px; color: var(--sub); line-height: 1.6; word-break: keep-all; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-size: 14px; font-weight: 600;
  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,.85); 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; }
}
.site-links { margin-top: 8px; }
.site-links a { color: var(--sub); text-decoration: none; font-weight: 600; }
