/* 사이코패스 지수 검사 (psycho.html) 전용 스타일.

   다른 검사(사랑받는 순서의 보라·알약 결)와 일부러 다르게 간다. 참고한 건 여기어때
   디자인 시스템(YDS)의 기초값이다. 브랜드를 흉내 내는 게 아니라 결만 가져왔다.
     흰 바탕 · 먹색 #222222 · 테두리 #E6E6E6 · 그림자 없이 선으로 나눈다
     누르는 건 Cyan #1D8BFF 하나. 경고·매운맛은 Lively Red #F94239
     둥글기는 버튼 8 · 입력칸과 보기 12 · 큰 덩어리 20
     좌우 여백 20 · 글자는 Pretendard, 자간을 조이지 않는다

   채도 있는 색에 투명도를 걸지 않는다 (YDS 원칙). 옅은 색이 필요하면
   따로 정해진 옅은 값(#E3F0FF, #FFEDEA)을 쓴다.
   공용 styles.css 와 engine.js 는 안 쓴다. */

*, *::before, *::after { box-sizing: border-box; }
/* .btn 의 display 가 hidden 을 이겨서 숨긴 버튼이 빈 칸으로 남는 걸 막는다 */
[hidden] { display: none !important; }
/* 문항마다 높이가 달라 스크롤바가 생겼다 사라지며 폭이 흔들리는 걸 막는다 */
html { scrollbar-gutter: stable; }

:root {
  --cyan: #1D8BFF;          /* 누르는 것 하나에만 */
  --cyan-soft: #E3F0FF;     /* 고른 보기 바탕 */
  --red: #F94239;           /* 매운맛, 강조 딱지 */
  --red-soft: #FFEDEA;
  --yellow: #FFC83B;
  --navy: #49627A;
  --ink: #222222;
  --ink-sub: #555555;
  --ink-mute: #888888;
  --line: #E6E6E6;
  --canvas: #FFFFFF;
  --muted-surface: #F5F5F5;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Pretendard, "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR",
    system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  word-break: keep-all;
}

.page { min-height: 100dvh; display: flex; flex-direction: column; }
.inner { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 20px; }

.lucide {
  width: 1em; height: 1em; stroke: currentColor; fill: none;
  flex-shrink: 0; display: inline-block; vertical-align: -0.15em;
}
.homelink .lucide, .moreTests .lucide { width: 16px; height: 16px; vertical-align: middle; }
.btn .lucide { width: 16px; height: 16px; }
.a__pick .lucide { width: 14px; height: 14px; margin-right: 4px; }

.screen { display: none; }
.screen.is-on { display: flex; flex-direction: column; flex: 1; }

/* ── 공통 부속 ─────────────────────────────────── */

.topnav { padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.homelink {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0; color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.homelink:hover { color: var(--cyan); }
.homelink:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.adslot {
  margin-top: 28px; padding: 16px; text-align: center;
  border: 1px solid var(--line); border-radius: 20px;
}
.adslot__label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--ink-mute); }

.siteFoot {
  padding: 32px 20px 36px; border-top: 1px solid var(--line);
  text-align: center; font-size: 13px; line-height: 1.6; color: var(--ink-mute);
}
.siteFoot a { color: var(--ink-mute); }
.siteFoot .moreTests {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 14px; padding: 10px 18px;
  border: 1.5px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
}
.siteFoot .moreTests:hover { border-color: var(--cyan); color: var(--cyan); }
body.is-flow .siteFoot { display: none; }
#screen-intro.is-on, #screen-result.is-on { padding-bottom: 40px; }

/* ── 버튼 ──────────────────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 52px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: var(--cyan); color: #fff;
  font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: #0f7df0; }
.btn:active { background: #0a6fd8; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.btn--ghost {
  background: var(--canvas); color: var(--ink);
  border: 1.5px solid var(--line); font-weight: 600;
}
.btn--ghost:hover { background: var(--canvas); border-color: var(--ink); }
.btn--ghost:active { background: var(--muted-surface); }

.btnRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btnRow .btn { min-width: 0; }

.cta { margin-top: auto; padding: 16px 0; }
.cta > .btn + .btnRow { margin-top: 8px; }

#screen-quiz.is-on { min-height: 100dvh; }
#screen-quiz .quizBody { padding-bottom: 104px; }
.cta--flow {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  width: min(100%, 520px); margin: 0 auto;
  padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--canvas); border-top: 1px solid var(--line);
}
.cta--flow .btn { height: 48px; font-size: 15px; white-space: nowrap; }
.resultCta { margin-top: 20px; padding: 0 0 20px; }

/* ── 랜딩 ──────────────────────────────────────── */

