/* B3 노란 리프트권과 설원(mockups/design-b3-v2.html). 글꼴은 assets/fonts 에 함께 둔다. */
/* 제목: Fredoka. 부제목과 시스템 글자, 리프트권: 나눔스퀘어라운드. 본문: 학교안심 책갈피. */
@font-face { font-family: "NanumSquareRound"; src: url("../assets/fonts/NanumSquareRoundR.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NanumSquareRound"; src: url("../assets/fonts/NanumSquareRoundB.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "NanumSquareRound"; src: url("../assets/fonts/NanumSquareRoundEB.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Chaekgalpi"; src: url("../assets/fonts/Chaekgalpi.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "TtukttakGamja"; src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/2610081905@tuktakpotato/tuktakpotato/tuktakpotato.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../assets/fonts/Fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
/* 일본어: 둥근 고딕 M PLUS Rounded 1c(나눔스퀘어라운드 자리), 손글씨 Yusei Magic(책갈피 자리). 중국어: Resource Han Rounded, Xiaolai. 모두 SIL OFL 1.1, 문구에 쓰는 글자만 담았다(tools/subset-fonts.mjs) */
@font-face { font-family: "MPlusRounded"; src: url("../assets/fonts/MPlusRounded-B.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "MPlusRounded"; src: url("../assets/fonts/MPlusRounded-EB.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "YuseiMagic"; src: url("../assets/fonts/YuseiMagic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "ResourceHanRounded"; src: url("../assets/fonts/ResourceHanRounded-B.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "ResourceHanRounded"; src: url("../assets/fonts/ResourceHanRounded-H.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Xiaolai"; src: url("../assets/fonts/Xiaolai.woff2") format("woff2"); font-display: swap; }

:root {
  --album-ink: #342d49;
  --head: #443d59;
  --sub: #575171;
  --ticket: #fff2c2;
  --ticket-stub: #ffeaa6;
  --perf: #e6d18c;
  --accent: #e8573f;
  --sky: #d7cafd;
  --cjk: "Apple SD Gothic Neo", "Pretendard", "Hiragino Sans", "Yu Gothic", "PingFang SC", "Microsoft YaHei", "Malgun Gothic", "맑은 고딕", sans-serif;
  --font-display: "Fredoka", var(--cjk);
  /* 부제목은 제목과 맞춘다: 영문, 숫자, 문장부호는 Fredoka, 한글은 나눔스퀘어라운드 아주 굵게 */
  --font-sub: "Fredoka", "NanumSquareRound", var(--cjk);
  --font-ui: "NanumSquareRound", var(--cjk);
  --font-body: "TtukttakGamja", "Chaekgalpi", "NanumSquareRound", var(--cjk);
  --font-body-spacing: 0.015em;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* 화면 전체 드래그, 글자 선택, 그림 끌기, 길게 눌러 저장 메뉴를 막는다 */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg { -webkit-user-drag: none; user-drag: none; }
body {
  background: var(--sky);
  color: var(--head);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
/* 일본어, 중국어는 띄어쓰기가 없어 keep-all 이면 낱말 중간에서 억지로 끊긴다.
   일본어는 문절 단위(auto-phrase, 지원 안 하는 브라우저는 normal), 중국어는 글자 단위로 끊는다. */
html:lang(ja) body, html:lang(zh-CN) body { word-break: normal; }
html:lang(ja) body { word-break: auto-phrase; }
/* 마지막 줄에 한 마디만 떨어지지 않게 줄바꿈한다. */
.title, .quiz h2, .tname, .friends-title, .option, .tdesc,
.intro, .overlay p, .status, .modal-box h3, .modal-box p { text-wrap: pretty; }
button { font: inherit; color: inherit; }

/* 배경 설원은 화면 폭 440px 안에서만 깐다 */
.shell {
  position: relative; max-width: 440px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  background: var(--sky) url("../assets/bg/winter-scene.webp") center bottom / cover no-repeat;
  display: flex; flex-direction: column;
}
/* 오른쪽 위 옵션: 효과음과 언어를 알약 트랙 하나에 담고, 고른 언어 뒤로 알약(.pill)이 미끄러진다.
   색과 그림자는 아래 글래스모피즘 토큰(--track-*, --pill-*)이 정한다 */
.topbar {
  position: absolute; top: 14px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px; background: var(--track-bg); box-shadow: var(--track-shadow);
  -webkit-backdrop-filter: var(--track-blur); backdrop-filter: var(--track-blur);
}
/* 효과음 켜고 끄기: 꺼지면 흐리게, 언어 탭과는 옅은 세로선으로 나눈다 */
.sound-toggle {
  position: relative; width: 32px; height: 32px; padding: 6px; border: 0; background: none; color: var(--head);
  cursor: pointer; opacity: .8; border-radius: 50%; transition: opacity .3s var(--ease-soft);
}
.sound-toggle::after { content: ""; position: absolute; right: -2px; top: 9px; bottom: 9px; width: 1px; background: rgba(54, 59, 110, .18); }
.sound-toggle[aria-pressed="false"] { opacity: .4; }
.sound-toggle svg { width: 20px; height: 20px; display: block; }
.sound-toggle:focus-visible, .lang-tabs button:focus-visible { outline: 2px solid var(--head); outline-offset: 1px; }
.lang-tabs { position: relative; display: flex; gap: 0; margin-left: 2px; }
.lang-tabs button {
  position: relative; z-index: 1; border-radius: 999px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 800;
  min-width: 34px; min-height: 32px; padding: 4px 8px; border: 0; background: none; color: var(--head);
  cursor: pointer;
}
.lang-tabs .pill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 34px; border-radius: 999px;
  background: var(--pill-bg); box-shadow: var(--pill-shadow);
  transition: transform .5s var(--ease-glide), width .5s var(--ease-glide);
}

.app { flex: 1; display: flex; flex-direction: column; padding: 66px 22px 24px; }

.brand { font-family: var(--font-display); font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: .08em; color: var(--sub); }
.album { font-family: var(--font-display); color: var(--album-ink); font-size: 48px; font-weight: 700; line-height: .92; margin: 2px 0 0; letter-spacing: -.01em; }
.title { font-family: var(--font-sub); font-weight: 800; font-size: 23px; line-height: 1.3; letter-spacing: -.025em; margin: 10px 0 0; max-width: 260px; }
/* 한국어 부제목은 한 줄로: 폭이 좁은 화면에서는 글자를 줄여 맞춘다(한 줄 폭이 글자 크기의 약 13.9배) */
html:lang(ko) .title { white-space: nowrap; max-width: none; font-size: min(23px, calc((100vw - 48px) / 14)); }
.intro {
  font-family: var(--font-body); font-size: 16px; line-height: 1.7; letter-spacing: 0.015em; color: var(--sub); text-align: center;
  align-self: stretch; margin: 16px 0 24px; white-space: pre-line;
}

/* 티켓: 그림자는 바깥 틀(tw)이 맡고, 안쪽은 양옆 반원 홈을 실제로 뚫는다 */
.tw { flex: 1; display: flex; margin: 20px 0 16px; filter: drop-shadow(0 8px 14px rgba(54, 59, 110, .16)); }
/* 홈 위치(--cut)를 모핑할 수 있게 등록한다. 지원하지 않는 브라우저는 바로 바뀐다 */
@property --cut { syntax: '<length-percentage>'; inherits: false; initial-value: 66%; }
/* 첫 화면 리프트권은 바닥에 붙이지 않고, 제목 아래 남는 공간 가운데보다 조금 위에 둔다 */
.start .tw { flex: 0 0 auto; min-height: 260px; margin-top: auto; margin-bottom: 14px; }
.start .tap-hint { margin-bottom: auto; padding-bottom: clamp(0px, 7vh, 72px); }
.ticket {
  flex: 1; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--ticket);
  -webkit-mask: radial-gradient(circle 11px at 0 var(--cut, 66%), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--cut, 66%), #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 var(--cut, 66%), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--cut, 66%), #0000 97%, #000) right / 51% 100% no-repeat;
}
.main { position: relative; padding: 24px 20px 12px; flex: 1; display: flex; flex-direction: column; }
.hole { position: absolute; top: 10px; left: 50%; width: 36px; height: 7px; margin-left: -18px; border-radius: 4px; background: rgba(54, 59, 110, .14); }
.tline { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--ticket-detail, var(--sub)); }
.stub { position: relative; background: var(--ticket-stub); border-top: 2px solid transparent; padding: 14px 20px; }
/* 절취선: 테두리 대신 그린 점선이라 왼쪽에서 오른쪽으로 그어지는 움직임을 줄 수 있다 */
.stub::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--perf) 0 6px, transparent 6px 11px);
}
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.barcode { width: 92px; height: 18px; flex: none; color: var(--ticket-detail, var(--head)); background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px, currentColor 8px 11px, transparent 11px 13px); opacity: .75; }
.resort { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--ticket-detail, var(--sub)); text-align: right; }

