:root {
  --bg: #fff7ee; --surface: #ffffff; --ink: #3a3340; --sub: #75697d; --line: #efe3d6;
  --accent: #6c52e0; --accent-soft: #f1edff; --danger: #d4344f;
  --paper: #fffdf9; --grid: #f6eadc;
  --yellow: #ffd54f; --yellow-deep: #efb52c; --yellow-soft: #fff1c2;
  --pink: #ff9fb5; --pink-soft: #fff0f4;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --cute: "Jua", var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); font: 16px/1.6 var(--font); }
/* 모눈 노트 같은 바탕 */
body { background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px; }
/* 한국어는 낱말 중간에서 줄이 바뀌지 않게 */
body { word-break: keep-all; overflow-wrap: break-word; }
h1 { font: 40px/1.3 var(--cute); margin: 8px 0 14px; }
.eyebrow { display: inline-block; margin: 0; padding: 4px 14px; border-radius: 99px; background: var(--yellow-soft);
  color: #c97a00; font: 16px var(--cute); }
.lead { color: var(--sub); margin: 0 0 28px; }
.fine { font-size: 13px; color: var(--sub); margin-top: 20px; }
.center { text-align: center; }

/* 머리글: 아이콘 + 제목 + 부제 */
.top { background: rgba(255, 255, 255, .92); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; max-width: 1000px; margin: 0 auto; padding: 14px 24px;
  color: inherit; text-decoration: none; }
.brand-icon { width: 64px; height: 64px; flex: none; border-radius: 18px; box-shadow: 0 4px 12px rgba(255, 140, 160, .3); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font: 26px/1.25 var(--cute); }
.brand-text small { font-size: 14px; color: var(--sub); line-height: 1.45; }

/* 무대: 장식이 흩어진 둥근 큰 카드 */
.wrap { max-width: 1000px; margin: 0 auto; padding: 28px 20px 64px; }
.stage { position: relative; overflow: hidden; padding: 56px 56px 60px; border-radius: 32px;
  background: var(--paper); border: 2px solid var(--line); box-shadow: 0 12px 32px rgba(171, 128, 96, .1); }
.stage > section { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.deco img { position: absolute; z-index: 0; filter: drop-shadow(0 4px 5px rgba(120, 90, 60, .12)); }
.deco .d1 { top: 18px; left: 22px; width: 46px; transform: rotate(-12deg); }
.deco .d2 { top: 22px; right: 20%; width: 92px; transform: rotate(8deg); }
.deco .d3 { top: 74px; right: 26px; width: 40px; transform: rotate(14deg); }
.deco .d4 { top: -8px; left: 28%; width: 30px; transform: rotate(24deg); }
.deco .d5 { bottom: 28px; left: -10px; width: 72px; transform: rotate(-10deg); }
.deco .d6 { top: 40%; left: 20px; width: 28px; }
.deco .d7 { bottom: 20px; right: 16px; width: 84px; }
.deco .d8 { top: 32%; right: 30px; width: 26px; }
.deco .d9 { bottom: 22%; right: 34px; width: 30px; transform: rotate(16deg); }
.deco .d10 { bottom: 36px; left: 34%; width: 24px; }
.deco .d11 { top: 14px; left: 46%; width: 18px; }
.deco .d12 { bottom: 32%; left: 26px; width: 24px; transform: rotate(-14deg); }

/* 버튼 */
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; padding: 0 24px;
  border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: 18px var(--cute); text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.btn.primary { width: 100%; background: var(--yellow); border-color: var(--yellow-deep); color: var(--ink);
  box-shadow: 0 5px 0 var(--yellow-deep); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--yellow-deep); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--yellow-deep); }
.btn.big { min-height: 64px; max-width: 420px; font-size: 22px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--sub); min-height: 40px; padding: 0 12px;
  font-size: 16px; }
.btn.ghost:hover { color: var(--ink); }
.btn:focus-visible, .option:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* 첫 화면 */
.hero { text-align: center; }
.hero .lead { max-width: 500px; margin: 0 auto 32px; }
.parade { display: flex; justify-content: center; gap: 4px; margin-bottom: 18px; }
.parade img { width: 92px; height: 92px; }
.bob { animation: bob 2.8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.7s); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.chips li { padding: 4px 14px; border-radius: 99px; background: var(--surface); border: 2px solid var(--line);
  font-size: 14px; color: var(--sub); }

