:root {
  --bg: #f6f5f2;
  --bg-2: #ffffff;
  --fg: #171717;
  --fg-2: #5b5b5b;
  --fg-3: #9a9a9a;
  --line: #e8e6e1;
  --accent: #ff6b4a;
  --accent-2: #ffb56b;
  --accent-soft: #fff0eb;
  --kakao: #fee500;
  --radius: 20px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.18);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
/* 항상 밝은 테마. 브라우저 강제 다크 모드가 글자색을 바꾸지 못하게 고정 */
:root { color-scheme: light only; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #f6f5f2; }
body {
  margin: 0; background: #f6f5f2; color: #171717; font-family: var(--font);
  line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }

.app { max-width: 480px; margin: 0 auto; padding: 0 16px 48px; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 800; font-size: 15px; text-decoration: none; display: flex; gap: 6px; align-items: center; }
.brand span { font-size: 18px; }
.main { flex: 1; display: flex; flex-direction: column; gap: 16px; animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.card.soft { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.muted { color: var(--fg-2); }
.tiny { font-size: 12px; color: var(--fg-3); }
.row { display: flex; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg);
  font-weight: 700; transition: transform .08s ease, background .15s ease, border-color .15s ease; text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; }
.btn.kakao { background: var(--kakao); color: #191919; border: none; }
.btn.ghost { background: transparent; }
.btn.sm { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* 홈 */
.hero { text-align: center; padding: 28px 0 8px; }
.hero .emoji-row { font-size: 44px; letter-spacing: 6px; margin-bottom: 10px; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hero h1 { font-size: 30px; font-weight: 900; }
.hero p { margin-top: 10px; color: var(--fg-2); }
.pill { display: inline-flex; gap: 6px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.feature { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; text-align: center; font-size: 12.5px; font-weight: 600; }
.feature b { display: block; font-size: 22px; margin-bottom: 4px; }
.invite-banner { display: flex; gap: 12px; align-items: center; }
.invite-banner .avatar { font-size: 34px; }

/* 테스트 */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.qnum { font-size: 13px; font-weight: 700; color: var(--fg-3); display: flex; justify-content: space-between; }
.question { padding: 30px 0 10px; }
.question .fu-tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; margin-bottom: 12px; }
.question h2 { font-size: 23px; font-weight: 800; word-break: keep-all; }
.question .sub { margin-top: 8px; font-size: 18px; color: var(--fg-2); font-weight: 600; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  text-align: left; padding: 16px 18px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg-2);
  font-weight: 600; line-height: 1.4; word-break: keep-all; transition: border-color .15s, background .15s, transform .08s;
}
.opt:hover { border-color: var(--fg-3); }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); transform: scale(.99); }
.interlude { text-align: center; padding: 36px 0; }
.interlude .big { font-size: 52px; margin-bottom: 8px; }
.interlude h2 { font-size: 22px; }
.loading { text-align: center; padding: 60px 0; }
.loading .ring { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 결과 */
.result-hero { text-align: center; padding: 10px 0 0; }
.result-hero .big-emoji { font-size: 64px; line-height: 1; margin: 6px 0 8px; animation: pop .6s cubic-bezier(.2,1.4,.3,1) both; }
.result-hero .code { font-size: 56px; font-weight: 900; letter-spacing: .06em; line-height: 1; margin: 4px 0 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-hero .chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; padding: 6px 11px; border-radius: 99px; background: var(--bg-2); border: 1.5px solid var(--line); }
.chip.accent { border-color: var(--accent); color: var(--accent); }
.chip.fill { color: #fff; border-color: transparent; }
.brand small { font-weight: 600; color: var(--fg-3); font-size: 12px; }
.attach-head { display: flex; gap: 12px; align-items: center; }
.attach-head .e { font-size: 40px; }
.attach-head h3 { font-size: 19px; }
.attach-head p { font-size: 13px; color: var(--fg-2); }
.tip { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; word-break: keep-all; }
.box-item { display: flex; gap: 10px; align-items: center; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.box-item .e { font-size: 28px; }
.box-item .t { flex: 1; min-width: 0; }
.box-item .t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box-item .t small { color: var(--fg-3); font-size: 12px; }
.box-item .x { background: none; border: none; color: var(--fg-3); font-size: 18px; padding: 4px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.result-hero .type { display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .14em; color: #fff; padding: 5px 12px; border-radius: 99px; }
.result-hero h1 { font-size: 27px; font-weight: 900; margin-top: 12px; word-break: keep-all; }
.rank { display: flex; flex-direction: column; gap: 12px; }
.rank .r { font-size: 13.5px; }
.rank .r .top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 5px; }
.rank .r .top b { color: var(--accent); }
.rank .track { position: relative; height: 10px; border-radius: 99px; background: var(--line); }
.rank .track .avg { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--fg-3); transform: translateX(-50%); }
.rank .track .me { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-2); transform: translate(-50%, -50%); }
.rank .track .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); opacity: .35; }
.result-hero .tagline { color: var(--fg-2); margin-top: 6px; }
.result-hero .nick { margin-top: 14px; font-size: 14px; color: var(--fg-3); }
.desc { font-size: 15.5px; word-break: keep-all; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.trait { font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.trait.bad { background: var(--line); color: var(--fg-2); }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; word-break: keep-all; }
.list li::before { content: "·"; color: var(--accent); font-weight: 900; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar { font-size: 13px; font-weight: 700; }
.bar .labels { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bar .labels .win { color: var(--accent); }
.bar .track { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; }
.bar .track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar .track i.neg { background: var(--fg-3); margin-left: auto; }

.radar { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.radar .grid { fill: none; stroke: var(--line); }
.radar .axis { stroke: var(--line); }
.radar .shape { fill: rgba(255,107,74,.25); stroke: var(--accent); stroke-width: 2; }
.radar .shape.b { fill: rgba(79,134,198,.22); stroke: #4F86C6; }
.radar text { font-size: 11px; font-weight: 700; fill: var(--fg-2); }
.radar text.val { fill: var(--accent); font-size: 10px; }

.timeline { display: block; width: 100%; height: 150px; }
.timeline .mid { stroke: var(--line); stroke-dasharray: 3 3; }
.timeline path { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.timeline text { font-size: 10px; fill: var(--fg-3); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; font-weight: 700; color: var(--fg-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.why { display: flex; flex-direction: column; gap: 14px; }
.why .ax { border-left: 3px solid var(--accent); padding-left: 12px; }
.why .ax h3 { font-size: 15px; }
.why .ax h3 b { color: var(--accent); }
.why q { display: block; margin-top: 6px; font-size: 14px; color: var(--fg-2); word-break: keep-all; quotes: none; }
.why q b { color: var(--fg); }
.why .counter { margin-top: 6px; font-size: 13.5px; color: var(--fg-2); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.insight { background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px dashed var(--accent); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; word-break: keep-all; }

/* 잠금(보상형 광고) */
.locked { position: relative; }
.locked .blur { filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.locked .gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.locked .gate .box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); max-width: 300px; }
.locked .gate h3 { font-size: 16px; }
.locked .gate p { font-size: 13px; color: var(--fg-2); margin: 6px 0 12px; }

/* 광고 슬롯 */
.ad { border: 1px dashed var(--line); border-radius: 14px; min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--fg-3); font-size: 12px; background: var(--bg-2); overflow: hidden; }
.ad .label { position: absolute; }
.ad-wrap { position: relative; }
.ad-wrap .tag { position: absolute; top: 6px; left: 10px; font-size: 10px; color: var(--fg-3); }

/* 모달 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; animation: fade .2s; }
.modal .sheet { background: var(--bg-2); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 22px 20px 30px; }
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal .ad { min-height: 250px; margin: 14px 0; }
.countdown { font-weight: 800; color: var(--accent); }
input[type=text] { width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); font-family: inherit; font-size: 16px; }
input[type=text]:focus { outline: none; border-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--fg-2); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 700; z-index: 60; animation: fade .2s; }

/* 궁합 */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.vs .who { background: var(--bg); border-radius: 16px; padding: 14px 8px; }
.vs .who .e { font-size: 40px; }
.vs .who b { display: block; font-size: 13px; margin-top: 4px; word-break: keep-all; }
.vs .who small { color: var(--fg-3); font-size: 12px; }
.vs .heart { font-size: 22px; }
.score-ring { text-align: center; padding: 6px 0; }
.score-ring .n { font-size: 56px; font-weight: 900; letter-spacing: -0.04em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.score-ring .t { font-weight: 800; margin-top: 4px; }
.pair-bars .bar .track { position: relative; background: var(--line); }
.pair-bars .dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--bg-2); }
.pair-bars .dot.a { background: var(--accent); }
.pair-bars .dot.b { background: #4F86C6; }
.cmp { display: flex; flex-direction: column; gap: 10px; }
.cmp .item { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; word-break: keep-all; }
.cmp .item .q { font-size: 12px; color: var(--fg-3); margin-bottom: 3px; }
.cmp .item .ab { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.cmp .item .ab span { background: var(--bg-2); border-radius: 8px; padding: 6px 8px; font-size: 13px; }

/* 귀인 지도 */
.map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.map .cell { background: var(--bg); border-radius: 12px; padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 700; color: var(--fg-2); }
.map .cell .e { font-size: 20px; display: block; }
.map .cell.best { background: var(--accent-soft); color: var(--accent); outline: 2px solid var(--accent); }
.map .cell.me { outline: 2px solid var(--fg); }
.map .cell small { display: block; font-weight: 600; color: var(--fg-3); }

footer { text-align: center; font-size: 12px; color: var(--fg-3); padding-top: 24px; }
footer a { color: inherit; }
