:root {
  --bg: #fafafa;
  --ink: #1b1b1f;
  --muted: #71717a;
  --line: #e4e4e7;
  --accent: #111114;
  --accent-soft: #ececef;
  --card: #ffffff;
  --radius: 18px;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; display: flex; flex-direction: column; word-break: keep-all; overflow-wrap: break-word; }

main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 12px;
}

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); margin: 0 0 10px; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.4; margin: 0 0 24px; letter-spacing: -0.01em; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 0 28px; }

.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }

.hero {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 28px;
}
.hero span {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); font-size: 26px; font-weight: 800;
}
.hero span:nth-child(2n) { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn {
  display: block; width: 100%; padding: 17px 20px; border-radius: 14px; border: none;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; transition: transform 0.08s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-dark { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; font-size: 15px; padding: 12px; }
.stack { display: grid; gap: 10px; }

.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 4px 0 10px; }
.progress > div { height: 100%; background: var(--accent); transition: width 0.25s ease; }
.counter { font-size: 13px; color: var(--muted); margin: 0 0 28px; }

.option {
  text-align: left; background: var(--card); border: 1.5px solid var(--line); color: var(--ink);
  font-weight: 600; line-height: 1.5; padding: 20px;
}
.option:hover { border-color: var(--ink); }

.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px; margin-bottom: 18px; text-align: center;
}
.result-avatar { display: flex; justify-content: center; margin-bottom: 8px; }
.result-code { display: inline-block; font-weight: 800; letter-spacing: 0.2em; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 8px; margin-bottom: 10px; }
.result-name { font-size: 28px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em; }
.result-summary { color: #333; line-height: 1.65; margin: 0; }

.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.section h3 { font-size: 14px; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.section p { margin: 0; line-height: 1.6; }

.axis { margin-bottom: 16px; }
.axis:last-child { margin-bottom: 0; }
.axis-labels { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 7px; }
.axis-labels em { font-style: normal; font-variant-numeric: tabular-nums; }
.axis-labels .win { color: var(--accent); font-weight: 800; }
.axis-labels .lose { color: #a1a1aa; font-weight: 500; }
.axis-bar { display: flex; gap: 3px; height: 12px; }
.axis-bar .seg { height: 100%; background: #e4e4e7; border-radius: 99px; min-width: 6px; }
.axis-bar .seg.on { background: var(--accent); }


.friend-card { border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 26px; background: var(--card); }
.friend-label { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.friend-type { margin: 0 0 6px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.mini { display: inline-flex; flex: none; }
.friend-type span { font-size: 13px; letter-spacing: 0.12em; color: var(--muted); margin-left: 4px; }
.friend-desc { margin: 0; color: var(--muted); font-size: 14px; }

.match-score { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.match-with { margin: 0 0 6px !important; color: var(--muted); font-size: 14px; }
.match-points { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px !important; }
.match-points strong { font-size: 36px; letter-spacing: -0.02em; }
.match-reasons { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.match-reasons li.good { color: var(--ink); font-weight: 600; }
.best { display: flex; align-items: center; gap: 10px; margin: 0; }
.best b { font-weight: 800; }
.best .code { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }

.prompt { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 14px; font-size: 15px; }
.copy { margin-top: 6px; }
.section .hint { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 20px 28px; line-height: 1.6; }
.footer p { margin: 0; }

.preview { position: fixed; inset: 0; background: rgba(17, 17, 20, 0.55); display: grid; place-items: center; padding: 20px; z-index: 10; }
.preview-box { background: var(--card); border-radius: var(--radius); padding: 18px; width: min(420px, 100%); max-height: 100%; overflow: auto; }
.preview-box img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 14px; }
.preview-box a.btn { text-align: center; text-decoration: none; }
