/* =========================================================================
   BITE — 오늘 당신을 문 것은 무엇인가?
   밝고 말랑한 스티커 톤. 스토리 구간만 밤 → 아침으로 분위기가 바뀐다.
   ========================================================================= */

/* ---------- 0. 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* clip 은 hidden 과 달리 스크롤 컨테이너를 만들지 않는다.
   html 에 overflow:hidden 을 걸면 iOS Safari 에서 스크롤·탭이 먹통이 되는 사례가 있다. */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 6px; }

/* ---------- 1. 토큰 ----------
   「곤충 도감」 그림체에 맞춘 세계관: 버터색 종이, 따뜻한 갈색 잉크,
   풀빛·흙빛 액센트. 검정과 형광은 쓰지 않는다. */
:root {
  --bg:      #FBF3D0;   /* 도감 종이 */
  --bg-2:    #F5E9B8;
  --paper:   #FFFDF2;

  --ink:     #3D2E22;   /* 외곽선·본문 — 검정이 아닌 갈색 */
  --ink-2:   #6B5541;
  --ink-3:   #9C8973;

  --line:    rgba(61,46,34,.16);
  --line-2:  rgba(61,46,34,.3);

  --grape:   #7FA05C;   /* 주 액센트 = 잎 초록 */
  --grape-d: #5E7C40;
  --coral:   #E0705E;
  --mint:    #5FA894;
  --sun:     #F0BC4E;
  --sky:     #7FB5D5;

  /* 유형별 색 — 결과 화면에서 덮어씀 */
  --c1: var(--grape);
  --c2: #C9BAFF;

  --r-sm: 14px; --r-md: 20px; --r-lg: 26px; --r-xl: 32px;
  --shell: 560px;
  --ease: cubic-bezier(.22,1,.36,1);
  /* 인쇄된 도감 한 장처럼 — 입체 그림자 대신 얇은 갈색 테두리로만 구분한다 */
  --pop: none;

  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto,
          'Noto Sans KR', system-ui, sans-serif;
  /* 도감 라벨용 손글씨 */
  --hand: 'Gaegu', 'Pretendard Variable', Pretendard, 'Malgun Gothic', cursive;
}

/* 손글씨는 제목·라벨에만. 본문까지 쓰면 가독성이 떨어진다. */
.hand, h1.hero-title, .holo-species, .holo-name, .sec-title,
.dex-name, .loading-title, .outro-lead, .story-lines p {
  font-family: var(--hand);
  letter-spacing: 0;
}