.section-title { font: 26px/1.35 var(--cute); text-align: center; margin: 64px 0 4px; }
.section-sub { text-align: center; color: var(--sub); margin: 0 0 20px; }
.friend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; list-style: none; margin: 0; padding: 0; }
.friend { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 14px;
  border-radius: 22px; border: 2px solid var(--line); background: var(--surface); text-align: center; }
.friend img { width: 84px; height: 84px; transition: transform .2s; }
.friend:hover img { transform: rotate(-6deg) scale(1.06); }
.friend strong { font: 16px/1.35 var(--cute); word-break: keep-all; }
.friend:nth-child(1) { background: #eef7ff; } .friend:nth-child(2) { background: #f4fde6; }
.friend:nth-child(3) { background: #fff4e6; } .friend:nth-child(4) { background: #fff0f5; }
.friend:nth-child(5) { background: #f5f1ff; } .friend:nth-child(6) { background: #fff2ee; }
.friend:nth-child(7) { background: #eefaf4; } .friend:nth-child(8) { background: #fffae3; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; margin: 20px 0 0; padding: 0; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 12px; text-align: center;
  border-radius: 22px; background: var(--surface); border: 2px dashed var(--line); }
.steps img { width: 44px; height: 44px; margin-bottom: 6px; }
.steps li div { display: flex; flex-direction: column; }
.steps b { font: 18px var(--cute); font-weight: normal; }
.steps span { font-size: 14px; color: var(--sub); word-break: keep-all; }

/* 테스트 */
.progress-row { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.progress { position: relative; flex: 1; height: 16px; border-radius: 99px; background: #f6eee5; border: 2px solid var(--line); }
.progress .bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--pink));
  transition: width .3s; }
.progress .rider { position: absolute; bottom: 4px; left: 0; width: 42px; height: 42px; transform: translateX(-50%);
  transition: left .3s; pointer-events: none; }
.step { margin: 0; min-width: 64px; text-align: right; font: 20px var(--cute); }
.qhead { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; }
.buddy { width: 64px; height: 64px; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.6) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
.badge { margin: 0; padding: 8px 22px; border-radius: 99px; background: var(--yellow-soft); color: #d98200; font: 22px var(--cute); }
.note { width: fit-content; margin: 14px auto 0; padding: 4px 14px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent); font-size: 14px; font-weight: 600; }
.question { font: 28px/1.45 var(--cute); text-align: center; margin: 18px 0 32px; min-height: 82px;
  display: flex; align-items: center; justify-content: center; }
.options { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.option { min-height: 68px; padding: 14px 22px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 4px 0 var(--line); color: var(--ink); font: 19px/1.45 var(--cute); text-align: center; cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s; }
.option:hover { border-color: var(--pink); transform: translateY(-2px); }
.option.chosen { border-color: var(--pink); background: var(--pink-soft); box-shadow: 0 4px 0 #ffc9d6; }
.quiz-nav { margin-top: 20px; min-height: 40px; text-align: center; }
.error { color: var(--danger); font-size: 14px; text-align: center; }
.quiz.busy .options { opacity: .5; pointer-events: none; }

/* 결과 */
.stage > section.result { max-width: 720px; }
.result-hero { text-align: center; }
.ribbon { display: inline-block; margin: 0 0 8px; padding: 6px 18px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent); font: 17px var(--cute); }
.me { position: relative; width: 220px; height: 220px; margin: 0 auto; display: grid; place-items: center; }
.me img { position: relative; width: 180px; height: 180px; }
.burst { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0 38%, transparent 39%),
              repeating-conic-gradient(#fff1c2 0 12deg, #fffaf0 12deg 24deg);
  animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-hero h1 { margin: 6px 0 12px; }
.bubble { position: relative; display: inline-block; max-width: 460px; margin: 4px 0 0; padding: 14px 22px;
  border-radius: 22px; background: var(--surface); border: 2px solid var(--line); word-break: keep-all; }
.bubble::before { content: ""; position: absolute; top: -10px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  background: var(--surface); border: 2px solid var(--line); border-right: 0; border-bottom: 0; transform: rotate(45deg); }
.hook { margin: -6px 0 10px; font: 19px/1.45 var(--cute); color: #d98200; }
.summary { max-width: 600px; margin: 22px auto 0; line-height: 1.8; text-align: center; }

/* 축별 성향 비율 */
.axes { margin-top: 28px; padding: 22px 22px 8px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line); }
.axes-title { margin: 0 0 14px; font: 19px var(--cute); text-align: center; }
.axis { margin-bottom: 16px; }
.axis-head { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 13px; color: var(--sub); }
.axis-head b { color: var(--accent); font: 16px var(--cute); font-weight: normal; }
.axis-labels { display: flex; justify-content: space-between; font-size: 14px; color: var(--sub); }
.axis-labels .on { color: var(--ink); font-weight: 700; }
.axis-track { display: flex; height: 14px; margin: 4px 0 6px; border-radius: 99px; background: #f6eee5; overflow: hidden; }
.axis-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--pink)); }
.axis-fill.to-right { margin-left: auto; background: linear-gradient(90deg, var(--pink), var(--yellow)); }
.axis-desc { margin: 0; font-size: 13px; color: var(--sub); }

/* 이런 모습 있지 않나요? */
.traits { list-style: none; margin: 0; padding: 8px 22px; border-radius: 22px; background: var(--surface);
  border: 2px solid var(--line); }
.traits li { position: relative; padding: 12px 0 12px 34px; border-bottom: 2px dashed var(--line); }
.traits li:last-child { border-bottom: 0; }
.traits li::before { content: "✓"; position: absolute; left: 0; top: 11px; width: 24px; height: 24px; border-radius: 8px;
  background: var(--pink-soft); color: #e0607e; font-weight: 700; line-height: 24px; text-align: center; }

/* 강점 · 조심할 점 */
.sw { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.sw-box { padding: 18px 20px; border-radius: 22px; }
.sw-box.good { background: #eefaf4; }
.sw-box.care { background: #fff4e6; }
.sw-title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 18px var(--cute); }
.sw-title img { width: 26px; height: 26px; }
.sw-box ul { margin: 0; padding-left: 18px; font-size: 15px; }
.sw-box li { margin: 4px 0; }

/* 공부 꿀팁: 포스트잇 */
.tip { margin: 22px auto 0; max-width: 560px; padding: 18px 22px; background: var(--yellow-soft);
  border-radius: 4px 4px 22px 4px; box-shadow: 0 6px 14px rgba(171, 128, 96, .14); transform: rotate(-1deg); }
.tip p { margin: 0; }
.tip .tip-title { margin-bottom: 4px; font: 18px var(--cute); color: #c97a00; }

.result .section-title { margin-top: 48px; margin-bottom: 4px; }
.result .section-sub { margin-bottom: 18px; }
.cards { display: grid; gap: 14px; }
.card { position: relative; padding: 20px 18px 18px; border-radius: 22px; background: var(--surface);
  border: 2px solid var(--line); border-top: 8px solid #cfe7ff; }
.card.cat-review { border-top-color: #d9ccff; }
.card.cat-manage { border-top-color: #ffe08a; }
.card-icon { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; }
.card .cat { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.card h2 { margin: 2px 0 10px; font: 22px/1.35 var(--cute); padding-right: 30px; }
.card .alt { margin: 0; font-size: 14px; color: var(--sub); }
.card .alt b { color: var(--ink); }
.card .alt-desc { display: block; font-size: 13px; }
.why { margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--paper); border: 2px dashed var(--line); }
.why p { margin: 0; font-size: 15px; line-height: 1.75; }
.why .why-title { margin-bottom: 4px; font: 16px var(--cute); color: var(--accent); }
.card .btn.download { width: 100%; min-height: 46px; margin: 0 0 12px; font-size: 17px;
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.card .btn.download:hover { background: #e6dfff; }
.card .alt a { color: var(--accent); font-weight: 700; margin-left: 4px; white-space: nowrap; }
.download-all { max-width: 420px; margin: 26px auto 0; }
.download-msg { margin: 12px 0 0; font-size: 14px; color: var(--sub); }
.download-msg p { margin: 0 0 6px; }
.download-msg ul { margin: 0; padding-left: 18px; }
.download-msg a { color: var(--accent); font-weight: 600; }
.others { margin-top: 36px; text-align: center; }
.others .section-sub { margin-bottom: 8px; }
.others-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 10px; }
.others-row img { width: 52px; height: 52px; }
.others .btn { border-color: var(--line); background: var(--surface); color: var(--ink); padding: 0 28px; }

/* 찰떡 스터디 메이트 */
.mate { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 16px 20px; border-radius: 22px;
  background: var(--pink-soft); }
.mate img { width: 84px; height: 84px; flex: none; }
.mate p { margin: 0; font-size: 15px; }
.mate .mate-title { margin-bottom: 4px; font: 17px var(--cute); }
.mate .mate-title b { font-weight: normal; color: #e0607e; }

/* 공유 */
.share { margin-top: 28px; padding: 20px; border-radius: 22px; background: var(--accent-soft); text-align: center; }
.share-title { margin: 0 0 12px; font: 19px var(--cute); }
.share-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.share-buttons .btn { padding: 0 12px; white-space: nowrap; }
.btn.kakao { background: #fee500; border-color: #fee500; color: rgba(0, 0, 0, .85); }
.share-msg { min-height: 20px; margin: 8px 0 -6px; font-size: 14px; color: var(--accent); }

/* 패드로 보내기 (QR) */
.to-pad { margin-top: 16px; padding: 20px; border-radius: 22px; border: 2px solid var(--line);
  background: var(--surface); text-align: center; }
.to-pad-desc { margin: 0 0 14px; font-size: 14px; color: var(--sub); }
.qr { display: block; margin: 0 auto; width: 180px; height: 180px; padding: 8px; background: #fff; border-radius: 12px; }
.qr-url { margin: 10px 0 0; font-size: 12px; color: var(--sub); word-break: break-all; }

/* 태블릿 세로 */
@media (max-width: 860px) {
  .stage { padding: 44px 36px 52px; }
  .deco .d2 { right: 12%; }
  .deco .d6, .deco .d12 { display: none; }
}
/* 휴대폰 */
@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .brand { gap: 12px; padding: 10px 16px; }
  .brand-icon { width: 48px; height: 48px; border-radius: 14px; }
  .brand-text strong { font-size: 21px; }
  .brand-text small { font-size: 12px; }
  .wrap { padding: 16px 12px 40px; }
  .stage { padding: 40px 18px 44px; border-radius: 26px; }
  .deco .d4, .deco .d6, .deco .d8, .deco .d9, .deco .d10, .deco .d11, .deco .d12 { display: none; }
  .deco .d1 { width: 34px; top: 12px; left: 12px; }
  .deco .d2 { width: 70px; top: 12px; right: 18px; }
  .deco .d3 { display: none; }
  .deco .d5 { width: 54px; bottom: 10px; left: -12px; }
  .deco .d7 { width: 60px; bottom: 8px; right: 6px; }
  .parade img { width: 64px; height: 64px; }
  .btn.big { font-size: 20px; }
  .section-title { font-size: 22px; margin-top: 48px; }
  .friend-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .friend img { width: 72px; height: 72px; }
  .steps { grid-template-columns: 1fr; }
  .steps li { flex-direction: row; text-align: left; gap: 12px; padding: 12px 16px; }
  .steps img { margin: 0; width: 36px; height: 36px; flex: none; }
  .progress-row { margin-top: 18px; gap: 10px; }
  .step { font-size: 17px; min-width: 52px; }
  .qhead { margin-top: 26px; }
  .buddy { width: 52px; height: 52px; }
  .badge { font-size: 19px; padding: 6px 18px; }
  .question { font-size: 22px; min-height: 70px; margin-bottom: 24px; }
  .option { min-height: 60px; font-size: 17px; border-radius: 18px; }
  .others-row img { width: 42px; height: 42px; }
  .sw { grid-template-columns: 1fr; }
  .summary { text-align: left; }
  .axes, .traits { padding-left: 16px; padding-right: 16px; }
  .mate img { width: 64px; height: 64px; }
  .me { width: 180px; height: 180px; }
  .me img { width: 148px; height: 148px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
