/* A안 「내 이상형은 몇 명?」 */
:root {
  --bg: #fff4f6;
  --card: #ffffff;
  --ink: #2b1420;
  --muted: #8b6a78;
  --line: #f3d3dc;
  --soft: #ffe7ee;
  --accent: #ff4f7e;
  --accent2: #ff8a5b;
  --on-accent: #ffffff;
  --good: #1f9d6a;
  --bad: #e5484d;
  --track: #f6d5de;
  --shadow: 0 14px 34px -20px rgba(190, 40, 90, 0.45);
  --focus: #ff4f7e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1017;
    --card: #2a1820;
    --ink: #fdeef3;
    --muted: #c9a3b3;
    --line: #4a2a38;
    --soft: #3a2230;
    --track: #4a2a38;
    --shadow: 0 14px 34px -20px rgba(0, 0, 0, 0.7);
  }
}

.top .brand .heart { font-size: 20px; }

/* ---------- 첫 화면 ---------- */
.hero { padding: 18px 0 6px; text-align: center; }
.hero h1 { margin: 8px 0 10px; font-size: clamp(28px, 8.4vw, 36px); line-height: 1.22; letter-spacing: -0.03em; font-weight: 900; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
.shared-banner { margin: 10px 0 4px; padding: 14px 16px; border-radius: 18px; background: var(--soft); font-size: 15px; font-weight: 700; text-align: center; }
.shared-banner b { color: var(--accent); }

.demo { margin: 18px 0 16px; padding: 22px 18px 18px; border-radius: 26px; background: linear-gradient(160deg, #ff5f8a, #ff9a6b); color: #fff; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.demo::after { content: "💗"; position: absolute; right: -10px; top: -14px; font-size: 90px; opacity: 0.16; transform: rotate(18deg); }
.demo .lbl { font-size: 13px; font-weight: 800; opacity: 0.85; letter-spacing: 0.02em; }
.demo .num { margin: 6px 0 2px; font-size: clamp(40px, 13vw, 54px); font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.demo .sub { font-size: 14px; font-weight: 700; opacity: 0.9; min-height: 21px; }
.demo .dchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; min-height: 30px; }
.demo .dchips span { background: rgba(255, 255, 255, 0.22); padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; animation: pop 0.35s ease both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cta-note { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.count-note { text-align: center; font-size: 14px; font-weight: 800; color: var(--accent); margin: 12px 0 0; }

/* ---------- 단계 ---------- */
.stepbar { display: flex; align-items: center; gap: 10px; height: 56px; }
.stepbar .back { border: 0; background: none; font-weight: 800; min-height: 44px; padding: 0 6px; color: var(--ink); }
.progress { flex: 1; height: 8px; border-radius: 8px; background: var(--track); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 8px; transition: width 0.3s ease; }
.stepno { font-size: 13px; font-weight: 800; color: var(--muted); min-width: 34px; text-align: right; }

.counter { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 6px 16px 10px; background: var(--bg); }
.counter .box { border-radius: 20px; padding: 10px 16px 12px; background: linear-gradient(160deg, #ff5f8a, #ff9a6b); color: #fff; text-align: center; box-shadow: var(--shadow); transition: background 0.3s; }
.counter .box.zero { background: linear-gradient(160deg, #8f2d4a, #5a1f3a); }
.counter .k { font-size: 12px; font-weight: 800; opacity: 0.9; }
.counter .v { font-size: clamp(30px, 10vw, 40px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.counter .s { font-size: 13px; font-weight: 700; opacity: 0.92; }

.q { margin: 14px 0 4px; font-size: 23px; line-height: 1.3; letter-spacing: -0.02em; font-weight: 900; }
.qhint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { min-height: 84px; border-radius: 20px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 16px; }
.tile b { font-size: 30px; line-height: 1; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { min-height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 16px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.25; }
.opt small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.opt[aria-pressed="true"] small { color: var(--accent); }
.step-actions { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 30%); margin-top: 18px; }

/* 범위 슬라이더(두 손잡이) */
.dual { position: relative; height: 52px; margin: 6px 6px 0; }
.dual .rail { position: absolute; left: 0; right: 0; top: 22px; height: 8px; border-radius: 8px; background: var(--track); }
.dual .fill { position: absolute; top: 22px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.dual input { position: absolute; left: 0; top: 4px; width: 100%; pointer-events: none; --track: transparent; }
.dual input::-webkit-slider-thumb { pointer-events: auto; position: relative; z-index: 2; }
.dual input::-moz-range-thumb { pointer-events: auto; }
.dual-val { text-align: center; font-size: 28px; font-weight: 900; letter-spacing: -0.03em; margin: 4px 0 0; }
.dual-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; margin: 0 6px; }
.pass-note { text-align: center; font-size: 14px; color: var(--muted); font-weight: 700; margin: 8px 0 0; min-height: 21px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.presets .chip { min-height: 36px; font-size: 13px; padding: 0 12px; }
.sel { width: 100%; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); padding: 0 14px; font-weight: 700; font-size: 16px; }
.region-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.region-grid .opt { min-height: 48px; font-size: 15px; padding: 4px; }
.region-grid .opt.wide { grid-column: span 2; }
.narrow { margin-top: 8px; }

/* 계산 연출 */
.calc { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.calc .spin { font-size: 64px; animation: beat 0.9s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.calc p { margin: 0; font-weight: 800; font-size: 18px; }
.calc small { color: var(--muted); font-weight: 700; }

/* ---------- 결과 ---------- */
.rhero { margin-top: 6px; padding: 26px 18px 22px; border-radius: 28px; background: linear-gradient(160deg, #ff5f8a, #ff9a6b); color: #fff; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.rhero::before { content: "💗"; position: absolute; left: -16px; bottom: -26px; font-size: 110px; opacity: 0.14; transform: rotate(-16deg); }
.rhero .k { font-size: 15px; font-weight: 800; opacity: 0.92; }
.rhero .big { margin: 4px 0 8px; font-size: clamp(40px, 13vw, 56px); font-weight: 900; letter-spacing: -0.045em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.24); font-weight: 900; font-size: 18px; }
.badge b { font-size: 22px; }
.rhero .line { margin: 10px 0 0; font-size: 15px; font-weight: 700; opacity: 0.95; }
.rhero .facts { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rhero .facts div { background: rgba(255, 255, 255, 0.18); border-radius: 16px; padding: 10px 8px; font-size: 13px; font-weight: 700; line-height: 1.35; }
.rhero .facts b { display: block; font-size: 20px; font-weight: 900; }
.rhero .facts .one { grid-column: span 2; }
.est { margin: 10px 2px 0; font-size: 12px; color: var(--muted); text-align: center; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; justify-content: center; }
.rchips span { background: var(--soft); color: var(--ink); padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; }

.funnel { display: grid; gap: 10px; }
.fn { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.fn .l { font-weight: 800; font-size: 14px; }
.fn .n { font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; }
.fn .bar { grid-column: span 2; height: 10px; border-radius: 10px; background: var(--track); overflow: hidden; }
.fn .bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent), var(--accent2)); min-width: 3px; transition: width 0.5s ease; }
.fn .p { grid-column: span 2; font-size: 12px; color: var(--muted); font-weight: 700; }
.fn.wall .l::after { content: "가장 큰 벽"; margin-left: 6px; font-size: 11px; color: #fff; background: var(--bad); padding: 2px 7px; border-radius: 99px; vertical-align: 2px; }
.wall-line { margin: 12px 0 0; font-size: 15px; font-weight: 700; }
.wall-line b { color: var(--accent); }
.relax { display: grid; gap: 8px; margin-top: 12px; }
.relax .btn { justify-content: space-between; min-height: 54px; background: var(--soft); color: var(--ink); font-size: 15px; }
.relax .btn em { font-style: normal; color: var(--accent); font-weight: 900; }

.edit-grid { display: grid; gap: 16px; }
.edit-grid label.t { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.edit-grid .chips { gap: 6px; }
.edit-grid .chip { min-height: 40px; font-size: 14px; padding: 0 12px; }
.crowd-big { font-size: 18px; font-weight: 800; margin: 0; }
.crowd-big b { color: var(--accent); font-size: 24px; }
.toplist { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.toplist li { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.toplist li b { color: var(--accent); }

.send { margin-top: 12px; }
.send .btn { width: 100%; min-height: 58px; font-size: 17px; }
.send p { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.ending { text-align: center; margin: 22px 0 0; font-weight: 800; font-size: 16px; }
.again { display: grid; gap: 8px; margin-top: 14px; }

/* 시트 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 8, 14, 0.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: 480px; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: up 0.25s ease; max-height: 90dvh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.sheet h3 { margin: 0 0 6px; font-size: 20px; }
.sheet p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.inp { width: 100%; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 16px; font-weight: 700; }

/* ---------- 조건표(받은 사람) ---------- */
.letter { margin-top: 8px; padding: 22px 18px; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); border: 2px dashed var(--line); text-align: center; }
.letter .from { font-size: 14px; font-weight: 800; color: var(--accent); }
.letter h2 { margin: 6px 0 12px; font-size: 22px; line-height: 1.3; letter-spacing: -0.02em; }
.letter .rchips { margin-top: 0; }
.form-grid { display: grid; gap: 18px; margin-top: 16px; }
.form-grid .t { display: block; font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.form-grid .chips { gap: 6px; }
.form-grid .chip { min-height: 42px; font-size: 14px; padding: 0 13px; }
.form-grid .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.verdict { text-align: center; padding: 26px 18px; border-radius: 28px; background: linear-gradient(160deg, #ff5f8a, #ff9a6b); color: #fff; box-shadow: var(--shadow); }
.verdict .big { font-size: clamp(36px, 11vw, 48px); font-weight: 900; letter-spacing: -0.04em; margin: 4px 0; }
.verdict p { margin: 6px 0 0; font-weight: 800; }
.checks { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.checks li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); font-weight: 800; font-size: 15px; box-shadow: var(--shadow); }
.checks li span:last-child { font-size: 20px; }
.privacy-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 공유 이미지 (1080×1350, 화면 밖) ---------- */
.shot { width: 1080px; height: 1350px; padding: 90px 84px; background: linear-gradient(160deg, #ff5f8a 0%, #ff7a73 55%, #ffa067 100%); color: #fff; font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif; display: flex; flex-direction: column; position: relative; overflow: hidden; word-break: keep-all; }
.shot .hearts { position: absolute; right: -60px; top: -40px; font-size: 360px; opacity: 0.13; transform: rotate(16deg); line-height: 1; }
.shot .brand { font-size: 38px; font-weight: 900; display: flex; justify-content: space-between; opacity: 0.95; }
.shot .brand span:last-child { font-weight: 700; opacity: 0.85; font-size: 32px; }
.shot .k { margin-top: 120px; font-size: 58px; font-weight: 800; }
.shot .num { margin-top: 10px; font-size: 168px; font-weight: 900; letter-spacing: -0.05em; line-height: 1.02; }
.shot .num.long { font-size: 136px; }
.shot .tier { margin-top: 34px; align-self: flex-start; display: inline-flex; gap: 18px; align-items: center; background: rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 18px 36px; font-size: 54px; font-weight: 900; }
.shot .chips2 { margin-top: 46px; display: flex; flex-wrap: wrap; gap: 14px; }
.shot .chips2 span { background: rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 12px 26px; font-size: 36px; font-weight: 800; }
.shot .facts2 { margin-top: auto; font-size: 40px; font-weight: 800; line-height: 1.45; }
.shot .facts2 b { font-weight: 900; }
.shot .foot2 { margin-top: 40px; padding-top: 34px; border-top: 3px solid rgba(255, 255, 255, 0.35); display: flex; justify-content: space-between; align-items: center; font-size: 38px; font-weight: 900; }
.shot .foot2 span:last-child { font-weight: 700; font-size: 32px; opacity: 0.9; }

/* 2단계 이후 추가 */
.sub-q { margin: 16px 0 6px; font-size: 16px; font-weight: 900; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sub-q .muted { font-size: 15px; font-weight: 800; }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--muted); min-height: 32px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.step-actions .skip { margin-top: 8px; min-height: 46px; font-size: 15px; }
.share .btn b svg { display: block; }