/* 도감 장식 — 카드 위에 흩뿌린 꽃·잎·반짝임 */
.scatter { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.scatter .dec { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; opacity: .8; }
.scatter .dec svg { width: 100%; height: 100%; }
.holo > *:not(.scatter), .outro > *:not(.scatter) { position: relative; z-index: 1; }

/* ---------- 2. 바탕 ---------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  letter-spacing: -.017em;
  min-height: 100dvh;
  word-break: keep-all;
}

/* 파스텔 배경 — filter:blur() 를 쓴 커다란 블롭은 모바일에서 매 프레임 리페인트를
   유발해 탭이 씹힌다. 같은 그림을 그라디언트로 한 번만 칠한다(비용 0). */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(56vmax 56vmax at -6% -10%, #FDF8DE, transparent 60%),
    radial-gradient(48vmax 48vmax at 106% 4%,  #F2E6AE, transparent 60%),
    radial-gradient(46vmax 46vmax at 20% 106%, #F6EFC6, transparent 60%);
  background-attachment: fixed;
}
.aurora, .grain, .scan { display: none; }

/* ---------- 3. 레이아웃 ---------- */
.stage { position: relative; z-index: 2; display: flex; justify-content: center; gap: 28px; padding: 0 16px; }
.shell {
  width: 100%; max-width: var(--shell);
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(28px + env(safe-area-inset-bottom));
}
.screen { display: none; flex: 1; flex-direction: column; animation: screenIn .45s var(--ease) both; }
.screen.is-active { display: flex; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.rail { display: none; width: 300px; flex: 0 0 300px; }
.rail-inner { position: sticky; top: 24px; }
@media (min-width: 1180px) { :root { --shell: 600px; } .rail { display: block; } }
@media (min-width: 1560px) { :root { --shell: 660px; } }

/* ---------- 4. 공통 파츠 ---------- */
.brandbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: .14em; font-size: 14px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 0 rgba(224,112,94,.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(224,112,94,0); } 100% { box-shadow: 0 0 0 0 rgba(224,112,94,0); } }
.brand-sub { font-size: 11px; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-size: 11.5px; font-weight: 800; letter-spacing: .12em;
  padding: 7px 13px; border-radius: 999px;
  border: 2px solid var(--line-2); background: var(--paper); color: var(--ink-2);
}

.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 17px 22px; border-radius: 999px;
  font-weight: 900; font-size: 17px; letter-spacing: -.01em;
  touch-action: manipulation;   /* 모바일 탭 지연·더블탭 확대 방지 */
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background .2s;
}
.btn-primary { color: #fff; background: var(--grape); box-shadow: none; }
.btn-primary:hover { background: #8DAF69; }
.btn-primary:active { transform: translateY(2px); filter: brightness(.94); }
.btn-ghost {
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--line-2); box-shadow: none;
}
.btn-ghost:active { transform: translateY(2px); }
.btn-sm { padding: 12px 18px; font-size: 14.5px; width: auto; }

.card {
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--pop);
}

/* 유형 마크 */
.mark { display: block; line-height: 0; }
.mark > .bug { width: 100%; height: 100%; }

/* ---------- 5. 인트로 ---------- */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 16px 0 6px; text-align: center; }
.hero > * { animation: heroIn .7s var(--ease) both; }
.hero > *:nth-child(1) { animation-delay: .04s; }
.hero > *:nth-child(2) { animation-delay: .14s; }
.hero > *:nth-child(3) { animation-delay: .24s; }
.hero > *:nth-child(4) { animation-delay: .32s; }
.hero > *:nth-child(5) { animation-delay: .4s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero-mark { position: relative; align-self: center; width: 172px; height: 172px; }
.hero-mark .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(224,112,94,.3);
  animation: expand 3.6s var(--ease) infinite;
}
.hero-mark .ring:nth-child(2) { animation-delay: 1.2s; }
.hero-mark .ring:nth-child(3) { animation-delay: 2.4s; }
@keyframes expand {
  0%   { transform: scale(.55); opacity: 0; }
  30%  { opacity: .9; }
  100% { transform: scale(1.32); opacity: 0; }
}
.bite-mark { position: absolute; inset: 0; display: grid; place-items: center; }
.bite-mark svg { width: 116px; height: 116px; animation: throb 2.6s var(--ease) infinite; }
@keyframes throb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

h1.hero-title { font-size: clamp(29px, 8.6vw, 44px); line-height: 1.24; font-weight: 900; letter-spacing: -.04em; text-wrap: balance; }
.hero-title .hl { color: var(--grape); }
.hero-title .hl::after {
  content: ''; display: block; height: 12px; margin: -12px 2px 0;
  border-radius: 999px; background: rgba(240,188,78,.55);
}
.hero-desc { color: var(--ink-2); font-size: 16px; font-weight: 500; }
.hero-desc b { color: var(--ink); font-weight: 800; }

.stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.stat {
  padding: 9px 15px; border-radius: 999px; background: var(--paper);
  border: 2px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: none;
}
.stat b { color: var(--grape); font-weight: 900; font-variant-numeric: tabular-nums; }

/* 12종 마퀴 */
.peek {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.peek-track { display: flex; gap: 10px; width: max-content; animation: marquee 34s linear infinite; }
.peek li {
  flex: 0 0 58px; width: 58px; height: 58px; padding: 3px;
  display: grid; place-items: center;
  border-radius: 16px; background: var(--paper); border: 2px solid var(--line);
  box-shadow: none;
  animation: bob 4s var(--ease) infinite;
}
.peek li > .mark { width: 100%; height: 100%; }
.peek li:nth-child(2n) { animation-delay: .5s; }
.peek li:nth-child(3n) { animation-delay: 1s; }
.peek:hover .peek-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 5px)); } }
@keyframes bob { 50% { transform: translateY(-5px); } }

