/* 위조상품 구매 위기탈출 — 완성본(2026-11-30): 공식 미리·이피의 광택 입체 화풍에 맞춘 "맑은 유리 + 로열 블루" 톤
 * 시연본의 잉크 테두리·노란 나레이션 상자·주아체 레터링은 쓰지 않는다. 미리 게임(miri-game/src/styles.css)과 같은 토큰을 쓴다.
 * 색은 아래 :root 토큰으로만 쓴다(흰색 #fff 제외). 흰 글자를 올리는 면은 대비 4.5:1 이상인 토큰만 쓴다.
 */
@font-face {
  font-family: 'Pretendard';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/pretendard-medium-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/pretendard-bold-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 800 900;
  font-display: swap;
  src: url('/fonts/pretendard-extrabold-subset.woff2') format('woff2');
}
/* 레터링(제목·버튼·도장): 굵기 값과 관계없이 늘 프리텐다드 ExtraBold로 그린다 */
@font-face {
  font-family: 'Miri Display';
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/pretendard-extrabold-subset.woff2') format('woff2');
}

:root {
  --paper: #ffffff;
  --ink: #18224a; /* 남색 글자 */
  --sub: #586189; /* 보조 글자 (흰 바탕 6.0:1) */
  --line: rgba(35, 60, 150, 0.16); /* 남색 반투명 머리카락선 (옛 잉크 테두리 대체) */
  --line-strong: rgba(35, 60, 150, 0.28);
  --stroke: 1px;
  --brand: #3d8bff; /* 미리 머리색: 면에만, 흰 글자 바탕으로 쓰지 않는다 */
  --brand-deep: #2352d8; /* 버튼 바탕, 진행 점 (흰 글자 6.4:1) */
  --brand-top: #3069f0; /* 주 버튼 위쪽 빛 (흰 글자 4.8:1) */
  --brand-deeper: #1f45c4; /* 버튼 아래쪽·누름 */
  --violet: #4335c4; /* 미리 머리 끝의 보라 */
  --brand-soft: #e7eeff;
  --brand-pale: #d6e2ff; /* 글자 선택 바탕 */
  --bg: #f1f4ff;
  --coat: #ffcc33; /* 이피 전구의 노랑: 강조 면에만, 글자색으로 쓰지 않는다 */
  --coat-deep: #f5a300;
  --caption: #eef2ff; /* 나레이션 상자 */
  --good: #13703f;
  --good-soft: #e4f6ec;
  --mid: #8a5307;
  --mid-soft: #fff3d6;
  --bad: #b8243a;
  --bad-soft: #ffe8ec;
  --alert: #ef4b5f;
  --alert-strong: #c4283f; /* 흰 글자를 올리는 경고 면: 할인 딱지, 표지, NEW (흰 글자 5.6:1) */
  --rank-good: #8fe0b0; /* 엔딩 등급 도장 면 */
  --rank-bad: #ffb3bd;
  --chip-bg: #eceff8; /* 아직 못 본 엔딩 칩 */
  --chip-ink: #5f6789; /* 칩 글자 (칩 바탕 대비 5.0:1) */
  --push-bg: #f1f4ff; /* 휴대폰 알림 */
  --product-bg: #eef2ff; /* 상품 사진 칸 */
  --chat-bg: #f1f4ff; /* 대화 화면 */
  --chat-line: #d6dcef; /* 판매자 말풍선 테두리 */
  --chat-bar-sub: #c3cae6; /* 대화 화면 머리줄 보조 글자 (남색 바탕) */
  --chat-system: #6a7290; /* "차단했습니다" 알림 면 (흰 글자 4.9:1) */
  --panel-radius: 20px;
  --shadow: 0 12px 32px -12px rgba(31, 52, 140, 0.28), 0 2px 6px rgba(31, 52, 140, 0.06);
  --shadow-sm: 0 6px 16px -8px rgba(31, 52, 140, 0.3), 0 1px 3px rgba(31, 52, 140, 0.08);
  --shadow-brand: 0 10px 22px -8px rgba(35, 82, 216, 0.55);
  --font-letter: 'Miri Display', 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  /* 이피의 노란 빛(오른쪽 위)·미리의 하늘빛(왼쪽)·보랏빛(아래)이 은은하게 번진 바탕 */
  background:
    radial-gradient(110% 45% at 100% 0%, rgba(255, 221, 120, 0.42) 0%, rgba(255, 221, 120, 0) 60%),
    radial-gradient(90% 40% at 0% 12%, rgba(140, 190, 255, 0.4) 0%, rgba(140, 190, 255, 0) 65%),
    radial-gradient(110% 50% at 50% 100%, rgba(170, 150, 255, 0.3) 0%, rgba(170, 150, 255, 0) 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
  caret-color: var(--brand-deep);
}
::selection { background: var(--brand-pale); color: var(--ink); }
h1, h2, h3, p, b, span, li, figcaption { word-break: keep-all; overflow-wrap: break-word; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1:focus, h2:focus { outline: none; }
:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 3px; border-radius: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ico { width: 1.15em; height: 1.15em; flex: none; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 14px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px)
    max(16px, env(safe-area-inset-left));
  /* 컷이 옆에서 밀려 들어오는 동안 가로 스크롤이 생기지 않게 한다 */
  overflow-x: hidden;
  overflow-x: clip;
}
.screen { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 컷 (패널) ---------- */
.cut {
  position: relative;
  margin: 0;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  animation: swipe 0.5s var(--ease-out) both;
}
@keyframes swipe { from { transform: translateX(32px); } }
/* 선택한 뒤 다시 그릴 때, 이미 본 장면 컷은 다시 밀려 들어오지 않는다 */
.cut.is-past { animation: none; }
/* 나레이션: 만화 컷 위쪽을 가로지르는 띠(컷 가장자리에 붙는다). 왼쪽 굵은 선을 단 둥근 강조 상자는 쓰지 않는다. */
.caption {
  margin: 0;
  padding: 12px 16px 11px;
  background: var(--caption);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--panel-radius) - 1px) calc(var(--panel-radius) - 1px) 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}