/* 가운데 정렬 대신 왼쪽 정렬. 목록을 훑는 화면처럼 위에서 아래로 읽힌다 */
.hero { padding: 28px 0 8px; text-align: left; }

/* 필터 칩 모양. 흰 바탕에 선 테두리 */
.chip {
  display: inline-block; margin-bottom: 16px;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--canvas);
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.hero h1 {
  margin: 0 0 12px; font-size: 32px; line-height: 38px;
  font-weight: 800; color: var(--ink);
}
.hero__lead { margin: 0 0 20px; font-size: 16px; line-height: 1.55; color: var(--ink-sub); }
.hero .btn + .btn { margin-top: 8px; }
.hero__fine { margin: 12px 0 0; font-size: 12px; color: var(--ink-mute); }

/* 매운맛 미리보기. 식은 색에서 뜨거운 색, 맨 끝은 먹색 */
.spiceTeaser { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.spiceTeaser span {
  padding: 5px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--ink);
}
.spiceTeaser span:nth-child(1) { background: var(--cyan-soft); }
.spiceTeaser span:nth-child(2) { background: var(--red-soft); }
.spiceTeaser span:nth-child(3) { background: var(--yellow); }
.spiceTeaser span:nth-child(4) { background: var(--red); color: #fff; }
.spiceTeaser span:nth-child(5) { background: var(--ink); color: #fff; }

/* 이름 칸은 검색창 모양 */
.field { margin: 24px 0 12px; }
.field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-sub); }
.field__optional { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ink-mute); }
.field input {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--canvas); color: var(--ink);
  font: inherit; font-size: 16px;
}
.field input::placeholder { color: var(--ink-mute); }
.field input:focus { outline: none; border-color: var(--ink); }

/* ── 문항 ──────────────────────────────────────── */

.qbar { display: flex; align-items: center; gap: 12px; padding: 16px 0 24px; }
.qbar__track { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.qbar__fill { display: block; height: 100%; background: var(--cyan); transition: width 200ms ease-out; }
.qbar__n { font-size: 13px; font-weight: 600; color: var(--ink-mute); flex-shrink: 0; }

.qflow { animation: qIn 220ms ease-out; }
.qflow.dir-back { animation-name: qInBack; }
@keyframes qIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes qInBack { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qflow { animation: none; } }

/* 장면은 색 띠가 아니라 빨간 작은 딱지로 문항 위에 얹는다 */
.qart { margin: 0 0 10px; }
.qart__chip {
  display: inline-block; padding: 4px 8px; border-radius: 4px;
  background: var(--red-soft); color: var(--red);
  font-size: 13px; font-weight: 600;
}
.qtext {
  margin: 0 0 24px; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--ink);
  text-wrap: pretty;
}

.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 14px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--canvas); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.45; font-weight: 600;
  cursor: pointer;
}
.opt:hover { border-color: var(--ink); }
.opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* 고른 보기는 색만이 아니라 글자 표시 칸까지 같이 바뀐다 */
.opt.is-picked { border-color: var(--cyan); background: var(--cyan-soft); }
.opt__mark {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 4px;
  display: grid; place-items: center;
  background: var(--muted-surface); color: var(--ink-sub);
  font-size: 12px; font-weight: 700;
}
.opt.is-picked .opt__mark { background: var(--cyan); color: #fff; }

/* ── 결과 ──────────────────────────────────────── */

/* 결과 덩어리는 그림자 없이 선으로 나누고 20 둥글기 */
.card {
  margin-bottom: 12px; padding: 20px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--canvas);
}
.card h2 { margin: 0 0 14px; font-size: 18px; line-height: 24px; font-weight: 700; }
.card h2 small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--ink-mute); }
.card p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--ink-sub); }
.card p:last-child { margin-bottom: 0; }

/* 첫 덩어리만 테두리 없이 화면 폭으로 깔고, 아래를 굵은 회색 띠로 끊는다.
   여기가 결과의 제목 자리다. 지수 · 유형 이름 · 설명이 한 덩어리로 뭉쳐 보여서
   덩어리 사이를 넉넉하게 벌렸다 (지수 줄 아래 32, 한 줄 아래 20) */