.hero-cta { display: flex; flex-direction: column; gap: 10px; }
.microcopy { font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- 6. 스토리 ---------- */
.story {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; text-align: center; cursor: pointer;
  padding: 26px 18px 14px; position: relative; min-height: 74dvh;
  border-radius: var(--r-xl);
  user-select: none; -webkit-user-select: none;
  transition: background .8s var(--ease), color .8s var(--ease);
}
/* 밤 → 아침. 물린 순간은 어둡고, 능력이 생긴 뒤에는 밝아진다 */
.story[data-mood="night"] {
  background: linear-gradient(170deg, #241C46, #140F2B 70%);
  color: #F0ECFF;
  box-shadow: var(--pop);
}
.story[data-mood="dawn"] {
  background: linear-gradient(170deg, #FFE9C9, #FFD9E6 55%, #E3E1FF);
  color: var(--ink);
  box-shadow: var(--pop);
}
.story-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.story-lines { display: flex; flex-direction: column; gap: 4px; }
.story-lines p {
  font-size: clamp(18px, 5.1vw, 24px); font-weight: 800; line-height: 1.62;
  letter-spacing: -.035em; text-wrap: balance;
  opacity: 0; transform: translateY(14px);
  animation: lineIn .7s var(--ease) forwards;
}
.story-lines p.gap { height: 14px; animation: none; }
@keyframes lineIn { to { opacity: 1; transform: none; } }
.story[data-mood="dawn"] .story-lines p:first-child,
.story[data-mood="dawn"] .story-lines p:nth-child(2) { color: #C2410C; }

.story-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px 0 6px; }
.story-next {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; opacity: .62;
  animation: fadeUp .6s var(--ease) both;
}
.story-next::after {
  content: ''; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px); animation: nudge 1.5s infinite;
}
.story-next.is-cta {
  opacity: 1; color: #fff; background: var(--grape); box-shadow: none;
  font-weight: 900; font-size: 16px; letter-spacing: -.01em; padding: 15px 32px; border-radius: 999px;
}
.story-next.is-cta::after { transform: rotate(-45deg) translateX(-1px); animation-name: nudgeRight; }
@keyframes nudge { 50% { transform: rotate(45deg) translate(3px,3px); } }
@keyframes nudgeRight { 50% { transform: rotate(-45deg) translate(3px,-3px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.story-dots { display: flex; gap: 6px; }
.story-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .25; transition: .3s; }
.story-dots i.on { opacity: 1; width: 20px; border-radius: 999px; }
.story-skip {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  font-size: 12.5px; font-weight: 700; color: currentColor; opacity: .55; padding: 6px 8px;
}
.story-skip:hover { opacity: 1; }

/* ---------- 6-1. 스토리 장면 ---------- */
.story-scene { width: min(262px, 64vw); aspect-ratio: 1; position: relative; }
.sc { position: absolute; inset: 0; display: grid; place-items: center; }
.sc > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
@keyframes sceneIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* 1) 평범한 하루 — 시계 */
.sc-day { animation: sceneIn .8s var(--ease) both; }
.sc-day svg { fill: none; stroke: rgba(240,236,255,.3); stroke-width: 2.4; stroke-linecap: round; }
.sc-dial { stroke: rgba(240,236,255,.18); stroke-width: 3; }
.sc-ticks line { stroke: rgba(240,236,255,.26); }
.sc-hand { transform-origin: 100px 100px; animation: spin 7s linear infinite; }
.sc-hand line { stroke: rgba(240,236,255,.62); stroke-width: 3.4; }
.sc-pivot { fill: rgba(240,236,255,.62); stroke: none; }
.sc-slot { position: absolute; width: 28px; height: 28px; color: rgba(240,236,255,.3); animation: slotOn 7s linear infinite; }
.sc-slot svg { position: static; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sc-slot.s1 { top: 2%;  left: 50%; margin-left: -14px; }
.sc-slot.s2 { right: 2%; top: 50%; margin-top: -14px; animation-delay: -5.25s; }
.sc-slot.s3 { bottom: 2%; left: 50%; margin-left: -14px; animation-delay: -3.5s; }
.sc-slot.s4 { left: 2%; top: 50%; margin-top: -14px; animation-delay: -1.75s; }
@keyframes slotOn { 0%,14% { color: #FFD98A; } 28%,100% { color: rgba(240,236,255,.24); } }

/* 2) 물린 자국 */
.sc-bite { animation: sceneIn .8s var(--ease) both; }
.sc-bite svg { fill: none; stroke-linecap: round; }
.sc-skin { fill: rgba(255,236,222,.16); stroke: rgba(255,236,222,.5); stroke-width: 3; }
.sc-vein { stroke: rgba(255,236,222,.22); stroke-width: 2.4; }
.sc-rash { fill: rgba(224,112,94,.24); stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; animation: rashIn .9s .7s var(--ease) forwards; }
.sc-rash.d2 { animation-delay: .95s; }
@keyframes rashIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
.sc-hole {
  fill: var(--coral); stroke: none; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  animation: holeIn .45s .5s var(--ease) forwards;
  filter: drop-shadow(0 0 8px rgba(224,112,94,.9));
}
.sc-hole.d2 { animation-delay: .75s; }
@keyframes holeIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
.sc-swell { fill: none; stroke: var(--coral); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: swell 2.4s 1.1s var(--ease) infinite; }
.sc-swell.w2 { animation-delay: 2.3s; }
@keyframes swell { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(3); } }
.sc-beam {
  position: absolute; left: 10%; right: 10%; height: 2px; top: 6%;
  background: linear-gradient(90deg, transparent, #9BE7FF, transparent);
  box-shadow: 0 0 18px #9BE7FF; opacity: 0;
  animation: beamDown 3.2s 1.4s linear infinite;
}
@keyframes beamDown { 0% { top: 6%; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 96%,100% { top: 92%; opacity: 0; } }
.sc-verdict {
  position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 800; letter-spacing: .16em; color: #FFB4C6;
  padding: 6px 14px; border-radius: 999px; border: 2px solid rgba(224,112,94,.5);
  background: rgba(30,20,45,.85); white-space: nowrap;
  animation: blink 2s 1.9s step-end infinite;
}
@keyframes blink { 0%,55% { opacity: 1; } 56%,100% { opacity: .3; } }

/* 3) 능력 발현 — 아침 */
.sc-surge { animation: sceneIn .8s var(--ease) both; }
.sc-figure { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; z-index: 2; }
.sc-bloom {
  position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(circle, #FFD166, #FF9EC4 52%, transparent 72%);
  filter: blur(14px); animation: bloom 2.6s var(--ease) infinite;
}
@keyframes bloom { 0%,100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.16); opacity: 1; } }
.sc-ring { position: absolute; inset: 18%; border-radius: 50%; border: 4px solid #fff; opacity: 0; animation: burst 2.4s var(--ease) infinite; }
.sc-ring.r2 { animation-delay: .8s; border-color: #FFB020; }
.sc-ring.r3 { animation-delay: 1.6s; border-color: #FF6B8A; }
@keyframes burst { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(2); } }
.sc-sparks { position: absolute; inset: 0; }
.sc-sparks i {
  position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.9);
  animation: spark 2.2s var(--ease) infinite; animation-delay: var(--d);
}
@keyframes spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-112px); } }
.sc-ghost { position: absolute; width: 50px; height: 50px; opacity: 0; }
.sc-ghost .mark { width: 100%; height: 100%; }
.sc-ghost .bug { opacity: .5; }
.sc-ghost.g1 { top: 2%;  left: 0%;  animation: driftBy 4.4s .0s linear infinite; }
.sc-ghost.g2 { top: 64%; left: -6%; animation: driftBy 4.4s .73s linear infinite; }
.sc-ghost.g3 { top: 18%; left: 80%; animation: driftBy 4.4s 1.46s linear infinite; }
.sc-ghost.g4 { top: 82%; left: 62%; animation: driftBy 4.4s 2.2s linear infinite; }
.sc-ghost.g5 { top: -4%; left: 60%; animation: driftBy 4.4s 2.93s linear infinite; }
.sc-ghost.g6 { top: 48%; left: 88%; animation: driftBy 4.4s 3.66s linear infinite; }
@keyframes driftBy {
  0%   { opacity: 0;  transform: translate(0,0) scale(.7) rotate(0deg); }
  22%  { opacity: .8; }
  72%  { opacity: .3; }
  100% { opacity: 0;  transform: translate(-38px,-30px) scale(1.15) rotate(-20deg); }
}
.sc-q {
  position: absolute; right: 0; top: 2%; z-index: 3;
  font-size: 56px; font-weight: 900; color: #fff;
  text-shadow: 0 4px 0 rgba(224,112,94,.85);
  animation: qBob 2.2s var(--ease) infinite;
}
@keyframes qBob { 50% { transform: translateY(-9px) rotate(7deg); } }

/* 4) 스캔 시작 */
.sc-hunt { --r: min(100px, 24vw); animation: sceneIn .8s var(--ease) both; }
.sc-track { position: absolute; inset: 6%; border-radius: 50%; border: 2px dashed rgba(61,46,34,.2); }
.sc-orbit { position: absolute; inset: 0; animation: spin 26s linear infinite; }
.sc-orb {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px;
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(var(--a) * -1));
}
.sc-orb .mark { width: 100%; height: 100%; }
.sc-reticle {
  fill: none; stroke: var(--grape); stroke-width: 3.4; stroke-linecap: round;
  z-index: 2; animation: reticle 2.6s var(--ease) infinite;
}
@keyframes reticle { 0%,100% { transform: scale(1); opacity: .6; } 50% { transform: scale(.82); opacity: 1; } }
.sc-blip {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--grape); top: 50%; left: 50%; margin: -5px;
  animation: blip 2.6s var(--ease) infinite;
}
@keyframes blip { 0%,100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- 7. 퀴즈 ---------- */
.quiz-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.quiz-meta .axis-chip {
  padding: 5px 12px; border-radius: 999px; background: var(--paper);
  border: 2px solid var(--line); color: var(--ink-2); font-size: 12.5px;
}
.progress { position: relative; height: 10px; border-radius: 999px; background: rgba(61,46,34,.09); overflow: hidden; }
.progress > i {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--grape), var(--coral));
  border-radius: 999px; transition: width .45s var(--ease);
}
.qnum { font-size: 14px; font-weight: 900; color: var(--grape); font-variant-numeric: tabular-nums; }
.qnum span { color: var(--ink-3); }

.quiz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 8px 0 20px; }
.qblock { display: flex; flex-direction: column; gap: 10px; }
.qlead {
  font-size: 15px; font-weight: 700; line-height: 1.55; color: var(--ink-2);
  padding-left: 14px; border-left: 4px solid var(--c2, #C9BAFF);
  animation: fadeUp .5s var(--ease) both;
}
.qtext {
  font-size: clamp(21px, 5.7vw, 27px); font-weight: 900; line-height: 1.45;
  letter-spacing: -.035em; white-space: pre-line; text-wrap: balance;
  animation: fadeUp .5s .06s var(--ease) both;
}
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  width: 100%; padding: 18px; border-radius: var(--r-md);
  background: var(--paper); border: 2px solid var(--line);
  box-shadow: none;
  font-size: 15.5px; line-height: 1.5; font-weight: 600;
  transition: .16s var(--ease);
  animation: fadeUp .5s var(--ease) both;
}
.choice:nth-child(1) { animation-delay: .1s; }
.choice:nth-child(2) { animation-delay: .17s; }
.choice:hover { border-color: var(--grape); background: #F6F3E2; }
.choice:active { transform: scale(.99); }
.choice.is-picked { border-color: var(--grape); background: #EDF2DF; }
.choice-key {
  flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 11px; border: 2px solid var(--line-2);
  font-size: 13px; font-weight: 900; color: var(--ink-2);
}
.choice.is-picked .choice-key { background: var(--grape); color: #fff; border-color: var(--grape); }

.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-btn { font-size: 14px; color: var(--ink-3); font-weight: 700; padding: 8px 4px; }
.link-btn:hover { color: var(--ink); }
.link-btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- 8. 분석 중 ---------- */
.loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; padding: 30px 0; }
.radar { position: relative; width: 138px; height: 138px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(61,46,34,.12); }
.radar i:nth-child(2) { inset: 18px; }
.radar i:nth-child(3) { inset: 36px; }
.radar .sweep {
  position: absolute; inset: 0; border-radius: 50%; border: 0;
  background: conic-gradient(from 0deg, transparent 0 72%, rgba(127,160,92,.5) 92%, transparent);
  animation: spin 1.15s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 0 12px, #000 13px);
          mask: radial-gradient(circle, transparent 0 12px, #000 13px);
}
.radar .core { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; animation: bob 2s infinite; }
.loading-title { font-size: 21px; font-weight: 900; letter-spacing: -.035em; }
.loading-step { font-size: 14.5px; color: var(--ink-2); min-height: 22px; font-weight: 600; }
.loading-bar { width: 200px; height: 10px; border-radius: 999px; background: rgba(61,46,34,.09); overflow: hidden; }
.loading-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--grape), var(--coral)); transition: width .4s linear; }