/* 효과음 스티커(띠링!·두둥!)가 있는 컷은 나레이션 오른쪽을 비워 글자를 가리지 않는다 */
.cut:has(.sfx) .caption { padding-right: 88px; }
.cut-body { padding: 12px; display: flex; justify-content: center; }
.sfx {
  position: absolute;
  top: -16px;
  right: -4px;
  padding: 6px 14px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe07a 0%, var(--coat) 60%, var(--coat-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 16px -6px rgba(245, 163, 0, 0.7);
  font-family: var(--font-letter);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  transform: rotate(6deg);
  pointer-events: none;
}

/* ---------- 버튼 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-family: var(--font-letter);
  font-size: 18px;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), background-color 0.15s;
  scroll-margin-bottom: 12px;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-top) 0%, var(--brand-deeper) 100%);
  border-color: rgba(20, 40, 150, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), var(--shadow-brand);
  color: #fff;
}
.btn.outline { background: var(--paper); border-color: var(--line-strong); box-shadow: var(--shadow-sm); color: var(--brand-deep); }
.btn.ghost {
  background: none;
  border: 0;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--sub);
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* 터치 기기에서는 탭한 자리에 새로 그려진 버튼이 hover 색으로 "미리 고른 것처럼" 보이지 않게 한다 */
@media (hover: hover) {
  .btn.primary:hover { filter: brightness(1.06); }
  .btn.outline:hover { background: var(--brand-soft); }
  .choice:hover { background: var(--brand-soft); }
}

/* ---------- 홈 ---------- */
.home { text-align: center; padding-top: 18px; }
.cover { margin: 0 2px 18px; }
/* 표지 그림은 아래쪽에 작게 놓아 위쪽을 제목(.logo) 자리로 비운다 */
.cover-art { width: 100%; height: auto; aspect-ratio: 1; padding: 27% 9% 3%; object-fit: contain; background: var(--paper); border-radius: var(--panel-radius); }
.cover-miri, .ending-miri { filter: drop-shadow(0 10px 14px rgba(31, 52, 140, 0.25)); }
.logo { position: absolute; top: 7%; left: 0; right: 0; margin: 0; line-height: 1; font-weight: 400; }
.logo span { display: block; font-family: var(--font-letter); font-size: 22px; color: var(--ink); }
.logo strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-letter);
  font-weight: 400;
  font-size: 60px;
  letter-spacing: -0.01em;
  color: var(--brand-deep);
  -webkit-text-stroke: 10px #fff;
  paint-order: stroke fill;
  filter: drop-shadow(0 8px 14px rgba(31, 52, 140, 0.25));
}
.cover-miri { position: absolute; left: -14px; bottom: -26px; width: 104px; height: auto; }
.sfx-cover { top: 44%; right: 6px; transform: rotate(10deg); }
.lead { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.55; }
.meta { margin: -6px 0 2px; font-size: 14px; color: var(--sub); }