/* 마스코트 자리 */
.art { display: flex; align-items: center; justify-content: center; }
.art img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }

/* 첫 화면 */
.start .main { align-items: center; justify-content: center; gap: 10px; }
.start .art { width: 132px; height: 121px; }
.start .tline { width: 100%; margin-top: 4px; }

/* 개찰 전 리프트권: 인쇄된 표처럼. 옅은 물결무늬 바탕, 리조트 이름, 사선 띠, 고양이 그림자 줄 */
.start .main {
  justify-content: flex-start; gap: 0; padding-top: 34px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24'%3E%3Cpath d='M0 12 Q15 4 30 12 T60 12 T90 12 T120 12' fill='none' stroke='%23e6d18c' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 120px 12px repeat;
  background-color: transparent;
}
.start .main::before {
  /* 물결무늬가 가장자리로 갈수록 옅어지게 가운데만 남긴다 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 65% at 50% 55%, rgba(255, 242, 194, .35), var(--ticket) 78%);
}
.start .main > :not(.hole):not(.punch-spot) { position: relative; }
.t-head {
  align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--sub);
}
.t-band {
  align-self: stretch; margin: 10px -20px 0; height: 30px; display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(-55deg, rgba(255, 255, 255, .09) 0 6px, transparent 6px 14px),
    var(--head);
}
.t-band span {
  font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .5em; margin-right: -.5em;
  color: var(--ticket);
}
.t-band::before, .t-band::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ticket); opacity: .7; margin: 0 14px;
}
.t-cats { display: flex; align-items: flex-end; justify-content: center; margin: 16px 0 12px; height: 104px; }
.t-cats .shade { display: block; width: 58px; margin: 0 -2px; }
.t-cats .shade:nth-child(2), .t-cats .shade:nth-child(4) { width: 68px; z-index: 1; }
.t-cats .shade:nth-child(3) { width: 86px; z-index: 2; }
.t-cats img { display: block; width: 100%; height: auto; filter: brightness(0); opacity: .13; }
.start .tline { padding-top: 10px; border-top: 1.5px dashed rgba(115, 101, 53, .28); }

/* 문답 */
.quiz .tw { flex: 1 0 auto; margin: 16px 0 0; }
.quiz h2 { font-family: var(--font-sub); font-weight: 800; font-size: 20px; line-height: 1.4; letter-spacing: -.025em; text-align: center; margin: auto 0; padding-block: 12px; }
.options { display: grid; gap: 8px; }
.option {
  font-family: var(--font-body); font-size: 16px; line-height: 1.5; letter-spacing: 0.015em; text-align: center; color: #414141;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 0; background: var(--opt-bg); box-shadow: var(--opt-shadow); /* 외곽선 없이 면으로만 구분한다 */
}
.option.is-picked { background: #ffda71; box-shadow: none; }
.steps { display: flex; gap: 5px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: rgba(54, 59, 110, .14); }
.steps span.done { background: var(--head); }
.steps span.now { background: rgba(54, 59, 110, .42); }
.quiz .tfoot { min-height: 32px; }
.prev {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: rgba(54, 59, 110, .09); color: var(--head); cursor: pointer;
  transition: background-color .25s var(--ease-soft), transform .25s var(--ease-soft);
}
.prev svg { display: block; width: 18px; height: 18px; }
.prev:active { transform: scale(.92); transition-duration: .08s; }
@media (hover: hover) { .prev:hover { background: rgba(54, 59, 110, .16); } }
.prev:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.prev[hidden] { visibility: hidden; display: inline-flex; }

/* 결과 */
.result .main { padding-bottom: 16px; }
.result, .loading, .friends { --ticket-detail: #d6bc73; }
.quiz { --ticket-detail: #856421; }
.result .main > :is(.tname, .tsub) { text-align: center; }
.result .main > .tsub { margin-top: 20px; }
.result .main > .tname { margin-top: 0; margin-bottom: 6px; }
.tname { font-family: var(--font-sub); font-weight: 800; font-size: 40px; line-height: 1.15; letter-spacing: -.03em; margin-top: 8px; }
.tsub { font-family: var(--font-ui); font-weight: 800; font-size: 13px; letter-spacing: -.01em; color: var(--sub); }
.result .art { flex: 1; min-height: 120px; margin-top: 12px; }
.tdesc, .mates { border-radius: 16px; background: rgba(255, 255, 255, .45); }
.tdesc { font-family: var(--font-body); font-size: 16px; line-height: 1.65; letter-spacing: var(--font-body-spacing, -.015em); margin: 0; padding: 20px; }
.tdesc-title { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.4; }
.tdesc-body { margin: 0; }
.tdesc-title + .tdesc-body { margin-top: 8px; }
/* 그림이 뜨기 전 자리: 같은 그림의 그림자 */
.art .shade-img { filter: brightness(0); opacity: .12; }
/* 짝 친구는 좌우 두 칸에 놓고, 각 칸을 누르면 상세 창을 연다. */
.mates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding: 24px 16px; }
.mate {
  display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: end; gap: 8px;
  min-width: 0; padding: 0; border: 0; background: transparent; text-align: center;
  cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; transition: transform .25s var(--ease-soft);
}
.mate-portrait { position: relative; width: min(100%, 96px); aspect-ratio: 1; }
.mate-pic {
  width: 100%; height: 100%; border-radius: 50%; background: rgba(232, 87, 63, .12);
  display: grid; place-items: center; overflow: hidden;
}
.mate-pic img { display: block; width: 90%; height: 90%; object-fit: contain; }
.mate-label { font-family: var(--font-ui); font-weight: 700; font-size: 12px; line-height: 1.3; color: var(--sub); }
.mate-name { font-family: var(--font-sub); font-weight: 800; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; color: var(--head); }
.mate.rival .mate-pic { background: rgba(75, 79, 134, .1); }
.mate-mark {
  display: flex; align-items: center; justify-content: center; position: absolute; right: -3px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff7dc;
}
.mate-portrait .mate-mark { right: 3px; bottom: 3px; width: 22px; height: 22px; }
.mate.rival .mate-mark { background: var(--sub); }
.mate-mark svg { width: 12px; height: 12px; fill: #fff; }
.mate:active { transform: scale(.98); }
.mate:focus-visible { outline: 2px solid var(--head); outline-offset: 2px; }

/* 버튼 */
.btn {
  display: block; width: 100%; padding: 15px 16px; border-radius: 999px; border: 0;
  background: var(--primary-bg); color: var(--head); font-family: var(--font-ui); font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  box-shadow: var(--primary-shadow); cursor: pointer; text-align: center; text-decoration: none;
}
.btn:active { transform: translateY(2px); box-shadow: var(--primary-shadow-press); }
/* 리프트권 저장 버튼은 같은 줄에서 배경으로 구분한다. */
.btn.primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-backdrop-filter: var(--primary-blur, none); backdrop-filter: var(--primary-blur, none);
}
.btn.primary::before {
  content: ""; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7.5 10.5 12 15l4.5-4.5'/%3E%3Cpath d='M5 19.5h14'/%3E%3C/svg%3E");
}
.btn-row .btn, .actions .btn.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-height: 40px; padding: 9px 16px; font-size: 13px; font-weight: 800; color: var(--head);
  background: var(--chip-bg); box-shadow: var(--chip-shadow);
  -webkit-backdrop-filter: var(--chip-blur); backdrop-filter: var(--chip-blur);
}
.btn-row .btn:active, .actions .btn.ghost:active { box-shadow: var(--chip-shadow-press); }
.btn-row .btn[hidden] { display: none; }
.btn.x-share { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E"); }
.actions .btn.ghost { display: flex; margin: 10px auto 0; }
/* 복사 알림 자리는 버튼들 맨 아래에 둔다(알약 줄과 다시 하기 사이가 벌어지지 않게) */
.result .actions { display: flex; flex-direction: column; }
.result .actions > .toast, .result .actions > .copy-field { order: 1; }
.result .actions .btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(4px, 1.5vw, 8px); }
.result .actions .btn-row .btn { width: 100%; min-width: 0; padding-inline: 0; }
.result .actions .btn-row .btn.primary { background: #fff; }
.btn.icon-only:not(.story)::before, .btn.retry::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.result .actions .btn.icon-only { min-height: 44px; }
.btn.icon-only:not(.story)::before, .btn.story > svg { display: block; width: 20px; height: 20px; }
.btn.facebook { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 21v-8h2.7l.4-3H14V8.2c0-.9.2-1.5 1.6-1.5H17V4a19 19 0 0 0-2.3-.1c-2.3 0-3.9 1.3-3.9 3.8V10H8v3h2.8v8z'/%3E%3C/svg%3E"); }
.btn.copy { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1'/%3E%3Cpath d='M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E"); }
.btn.retry { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 1 0 2.4-5.7'/%3E%3Cpath d='M4 4v4.5h4.5'/%3E%3C/svg%3E"); }
.btn.qr { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='6.5' height='6.5' rx='1.2'/%3E%3Crect x='14' y='3.5' width='6.5' height='6.5' rx='1.2'/%3E%3Crect x='3.5' y='14' width='6.5' height='6.5' rx='1.2'/%3E%3Cpath d='M14 14h2.5v2.5H14zM18 18h2.5v2.5H18zM14 19h1.5M19 14h1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.toast {
  text-align: center; font-size: 13px; font-weight: 800; color: var(--head); margin-top: 16px; min-height: 1.5em; line-height: 1.5;
  opacity: 0; transform: translateY(10px); transition: opacity .3s var(--ease-soft), transform .3s var(--ease-soft);
}
.toast.show { opacity: 1; transform: none; transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }

/* 저장 안내 창 */
.modal {
  position: fixed; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(54, 59, 110, .6); animation: fade .25s var(--ease-soft) both;
}
.modal-box {
  width: 100%; max-width: 320px; padding: 22px 20px 20px; border-radius: 24px; text-align: center;
  background: var(--ticket); color: var(--head); box-shadow: 0 18px 44px rgba(54, 59, 110, .35);
  animation: rise .45s var(--ease-out) both;
}
.modal-box img { display: block; width: auto; max-width: 62%; max-height: 34vh; margin: 0 auto 14px; border-radius: 12px; box-shadow: var(--outline-shadow); }
.modal-box h3 { margin: 0; font-family: var(--font-sub); font-weight: 800; font-size: 19px; line-height: 1.3; letter-spacing: -.02em; }
.modal-box p { margin: 8px 0 16px; font-family: var(--font-body); letter-spacing: var(--font-body-spacing, normal); font-size: 14px; line-height: 1.6; color: var(--sub); }
.modal-box .btn { margin: 0; }
.modal-box .btn, .mate-sheet .btn {
  --primary-bg: #ffe093;
  --primary-shadow: 0 0 1px 1px rgba(110, 77, 30, .24);
  --primary-shadow-press: var(--primary-shadow);
  --primary-blur: none;
}
/* QR 공유 창: 흰 판 위의 QR. 옆 사람이 휴대폰으로 찍기 좋게 창 폭을 거의 다 쓴다 */
.qr-code { width: min(220px, 70vw); aspect-ratio: 1; margin: 0 auto 14px; padding: 6px; border-radius: 16px; background: #fff; box-shadow: var(--outline-shadow); }
.qr-code svg { display: block; width: 100%; height: 100%; border-radius: 10px; }
.modal-box .btn.primary::before { content: none; }
/* 셔터 플래시: 한 번만, 가장 밝을 때도 30%, 0.6초에 걸쳐 사라진다(깜빡임 반복 없음) */
.flash { position: fixed; inset: 0; z-index: 12; pointer-events: none; background: #fff; opacity: 0; animation: flash .6s ease-out both; }
@keyframes flash { 0% { opacity: 0; } 18% { opacity: .3; } 100% { opacity: 0; } }

/* 저장 이미지 오버레이 (인앱 브라우저) */
.overlay { position: fixed; inset: 0; background: rgba(54, 59, 110, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.overlay img { max-width: 100%; max-height: 75vh; border-radius: 16px; }
.overlay p { color: var(--head); background: var(--ticket); padding: 6px 12px; border-radius: 8px; margin: 12px 0; font-family: var(--font-body); letter-spacing: var(--font-body-spacing, normal); }
.overlay .btn { max-width: 240px; background: #fff; color: var(--head); }
.copy-field { color: var(--head); width: 100%; margin-top: 8px; padding: 10px; border-radius: 12px; border: 2px solid var(--perf); font-size: 14px; }
/* 화면 전체는 선택, 길게 누르기 메뉴를 막아 두지만(body), 직접 복사하는 주소 칸과 길게 눌러 저장하는 이미지는 풀어 준다 */
.copy-field { -webkit-user-select: text; user-select: text; }
.overlay img { -webkit-touch-callout: default; }

/* ── 움직임 ──
   튕김 없이 감속하며 멈추는 곡선 두 개만 쓴다. 한 화면에서 공들인 순간은 결과 발권 하나이고,
   나머지는 상태를 알려 주는 짧은 반응이다. 계속 도는 움직임은 눈 내림과 고양이 숨쉬기뿐이다. */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);  /* 도착: 가볍게 와서 길게 내려앉는다 */
  --ease-glide: cubic-bezier(.45, 0, .2, 1); /* 큰 이동: 천천히 출발해 천천히 멈춘다 */
  --ease-soft: cubic-bezier(.33, 1, .68, 1); /* 반응: 짧고 담백하게 */
}

/* 눈 내림: 화면 위에 겹친 층. app.js 가 눈송이를 만든다. 느리고 흐리게, 바람은 살짝 */
.snow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.snow i {
  position: absolute; top: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: #fff; opacity: var(--o, .7); animation: snowfall var(--d) linear var(--delay) infinite;
}
.app, .topbar { position: relative; z-index: 1; }
.topbar { position: absolute; z-index: 3; } /* 본문(.app)보다 위에 둬야 눌린다 */
@keyframes snowfall {
  0% { transform: translate(0, 0); }
  50% { transform: translate(var(--drift, 8px), 52vh); }
  100% { transform: translate(0, 105vh); }
}

/* 첫 화면: 위에서부터 한 줄씩 천천히 떠오른다. 간격 120ms, 1.7초쯤에 다 자리 잡는다 */
.start > * { animation: rise 1.1s var(--ease-out) both; }
.start > :nth-child(2) { animation-delay: .12s; }
.start > :nth-child(3) { animation-delay: .24s; }
.start > :nth-child(4) { animation-delay: .36s; }
.start > :nth-child(5) { animation-delay: .48s; }
.start > .tap-hint { animation-delay: .6s; }
/* 고양이는 등장 뒤 천천히 숨만 쉰다 */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: none; } 50% { transform: translateY(-2px) scale(1.012); } }

/* 문답: 다음 질문은 오른쪽에서, 이전 질문은 왼쪽에서 짧게 미끄러져 들어온다 */
.quiz.dir-next .ticket { animation: slide-next .7s var(--ease-out) both; }
.quiz.dir-prev .ticket { animation: slide-prev .7s var(--ease-out) both; }
.option {
  animation: rise .9s calc(.2s + var(--i, 0) * .08s) var(--ease-out) both;
  transition: transform .25s var(--ease-soft), background-color .08s var(--ease-soft), color .35s var(--ease-soft), box-shadow .35s var(--ease-soft);
}
.option:active { transform: scale(.985); }
.option.is-picked { animation: press .14s var(--ease-soft) both; }
.steps span { transition: background-color .5s var(--ease-soft); }
@keyframes slide-next { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes press { 0% { transform: scale(.985); } 100% { transform: none; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 고르면 누른 자리에서 눈송이 몇 알이 퍼지며 사라진다 */
.burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c);
  animation: burst .9s var(--ease-out) both;
}
@keyframes burst {
  from { opacity: .9; transform: translate(0, 0) scale(.6); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* 결과: 리프트권이 발권기에서 나오듯 내려온다. */
.result .tw { animation: issue 1.3s var(--ease-out) both; }
.result .actions { animation: rise .9s 1.5s var(--ease-out) both; }
/* 이름은 글자가 차례로 떠오르고, 고양이는 리프트권이 다 나온 뒤 살며시 올라온다 */
.tname .letters { display: inline-block; }
.tname .letters span { display: inline-block; animation: letter .9s calc(.8s + var(--i) * .08s) var(--ease-out) both; }
.result .tsub, .app.morph.result .main > .tsub { animation: rise .7s .65s var(--ease-out) both; }
/* 번호: 리프트권이 나오는 동안 개찰 때처럼 한 자리씩 찍힌다 */
.result .tline .dg { animation-delay: calc(.7s + var(--i) * .13s); }
.result .art { position: relative; }
/* 발밑 둥근 그림자. 고양이가 리프트권 위에 올라선 느낌을 주고 위 칸 밀도를 채운다 */
.result .art::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; z-index: -1; width: min(62%, 180px); height: 18px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(54, 59, 110, .3), rgba(54, 59, 110, .14) 55%, transparent);
  animation: fade .9s 1.3s var(--ease-soft) both;
}
.result .art { isolation: isolate; }
.result .art > img:not(.shade-img) {
  transform-origin: 50% 100%;
  animation: rise 1.1s 1s var(--ease-out) both, breathe 7s 2.4s ease-in-out infinite;
}
@keyframes letter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 버튼과 언어 탭: 누르면 살짝 눌리고 손을 떼면 부드럽게 돌아온다 */
.btn { transition: transform .3s var(--ease-soft), box-shadow .3s var(--ease-soft); }
.btn:active { transition-duration: .08s; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }
@keyframes issue {
  from { transform: translateY(-36px); clip-path: inset(0 0 100% 0 round 18px); }
  to { transform: none; clip-path: inset(0 0 0 0 round 18px); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 리프트권 받기: 주변이 물러나고, 번호가 찍히고, 빛이 스친 뒤 손에 건네지듯 올라온다 */
.start .ticket { position: relative; }
.issuing > :not(.tw):not(.brand):not(.album) { animation: leave .2s var(--ease-glide) both !important; }
.issuing .tw { animation: none; transition: transform .26s var(--ease-glide); }
.issuing .album { animation: none !important; }
.issuing .tline span:last-child { color: var(--head); font-variant-numeric: tabular-nums; }
.tw.handed { transform: translateY(var(--lift, 0)); }
/* 번호는 한 자리씩 스며들듯 찍힌다 */
.tline .dg { display: inline-block; animation: digit .5s var(--ease-soft) calc(var(--i) * .13s) both; }
.issuing .tline .dg { animation-duration: .125s; animation-delay: calc(var(--i) * .025s); }
@keyframes digit { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.quiz.dir-enter .ticket { animation: enter .7s var(--ease-out) both; }
@keyframes leave { to { opacity: 0; transform: translateY(6px); } }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* 첫 화면: 리프트권 자체가 누르는 자리. 손을 대면 살짝 들리고, 누르면 눌린다 */
.start .ticket { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .3s var(--ease-soft); }
.start .ticket:focus { outline: none; }
.start .ticket::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%);
  transform: translateX(-120%);
}
.start:not(.issuing) .ticket::after { animation: idle-gleam 5.5s var(--ease-soft) 2.6s infinite; }
@keyframes idle-gleam { 0% { transform: translateX(-120%); } 22%, 100% { transform: translateX(120%); } }
@media (hover: hover) {
  .option:not(.is-picked):hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .9), 0 4px 14px rgba(255, 220, 120, .45); }
}
/* 키보드로 왔을 때만 테두리를 보인다(마우스, 손가락으로 누를 때는 보이지 않는다) */
.start .tw:has(.ticket:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 20px; }
.start:not(.issuing) .ticket:active { transform: scale(.985); transition-duration: .08s; }
@media (hover: hover) { .start:not(.issuing) .ticket:hover { transform: translateY(-2px); } }
.tap-hint { margin: 0 0 6px; text-align: center; font-family: var(--font-ui); font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--sub); }

/* 개찰 자리: 리프트권 오른쪽 위에 인쇄된 점선 동그라미. 구멍은 이 안에만 뚫린다 */
.punch-spot { position: absolute; top: 12px; right: 16px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.punch-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--sub); }
.punch-ring { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--sub); opacity: .75; }
.start:not(.issuing) .punch-ring { animation: invite 2.6s ease-in-out 1.8s infinite; }
@keyframes invite { 0%, 100% { transform: none; } 50% { transform: scale(1.12); } }
.quiz .main { padding-top: 40px; }

/* 개찰 펀치: 번호가 찍히면 딸깍 눌리며 동그라미 안에 구멍이 뚫리고, 종이 부스러기가 떨어진다 */
.v-hole {
  position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--sky); box-shadow: inset 0 2px 3px rgba(54, 59, 110, .3); opacity: 0; transform: scale(.4);
}
.v-hole.is-on { opacity: 1; transform: none; }
.v-chad { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--perf); opacity: 0; }
.tw.punched .v-hole { animation: hole .12s var(--ease-out) forwards; }
.tw.punched .v-chad { animation: chad .28s var(--ease-soft) calc(var(--i) * 25ms) forwards; }
.issuing .ticket { animation: clunk .16s var(--ease-soft); }
/* 올라가기 직전 안의 그림과 글은 비우고 종이만 남긴다. 다음 장에서 새 내용이 채워진다 */
.tw.cleared .art, .tw.cleared .tline, .tw.cleared .t-head, .tw.cleared .t-band, .tw.cleared .t-cats, .tw.cleared .intro { opacity: 0; transform: translateY(-4px); transition: opacity .16s var(--ease-soft), transform .16s var(--ease-soft); }
/* 첫 질문: 종이는 그대로 이어지고 내용만 위에서부터 차례로 들어온다 */
.quiz.dir-handoff .main > .tline { animation: rise .2s var(--ease-out) both; }
.quiz.dir-handoff h2 { animation: rise .2s var(--ease-out) both; }
.quiz.dir-handoff .option { animation: rise .22s var(--ease-out) calc(.025s + var(--i, 0) * .015s) both; }
@keyframes hole { to { opacity: 1; transform: none; } }
@keyframes chad { from { opacity: .9; transform: none; } to { opacity: 0; transform: translate(calc((var(--i) - 1.5) * 10px), 40px) rotate(90deg); } }
@keyframes clunk { 0% { transform: none; } 30% { transform: scale(.988) translateY(1px); } 100% { transform: none; } }

/* 결과 직전 발권기: 실루엣 아래에서 이름이 돌다 느려지며 멈춘다 */
/* 문답, 결과와 같은 자리(머리글 바로 아래)에 둬서 화면이 바뀔 때 리프트권이 위아래로 튀지 않게 한다 */
.loading .tw { flex: 0 0 auto; min-height: 360px; margin: 16px 0 auto; animation: rise .9s var(--ease-out) both; }
.machine .main { align-items: center; justify-content: center; gap: 6px; text-align: center; }
.machine .tline { position: absolute; top: 40px; left: 20px; right: 20px; }
.who { position: relative; width: 112px; height: 112px; margin-top: 34px; }
.who img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%; }
.who .shade-img { opacity: .16; animation: wonder 2.4s ease-in-out infinite; }
.reel {
  position: relative; height: 56px; min-width: 10ch; overflow: hidden;
  font-family: var(--font-sub); font-weight: 800; font-size: 40px; line-height: 56px; color: var(--head);
}
.reel span { display: block; animation: roll .2s var(--ease-out) both; }
.reel span.last { animation: land .8s var(--ease-out) both !important; }
.status { margin: 2px 0 0; min-height: 1.6em; font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--sub); }
.machine .stub { display: flex; flex-direction: column; gap: 4px; }
.print { height: 6px; border-radius: 3px; background: rgba(54, 59, 110, .14); overflow: hidden; }
.print span { display: block; height: 100%; background: var(--head); transform-origin: 0 50%; animation: print 2.8s linear both; }
/* 이름이 멈춰도 그림은 실루엣 그대로 두고(공개는 결과 화면에서) 흔들림만 멈추고 살짝 짙어진다 */
.landed .who img { animation: none; transition: opacity .7s var(--ease-soft), transform .6s var(--ease-out); transform: translateY(-4px); }
.landed .who .shade-img { opacity: .26; }
@keyframes wonder { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes roll { from { opacity: 0; transform: translateY(60%); } to { opacity: 1; transform: none; } }
@keyframes land { from { opacity: 0; transform: translateY(40%) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes print { from { transform: scaleX(0); } to { transform: none; } }

/* 다시 돌아온 결과 화면은 발권 연출 없이 조용히 보여 준다 */
.app.revisit { animation: fade .5s var(--ease-out) both; }
.app.revisit .tw, .app.revisit .tname .letters span, .app.revisit .tsub, .app.revisit.result .main > .tsub, .app.revisit .tline .dg, .app.revisit .actions { animation: none; }
.app.revisit .art > img { animation: breathe 7s ease-in-out infinite; }

.result .see-friends {
  margin-top: 8px;
  padding: 12px 8px; font-size: 14px; font-weight: 800; line-height: 1.3;
  background: var(--soft-bg); color: var(--head); box-shadow: var(--soft-shadow); /* 외곽선 없이 면과 그림자로만 */
  -webkit-backdrop-filter: var(--chip-blur); backdrop-filter: var(--chip-blur);
}
.result .see-friends:active { transform: translateY(1px); box-shadow: var(--soft-shadow-press); }

/* 친구 둘러보기: 옆으로 넘기는 리프트권 */
.friends > .btn { --primary-shadow: var(--outline-shadow); --primary-shadow-press: var(--outline-shadow); }

.friends-title { font-family: var(--font-sub); font-weight: 800; font-size: 21px; line-height: 1.35; letter-spacing: -.025em; margin: 14px 0 0; }
.friend-list {
  position: relative; min-width: 0;
  display: flex; gap: 12px; margin: 10px -22px 0; padding: 8px 22px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 22px;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
@media (any-hover: hover) and (any-pointer: fine) {
  .friend-list { cursor: grab; }
}
.friend-list.is-dragging, .friend-list.is-dragging .mate { cursor: grabbing; }
.friend-list:is(.is-dragging, .is-settling) { scroll-snap-type: none; }
.friend-list::-webkit-scrollbar { display: none; }
.friend-list:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 18px; }
.fcard { flex: 0 0 84%; min-height: 440px; margin: 0; scroll-snap-align: center; }
.fcard .main { padding-top: 22px; }
.fcard .tname { font-size: 32px; margin-top: 6px; }
.fcard .art { flex: 1; min-height: 96px; }
.fcard:nth-child(1) { animation: rise .9s .1s var(--ease-out) both; }
.fcard:nth-child(2) { animation: rise .9s .2s var(--ease-out) both; }
.badge {
  position: absolute; right: 18px; top: 48px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 800; font-size: 12px; line-height: 1.4; background: #ffcab9; color: var(--head);
}
.badge.mine { background: var(--sky); }
.fnav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 14px; }
.dots { display: flex; }
.dots button { position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.dots button::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%; background: rgba(54, 59, 110, .25);
  transition: transform .4s var(--ease-out), background-color .4s var(--ease-soft);
}
.dots button[aria-current="true"]::after { background: var(--head); transform: scale(1.4); }
.arrow {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .8); cursor: pointer; transition: opacity .3s var(--ease-soft);
}
.arrow svg { width: 20px; height: 20px; fill: none; stroke: var(--head); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.arrow:disabled { opacity: .3; cursor: default; }
.friend-list ~ .btn { margin-top: auto; }

/* 반응형: 노치, 홈 표시줄 같은 가림 구역을 피한다 (인앱 브라우저, 사파리) */
.topbar { top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); }
/* 왼쪽 위 바로가기(BEREO 누리집, 유튜브 채널). 오른쪽 언어 탭과 같은 유리 알약 모양 */
.toplinks {
  position: absolute; z-index: 3; top: calc(14px + env(safe-area-inset-top, 0px)); left: calc(16px + env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--track-bg);
  box-shadow: var(--track-shadow); -webkit-backdrop-filter: var(--track-blur); backdrop-filter: var(--track-blur);
}
.toplinks a {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--head);
  opacity: .8; transition: opacity .3s var(--ease-soft);
}
.toplinks a:hover, .toplinks a:focus-visible { opacity: 1; }
.toplinks a:focus-visible { outline: 2px solid var(--head); outline-offset: 1px; }
.toplinks a + a::before { content: ""; position: absolute; left: -2px; top: 9px; bottom: 9px; width: 1px; background: rgba(54, 59, 110, .18); }
.toplinks svg { width: 20px; height: 20px; display: block; }
.app {
  padding-top: calc(66px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
@media (hover: hover) {
  .option:not(.is-picked):hover { background: rgba(255, 255, 255, .85); }
  .app.no-hover .option:not(.is-picked):hover { background: rgba(255, 255, 255, .62); box-shadow: none; }
  .result .see-friends:hover, .arrow:not(:disabled):hover { background: #fff; }
}
/* 폭이 좁은 폰(갤럭시 폴드 접은 화면, 아이폰 SE) */
@media (max-width: 359px) {
  .app { padding-left: 16px; padding-right: 16px; }
  .album { font-size: 40px; }
  .tname { font-size: 34px; }
  .friend-list { margin: 10px -16px 0; padding: 8px 16px 18px; scroll-padding: 0 16px; }
  .result .see-friends { font-size: 13px; }
}
/* 키가 낮은 화면(인앱 브라우저는 위아래 도구 막대가 화면을 많이 먹는다) */
@media (max-height: 700px) {
  .app { padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
  .quiz .options { gap: 6px; }
  .quiz .option { min-height: 44px; padding-block: 10px; }
  .start .tw { min-height: 188px; margin-top: 18px; }
  .start .art { width: 96px; height: 88px; }
  .start .main { padding-top: 30px; }
  .t-cats { height: 76px; margin: 10px 0 8px; }
  .t-cats .shade { width: 48px; margin: 0 -7px; }
  .t-cats .shade:nth-child(2), .t-cats .shade:nth-child(4) { width: 58px; }
  .t-cats .shade:nth-child(3) { width: 72px; }
  .title { font-size: 21px; margin-top: 8px; }
  html:lang(ko) .title { font-size: min(21px, calc((100vw - 48px) / 14)); }
  .intro { line-height: 1.6; }
  .start .tap-hint { padding-bottom: 0; }
  .loading .tw { min-height: 300px; }
  .fcard { min-height: 380px; }
}
/* PC: 가운데에 폰 크기 무대를 띄우고 바깥은 같은 그림체의 가로 설원으로 */
@media (min-width: 720px) {
  /* 바깥 설원은 흐리게 깔아 가운데 무대가 앞으로 나와 보이게 한다. 가장자리가 비치지 않게 조금 키운다 */
  /* 스크롤바 자리를 늘 비워 둔다. 결과처럼 긴 화면으로 넘어가며 스크롤바가 생길 때 폭이 바뀌어
     글 줄바꿈과 리프트권 크기가 애니메이션 도중 다시 계산되며 끊기는 것을 막는다 */
  html { scrollbar-gutter: stable; }
  body { background: var(--sky); }
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: var(--sky) url("../assets/bg/winter-wide.webp") center bottom / cover no-repeat;
    filter: blur(14px) saturate(1.05); transform: scale(1.08);
  }
  /* 큰 모니터에서 무대가 화면 높이만큼 가늘고 길어지지 않게 폰 비율(최대 900px)로 두고 위아래 가운데에 놓는다.
     내용이 더 길면 무대가 늘어나고 페이지가 스크롤된다(body 에 붙는 창과 효과는 모두 position: fixed) */
  body { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; }
  .shell { width: 100%; margin: 32px auto; min-height: min(calc(100vh - 64px), 900px); border-radius: 28px; overflow: hidden; box-shadow: 0 24px 60px rgba(54, 59, 110, .2); }
  /* 결과 고양이는 300px(원본 640px라 레티나 화면에서도 선명한 크기)을 기본으로 두고 남는 자리가 있으면 더 채운다 */
  .result .art { flex: 1 0 300px; }
}
@media (min-width: 720px) and (max-height: 760px) {
  .shell { margin: 0 auto; min-height: 100vh; border-radius: 0; }
}

/* 키보드 포커스 */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}

/* 움직임 줄이기 설정 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active, .btn:hover, .option:active { transform: none; }
  .snow, .burst, .flash { display: none; }
  .print span { transform: none; }
  /* 위치 이동은 빼고, 화면이 바뀌었다는 것만 짧은 페이드로 알린다 */
  .app > *, .result .tw { animation: fade .4s ease-out both !important; }
  .app.quiz > * { animation-duration: .18s !important; }
  .option.is-picked { transition: background-color .08s, color .08s !important; }
  .steps span.now.filled::before { transform: none; }
}

/* 일본어, 중국어: 웹 글꼴에 글자가 없으므로 본문, 부제목은 시스템 글꼴을 굵게 쓴다 */
/* 일본어, 중국어: 한국어 화면과 같은 역할로 글꼴을 맞춘다(제목 줄은 Fredoka + 둥근 고딕, 본문은 손글씨). 뒤의 시스템 글꼴은 못 받았을 때의 대비 */
html:lang(ja) { --cjk: "MPlusRounded", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", sans-serif; --font-body: "YuseiMagic", var(--cjk); --font-body-spacing: initial; }
html:lang(zh-CN) { --cjk: "ResourceHanRounded", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; --font-body: "Xiaolai", var(--cjk); --font-body-spacing: initial; }
html:lang(ja), html:lang(zh-CN) { --font-sub: "Fredoka", var(--cjk); }
/* 둥근 고딕 줄은 굵게. 손글씨 본문(.intro, .option, .tdesc 등)은 굵기가 하나라 그대로 둔다 */
html:lang(ja) .tsub, html:lang(zh-CN) .tsub { font-weight: 700; }


/* 화면 바꾸기: 끊지 않고 잇는다 (swap, morphPaper)
   공통 규칙의 :not() 묶음은 :where() 로 감싸 우선순위를 낮춘다. 그래야 아래 화면별 움직임(문답 넘김 등)이 덮이지 않는다.
   1) 나가는 화면은 내용이 옅어진다. 같은 종이가 이어지면(keep) 종이와 머리글, 개찰 자리는 남긴다.
   2) 들어오는 화면이 같은 종이면(morph) 종이 자체의 등장 움직임은 끄고, 안의 글만 서서히 나타난다. */
@keyframes out { to { opacity: 0; } }
.app.out:is(.go-next, .go-prev) { --out-duration: .15s; }
.app.out > * { animation: out var(--out-duration, .28s) var(--ease-soft) forwards !important; }
.app.out > .brand, .app.out > .album { animation: none !important; }
.app.out.out-head > .brand, .app.out.out-head > .album { animation: out .28s var(--ease-soft) forwards !important; }
.app.out.keep > .tw { animation: none !important; }
.app.out.keep .tw .main > :where(:not(.punch-spot):not(.hole)), .app.out.keep .tw .stub > :where(*) { animation: out var(--out-duration, .28s) var(--ease-soft) forwards !important; }
.app.morph .tw, .app.morph .ticket { animation: none !important; }
.app.morph .main > :where(:not(.punch-spot):not(.hole)), .app.morph .stub > :where(*) { animation: fade .5s var(--ease-soft) .12s both; }
/* 결과에서는 개찰 자리가 도장에 자리를 내주며 옅어진다 */
.result .punch-spot { animation: out .5s var(--ease-soft) .1s forwards; }
/* 머리글 아래 화면이 바뀌어도 머리글이 다시 떠오르지 않게 한다(첫 화면 제외) */
.app:not(.start) > .brand, .app:not(.start) > .album { animation: none; }

/* 문답 넘기기: 종이는 그대로 두고, 질문과 선택지만 옆으로 밀려 나가고 반대편에서 들어온다.
   진행 칸과 절취선 아래는 종이에 인쇄된 부분이라 움직이지 않는다. */
@keyframes out-next { to { opacity: 0; transform: translateX(-28px); } }
@keyframes out-prev { to { opacity: 0; transform: translateX(28px); } }
@keyframes in-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.app.out.go-next .tw .main > :where(:not(.punch-spot):not(.hole):not(.options)),
.app.out.go-next .option { animation: out-next .12s var(--ease-glide) forwards !important; }
.app.out.go-prev .tw .main > :where(:not(.punch-spot):not(.hole):not(.options)),
.app.out.go-prev .option { animation: out-prev .12s var(--ease-glide) forwards !important; }
.app.out.go-next .tw .main > .options, .app.out.go-prev .tw .main > .options,
.app.out.go-next .tw .main > .tline, .app.out.go-prev .tw .main > .tline,
.app.out.go-next .stub > .steps, .app.out.go-prev .stub > .steps { animation: none !important; }
.app.out.go-next .option:nth-child(2), .app.out.go-prev .option:nth-child(2) { animation-delay: .01s !important; }
.app.out.go-next .option:nth-child(3), .app.out.go-prev .option:nth-child(3) { animation-delay: .02s !important; }
.app.out.go-next .option:nth-child(n+4), .app.out.go-prev .option:nth-child(n+4) { animation-delay: .03s !important; }
.app.morph.quiz.dir-next .main > h2 { animation: in-next .22s var(--ease-out) both; }
.app.morph.quiz.dir-prev .main > h2 { animation: in-prev .22s var(--ease-out) both; }
.app.morph.quiz.dir-next .main > .options, .app.morph.quiz.dir-prev .main > .options,
.app.morph.quiz .stub > .steps, .app.morph.quiz .stub > .tfoot { animation: none; }
/* 머리줄(1-DAY PASS, n/7)은 종이에 인쇄된 줄이라 넘길 때 움직이지 않고, 숫자만 조용히 바뀐다 */
.app.morph.quiz.dir-next .main > .tline, .app.morph.quiz.dir-prev .main > .tline { animation: none; }
.app.morph.quiz.dir-next .tline span:last-child, .app.morph.quiz.dir-prev .tline span:last-child { animation: fade .4s var(--ease-soft) both; }
.prev.appear { animation: fade .4s var(--ease-soft) .1s both; }
.app.out.keep.quiz .tw .stub > .tfoot { animation: none !important; }
.app.morph.quiz.dir-next .option { animation: in-next .22s var(--ease-out) calc(var(--i, 0) * .015s) both; }
.app.morph.quiz.dir-prev .option { animation: in-prev .22s var(--ease-out) calc(var(--i, 0) * .015s) both; }

/* 첫 개찰 뒤 리프트권이 펼쳐질 때: 절취선이 왼쪽에서 오른쪽으로 그어지고, 진행 칸과 바코드가 아래에서 떠오른다 */
@keyframes draw-line { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.quiz.dir-handoff .stub::before { animation: draw-line .2s var(--ease-glide) .14s both; }
.quiz.dir-handoff .stub > .steps { animation: rise-up .2s var(--ease-out) .16s both; }
.quiz.dir-handoff .stub .tfoot { animation: rise-up .2s var(--ease-out) .18s both; }

/* 진행 칸: 지금 칸은 옅은 색이 스며든다(차오르지 않음).
   답을 고르면 그 칸이 그 자리에서 진하게 차오르고, 다음 화면에서는 다음 칸에 색이 스며든다. */
.steps span { position: relative; overflow: hidden; }
.steps span.now { background: rgba(54, 59, 110, .14); }
.steps span.now::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(54, 59, 110, .3);
  animation: now-tint .7s var(--ease-soft) .35s both, now-breathe 3.2s ease-in-out 1.6s infinite;
}
.steps span.now::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: var(--head);
  transform-origin: 0 50%; transform: scaleX(0);
}
.steps span.now.filled::before { animation: fill .18s var(--ease-out) both; }
.steps span.now.filled::after { animation: none; }
.quiz.dir-handoff .steps span.now::after { animation-delay: .26s, 1.4s; }
.quiz.dir-prev .steps span.now::after { animation-delay: .2s, 1.5s; }
@keyframes now-tint { from { opacity: 0; } to { opacity: 1; } }
@keyframes now-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* 다시 하기(blowAway): 화면의 요소가 위에서부터 차례로 바람에 날려 왼쪽으로 흩어진다(문답 넘김과 같은 방향).
   살짝 뒤로 젖혀졌다가 휙 날아가고, 멀어지며 흐려진다. 그 뒤 첫 화면은 처음 열 때의 등장 움직임 그대로 */
@keyframes blow {
  0% { opacity: 1; transform: none; filter: none; }
  22% { opacity: 1; transform: translate(8px, 2px) rotate(1deg); filter: none; }
  100% { opacity: 0; transform: translate(var(--bx, -200px), var(--by, -20px)) rotate(var(--br, -7deg)); filter: blur(3px); }
}
.app.blow { pointer-events: none; }
/* 결과 화면에 남은 .morph 의 "종이 움직임 끔"(.app.morph .tw)보다 앞서야 해서 .tw 를 따로 적는다. 차례 지연은 --bd 로 받는다 */
.app.blow > *, .app.blow > .tw { animation: blow .62s cubic-bezier(.5, 0, .75, .4) var(--bd, 0ms) both !important; }

/* ── 버튼, 옵션 토큰(글래스모피즘) ──
   흐린 유리판 위에 윗면 빛만 얹고 외곽선은 쓰지 않는다 */
:root {
  --outline-shadow: 0 0 1px 1px rgba(54, 59, 110, .18);
  --track-bg: rgba(255, 255, 255, .42);
  --track-shadow: var(--outline-shadow);
  --track-blur: blur(14px) saturate(1.5);
  --pill-bg: rgba(255, 255, 255, .92);
  --pill-shadow: var(--outline-shadow);
  --primary-bg: #ebe3ff;
  --primary-shadow: 0 8px 20px -8px rgba(54, 59, 110, .55);
  --primary-shadow-press: 0 3px 8px -4px rgba(54, 59, 110, .5);
  --primary-blur: blur(12px) saturate(1.4);
  --soft-bg: rgba(255, 255, 255, .58);
  --soft-shadow: var(--outline-shadow);
  --soft-shadow-press: var(--outline-shadow);
  --chip-bg: rgba(255, 255, 255, .48);
  --chip-shadow: var(--outline-shadow);
  --chip-shadow-press: var(--outline-shadow);
  --chip-blur: blur(12px) saturate(1.4);
  --opt-bg: rgba(255, 255, 255, .55);
  --opt-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

/* 짝 친구 크게 보기 창: 남색 반투명 막 위에 글래스 카드. 막을 누르거나 Esc, 닫기로 닫는다 */
.mate-modal {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(54, 59, 110, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: modal-in .3s var(--ease-soft) both;
}
.mate-modal.closing { animation: modal-out .22s var(--ease-soft) both; }
.mate-sheet {
  position: relative; width: 100%; max-width: 320px; padding: 26px 22px 20px; border-radius: 24px; text-align: center;
  background: rgba(255, 250, 235, .94); box-shadow: 0 20px 50px rgba(30, 33, 70, .35), inset 0 1px 0 rgba(255, 255, 255, .8);
  animation: sheet-in .42s var(--ease-out) both;
}
.mate-modal.closing .mate-sheet { animation: sheet-out .22s var(--ease-soft) both; }
.mate-big { position: relative; width: 190px; height: 190px; margin: 0 auto 10px; border-radius: 50%; background: rgba(232, 87, 63, .12); }
.mate-modal.rival .mate-big { background: rgba(75, 79, 134, .1); }
.mate-big img { position: absolute; left: 9%; top: 9%; width: 82%; height: 82%; object-fit: contain; transform: translateY(5%); }
.mate-big .mate-mark { width: 34px; height: 34px; right: 8px; bottom: 8px; box-shadow: 0 0 0 3px #fffaeb; }
.mate-big .mate-mark svg { width: 18px; height: 18px; }
.mate-modal.rival .mate-big .mate-mark { background: var(--sub); }
.mate-sheet .m-label { margin: 0; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .04em; color: var(--sub); }
.mate-sheet .m-name { margin: 4px 0 0; font-family: var(--font-sub); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; color: var(--head); }
.mate-sheet .m-line { margin: 10px 0 0; font-family: var(--font-body); font-size: 16px; line-height: 1.65; letter-spacing: var(--font-body-spacing, -.015em); color: var(--sub); }
.mate-sheet .btn { margin-top: 18px; }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* 첫 진입 로딩: 글꼴과 그림을 다 받을 때까지 고양이 실루엣이 갸웃거리고 아래 막대가 찬다 */
.boot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 60vh; transition: opacity .35s var(--ease-soft); }
.boot.done { opacity: 0; }
.boot-cat { width: 72px; height: 72px; filter: brightness(0); opacity: .16; transform-origin: 50% 100%; animation: wonder 2.4s ease-in-out infinite; }
.boot-bar { width: 120px; height: 6px; border-radius: 3px; background: rgba(54, 59, 110, .14); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 100%; background: var(--head); transform: scaleX(.06); transform-origin: 0 50%; transition: transform .3s var(--ease-out); }