/* ---------- 9. 결과 ---------- */
.result { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }

.holo {
  position: relative; overflow: hidden; text-align: center; isolation: isolate;
  border-radius: var(--r-xl); padding: 26px 22px 24px;
  border: 2.5px solid var(--ink);
  background:
    radial-gradient(120% 70% at 50% 12%, color-mix(in srgb, var(--c1) 20%, var(--paper)), transparent 66%),
    var(--paper);
  box-shadow: none;
}
.holo-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .16em; font-weight: 900; color: var(--ink-3); }

/* 도감 표본 한 칸: 질문 → 답(종 이름) → 그림 → 능력 */
.holo-q { margin-top: 16px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.holo-species {
  font-size: clamp(42px, 12vw, 58px); font-weight: 700; line-height: 1.1; margin-top: 2px;
  color: var(--ink);
}
/* 곤충 일러스트는 정사각 누끼 PNG */
.holo-art { position: relative; width: min(290px, 84vw); aspect-ratio: 1; margin: 6px auto 2px; }
.holo-art .bug { position: relative; z-index: 1; width: 100%; height: 100%; animation: bob 5s var(--ease) infinite; }
.bug { width: 100%; height: 100%; object-fit: contain; }
.mark > .bug { width: 100%; height: 100%; }

/* 손글씨로 그은 구분선 */
.holo-rule {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 4px 0; color: var(--ink-3);
}
.holo-rule::before, .holo-rule::after {
  content: ''; flex: 1; height: 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 7px, transparent 7px 13px);
}
.holo-rule span { font-size: 13px; font-weight: 800; white-space: nowrap; }

