@font-face { font-family: 'Jua'; src: url('/assets/fonts/jua.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Gowun Dodum'; src: url('/assets/fonts/gowun-dodum.woff2') format('woff2'); font-display: swap; }

:root {
  --paper: #FBF7F0;
  --card: #FFFFFF;
  --ink: #2A2833;
  --muted: #5E5A66;
  --deep: #B8475F;
  --deep-ink: #8E2F45;
  --pink: #F4C7D0;
  --blue: #BFD9F2;
  --yellow: #F7E4A6;
  --green: #CFE6C8;
  --lilac: #DCD3F0;
  --agree: #B8475F;
  --disagree: #3F6E9E;
  --neutral: #7A7482;
  --radius: 18px;
  --display: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--deep); }
a:hover { color: var(--deep-ink); }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 2px; border-radius: 8px; }

.wrap {
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--display); font-size: 18px; color: var(--ink); text-decoration: none; }
.tiny { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.display { font-family: var(--display); font-weight: 400; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1.2; }
h1 { font-size: 40px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.grow { flex-grow: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); font-size: 13px; font-weight: 700;
}
.pill.yellow { background: var(--yellow); }
.pill.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.card.dashed { border-style: dashed; }
.card.green { background: var(--green); }
.card.yellow { background: var(--yellow); }
.card.pink { background: var(--pink); }
.shadow { box-shadow: 5px 5px 0 var(--ink); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: 16px;
  background: var(--card); font-size: 16px; cursor: pointer; text-decoration: none; color: var(--ink);
  text-align: center;
}
.btn:hover { background: #F5F0E6; color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); font-family: var(--display); font-size: 21px; min-height: 60px; box-shadow: 4px 4px 0 var(--deep); }
.btn.primary:hover { background: #3A3745; color: var(--paper); }
.btn.pink { background: var(--pink); font-family: var(--display); font-size: 18px; }
.btn.yellow { background: var(--yellow); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.linkbtn { background: none; border: none; padding: 8px; font-size: 15px; color: var(--deep); text-decoration: underline; cursor: pointer; align-self: center; min-height: 44px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); flex-shrink: 0; }

.avatar {
  border-radius: 50%; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--display); line-height: 1; color: var(--ink);
}

.notice { padding: 12px 14px; border: 2px dashed var(--ink); border-radius: 14px; background: var(--card); font-size: 14px; }

/* quiz */
.qtop { display: flex; align-items: center; gap: 12px; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--ink); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.iconbtn[disabled] { opacity: .35; cursor: default; }
.progress { flex-grow: 1; height: 14px; border-radius: 7px; border: 2px solid var(--ink); background: var(--card); overflow: hidden; }
.progress > div { height: 100%; background: var(--pink); transition: width .25s ease; }
.counter { font-weight: 700; min-width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.qbody { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; min-height: 240px; }
.qtext { font-family: var(--display); font-size: 27px; line-height: 1.45; }
.scale { background: var(--card); border: 2px solid var(--ink); border-radius: 20px; padding: 16px 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.scale-row { display: flex; justify-content: space-between; align-items: center; }
.opt { width: 44px; height: 48px; padding: 0; border: none; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.opt span { display: block; border-radius: 50%; border: 2.5px solid var(--c); background: var(--card); transition: transform .12s ease, background .12s ease; }
.opt:hover span { transform: scale(1.08); }
.opt[aria-pressed="true"] span { background: var(--c); }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 6px; }
.toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); transform: translateX(-50%); pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-family: var(--display); font-size: 17px;
  box-shadow: 4px 4px 0 var(--deep); max-width: calc(100% - 32px); text-align: center; z-index: 10;
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* result */
.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px 20px; border: 2px solid var(--ink); border-radius: 24px; box-shadow: 5px 5px 0 var(--ink); text-align: center; }
.hero .name { font-family: var(--display); font-size: 40px; line-height: 1.1; }
.hero .headline { font-size: 17px; line-height: 1.5; }
.code { letter-spacing: 2px; font-weight: 700; font-size: 15px; padding: 4px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; font-variant-numeric: tabular-nums; }
.pct strong { font-size: 21px; }
.ranks { display: flex; flex-direction: column; gap: 8px; }
.rank { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; }
.rank .no { font-family: var(--display); width: 30px; }
.rank .nm { flex-grow: 1; }
.rank .pc { font-weight: 700; font-variant-numeric: tabular-nums; }
.axis { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.axis-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.axis-head .t { font-family: var(--display); font-size: 17px; }
.track { position: relative; height: 28px; }
.track .rail { position: absolute; left: 0; right: 0; top: 5px; height: 12px; border-radius: 7px; border: 2px solid var(--ink); background: var(--paper); }
.track .fill { position: absolute; top: 7px; height: 12px; }
.track .mid { position: absolute; left: 50%; top: 1px; height: 22px; border-left: 2px solid var(--ink); }
.track .me { position: absolute; top: 2px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; }
.track .ref { position: absolute; top: 18px; width: 0; height: 0; margin-left: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--deep); }
.axis-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.axis-foot .ref-t { color: var(--deep); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.two .card { padding: 14px; }
.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.friend { display: flex; flex-direction: row; align-items: center; gap: 14px; }
.friend > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.small { font-size: 14px; line-height: 1.6; }
.xsmall { font-size: 13px; line-height: 1.55; }

.overlay { position: fixed; inset: 0; background: rgba(42, 40, 51, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sheet { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 16px; max-width: 420px; width: 100%; max-height: calc(100dvh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet img { width: 100%; height: auto; border-radius: 12px; border: 2px solid var(--ink); }

.footer { font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; padding-top: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  h1 { font-size: 34px; }
  .qtext { font-size: 24px; }
  .opt { width: 40px; }
}

/* landing */
.intro { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.intro .pill { align-self: flex-start; }
.cta { display: flex; flex-direction: column; gap: 10px; }
.chips-wrap { display: flex; flex-direction: column; gap: 8px; }
.small-link { font-size: 13px; color: var(--muted); }

/* result + duo */
.pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero .tiny { color: var(--ink); }
.duo-top { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.duo-side { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; text-align: center; }
.duo-row { display: flex; flex-direction: column; gap: 5px; }
.duo-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sheet { overscroll-behavior: contain; }

@media (hover: none) { .keyhint { display: none; } }
@media (max-height: 740px) {
  .wrap { gap: 12px; padding-top: 16px; }
  h1 { font-size: 32px; }
  .intro { gap: 8px; padding-top: 0; }
  .quiz .qbody { min-height: 150px; }
  .qtext { font-size: 23px; }
}
@media (max-height: 520px) {
  .quiz .qbody { min-height: 0; }
  .quiz .qbody > p { display: none; }
}