.card--hero {
  margin: 0 -20px 20px; padding: 28px 20px 36px;
  border: 0; border-bottom: 8px solid var(--muted-surface); border-radius: 0;
}
.rwho { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--ink-mute); }
.rnick { margin: 0 0 10px; font-size: 32px; line-height: 40px; font-weight: 800; }
.rtag { margin: 0 0 20px; font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--red); }
.card .rdesc { font-size: 15px; line-height: 1.75; color: var(--ink-sub); }

/* 매운맛 다섯 칸. 지금 단계까지 칠하고, 지금 단계 이름은 굵게 */
.spice { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 16px; }
.spice__step i { display: block; height: 8px; border-radius: 2px; background: var(--line); }
.spice__step em {
  display: block; margin-top: 8px; font-style: normal; font-size: 11px; line-height: 14px;
  text-align: center; color: var(--ink-mute);
}
.spice__step.is-on:nth-child(1) i { background: var(--cyan-soft); }
.spice__step.is-on:nth-child(2) i { background: var(--red-soft); }
.spice__step.is-on:nth-child(3) i { background: var(--yellow); }
.spice__step.is-on:nth-child(4) i { background: var(--red); }
.spice__step.is-on:nth-child(5) i { background: var(--ink); }
.spice__step.is-now em { color: var(--ink); font-weight: 700; }
.card .spice__line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 32px; font-size: 14px; color: var(--ink-sub);
}
/* 가격표 딱지 모양 */
.spice__line b {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  border: 1.5px solid var(--ink); color: var(--ink); font-size: 13px;
}

/* 사이코패스 쪽 대 소시오패스 쪽 */
.side { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.side__label { font-size: 12px; font-weight: 600; color: var(--ink-mute); }
.side__track {
  position: relative; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--navy), var(--red));
}
.side__dot {
  position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--canvas); border: 3px solid var(--ink);
}

/* 네 갈래 막대 */
.bars { display: grid; gap: 16px; }
.brow__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.brow__name { font-size: 15px; font-weight: 700; }
.brow__rank {
  padding: 2px 6px; border-radius: 4px; background: var(--red-soft);
  font-size: 11px; font-weight: 700; color: var(--red);
}
.brow__track { display: block; height: 8px; border-radius: 2px; background: var(--muted-surface); overflow: hidden; }
.brow__fill { display: block; height: 100%; border-radius: 2px; }
.brow__line { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-mute); }

/* 이럴 때 티 나요. 체크리스트처럼 줄로 나눈다 */
.hurts { margin: 0; padding: 0; list-style: none; }
.hurts li {
  position: relative; padding: 12px 0 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 15px; line-height: 1.5; color: var(--ink);
}
.hurts li:first-child { border-top: 0; padding-top: 0; }
.hurts li::before {
  content: ''; position: absolute; left: 2px; top: 20px;
  width: 8px; height: 8px; border-radius: 2px; background: var(--red);
}
.hurts li:first-child::before { top: 8px; }

/* 셋이 뭐가 달라요 */
.explain { margin: 0; }
.explain__row { padding: 14px 0; border-top: 1px solid var(--line); }
.explain__row:first-child { border-top: 0; padding-top: 0; }
.explain dt { margin-bottom: 4px; font-size: 15px; font-weight: 700; }
.explain dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-sub); }

.answers { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.answers li { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.answers li:last-child { padding-bottom: 0; border-bottom: 0; }
.a__no { font-size: 12px; font-weight: 600; color: var(--ink-mute); }
.card .a__q { margin: 4px 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.card .a__pick { margin: 0; font-size: 14px; color: var(--cyan); }

details.foldable > summary { cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; }
details.foldable > summary::-webkit-details-marker { display: none; }
details.foldable > summary::after { content: ' 펼치기'; font-weight: 400; color: var(--ink-mute); }
details.foldable[open] > summary::after { content: ' 접기'; }
details.foldable[open] > summary { margin-bottom: 14px; }
details.foldable > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.note { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-mute); }

/* ── 알림 ──────────────────────────────────────── */

.snackbar {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 8px);
  max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; text-align: center;
  opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.snackbar.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .hero h1, .rnick { font-size: 28px; line-height: 34px; }
  .qtext { font-size: 21px; line-height: 28px; }
}