.holo-name {
  font-size: clamp(32px, 9vw, 42px); font-weight: 700; line-height: 1.14; margin-top: 8px;
  color: var(--c1); filter: brightness(.72) saturate(1.15);
}
.holo-grade {
  display: inline-block; margin-top: 10px; padding: 7px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 800; letter-spacing: -.02em;
  color: var(--ink); background: color-mix(in srgb, var(--c1) 24%, var(--paper));
  border: 2px solid var(--ink);
}
.holo-tag { margin-top: 14px; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.holo-kw { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.holo-kw li {
  font-size: 12.5px; font-weight: 800; color: var(--ink);
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--c1) 26%, var(--paper));
  border: 2px solid color-mix(in srgb, var(--c1) 30%, transparent);
}
.holo-rarity {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg); border: 2px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.holo-rarity b { color: var(--ink); font-variant-numeric: tabular-nums; }
.holo-rarity i { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding-left: 8px; border-left: 1px solid var(--line-2); }
.holo-rarity.is-live i { color: var(--ink-2); }
.holo-rarity.is-live i::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px;
  border-radius: 50%; background: var(--mint); vertical-align: 1px; animation: pulse 2.2s infinite;
}

/* 4축 — 3문항 다수결이라 값이 2/3 아니면 3/3. 칸으로 보여야 차이가 보인다.
   축마다 색을 달리해 결과 화면이 한 색으로 밋밋해지지 않게 한다. */