.collection { background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: var(--panel-radius); box-shadow: var(--shadow); padding: 14px; }
.collection h2 { margin: 0 0 10px; font-family: var(--font-letter); font-weight: 400; font-size: 18px; }
.collection h2 b { color: var(--brand-deep); font-weight: 400; }
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; background: var(--chip-bg); color: var(--chip-ink); font-size: 12px; line-height: 1.25; }
.chip b { font-family: var(--font-letter); font-weight: 400; font-size: 22px; }
.chip.got { background: var(--mid-soft); color: var(--ink); }
.chip.got b { color: var(--bad); }
.foot { margin: 4px 0 0; font-size: 12px; color: var(--sub); line-height: 1.65; }

/* ---------- 진행 줄 ---------- */
/* 색만으로 상태를 나누지 않는다: 아직 = 빈 원, 지난 = 채운 원, 지금 = 가로 막대 */
.hud { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.dots { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.dots li { width: 8px; height: 8px; border-radius: 4px; background: var(--paper); border: 1.5px solid var(--sub); transition: width 0.3s var(--ease-out); }
.dots li.done { background: var(--brand-deep); border-color: var(--brand-deep); }
.dots li.now { width: 18px; background: var(--brand-deep); border-color: var(--brand-deep); }
.score { margin: 0; font-size: 14px; color: var(--sub); }
.score b { font-family: var(--font-letter); font-weight: 400; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.step-title { margin: 2px 0 0; font-family: var(--font-letter); font-weight: 400; font-size: 26px; line-height: 1.2; }

/* ---------- 장면 그림 ---------- */
.phone { width: 100%; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.push { display: flex; gap: 10px; align-items: flex-start; margin: 10px; padding: 10px 12px; background: var(--push-bg); border-radius: 12px; font-size: 13px; line-height: 1.4; }
.push .ico { color: var(--brand-deep); margin-top: 2px; }
.push p { margin: 0; }
.push b { display: block; font-size: 13px; }
.push span { color: var(--sub); }
.product { display: flex; gap: 12px; align-items: center; padding: 4px 12px 14px; }
.product-art { position: relative; flex: 0 0 92px; height: 104px; display: grid; place-items: center; background: var(--product-bg); border-radius: 12px; }
.bottle { width: 78px; height: 96px; object-fit: contain; }
.burst { position: absolute; top: -8px; right: -12px; display: grid; place-items: center; width: 46px; height: 46px; background: var(--alert-strong); color: #fff; font-family: var(--font-letter); font-size: 15px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 6px 12px -4px rgba(196, 40, 63, 0.6); transform: rotate(12deg); }
.product-info { min-width: 0; }
.product-info p { margin: 0; }
.product-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px !important; }
.product-tags span { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); }
.product-name { font-size: 14px; font-weight: 800; line-height: 1.35; }
.product-price { font-size: 13px; color: var(--sub); margin-top: 2px !important; }
.product-price b { color: var(--bad); font-size: 19px; font-variant-numeric: tabular-nums; }
.product-seller { font-size: 12px; color: var(--sub); margin-top: 3px !important; }
.product-timer { display: flex; align-items: center; gap: 4px; margin-top: 4px !important; font-size: 12px; font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }

.phone-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--ink); color: #fff; font-size: 13px; }
.phone-bar span { color: var(--chat-bar-sub); }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; background: var(--chat-bg); }
.bubble { margin: 0; max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.bubble.seller { align-self: flex-start; background: var(--paper); border: 1.5px solid var(--chat-line); border-top-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--brand-deep); color: #fff; border-top-right-radius: 4px; }
.chat-system { margin: 4px 0 0; align-self: center; font-size: 12px; color: #fff; background: var(--chat-system); padding: 4px 10px; border-radius: 10px; }

.art { position: relative; width: 100%; }
.art img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
/* 표지는 가리키는 곳(번진 라벨, 빈 표시사항 칸) 가까이에 두고 말꼬리로 가리킨다. 위치는 그림(unbox.webp) 기준 % */
.pin { position: absolute; padding: 4px 10px; background: var(--alert-strong); color: #fff; font-family: var(--font-letter); font-size: 14px; line-height: 1.3; border: 0; border-radius: 10px; box-shadow: 0 8px 16px -6px rgba(196, 40, 63, 0.6); white-space: nowrap; }
.pin::after { content: ''; position: absolute; width: 10px; height: 10px; background: inherit; border: 0; }
.pin-a { left: 15%; top: 45%; transform: rotate(-4deg); }
.pin-a::after { right: -7px; top: 50%; margin-top: -5px; transform: rotate(-45deg); } /* 오른쪽(번진 라벨)을 가리킴 */
.pin-b { right: 9%; top: 60%; transform: rotate(4deg); }
.pin-b::after { left: -7px; top: 50%; margin-top: -5px; transform: rotate(135deg); } /* 왼쪽(빈 표시사항 칸)을 가리킴 */

.think { display: flex; align-items: center; gap: 10px; width: 100%; }
/* 완성본 15번 컷에는 팻말이 없으므로 "의심 신호 발견!"은 캐릭터 아래 배지로 둔다(그림 위에 겹치지 않게) */
.sign-miri { flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sign-miri .miri { width: 142px; height: auto; }
.sign-text {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--alert-strong);
  box-shadow: 0 6px 14px -6px rgba(196, 40, 63, 0.7);
  font-family: var(--font-letter);
  font-size: 14px;
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
}
.clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.clues li { display: flex; gap: 6px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-sm); font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.clues .ico { color: var(--brand-deep); }

/* ---------- 선택지 ---------- */
.prompt { margin: 4px 0 -4px; font-family: var(--font-letter); font-weight: 400; font-size: 19px; }
.choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.choice {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), background-color 0.15s;
}
.choice:active { transform: scale(0.98); }
.key { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, var(--brand-top) 0%, var(--violet) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); color: #fff; font-family: var(--font-letter); font-size: 15px; }

/* ---------- 반응 컷 ---------- */
.react { padding: 12px 12px 10px; animation-name: rise; }
@keyframes rise { from { transform: translateY(18px); } }
.react.tone-good { background: var(--good-soft); }
.react.tone-mid { background: var(--mid-soft); }
.react.tone-bad { background: var(--bad-soft); }
.verdict { display: flex; align-items: center; gap: 6px; margin: 0; font-family: var(--font-letter); font-size: 20px; }
.tone-good .verdict { color: var(--good); }
.tone-mid .verdict { color: var(--mid); }
.tone-bad .verdict { color: var(--bad); }
.verdict b { font-weight: 400; margin-left: 2px; }
.react-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.react-miri { flex: 0 0 104px; width: 104px; height: auto; }
/* 05번(O 판을 머리 위로 든 컷)은 인물이 작게 그려져 있어 조금 키워 다른 컷과 크기를 맞춘다 */
.react-miri.pose-05 { flex-basis: 118px; width: 118px; margin-right: -8px; }
.say {
  position: relative;
  margin: 0;
  padding: 11px 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}
.say::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.react-pick { margin: 8px 2px 0; font-size: 13px; color: var(--sub); }

/* ---------- 4컷 (진행 과정·안내) ---------- */
.letter-title { margin: 8px 0 0; font-family: var(--font-letter); font-weight: 400; font-size: 28px; line-height: 1.25; }
.narration { margin: -4px 0 0; font-size: 16px; font-weight: 600; color: var(--sub); }
.four-cut { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-cut { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 16px; box-shadow: var(--shadow-sm); animation: swipe 0.5s var(--ease-out) both; }
.mini-cut:nth-child(2) { animation-delay: 0.12s; }
.mini-cut:nth-child(3) { animation-delay: 0.24s; }
.mini-cut:nth-child(4) { animation-delay: 0.36s; }
.mini-cut .miri { width: 84px; height: auto; align-self: center; }
.mini-cut b { display: flex; align-items: center; gap: 6px; font-family: var(--font-letter); font-weight: 400; font-size: 16px; line-height: 1.25; }
.mini-n { flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, var(--brand-top) 0%, var(--brand-deeper) 100%); color: #fff; font-size: 13px; }
.mini-status { align-self: flex-start; padding: 1px 9px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #ffe07a 0%, var(--coat) 100%); font-size: 13px; font-weight: 700; line-height: 1.5; }
.mini-cut p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--sub); }

/* ---------- 엔딩 ---------- */
.ending { padding-top: 14px; }
.ending-cut { margin: 0 2px 16px; }
.ending-art { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--panel-radius); }
.new-tag { position: absolute; top: -13px; left: 12px; padding: 3px 10px; background: var(--alert-strong); color: #fff; font-family: var(--font-letter); font-size: 14px; border: 0; border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(196, 40, 63, 0.7); }
.cut-credit { position: absolute; right: 12px; bottom: -12px; padding: 2px 10px; background: var(--paper); color: var(--sub); font-family: var(--font-letter); font-size: 12px; line-height: 1.5; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.rank {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 50% at 50% 20%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%),
    var(--coat);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 20px -8px rgba(31, 52, 140, 0.45);
  font-family: var(--font-letter);
  font-size: 34px;
  color: var(--ink);
  transform: rotate(-8deg);
}
.tone-good .rank { background: radial-gradient(70% 50% at 50% 20%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%), var(--rank-good); }
.tone-bad .rank { background: radial-gradient(70% 50% at 50% 20%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%), var(--rank-bad); }
/* 엔딩 B 그림(end-half)은 오른쪽 위에 날아가는 동전이 있어 도장을 오른쪽 아래 빈 곳으로 옮긴다 */
.tone-mid .rank { top: auto; bottom: 18px; }
.ending-miri { position: absolute; left: -10px; bottom: -20px; width: 104px; height: auto; }
.result-title { margin: 0; text-align: center; font-family: var(--font-letter); font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; }
.result-score { margin: -6px 0 0; text-align: center; font-size: 15px; color: var(--sub); }
.result-score b { font-family: var(--font-letter); font-weight: 400; font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wallet { align-self: center; margin: 0; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.tone-good .wallet { background: var(--good-soft); color: var(--good); }
.tone-mid .wallet { background: var(--mid-soft); color: var(--mid); }
.tone-bad .wallet { background: var(--bad-soft); color: var(--bad); }
.result-text { margin: 0; text-align: center; font-size: 16px; line-height: 1.6; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.review { background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 2px 14px; }
.review summary { cursor: pointer; padding: 11px 0; min-height: 44px; font-family: var(--font-letter); font-size: 17px; }
.review summary:focus-visible { outline-offset: -2px; border-radius: 8px; }
.review ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review li { display: flex; gap: 10px; align-items: flex-start; }
.review li .ico { width: 22px; height: 22px; margin-top: 1px; }
.review li.good .ico { color: var(--good); }
.review li.mid .ico { color: var(--mid); }
.review li.bad .ico { color: var(--bad); }
.review b { font-size: 13px; color: var(--sub); }
.review p { margin: 0; font-size: 15px; }

.guide { padding: 16px 12px 14px; background: linear-gradient(180deg, #e9efff 0%, #eee9ff 100%); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: var(--panel-radius); box-shadow: var(--shadow); }
.guide h2 { margin: 0 0 12px; font-family: var(--font-letter); font-weight: 400; font-size: 22px; }
.guide .mini-cut { animation: none; }
.guide-name { margin: 14px 0 10px; text-align: center; font-family: var(--font-letter); font-size: 18px; color: var(--brand-deep); }
.soon { margin: 0; padding: 11px; text-align: center; font-weight: 800; background: var(--paper); border: 1.5px dashed var(--brand-deep); border-radius: 14px; }

.cross { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 16px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; }
.cross.is-soon { border: 1.5px dashed var(--line-strong); box-shadow: none; }
.cross .miri { flex: 0 0 56px; width: 56px; height: auto; }
.cross span { font-size: 14px; color: var(--sub); line-height: 1.4; }
.cross b { display: block; font-size: 16px; color: var(--ink); }
.soon-badge { display: inline-block; padding: 0 7px; font-style: normal; font-size: 12px; font-weight: 800; line-height: 1.6; white-space: nowrap; color: var(--mid); background: var(--paper); border: 1.5px solid var(--mid); border-radius: 6px; }

/* ---------- 확인 1문항 (본문 글꼴; 정답·오답은 색만이 아니라 테두리 모양과 해설 글로도 드러난다) ---------- */
.quiz { padding: 14px 12px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: var(--panel-radius); box-shadow: var(--shadow); }
.quiz-q { margin: 0 0 10px; font-family: var(--font-body); font-weight: 800; font-size: 17px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
}
.quiz-option[aria-disabled="true"] { cursor: default; }
.quiz-option.is-correct { background: var(--good-soft); border-color: var(--good); border-width: 3px; }
.quiz-option.is-wrong { background: var(--bad-soft); border-color: var(--bad); border-style: dashed; }
/* 비어 있어도 접근성 트리에 남도록 display:none이 아니라 높이만 0으로 둔다 */
.quiz-explain { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5; font-weight: 700; }
.quiz-explain:empty { height: 0; overflow: hidden; }
.quiz-explain:not(:empty) { margin-top: 10px; }
.quiz-skip { margin: 6px auto 0; width: auto; padding: 0 12px; }
.share-row { margin: 0; }

/* ---------- 토스트 ---------- */
/* 양옆 16px 안에서 글자 폭만큼만 차지한다(가운데 맞춤을 transform으로 하면 상자 폭이 화면 절반으로 줄어 낱말 중간에서 줄이 바뀐다).
 * 화면 위쪽에 띄워 결과 글·공유 버튼을 가리지 않는다. */
.toast {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  top: calc(env(safe-area-inset-top) + 16px);
  width: fit-content;
  max-width: 448px;
  margin: 0 auto;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  word-break: keep-all;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }

/* ---------- 키 작은 화면 (360×640 등): 장면 그림을 줄여 선택지가 첫 화면에 더 들어오게 ---------- */
@media (max-height: 720px) {
  .scene-unbox .art { width: min(100%, 40vh); }
  .pin { font-size: 13px; padding: 3px 7px; }
  .chat { padding: 10px; gap: 6px; }
  .bubble { font-size: 14px; padding: 7px 11px; }
  .caption { font-size: 15px; padding: 8px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
