:root {
  --bg: #fff4e4;
  --ink: #2b2420;
  --muted: #7a6c5f;
  --card: #ffffff;
  --coral: #ff7f5c;
  --coral-soft: #ffe1d6;
  --sky: #cfe8ff;
  --mint: #d7f2e3;
  --lemon: #fff1b8;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
main { max-width: 480px; margin: 0 auto; padding: 28px 16px 8px; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
}
.btn {
  display: block; width: 100%;
  font: inherit; font-size: 17px; font-weight: 800;
  padding: 15px 18px; border-radius: 16px;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  background: #fff; color: var(--ink); cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--coral); color: #fff; }

/* 시작 화면 */
#start { text-align: center; }
.hero-dogs { display: flex; justify-content: center; margin-bottom: 6px; }
.hero-dogs svg { width: 118px; height: 118px; margin: 0 -14px; }
.hero-dogs svg:nth-child(2) { width: 140px; height: 140px; position: relative; z-index: 1; }
.badge {
  display: inline-block; font-size: 13px; font-weight: 800;
  padding: 5px 12px; border-radius: 999px;
  background: var(--lemon); border: 2px solid var(--ink);
}
#start h1 { margin: 12px 0 8px; font-size: 40px; font-weight: 900; letter-spacing: -0.03em; }
.lead { margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.start-card { padding: 20px; text-align: left; }
.start-card label { display: block; font-weight: 800; margin-bottom: 8px; }
.start-card input {
  width: 100%; font: inherit; font-size: 18px; font-weight: 700;
  padding: 13px 14px; margin-bottom: 14px;
  border: 2.5px solid var(--ink); border-radius: 14px; background: #fffaf3; color: var(--ink);
}
.start-card input:focus { outline: none; background: #fff; box-shadow: 0 0 0 4px var(--coral-soft); }
.fine { margin: 18px 0 0; font-size: 12px; color: var(--muted); }

/* 문항 화면 */
.quiz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.back {
  width: 40px; height: 40px; flex: none; font: inherit; font-size: 18px; font-weight: 900;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer;
}
.back:disabled { opacity: 0.3; cursor: default; }
.bar { flex: 1; height: 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--coral); transition: width 0.25s ease; }
.count { font-weight: 800; font-size: 14px; min-width: 42px; text-align: right; }
.q-card { padding: 26px 20px; text-align: center; margin-bottom: 18px; }
.q-who { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--coral); }
.q-card h2 { margin: 0; font-size: 22px; line-height: 1.45; letter-spacing: -0.02em; }
.choices { display: grid; gap: 12px; }
.choices .btn { text-align: left; font-weight: 700; font-size: 16px; line-height: 1.45; padding: 16px 18px; }
@media (hover: hover) { .choices .btn:hover { background: var(--coral-soft); } }

/* 결과 화면 */
.r-head { text-align: center; padding: 22px 18px 20px; background: var(--sky); }
.r-head .who { margin: 0; font-size: 17px; font-weight: 700; }
.r-head .code { margin: 2px 0 6px; font-size: 40px; font-weight: 900; letter-spacing: -0.02em; }
.r-head .nick { margin: 0 auto; max-width: 300px; font-size: 18px; font-weight: 800; line-height: 1.45; }
.r-head svg { width: 200px; height: 200px; display: block; margin: 4px auto 6px; }
.shared-note { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.bubble {
  position: relative; margin: 18px 6px 6px; padding: 16px 18px;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px;
  font-size: 17px; font-weight: 800; text-align: center; line-height: 1.45;
}
.bubble::before {
  content: ""; position: absolute; top: -13px; left: 50%; margin-left: -10px;
  border: 10px solid transparent; border-bottom-color: var(--ink); border-top: 0;
}
.bubble::after {
  content: ""; position: absolute; top: -8px; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-bottom-color: #fff; border-top: 0;
}

.sec { margin-top: 18px; padding: 20px; }
.sec h3 { margin: 0 0 12px; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.sec p { margin: 0; font-size: 15px; line-height: 1.7; }
.sec .sub { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }

.axes { display: grid; gap: 10px; margin-top: 16px; }
.axis { display: grid; grid-template-columns: 62px 1fr 62px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.axis span:last-child { text-align: right; }
.axis .on { color: var(--coral); font-weight: 900; }
.axis .track { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; display: flex; }
.axis .track i { background: var(--coral); }

.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acts li { display: flex; gap: 8px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--lemon); font-size: 15px; font-weight: 600; line-height: 1.5; }
.acts li .ic { width: 22px; height: 22px; margin-top: 1px; }

.likes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.likes > div { padding: 14px 12px; border-radius: 16px; border: 2.5px solid var(--ink); text-align: center; }
.likes .like { background: var(--mint); }
.likes .dislike { background: var(--coral-soft); }
.likes .face { width: 56px; height: 56px; display: block; margin: 0 auto 4px; }
.likes b { display: block; font-size: 15px; font-weight: 900; }
.likes small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.likes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.likes li { font-size: 14px; font-weight: 700; padding: 7px 8px; border-radius: 12px; background: #fff; line-height: 1.4; }

.tip { background: var(--ink); color: #fff; }
.tip h3 { color: var(--lemon); }

/* 보호자 궁합 */
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.picker .pair { display: grid; gap: 6px; }
.picker button {
  font: inherit; font-size: 18px; font-weight: 900; padding: 10px 0;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer;
}
.picker button.on { background: var(--coral); color: #fff; }
.match { margin-top: 16px; }
.match-empty { text-align: center; font-size: 14px; color: var(--muted); margin-top: 14px !important; }
.match-card { text-align: center; padding: 16px; border-radius: 16px; border: 2.5px solid var(--ink); }
.match-card span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.match-card b { display: block; font-size: 26px; font-weight: 900; margin: 4px 0 6px; letter-spacing: -0.02em; }
.match-card p { font-size: 14px; }
.lv-B { background: #dcecff; } .lv-B b { color: #2f6fd6; }
.lv-G { background: #d7f2e3; } .lv-G b { color: #1f8a57; }
.lv-L { background: #eef6d6; } .lv-L b { color: #6b8f12; }
.lv-O { background: #fff1c9; } .lv-O b { color: #b47d00; }
.lv-R { background: #efe6ff; } .lv-R b { color: #7a4fd0; }

/* 궁합 조합 설명 */
.duo { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.duo-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 10px 14px; border-radius: 18px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.duo-card.owner { background: #fff1e8; }
.duo-card.pup { background: #e9f4ff; }
.duo-card .avatar {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--coral); color: #fff; font-size: 16px; font-weight: 900; letter-spacing: 0.02em;
  border: 2.5px solid var(--ink);
}
.duo-card .mini { width: 72px; height: 72px; margin: -4px 0 -4px; }
.duo-card .role {
  margin: 8px 0 6px; padding: 2px 9px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--ink); font-size: 11px; font-weight: 800;
}
.duo-card b { font-size: 14px; line-height: 1.4; margin-bottom: 6px; letter-spacing: -0.01em; }
.duo-card p { font-size: 12.5px !important; line-height: 1.55 !important; color: var(--muted); }
.duo-x {
  position: absolute; left: 50%; top: 38px; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink);
  display: grid; place-items: center;
}
.duo-x .ic { width: 20px; height: 20px; }

.mx { margin-top: 18px; }
.mx h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 15px; font-weight: 900; }
.mx h4 em {
  font-style: normal; font-size: 11px; font-weight: 900; color: #fff;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
}
.mx.same h4 em { background: #2fb170; }
.mx.diff h4 em { background: #8a5fe0; }
.mx ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mx li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.55;
}
.mx.same li { background: #e8f7ef; }
.mx.diff li { background: #f1ebff; }
.mx .mark { width: 30px; height: 22px; flex: none; margin-top: 1px; }

.tipbox {
  display: flex; gap: 12px; align-items: center; margin-top: 18px;
  padding: 14px; border-radius: 16px; background: var(--lemon);
  border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.tipbox .ic { width: 46px; height: 46px; padding: 7px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.tipbox h4 { margin: 0 0 2px; font-size: 13px; font-weight: 900; color: #a06a00; }
.tipbox p { font-size: 14px !important; font-weight: 700; line-height: 1.55 !important; }

/* 추천 장소 */
.walk { background: #eafaf0; }
.walk .place { font-size: 20px; font-weight: 900; margin-bottom: 6px; letter-spacing: -0.02em; }

.actions { display: grid; gap: 12px; margin: 24px 0 8px; }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fine.center { text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
  padding: 11px 18px; border-radius: 999px; z-index: 10;
}

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 16px 36px; }
footer p { margin: 0 0 6px; }
footer a { color: var(--ink); font-weight: 700; }
footer p:first-child a { color: var(--coral); text-decoration: none; font-size: 14px; }
.axis .track.right { justify-content: flex-end; }

/* 아이콘 */
.ic { flex: none; }
.sec h3 { display: flex; align-items: center; gap: 8px; }
.sec h3 .ic { width: 30px; height: 30px; }
.btn .ic { width: 24px; height: 24px; vertical-align: -6px; margin-right: 6px; }
.btn.save { background: var(--lemon); }
.btn:disabled { opacity: 0.6; }