.axes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.axis {
  --ac: var(--grape);
  padding: 14px 15px; border-radius: var(--r-md);
  background: var(--paper); border: 2px solid color-mix(in srgb, var(--ac) 34%, transparent);
  box-shadow: none;
}
.axis[data-axis="E"] { --ac: #FF9F43; }
.axis[data-axis="J"] { --ac: #4FC3F7; }
.axis[data-axis="A"] { --ac: #2ECC8F; }
.axis[data-axis="R"] { --ac: #FF6B8A; }
.axis-name { font-size: 12px; color: var(--ink-2); font-weight: 800; letter-spacing: .04em; }
.axis-name span { font-size: 14px; }
.axis-val { font-size: 17px; font-weight: 900; margin-top: 4px; letter-spacing: -.035em; }
.axis-seg { display: flex; gap: 4px; margin-top: 10px; }
.axis-seg i {
  flex: 1; height: 9px; border-radius: 5px; background: rgba(61,46,34,.09);
  transition: background .4s var(--ease);
}
.axis-seg i.on { background: var(--ac); }

.sec { padding: 22px 20px; border-color: color-mix(in srgb, var(--c1) 26%, transparent); }
.sec-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; color: var(--ink-2); margin-bottom: 12px; }
.sec-ico { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; }
.sec-ico svg { width: 100%; height: 100%; }
.sec-title { font-size: 20px; font-weight: 900; letter-spacing: -.04em; line-height: 1.38; margin-bottom: 14px; text-wrap: balance; }
.sec p { color: var(--ink-2); font-size: 15.5px; margin-bottom: 9px; font-weight: 500; }
.sec p:last-child { margin-bottom: 0; }
.sec p.quote { color: var(--ink); font-weight: 800; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c1) 18%, var(--paper)); }

.traits { display: flex; flex-direction: column; gap: 10px; }
.traits li { display: flex; gap: 11px; font-size: 15.5px; color: var(--ink-2); line-height: 1.55; font-weight: 500; }
.traits li::before {
  content: ''; flex: 0 0 9px; width: 9px; height: 9px; margin-top: 8px;
  border-radius: 50%; background: var(--c1);
}

.pill-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill { padding: 16px; border-radius: var(--r-md); background: var(--paper); border: 2px solid var(--line); }
.pill dt { font-size: 11.5px; letter-spacing: .1em; font-weight: 800; color: var(--ink-3); margin-bottom: 6px; }
.pill dd { font-size: 15px; font-weight: 800; line-height: 1.45; }
.pill.warn { border-color: rgba(224,112,94,.45); background: #FDF0EC; }
.pill.warn dd { color: #C25545; }

.grade {
  text-align: center; padding: 26px 20px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--c1) 20%, var(--paper));
  border: 2px solid color-mix(in srgb, var(--c1) 35%, transparent);
}
.grade-label { font-size: 12px; letter-spacing: .14em; font-weight: 900; color: var(--ink-3); }
.grade-val {
  display: inline-block; margin: 12px 0; font-size: clamp(20px, 5.6vw, 25px); font-weight: 700;
  font-family: var(--hand); letter-spacing: 0; color: var(--ink);
  background: color-mix(in srgb, var(--c1) 24%, var(--paper));
  padding: 9px 22px; border-radius: 999px; border: 2px solid var(--ink);
}
.grade-note { font-size: 14.5px; color: var(--ink-2); white-space: pre-line; font-weight: 600; }

.outro { position: relative; text-align: center; padding: 30px 20px; overflow: hidden; }
.outro-lead { font-size: clamp(19px, 5.4vw, 24px); font-weight: 900; letter-spacing: -.04em; line-height: 1.42; text-wrap: balance; }
.outro-body { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; white-space: pre-line; font-weight: 500; }
.outro-cta { margin-top: 18px; font-size: 16px; font-weight: 900; color: var(--c1); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 16px 12px; border-radius: var(--r-md); background: var(--paper);
  border: 2px solid var(--line); box-shadow: none;
  transition: .16s var(--ease);
}
.match a:hover { transform: translateY(-3px); border-color: var(--line-2); }
.match .m-kind { font-size: 11px; letter-spacing: .1em; font-weight: 900; }
.match .mark { width: 74px; height: 74px; }
.match .m-name { font-size: 15px; font-weight: 900; }
.match .m-nick { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.match a.good .m-kind { color: var(--mint); }
.match a.bad  .m-kind { color: var(--coral); }

.share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 15px 8px; border-radius: var(--r-md); background: var(--paper);
  border: 2px solid var(--line); box-shadow: none;
  font-size: 12.5px; font-weight: 800; color: var(--ink-2); transition: .16s var(--ease);
}
.share-btn:hover { transform: translateY(-2px); color: var(--ink); }
.share-btn:active { transform: scale(.98); }
.share-btn svg { width: 22px; height: 22px; }
.share-btn[data-share="kakao"] { background: #FEE500; border-color: #E6CF00; color: #3C1E1E; box-shadow: none; }

.all-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 9px; }
.tcard {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 13px 8px; border-radius: var(--r-sm); background: var(--paper);
  border: 2px solid var(--line); transition: .16s var(--ease);
}
.tcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tcard.is-me { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 16%, var(--paper)); }
.tcard .mark { width: 62px; height: 62px; }
.tcard b { font-size: 13.5px; font-weight: 900; }
.tcard i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ---------- 10. 광고 슬롯 ---------- */
.ad {
  position: relative; display: block; width: 100%;
  border-radius: var(--r-md); overflow: hidden;
  background: rgba(61,46,34,.03); border: 2px dashed var(--line-2);
}
.ad::before {
  content: 'AD'; position: absolute; top: 8px; left: 10px; z-index: 2;
  font-size: 10px; letter-spacing: .14em; font-weight: 900; color: var(--ink-3);
}
.ad-inner { min-height: 100px; display: grid; place-items: center; }
.ad-ph { font-size: 12px; color: var(--ink-3); text-align: center; padding: 30px 12px; font-weight: 600; }
.ad-inline .ad-inner { min-height: 250px; }
.ad-rail .ad-inner { min-height: 600px; }

/* 제휴 카드 */
.aff {
  display: flex; align-items: center; gap: 13px; padding: 15px 16px;
  border-radius: var(--r-md); background: #FBF1D4; border: 2px solid rgba(240,188,78,.55);
  box-shadow: none; transition: .16s var(--ease);
}
.aff:hover { transform: translateY(-2px); border-color: rgba(240,188,78,.85); }
.aff-ico { flex: 0 0 52px; width: 52px; height: 52px; padding: 4px; display: grid; place-items: center; border-radius: 14px; background: #fff; border: 2px solid rgba(240,188,78,.5); }
.aff-ico .mark { width: 100%; height: 100%; }
.aff-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aff-k { font-size: 11px; letter-spacing: .1em; font-weight: 900; color: #9A7420; line-height: 1.4; }
.aff-t { font-size: 15px; font-weight: 900; line-height: 1.4; }
.aff-d { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; font-weight: 500; }
.aff-arrow { color: var(--ink-3); font-size: 20px; }

/* ---------- 11. 토스트 / 푸터 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  z-index: 60; padding: 13px 22px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 800;
  box-shadow: 0 10px 26px -10px rgba(61,46,34,.6);
  opacity: 0; pointer-events: none; transition: .28s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.footer { margin-top: 26px; padding-top: 20px; border-top: 2px solid var(--line); text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.9; font-weight: 500; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; font-weight: 700; }

/* ---------- 12. 유틸 ---------- */
.stack { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 13. 반응형 ---------- */
@media (max-width: 380px) {
  .stage { padding: 0 12px; }
  .axes, .pill-row, .match { grid-template-columns: 1fr; }
}
/* 세로가 짧은 폰에서도 "시작하기" 가 첫 화면 안에 들어오도록 압축한다 */
@media (max-height: 760px) {
  .hero { gap: 15px; padding: 8px 0 4px; }
  .hero-mark { width: 128px; height: 128px; }
  .bite-mark svg { width: 88px; height: 88px; }
  h1.hero-title { font-size: clamp(26px, 7.6vw, 36px); }
  .hero-desc { font-size: 14.5px; }
  .peek li { flex-basis: 50px; width: 50px; height: 50px; }
  .microcopy { font-size: 11.5px; }
}
@media (max-height: 640px) {
  .hero-mark { display: none; }
}
@media (min-width: 720px) {
  .hero { gap: 28px; }
  .sec { padding: 28px 26px; }
  .holo { padding: 34px 30px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
