/* 지저스월드 공통 모양: 색·글꼴 토큰과 큰 버튼. 색 값은 디자인/아트디렉션.md 2장 그대로. */
/* 글꼴 목록(fonts.css)은 페이지마다 이 파일 바로 다음 줄 <link> 로 나란히 받는다 (페이퍼로지는 사이트 안에 둔다, Daniel 2026-10-15). @import 로 부르면 이 파일을 다 받은 뒤에야 받기 시작해 첫 화면이 늦었다 */

:root {
  /* 함께 쓰는 색 */
  --ink: #1C2554; --cream: #FFF6E3; --gold: #F6B73C; --gold-dark: #D9952A;
  /* 마을 팔레트 (낮) */
  --sky: #BFE6FF; --sky-dark: #8FD0F5; --white: #FFFFFF; --sun: #FFD465; --sun-dark: #F2B92E;
  --field: #7CC77B; --field-dark: #4FA35A; --forest: #2F7F4F; --forest-dark: #23633D;
  --lake: #2A66A8; --lake-dark: #1F4F83; --apricot: #FFB98A; --apricot-dark: #F09A62;
  --roof: #E8574A; --roof-dark: #C23E33; --sand: #EBC98D; --sand-dark: #D2AC6C;
  --wood: #8A5A3B; --wood-dark: #6B432B;
  /* 행사 팔레트 ('약속의 길' 안에서만. 마을에서는 행사 기간 입구 칸 하나만) */
  --advent: #5B2C83; --advent-dark: #431E63; --night: #1C2554; --night-dark: #121838;
  --lock: #9C93B8; --lock-dark: #7F769D; --joy: #D9383F;
  --zone1: #A8DDB5; --zone2: #EBC98D; --zone3: #E9967A; --zone4: #6B4E8C; --zone5: #1C2554;
  /* 캐릭터 대표색 (자리표시용, 아트디렉션 3-2) */
  --siwoo: #5535A3; --dada: #E8282F; --yangmal: #E2DAD1; --bomi: #F7B01F; /* 디자인/캐릭터/확정/palette.md 대표색 */

  --font: "Paperlogy", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --tap: 56px;
  --r-card: 24px; --r-tile: 28px;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; } /* 두 번 톡(확대) 기다림 없이 한 번 탭 = 바로 반응. 두 손가락 확대는 그대로 */
body {
  min-height: 100vh; min-height: 100svh;
  background: var(--field); color: var(--ink);
  font: 500 18px/1.6 var(--font); word-break: keep-all; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--focus, var(--ink)); outline-offset: 3px; } /* 어두운 바탕 화면은 --focus 를 금색으로 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* 상단 막대: 왼쪽 위 같은 자리에 동그란 버튼. 모든 화면에서 내려도 그 자리에 붙어 있다 (고칠 일 8, 10/16 중간점검 "위쪽 띠 한 규칙").
   막대 빈 곳은 눌림을 통과시킨다(아래 내용을 가리지 않게). 내려가는 화면은 --bar-bg 로 바탕을 깐다 */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bar-bg, none); pointer-events: none; }
/* 스크롤하면 위 단추 뒤로 지나가는 글자·카드를 흐리게 (ui.js 가 .is-stuck 을 붙임, 10/31 고칠 일 8) */
.topbar.is-stuck { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.topbar > * { pointer-events: auto; margin: 0; } /* 화면마다 p·h1 기본 여백이 달라 단추 줄이 어긋나지 않게 */
.topbar .spacer { flex: 1; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; flex: none;
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
  font-size: 26px; line-height: 1; box-shadow: 0 4px 0 rgba(28, 37, 84, .18);
}
.icon-btn--home { background: var(--gold); }
.icon-btn--sound { background: var(--lake); color: var(--cream); }
.icon-btn--menu { background: var(--roof); color: var(--cream); font-size: 28px; font-weight: 900; }
.icon-btn--close { background: var(--cream); color: var(--ink); font-size: 24px; font-weight: 900; }
.icon-btn.has-img { background: none; padding: 0; }
.icon-btn img, .m-done img { width: 100%; height: 100%; object-fit: contain; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(28, 37, 84, .18); }
.topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 성탄 카운트다운 (약속의 길 기간, 모든 화면 오른쪽 위). 산타 추적기의 빨간 날짜 칸처럼 */
.count-chip {
  flex: none; display: grid; place-items: center; align-content: center; min-width: 60px; height: var(--tap); padding: 0 8px;
  border-radius: 16px; background: var(--joy); color: #fff; text-align: center; line-height: 1.1; box-shadow: 0 4px 0 rgba(28, 37, 84, .18);
}
.count-chip small { font-size: 12px; font-weight: 700; }
.count-chip b { font-size: 19px; font-weight: 900; }
/* 휴대폰: 막대 단추·날짜 칩을 줄이고 제목은 두 줄까지 (375px 에서 '약속…'·'요셉의 …' 로 잘리고 '태권도/코딩' 이 깨지던 것, 10/29 밤 검수 고칠 일 8) */
@media (max-width: 480px) { /* 11/20 Daniel "약속의... 하고 글씨가 안보이는데": 400 이하만 잡아 402px 아이폰 17 Pro·430~440 Plus·Pro Max 가 빠졌음 → 휴대폰 전부 */
  .topbar { gap: 6px; padding: 10px 12px; --tap: 44px; }
  .topbar .topbar-title { font-size: 16px; line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; }
  .topbar .count-chip { min-width: 0; padding: 0 6px; border-radius: 14px; }
  .topbar .count-chip small { font-size: 11px; } .topbar .count-chip b { font-size: 16px; }
}

/* ☰ 메뉴 패널: 전체 이야기·놀이 그림 카드 격자 (ui.js JW.menu) */
.jw-menu {
  width: min(1100px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); margin: 12px auto; padding: 0;
  border: 0; border-radius: var(--r-card); background: var(--sky); color: var(--ink); overflow: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.jw-menu[open] { animation: jw-menu-pop .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes jw-menu-pop {
  0% { opacity: 0; transform: scale(.96); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .jw-menu[open] { animation: none; }
}
.jw-menu::backdrop { background: rgba(28, 37, 84, .55); }
/* 빈 카드 자리 (스켈레톤): 0.3초 안에 판(틀·제목·빈 카드 자리)이 먼저 열릴 때 표시 */
.tc-skel { pointer-events: none; }
.tc-skel .tc-tile {
  background-color: rgba(255, 255, 255, .32);
  background-image: radial-gradient(rgba(255, 255, 255, .42) 1.6px, transparent 1.9px);
  background-size: 14px 14px;
  box-shadow: 0 4px 0 rgba(28, 37, 84, .08);
}
.tc-skel .m-name {
  height: 16px; margin: 4px auto 0; width: 65%; border-radius: 8px;
  background: rgba(28, 37, 84, .1);
}
.m-grid--small .tc-skel {
  background: rgba(255, 255, 255, .55);
}
.m-grid--small .tc-skel .m-pic {
  background: rgba(255, 255, 255, .35);
}
.m-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--sky); }
.m-head h2 { font-size: 24px; font-weight: 900; }
.m-body { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.m-body h3 { font-size: 19px; font-weight: 900; margin: 8px 0 10px; }
.m-top { display: grid; gap: 4px; }
@media (min-width: 900px) {
  .m-top { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 8px; }
  .m-top .m-grid { margin-bottom: 8px; }
  .m-top .m-grid--small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (min-width: 600px) { .m-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .m-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* PC: 카드 한 장 200px 이상 (고칠 일 5, 10/16 중간점검: 1920 에서 146px 이라 마을 그림에 비해 작았음). 칸 수는 폭에 맞춰 */
@media (min-width: 1060px) { .jw-menu { width: min(1320px, calc(100% - 48px)); } .m-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.m-grid--small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 860px) { .m-grid--small { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* ☰ 카드 두 규격 (고칠 일 6): 큰 표지 = .tc 타일 (위 격자), 작은 바로 가기 = 아래 흰 작은 카드. 휴대폰 첫 812px 안에 게임 입구가 보이게 낮게 */
.m-grid--small .m-card { gap: 4px; padding: 6px 6px 8px; border-radius: 16px; }
.m-grid--small .m-pic { aspect-ratio: 2 / 1; border-radius: 11px; font-size: 28px; }
.m-grid--small .m-name { font-size: 14px; line-height: 1.25; }
.m-card { position: relative; display: grid; gap: 6px; padding: 8px 8px 10px; border-radius: 20px; background: var(--white); color: var(--ink);
  text-decoration: none; box-shadow: 0 4px 0 rgba(28, 37, 84, .15); transition: transform .15s; }
.m-card:hover { transform: translateY(-3px) rotate(-1deg); }
.m-card:active { transform: translateY(2px); }
.m-pic { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--cream); font-size: 40px; overflow: hidden; }
.m-pic { position: relative; }
.m-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.m-ph { opacity: .7; }
.m-name { font-size: 16px; font-weight: 800; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-done { position: absolute; top: 4px; right: 6px; font-size: 22px; }
.m-done.has-img { width: 34px; height: 34px; top: 2px; right: 2px; }
/* 새 카드 (ui.js tileCard, 디자인/카드-시안): 정사각 단색+점무늬 타일 + 잘려 들어오는 주인공 + 흰 로고 글자, 제목은 타일 밖 */
.m-card.tc { align-content: start; padding: 0; gap: 8px; background: none; box-shadow: none; color: inherit; transition: none; -webkit-tap-highlight-color: transparent; }
.m-card.tc:hover, .m-card.tc:active { transform: none; }
.tc .m-name { text-align: center; font-weight: 700; font-size: 15px; }
.tc .m-done { top: 6px; right: 8px; z-index: 3; }
.tc-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1.6px, transparent 1.9px); background-size: 14px 14px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .1); container-type: inline-size; }
.tc-art { position: absolute; inset: 0; transform-origin: 80% 100%; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.tc-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity .12s; }
.tc-art .tc-fun { opacity: 0; }
.tc-art .tc-old { inset: auto 4% 4% auto; width: 74%; height: 62%; object-fit: contain; object-position: right bottom; }
.tc-logo { position: absolute; left: 6%; top: 6%; right: 6%; z-index: 2; line-height: 1.02; pointer-events: none;
  font-family: "Paperlogy", -apple-system, "Apple SD Gothic Neo", sans-serif; font-weight: 900; color: #fff; font-size: var(--fs, 20cqw);
  letter-spacing: -.04em; transform: rotate(-6deg); transform-origin: left top; white-space: nowrap; }
.tc-logo span { display: inline-block; transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)) scale(var(--s, 1));
  text-shadow: 0 .055em 0 var(--deep), 0 .1em 0 var(--deep), 0 .16em .12em rgba(0, 0, 0, .18); }
.tc-logo .sp { width: .28em; }
.tc-logo br + span { margin-left: .15em; }
.tc:focus-visible { outline: none; }
.tc:focus-visible .tc-tile { outline: 4px solid var(--focus, var(--ink)); outline-offset: 3px; }
@media (hover: hover) {
  .tc:hover .tc-fun { opacity: 1; }
  .tc.fun-ok:hover .tc-base { opacity: 0; } /* 재미 그림이 다 온 뒤에만 바꿔 보임 (빈 칸 방지) */
  .tc:hover .tc-art { transform: scale(1.06) rotate(-2.5deg); animation: tc-hop .45s ease-out; }
  .tc:hover .tc-logo span { animation: tc-bounce .5s ease-out both; animation-delay: calc(var(--i) * 55ms); }
}
.tc.on .tc-fun { opacity: 1; }
.tc.fun-ok.on .tc-base { opacity: 0; }
.tc.on .tc-art { transform: scale(1.06) rotate(-2.5deg); animation: tc-hop .45s ease-out; }
.tc.on .tc-logo span { animation: tc-bounce .5s ease-out both; animation-delay: calc(var(--i) * 55ms); }
@keyframes tc-hop { 0% { transform: none; } 40% { transform: scale(1.1) translateY(-4%) rotate(-4deg); } 100% { transform: scale(1.06) rotate(-2.5deg); } }
@keyframes tc-bounce { 0%, 100% { translate: 0 0; } 40% { translate: 0 -.18em; } 70% { translate: 0 .03em; } }
@media (prefers-reduced-motion: reduce) {
  .tc-art, .tc-art img { transition: none; }
  .tc:hover .tc-art, .tc.on .tc-art { transform: none; animation: none; }
  .tc:hover .tc-logo span, .tc.on .tc-logo span { animation: none; }
}
.m-family { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 8px; font-size: 15px; font-weight: 700; }

/* 큰 알약 버튼: 한 화면에 하나만 */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: var(--ink); font-weight: 800; font-size: 20px; text-decoration: none;
  box-shadow: 0 6px 0 var(--gold-dark);
}
.btn-gold:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn-gold::after { content: "▶︎"; font-size: 16px; }
/* 보조 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--cream); color: var(--ink); font-weight: 700; font-size: 18px; text-decoration: none;
  box-shadow: 0 4px 0 rgba(28, 37, 84, .18);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(28, 37, 84, .18); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.chip { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 15px; font-weight: 700; background: var(--cream); color: var(--ink); }

/* 카드·말풍선 */
.card { background: var(--cream); color: var(--ink); border-radius: var(--r-card); padding: 20px; }
.bubble { position: relative; background: var(--cream); color: var(--ink); border-radius: 18px; padding: 10px 16px; font-weight: 700; line-height: 1.4; }
.bubble::after { content: ""; position: absolute; left: 32px; bottom: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--cream); }
.bubble b { font-weight: 900; margin-right: 6px; }
/* 말한 사람 이름 = 말풍선 위쪽 작은 색 꼬리표, 대사는 그 아래 따로 (고칠 일 8, 10/16 중간점검: "다다 소리 켤까?"처럼 이름까지 한 문장으로 읽혔음).
   색은 캐릭터 대표색(ui.js JW.bubble 이 who-<키> 를 붙임). 화면 읽기는 "다다: …"로 읽게 쌍점을 숨겨 둔다 */
.bubble > b:first-child { display: table; margin: -2px 0 4px; padding: 0 10px; border-radius: 999px; background: var(--who, var(--ink)); color: #fff;
  font-size: 14px; font-weight: 800; line-height: 1.6; letter-spacing: .02em; }
.bubble > b:first-child::after { content: ":"; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.who-siwoo { --who: var(--siwoo); } .who-dada { --who: #C62828; } .who-yangmal { --who: var(--wood); } .who-jesus { --who: var(--lake); }
/* 다다 이름표만 한 단계 진하게: 흰 글자 대비 5.6:1 (대표색 #E8282F 는 4.4:1, 고칠 일 8) */
.who-bomi { --who: var(--bomi); } .who-bomi > b:first-child { color: var(--ink); }
.bubble.say-b { display: block; }
.say-q { display: block; }

/* 그림 자리표시: 디자인팀 그림이 오면 ui.js 의 JW.ART 경로만 채우면 바뀐다 */
.ph {
  display: grid; place-items: center; text-align: center; border-radius: 40% 40% 32% 32%;
  font-size: 15px; font-weight: 800; color: var(--ink); background: var(--white);
  width: 72px; height: 88px; flex: none;
}
.ph--siwoo { background: var(--siwoo); color: var(--cream); }
.ph--dada { background: var(--dada); color: var(--cream); }
.ph--yangmal { background: var(--yangmal); color: var(--ink); }
.ph--bomi { background: var(--bomi); border-radius: 50% 50% 40% 40%; width: 64px; height: 56px; align-self: end; }
.ph--scene { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--r-card); background: rgba(255, 255, 255, .6); font-size: 18px; }
img.fig { width: 72px; height: 88px; flex: none; object-fit: contain; object-position: 50% 100%; } /* 캐릭터 그림: 자리표시와 같은 칸에 비율 그대로 */
.ph--building { width: 72px; height: 64px; border-radius: 18px 18px 8px 8px; background: rgba(255, 255, 255, .35); color: inherit; }

/* 토스트(짧은 안내) */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--cream); padding: 12px 20px; border-radius: 999px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center;
}

/* 미리보기 띠 (미리보기 빌드에서만 생김). 화면 아래 '다음' 버튼을 가리지 않게 맨 위 가운데에 작게 */
.preview-band {
  position: fixed; left: 50%; top: env(safe-area-inset-top); transform: translateX(-50%); z-index: 99; background: var(--joy); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 16px; padding: 0 10px; border-radius: 0 0 10px 10px; pointer-events: none; white-space: nowrap;
}
/* 검수용 메모(구절 카드의 '개역개정판 일부 …' 등): 미리보기에서만 작게. 아이 화면(공개용)에는 그리지 않는다 */
.preview-note { justify-self: center; font-size: 12px; font-weight: 700; color: var(--joy); border: 1px dashed currentColor; border-radius: 8px; padding: 0 8px; }
/* 말씀 카드 (.verse): PC(1280 이상 등)에서 화면 높이 60% 이상 차게 확대 배치 */
.card.verse, .verse { border: 4px solid var(--gold); text-align: center; display: grid; gap: 8px; margin-bottom: 16px; }
.verse .v-text { font-size: 20px; font-weight: 700; line-height: 1.5; }
.verse .v-ref { font-size: 15px; font-weight: 800; }
@media (min-width: 900px) and (min-height: 560px) {
  .card.verse, .verse { padding: 44px 36px; gap: 16px; border-width: 5px; border-radius: 28px; box-shadow: 0 8px 0 rgba(0, 0, 0, .14); }
  .verse .v-text { font-size: 28px; line-height: 1.65; }
  .verse .v-ref { font-size: 19px; }
}
@media (min-width: 1200px) and (min-height: 600px) {
  .card.verse, .verse { padding: 52px 48px; gap: 20px; }
  .verse .v-text { font-size: 32px; line-height: 1.7; }
  .verse .v-ref { font-size: 21px; }
}

/* 처음 온 아이에게 한 번 '소리 켤까?' (ui.js askSound): 화면 아래 띠 한 줄 (160px 이하, 마을이 다 보인 1초 뒤 올라옴).
   마을·오늘 단추를 덮지 않고 막지도 않는다 (고칠 일 6, 2026-10-18-0647: 큰 창이 마을 아래 절반을 덮었음).
   휴대폰: 다다 | 질문 / 단추 둘 (두 줄, 약 106px). 넓은 화면: 한 줄 */
.jw-ask { position: fixed; z-index: 80; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 24px)); max-height: 160px;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "dada q" "dada row"; align-items: center; gap: 4px 12px;
  padding: 10px 14px; border-radius: 28px; background: var(--sky); color: var(--ink); box-shadow: 0 6px 0 rgba(28, 37, 84, .22), 0 0 0 3px var(--white);
  transform: translate(-50%, calc(100% + 24px)); transition: transform .3s cubic-bezier(.3, 1.3, .5, 1); }
.jw-ask.in { transform: translate(-50%, 0); }
.jw-ask.top { bottom: auto; transform: translate(-50%, calc(-100% - 120px)); } /* 마을 밖 화면: 상단 막대 밑에서 내려옴 (top 은 ui.js 가 막대 아래 끝으로) */
.jw-ask.top.in { transform: translate(-50%, 0); }
/* 마을 밖 화면(이야기·놀이·게임·길·선반): 그림·판을 덜 가리게 작은 한 줄 띠(다다 없음, 약 44px)로, 몇 초 뒤 저절로 걷는다 (ui.js askSound, 10/29 밤 검수 고칠 일 4) */
.jw-ask.top { grid-template-columns: 1fr auto; grid-template-areas: "q row"; padding: 4px 6px 4px 16px; border-radius: 22px; max-height: 52px; width: min(420px, calc(100% - 24px)); opacity: .94; }
.jw-ask.top .ask-dada { display: none; }
.jw-ask.top .ask-q { font-size: 16px; white-space: nowrap; }
.jw-ask.top .ask-btn { min-height: 44px; padding: 2px 12px 2px 6px; font-size: 15px; border-radius: 18px; box-shadow: 0 3px 0 rgba(28, 37, 84, .18); }
.jw-ask.top .ask-ic { width: 28px; height: 28px; font-size: 20px; }
.jw-ask .ask-dada { grid-area: dada; width: 56px; height: 80px; }
.ask-q { grid-area: q; font-size: 22px; font-weight: 900; line-height: 1.2; }
.ask-row { grid-area: row; display: flex; gap: 10px; }
.ask-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 6px 12px 6px 6px; border: 0; border-radius: 22px; cursor: pointer;
  background: var(--cream); color: var(--ink); font: inherit; font-size: 18px; font-weight: 800; box-shadow: 0 5px 0 rgba(28, 37, 84, .18); }
.ask-btn.ask-on { background: var(--gold); box-shadow: 0 5px 0 var(--gold-dark); }
.ask-btn:active { transform: translateY(4px); box-shadow: none; }
.ask-ic { display: grid; place-items: center; width: 40px; height: 40px; font-size: 28px; }
.ask-ic img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 600px) { /* 한 줄 약 76px: PC·패드에서 오늘 단추(가운데 아래) 밑으로 들어가게 (1024×768 에서 오늘 단추 아래 끝 670px) */
  .jw-ask { grid-template-columns: auto auto 1fr; grid-template-areas: "dada q row"; padding: 8px 14px; }
  .jw-ask .ask-dada { width: 46px; height: 60px; }
  .ask-btn { min-height: 52px; }
}

/* 화면 아래 고정 버튼 자리 ('다음' 등): 그림이 길어도 늘 첫 화면 안. 아이폰 홈 막대(안전 영역)만큼 띄운다 */
.dock {
  position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 12px;
  margin: 8px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--dock-bg, var(--sky)) 40%);
}

/* 움직임 */
@keyframes jw-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes jw-spin { to { transform: rotate(360deg); } }
@keyframes jw-hop { 50% { transform: translateY(-14px); } }
@keyframes jw-breathe { 50% { transform: scale(1.04); } }
.shake { animation: jw-shake .35s 2; }
.hop { animation: jw-hop .6s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 화면 사이 연출 (ui.js interlude, 산타 추적기 막간의 원리): 색 층 3장이 물결 끝을 달고 아래에서 올라와 화면을 덮고(와이프 인),
   새 화면이 준비되면 위로 걷힌다(와이프 아웃). 0.25초 넘게 걸리면 맨 위 층(하늘색 무대)에서 촌극 하나가 나온다.
   상태: shown = 촌극이 보임, on = 등장·기다림 동작, out = 마무리 동작 + 와이프 아웃. --hit = 마무리에서 층이 걷히기 시작하는 때.
   움직임은 transform·opacity 만. 마무리 키프레임은 0% 를 비워 두어 ui.js 가 얼려 둔 지금 자세에서 이어 간다. */
.jw-wait { position: fixed; inset: 0; z-index: 90; overflow: hidden; --H: 200px; --hit: 0s; }
@media (min-width: 768px) { .jw-wait { --H: 280px; } }
.jw-wait.out { pointer-events: none; }
.jw-layer { position: absolute; inset: 0; --c: var(--sun); background: var(--c); will-change: transform; }
.jw-layer::before, .jw-layer::after { /* 물결(둥근 구름) 끝: 올라올 때는 윗변, 걷힐 때는 아랫변이 보인다 */
  content: ""; position: absolute; left: 0; right: 0; height: 30px;
  background: radial-gradient(circle 24px at 50% 100%, var(--c) 96%, transparent 100%) var(--wx, 0) 0 / 48px 30px repeat-x;
}
.jw-layer::before { bottom: calc(100% - 1px); }
.jw-layer::after { top: calc(100% - 1px); transform: scaleY(-1); }
.jw-layer.l1 { --c: var(--roof); --wx: 16px; }
.jw-layer.l2 { --c: var(--sky); --wx: 32px; }
.sk-kick .l1 { --c: var(--dada); } .sk-detect .l1 { --c: var(--siwoo); }
.sk-hop .l1 { --c: var(--field); } .sk-parade .l1 { --c: var(--lake); }
/* 와이프 인 (같은 사이트 링크를 누르면): 아래에서 빠르게 올라와 멈춤 (ease-out), 층마다 0.07초 시간차 */
.jw-enter .jw-layer { transform: translateY(calc(100% + 32px)); }
.jw-go .jw-layer { transition: transform .4s cubic-bezier(.2, .7, .3, 1); }
.jw-go .l1 { transition-delay: .07s; } .jw-go .l2 { transition-delay: .14s; }
/* 와이프 아웃: 맨 위 층부터 위로 빨려 나감 (ease-in) */
.jw-wait.out .jw-layer { transform: translateY(calc(-100% - 32px)); transition: transform .45s cubic-bezier(.6, 0, .8, .45) calc(var(--hit) + .14s); }
.jw-wait.out .l1 { transition-delay: calc(var(--hit) + .07s); }
.jw-wait.out .l2 { transition-delay: var(--hit); }

/* 첫 화면 로딩(index.html .jw-boot = 이 무대를 HTML 로 적은 것): 스크립트를 못 받아도 9초 뒤엔 걷힌다 (평소엔 ui.js 가 먼저 걷음) */
.jw-boot { animation: boot-gone .4s 9s forwards; }
@keyframes boot-gone { to { opacity: 0; visibility: hidden; } }
/* 약속의 길 문에서 온 도착 덮개 (ui.js warm.door): 문 열기 빛 원(보라)·제목 글자와 같은 모습으로 이어지다가 위로 걷힌다. 촌극이 나올 만큼 느리면 글자는 사라지고 아이 넷이 나옴 */
.jw-door .jw-layer { --c: var(--advent); }
.jw-door-title { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; color: var(--cream); padding: 16px; font-size: 26px; font-weight: 900; line-height: 1.3; transition: opacity .2s; }
.jw-door-title small { font-size: 17px; font-weight: 700; color: #FFE38A; }
.shown .jw-door-title { opacity: 0; }
/* 무대: 출연진 줄 (가운데) + 점 4개 */
.jw-cast { position: absolute; left: 16px; right: 16px; max-width: 640px; margin: 0 auto; top: calc(50% - var(--H) * .62); height: var(--H); visibility: hidden; }
.shown .jw-cast { visibility: visible; }
.jw-actor { position: absolute; bottom: 0; width: 0; height: 100%; } /* 폭 0 = 자리(left)가 곧 발 가운데 */
.jw-body { position: absolute; left: 0; bottom: 0; width: 0; height: 100%; transform-origin: 0 100%; }
.jw-fig { position: absolute; left: 0; bottom: 0; width: 0; height: 100%; }
.jw-fig > *, .jw-pose { position: absolute; left: 0; bottom: 0; height: 100%; width: auto; max-width: none; overflow: visible; transform: translateX(-50%); }
.jw-fig .ph { width: calc(var(--H) * .5); }
.jw-pose { width: auto; opacity: 0; }
.jw-shadow { position: absolute; left: calc(var(--H) * -.17); width: calc(var(--H) * .34); bottom: -6px; height: 12px; border-radius: 50%; background: rgba(28, 37, 84, .2); }
.act-yangmal { height: 74%; }
.jw-fx { position: absolute; width: calc(var(--H) * .46); height: calc(var(--H) * .46); opacity: 0; pointer-events: none;
  background: var(--sun); clip-path: polygon(50% 0%, 59% 28%, 85% 15%, 72% 41%, 100% 50%, 72% 59%, 85% 85%, 59% 72%, 50% 100%, 41% 72%, 15% 85%, 28% 59%, 0% 50%, 28% 41%, 15% 15%, 41% 28%); }
.jw-wait-dots { position: absolute; left: 0; right: 0; top: calc(50% + var(--H) * .5); display: flex; justify-content: center; gap: 12px; opacity: 0; }
.shown .jw-wait-dots { opacity: 1; transition: opacity .3s 1s; }
.jw-wait-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--siwoo); opacity: .3; animation: jw-dot 1.2s infinite; }
.jw-wait-dots i:nth-child(2) { background: var(--dada); animation-delay: .3s; }
.jw-wait-dots i:nth-child(3) { background: var(--gold); animation-delay: .6s; }
.jw-wait-dots i:nth-child(4) { background: var(--lake); animation-delay: .9s; }
@keyframes jw-dot { 0%, 50%, 100% { opacity: .3; transform: scale(.8); } 25% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .jw-wait-dots i { opacity: 1; } } /* 멈춘 그림 한 장: 출연진이 제자리에 서고 점 4개가 다 켜짐 */

/* 함께 쓰는 동작 */
@keyframes jw-on { to { opacity: 1; } }
@keyframes jw-off { to { opacity: 0; } }
@keyframes jw-blink { 0%, 92%, 100% { transform: none; } 96% { transform: scaleY(.1); } }
@keyframes jw-tail { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }
@keyframes jw-nod { 0%, 100% { transform: rotate(-2deg) translateY(3px); } 50% { transform: rotate(2deg); } }
@keyframes jw-arm-up-l { 70% { transform: rotate(140deg); } to { transform: rotate(128deg); } }
@keyframes jw-arm-up-r { 70% { transform: rotate(-140deg); } to { transform: rotate(-128deg); } }
@keyframes jw-pop { 0% { opacity: 1; transform: scale(0) rotate(-30deg); } 45% { opacity: 1; transform: scale(1.3) rotate(10deg); } 70%, 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes jw-shadow-hop { 50% { transform: scale(.55); opacity: .5; } }
.jw-wait.shown svg #eyes { animation: jw-blink 2.8s .9s infinite; }
.shown .jw-yangmal #tail { animation: jw-tail .9s ease-in-out infinite; }
.jw-wait.out .jw-actor, .jw-wait.out .jw-body { animation: none; } /* 마무리 동작이 없는 몸은 얼린 자세 그대로 */

/* ① 다다 격파: 달려와 끽 멈춤 → 겨루기 자세로 통통 + 주먹 기합 → (마무리) 움츠렸다가 높이 옆차기! 별이 펑, 화면이 걷어차여 올라감 */
.on.sk-kick .act-dada { animation: kick-in .62s cubic-bezier(.3, .8, .4, 1) both; }
@keyframes kick-in { from { transform: translateX(-80vw); } 72% { transform: translateX(16px); } 88% { transform: translateX(-4px); } to { transform: none; } }
.on.sk-kick .act-dada .jw-body { animation: kick-run .62s both, kick-stance .5s .62s ease-in-out infinite; }
@keyframes kick-run {
  0% { transform: rotate(10deg) scale(1.06, .94); }
  14% { transform: translateY(-24px) rotate(10deg) scale(.94, 1.08); }
  28% { transform: rotate(10deg) scale(1.08, .92); }
  42% { transform: translateY(-24px) rotate(8deg) scale(.94, 1.08); }
  60% { transform: rotate(-9deg) scale(1.16, .84); }
  78% { transform: translateY(-6px) rotate(3deg) scale(.96, 1.05); }
  100% { transform: scale(1.04, .96); }
}
@keyframes kick-stance { 0%, 100% { transform: scale(1.04, .96); } 50% { transform: translateY(-9px) scale(.98, 1.03); } }
.shown.sk-kick .jw-dada #arm-right { animation: kick-pump 1s .8s infinite; }
@keyframes kick-pump { 0%, 40%, 100% { transform: none; } 52% { transform: rotate(-138deg); } 64% { transform: rotate(-118deg); } 76% { transform: rotate(-130deg); } }
.shown.sk-kick .jw-dada #head { animation: jw-nod .5s .7s ease-in-out infinite; } /* 몸보다 0.08초 늦게 = 따라 흔들림 */
.sk-kick .act-dada .jw-pose { transform: translateX(-36%); }
.sk-kick .jw-fx { left: calc(50% + var(--H) * .12); top: calc(var(--H) * -.12); }
.out.sk-kick .act-dada .jw-body { animation: kick-go .7s cubic-bezier(.3, .7, .4, 1) forwards; }
@keyframes kick-go {
  25% { transform: translateY(8px) rotate(-5deg) scale(1.16, .82); }
  36% { transform: translateY(-30px) rotate(5deg) scale(.92, 1.1); }
  52% { transform: translateY(-22px) rotate(-2deg) scale(1.02, .98); }
  100% { transform: translateY(-22px); }
}
.out.sk-kick .act-dada .jw-fig { animation: jw-off 0s .24s forwards; }
.out.sk-kick .act-dada .jw-pose { animation: jw-on 0s .24s forwards; }
.out.sk-kick .act-dada .jw-shadow { animation: jw-shadow-hop .7s .24s forwards; }
.out.sk-kick .jw-fx { animation: jw-pop .4s .26s cubic-bezier(.2, .9, .3, 1.3) both; }
.out.sk-kick .jw-cast { animation: jw-shake .1s .27s 3; }

/* ② 돋보기 탐정 시우: 살금살금 들어와 돋보기로 두리번 / 뒤에서 봉봉이 기어 옴 → (마무리) 봉봉이 엉덩이 씰룩 덮치기!
      시우가 깜짝(!) 두 팔 번쩍 뛰고 달아나고 봉봉이 쫓아감 */
.sk-detect .act-siwoo .jw-pose { opacity: 1; transform: translateX(-42%); }
.sk-detect .act-siwoo .jw-fig { opacity: 0; }
.sk-detect .act-yangmal .jw-pose { opacity: 1; transform: translateX(-50%) scaleX(-1); } /* 엎드려 기어 와서 앉음 (pose/bonbon-bow.svg: 리그와 같은 높이로 두면 머리 크기가 맞고 꼬리가 흔들림) */
.sk-detect .act-yangmal .jw-fig { opacity: 0; }
.on.sk-detect .act-yangmal .jw-fig { animation: jw-on 0s 1.3s forwards; }
.on.sk-detect .act-yangmal .jw-pose { animation: jw-off 0s 1.3s forwards; }
.on.sk-detect .act-siwoo { animation: det-in .7s cubic-bezier(.25, .7, .4, 1) both; }
@keyframes det-in { from { transform: translateX(-90vw); } 80% { transform: translateX(8px); } to { transform: none; } }
.on.sk-detect .act-siwoo .jw-body { animation: det-tiptoe .7s both, det-scan 1.6s .7s ease-in-out infinite; }
@keyframes det-tiptoe { 0%, 40%, 80% { transform: rotate(6deg); } 20%, 60% { transform: translateY(-12px) rotate(2deg) scale(.97, 1.04); } 100% { transform: none; } }
@keyframes det-scan { 0%, 100% { transform: none; } 20% { transform: translateY(-6px) rotate(3deg); } 45% { transform: rotate(6deg) scale(1.02, .98); } 70% { transform: translateY(-4px) rotate(-3deg); } }
.on.sk-detect .act-yangmal { animation: det-creep 1s .35s cubic-bezier(.4, 0, .5, 1) both; }
@keyframes det-creep { from { transform: translateX(-60vw); } to { transform: none; } }
.on.sk-detect .act-yangmal .jw-body { animation: det-sneak .5s ease-in-out infinite; }
@keyframes det-sneak { 0%, 100% { transform: scale(1.06, .9); } 50% { transform: translateY(-4px) scale(1.02, .95) rotate(2deg); } }
.sk-detect .jw-fx { left: calc(60% + var(--H) * .02); top: calc(var(--H) * -.3); width: calc(var(--H) * .3); height: calc(var(--H) * .3); background: none; clip-path: none;
  font: 900 calc(var(--H) * .3)/1 var(--font); color: var(--dada); text-align: center; }
.sk-detect .jw-fx::before { content: "!"; }
.out.sk-detect .act-yangmal .jw-fig { animation: jw-off 0s .04s forwards; }
.out.sk-detect .act-yangmal .jw-pose { animation: jw-on 0s .04s forwards; }
.out.sk-detect .act-yangmal .jw-body { animation: det-wiggle .3s forwards; }
@keyframes det-wiggle { 30% { transform: rotate(-4deg) scale(1.05, .92); } 60% { transform: rotate(4deg) scale(1.05, .92); } 100% { transform: scale(1.1, .86); } }
.out.sk-detect .act-yangmal { animation: det-pounce .7s .28s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes det-pounce { 40% { transform: translateX(28vw) translateY(-70px) rotate(-12deg); } 100% { transform: translateX(110vw) translateY(-10px); } }
.out.sk-detect .act-siwoo .jw-pose { animation: jw-off 0s .22s forwards; }
.out.sk-detect .act-siwoo .jw-fig { animation: jw-on 0s .22s forwards; }
.out.sk-detect .jw-siwoo #arm-left { animation: jw-arm-up-l .22s .22s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.out.sk-detect .jw-siwoo #arm-right { animation: jw-arm-up-r .22s .24s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.out.sk-detect .act-siwoo .jw-body { animation: det-jump .6s .1s forwards; }
@keyframes det-jump { 20% { transform: scale(1.1, .88); } 45% { transform: translateY(-50px) scale(.9, 1.14); } 70% { transform: translateY(-36px) rotate(6deg); } 100% { transform: translateY(-30px) rotate(12deg) scale(1.05, .95); } }
.out.sk-detect .act-siwoo { animation: det-flee .6s .42s cubic-bezier(.5, 0, .8, .5) forwards; }
@keyframes det-flee { to { transform: translateX(100vw); } }
.out.sk-detect .jw-fx { animation: jw-pop .3s .2s cubic-bezier(.2, .9, .3, 1.3) both; }

/* ③ 미미와 몽실이 깡충: 두 번 깡충 들어와 제자리 깡충 (땅=정면 찌그러짐, 공중=깡충 그림 늘어남) / 봉봉이 고개·눈으로 따라 봄
      → (마무리) 봉봉이 움츠렸다 위로 뛰어올라 무대(커튼)를 끌고 올라감 */
.sk-hop .act-bomi .jw-pose { height: 88%; }
.on.sk-hop .act-bomi { animation: hop-in .64s linear both; }
@keyframes hop-in { from { transform: translateX(-80vw); } to { transform: none; } }
.on.sk-hop .act-bomi .jw-body { animation: jw-bhop .32s 2 both, jw-bhop .64s .64s infinite; }
.on.sk-hop .act-bomi .jw-pose { animation: hop-pose .32s 2, hop-pose .64s .64s infinite; }
.on.sk-hop .act-bomi .jw-fig { animation: hop-fig .32s 2, hop-fig .64s .64s infinite; }
.on.sk-hop .act-bomi .jw-shadow { animation: jw-shadow-hop .32s 2, jw-shadow-hop .64s .64s infinite; }
@keyframes jw-bhop {
  0% { transform: scale(1.14, .86); animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
  14% { transform: translateY(-8px) scale(.9, 1.12); animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
  50% { transform: translateY(-62px); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  86% { transform: translateY(-6px) scale(.94, 1.08); }
  100% { transform: scale(1.14, .86); }
}
@keyframes hop-pose { 0%, 12% { opacity: 0; } 12.1%, 88% { opacity: 1; } 88.1%, 100% { opacity: 0; } }
@keyframes hop-fig { 0%, 12% { opacity: 1; } 12.1%, 88% { opacity: 0; } 88.1%, 100% { opacity: 1; } }
.on.sk-hop .act-yangmal { animation: hop-yin .45s .15s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes hop-yin { from { transform: scale(0); } }
.shown.sk-hop .jw-yangmal #head { animation: hop-watch .64s .72s ease-in-out infinite; }
@keyframes hop-watch { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(-7deg) translateY(-10px); } }
.out.sk-hop .act-yangmal .jw-body { animation: hop-yleap .7s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes hop-yleap { 28% { transform: translateY(6px) scale(1.16, .8); } 40% { transform: translateY(-40px) scale(.84, 1.2); } 100% { transform: translateY(-110vh) scale(.9, 1.15); } }
.out.sk-hop .jw-yangmal #tail { animation: jw-tail .25s infinite; }
.out.sk-hop .act-bomi .jw-body { animation: hop-final .6s forwards; }
@keyframes hop-final { 30% { transform: scale(1.16, .84); } 60% { transform: translateY(-56px) scale(.92, 1.1); } 100% { transform: translateY(-44px); } }
.out.sk-hop .act-bomi .jw-fig { animation: jw-off 0s .18s forwards; }
.out.sk-hop .act-bomi .jw-pose { animation: jw-on 0s .18s forwards; }

/* ④ 넷이 줄지어: 오른쪽에서 앞사람부터 차례로 달려와 끽 (시간차) → 각자 박자대로 (다다 쿵쿵·시우 팔 흔들기·미미 콩콩·봉봉 꼬리)
      → (마무리) 앞사람부터 차례로 움츠렸다 만세 점프 */
.sk-parade .jw-actor { height: 74%; } .sk-parade .act-dada { height: 70%; } .sk-parade .act-bomi { height: 56%; } .sk-parade .act-yangmal { height: 42%; } /* 넷이 함께: 확정/final-lineup 키 비율 (시우 100 · 다다 94 · 미미 76 · 봉봉 57) */
/* 등장: 넷이 처음부터 다 보이게 짧게 달려 들어온다 (고칠 일 6: 화면 밖 90vw 에서 오면 짧은 로딩엔 다다 혼자만 찍혀 '다른 로딩'으로 보였음) */
.on.sk-parade .jw-actor { animation: par-in .45s cubic-bezier(.25, .8, .35, 1.2) both; }
.on.sk-parade .jw-actor:nth-child(2) { animation-delay: .04s; }
.on.sk-parade .jw-actor:nth-child(3) { animation-delay: .08s; }
.on.sk-parade .jw-actor:nth-child(4) { animation-delay: .12s; }
@keyframes par-in { from { transform: translateX(22vw); opacity: 0; } 35% { opacity: 1; } }
/* 첫 화면 로딩(.jw-boot)은 HTML 을 읽는 동안 화면 일이 바빠 등장 동작이 시작 자리에 멈춰 보일 수 있어 처음부터 제자리에 선다.
   그림은 <img> 그대로라(촌극은 SVG 를 넣음) 공통 img.fig 크기(72×88)를 풀어 무대 높이에 맞춘다 */
.jw-boot.on.sk-parade .jw-actor { animation: none; }
.jw-fig > img.fig { width: auto; height: 100%; }
@keyframes par-run { 0%, 100% { transform: rotate(-8deg) scale(1.04, .96); } 50% { transform: translateY(-14px) rotate(-8deg) scale(.96, 1.05); } }
@keyframes par-bob { 0%, 100% { transform: scale(1.04, .96); } 50% { transform: translateY(-8px) scale(.98, 1.03); } }
@keyframes par-bounce { 0%, 100% { transform: scale(1.1, .9); } 45% { transform: translateY(-18px) scale(.94, 1.07); } }
@keyframes par-stomp { 0%, 100% { transform: rotate(-5deg) scale(1.05, .95); } 25% { transform: translateY(-10px) rotate(0); } 50% { transform: rotate(5deg) scale(1.05, .95); } 75% { transform: translateY(-10px) rotate(0); } }
.on.sk-parade .act-dada .jw-body { animation: par-run .2s 3, par-stomp .8s .6s ease-in-out infinite; }
.on.sk-parade .act-siwoo .jw-body { animation: par-run .2s .08s 3, par-bob .6s .68s ease-in-out infinite; }
.on.sk-parade .act-bomi .jw-body { animation: par-run .2s .16s 3, par-bounce .4s .76s ease-in-out infinite; }
.on.sk-parade .act-yangmal .jw-body { animation: par-run .2s .24s 3, par-bob .45s .84s ease-in-out infinite; }
.shown.sk-parade .jw-siwoo #arm-left { animation: par-swing .6s .68s ease-in-out infinite; }
.shown.sk-parade .jw-siwoo #arm-right { animation: par-swing .6s .38s ease-in-out infinite; }
@keyframes par-swing { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
.shown.sk-parade .jw-dada #arm-right { animation: kick-pump 1.6s 1s infinite; }
.out.sk-parade .jw-body { animation: par-jump .7s cubic-bezier(.3, .7, .4, 1) forwards; }
.out.sk-parade .jw-actor:nth-child(2) .jw-body { animation-delay: .05s; }
.out.sk-parade .jw-actor:nth-child(3) .jw-body { animation-delay: .1s; }
.out.sk-parade .jw-actor:nth-child(4) .jw-body { animation-delay: .15s; }
@keyframes par-jump { 25% { transform: translateY(5px) scale(1.14, .84); } 45% { transform: translateY(-46px) scale(.9, 1.14); } 70% { transform: translateY(-40px) rotate(-4deg); } 100% { transform: translateY(-44px) rotate(3deg); } }
.out.sk-parade .jw-siwoo #arm-left { animation: jw-arm-up-l .25s .2s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.out.sk-parade .jw-siwoo #arm-right { animation: jw-arm-up-r .25s .22s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.out.sk-parade .jw-dada #arm-right { animation: jw-arm-up-r .25s .16s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.out.sk-parade .jw-bomi #arm-right { animation: jw-arm-up-r .25s .26s cubic-bezier(.3, 1.5, .5, 1) forwards; }

/* ── 공통 화면 조각 (ui.js) ── */
.page { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.topbar-title { font-size: 20px; font-weight: 900; }
.say-row { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0 18px; }
.say-row .say-fig { width: 56px; height: 68px; font-size: 13px; }
.say-row .ph--bomi.say-fig { height: 48px; }
.say-row .bubble { flex: 1; }
/* 놀이 안내 '다시 듣기' 손가락 단추 (ui.js JW.guide). finger.svg 는 손끝이 그림 한가운데라 손 부분만 보이게 잘라 크게 */
.guide-again { position: relative; display: inline-block; overflow: hidden; flex: none; width: 44px; height: 44px; padding: 0; margin-left: 6px; vertical-align: middle;
  border: 0; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 rgba(28, 37, 84, .2); cursor: pointer; }
.guide-again img { position: absolute; left: -33px; top: -39px; width: 92px; height: 92px; max-width: none; pointer-events: none; }
.guide-again[hidden] { display: none; }
.say-row .bubble::after { left: -8px; bottom: 14px; border: 8px solid transparent; border-left: 0; border-right-color: var(--cream); }
.notice { padding: 32px 0; display: grid; gap: 16px; }
/* PC(1280 이상 등): 잠긴 문·안내 화면 아래 절반 빈 색면 없애기 — 내용이 화면 높이 60% 이상 차게 중앙 확대 배치 */
@media (min-width: 900px) and (min-height: 560px) {
  .notice { min-height: min(65svh, 540px); align-content: center; justify-items: center; gap: 28px; padding: 40px 24px; max-width: 860px; margin: 0 auto; }
  .notice .say-row { align-items: center; gap: 20px; margin: 0; }
  .notice .say-row .say-fig { width: 100px; height: 124px; }
  .notice .bubble { font-size: 24px; padding: 20px 28px; border-radius: 24px; }
  .notice .bubble > b:first-child { font-size: 16px; padding: 2px 14px; margin-bottom: 6px; }
  .notice .btn-row { gap: 20px; }
  .notice .btn-row .btn, .notice .btn-row .btn-gold { min-height: 68px; padding: 0 40px; font-size: 22px; }
}
@media (min-width: 1200px) and (min-height: 600px) {
  .notice { min-height: min(70svh, 600px); }
  .notice .say-row .say-fig { width: 116px; height: 144px; }
  .notice .bubble { font-size: 28px; padding: 24px 34px; }
  .notice .btn-row .btn, .notice .btn-row .btn-gold { min-height: 74px; padding: 0 44px; font-size: 24px; }
}

.end { position: relative; isolation: isolate; display: grid; gap: 20px; justify-items: center; padding: 16px 0 40px; text-align: center; }
.end-rest { display: grid; gap: 16px; width: 100%; justify-items: stretch; text-align: left; }
.end-party { display: grid; justify-items: center; gap: 8px; }

/* PC(1280 이상 등): 이야기 끝·놀이 끝 화면 아래 절반 빈 색면 없애기 — 2단 또는 확대 배치 */
@media (min-width: 900px) and (min-height: 560px) {
  /* 놀이 끝 / 인사 끝 화면 (.end--greet): 중앙 확대 배치 */
  .end--greet { min-height: min(65svh, 540px); display: grid; align-content: center; justify-items: center; gap: 24px; max-width: 860px; margin: 0 auto; padding: 32px 20px; }
  .end--greet .end-party { gap: 14px; }
  .end--greet .end-yay { font-size: 38px; }
  .jw-hop { height: 136px; gap: 8px; }
  .rw-stars { height: 64px; gap: 12px; }
  .rw-star { width: 64px; height: 64px; }
  .end--greet .end-rest { max-width: 680px; gap: 16px; }
  .end--greet .say-row { gap: 16px; }
  .end--greet .say-row .say-fig { width: 72px; height: 88px; }
  .end--greet .bubble { font-size: 20px; }
  .end--greet .btn-row .btn, .end--greet .btn-row .btn-gold { min-height: 64px; padding: 0 32px; font-size: 20px; }

  /* 약속 카드 끝 화면 (.end--card): 초 버튼 확대 및 카드가 나오면 좌(카드)·우(대사·버튼) 2단 배치 */
  .end--card { max-width: 1040px; min-height: min(65svh, 560px); display: grid; grid-template-columns: minmax(320px, 380px) minmax(360px, 580px); gap: 28px 40px; align-items: start; justify-content: center; text-align: left; padding: 24px 20px 48px; }
  .end--card:not(:has(> .end-rest)) { grid-template-columns: minmax(320px, 380px); } /* 카드 뒤집기 전: 오른쪽 칸이 아직 없으니 한 칸 가운데 (아이패드 가로에서 오른쪽 55%가 비던 것, 10/27) */
  .end--card:has(.end-candle:only-child) { display: grid; grid-template-columns: 1fr; align-content: center; justify-items: center; text-align: center; }
  .end--card > .end-candle { grid-column: 1; width: 100%; display: flex; justify-content: center; }
  .end--card > .promise-card { grid-column: 1; width: 100%; max-width: 380px; justify-self: center; }
  .end--card > .end-rest { grid-column: 2; grid-row: 1 / span 3; width: 100%; }
  /* 카드를 뒤집은 뒤: 노란 '오늘의 놀이'·길로·선반·마을로 단추를 대사 바로 다음(부모 질문·수수께끼 앞)으로 — 아래 끝에 있어 PC 첫 화면 밖으로 밀리던 것 (10/29 막힌 길) */
  .end--card > .end-rest > .parent-q, .end--card > .end-rest > .riddle { order: 2; }
  .end--card > .end-rest > .btn-row { order: 1; }
  .end--card .jw-candle .jc-say { font-size: 24px; padding: 10px 32px; }
  .promise-card { width: min(380px, 100%); }
  .promise-card .pc-face { padding: 32px 28px; gap: 16px; }
  .promise-card .pc-text { font-size: 24px; }
  .promise-card .pc-head { font-size: 26px; }
  .promise-card .pc-hint { font-size: 17px; }
}
@media (min-width: 1200px) and (min-height: 600px) {
  .end--greet { min-height: min(70svh, 600px); }
  .jw-hop { height: 156px; }
  .end--greet .end-yay { font-size: 42px; }
  .rw-stars { height: 72px; gap: 16px; }
  .rw-star { width: 72px; height: 72px; }
  .end--card { max-width: 1100px; min-height: min(70svh, 620px); gap: 36px 48px; }
  .end--card .jw-candle .jc-say { font-size: 26px; padding: 12px 38px; }
  .promise-card { width: min(420px, 100%); }
  .promise-card .pc-text { font-size: 26px; }
  .promise-card .pc-head { font-size: 28px; }
}

/* 끝 화면 축하 조각 (ui.js JW.burst). 그림은 JW.ART.confetti 한곳에서 바꾼다 */
.fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; } /* 글·버튼 뒤에서 터진다 */
.fx--front { z-index: 5; } /* 약속 카드: 카드 위로 1.4초 터지고 사라짐 */
@media (prefers-reduced-motion: reduce) { .fx--front { z-index: -1; } } /* 정지 장면은 카드 글을 가리지 않게 뒤로 */
.fx-bit {
  position: absolute; left: 50%; top: var(--oy, 70px); width: 12px; height: 18px; margin: -9px 0 0 -6px; border-radius: 3px;
  transform: translate(var(--x), var(--y)) rotate(var(--r)); /* 끝 자리 = '동작 줄이기'일 때의 정지 장면 */
  animation: jw-burst 1.4s cubic-bezier(.15, .7, .3, 1) forwards;
}
.fx-star { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 0;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.fx-img { width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 0; }
.jw-dust { position: fixed; z-index: 70; width: 0; height: 0; pointer-events: none; } /* 맞힘 별 가루 (ui.js JW.hit) */
.jw-dust i { position: absolute; left: 0; top: 0; width: 14px; height: 14px; transform: translate(-50%, -50%) scale(.3);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
@keyframes jw-burst {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)); opacity: 0; }
}
@keyframes jw-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.12, .88); } 50% { transform: translateY(-26px) scale(.94, 1.06); } }
.end-yay { font-size: 28px; font-weight: 900; }
.frame-art { width: 220px; padding: 12px; background: var(--wood); border-radius: 12px; }
.frame-art svg { width: 100%; height: auto; background: var(--white); border-radius: 4px; }
.frame-note { color: var(--cream); font-size: 15px; margin-top: 8px; }
.end-bong { display: flex; justify-content: center; height: 124px; overflow: visible; }
/* 끝 화면 봉봉 (ui.js JW.bonbon, Daniel 10/15): 동작 하나를 무작위로. 꼬리는 그림 안에서 살랑살랑, 여기서는 몸 움직임만.
   그림은 모두 같은 높이로 놓으면 머리 크기·바닥선이 맞게 만들어 둠(bonbon_pose_svg.py) */
.bb-end { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bb-end img { display: block; height: 100%; width: auto; max-width: none; transform-origin: 50% 100%; }
.bb-end--hop img { animation: bb-hop 1.15s cubic-bezier(.3, 0, .5, 1) infinite; }
.bb-end--bow img { animation: bb-wiggle .38s ease-in-out infinite alternate; transform-origin: 22% 100%; }
.bb-end--wag img { animation: bb-bounce .45s ease-in-out infinite alternate; }
.bb-end--roll img { animation: bb-roll 4.4s ease-in-out infinite; transform-origin: 50% 60%; }
.bb-end--sniff img { animation: bb-pace 7s linear infinite; }
@keyframes bb-hop { 0%, 100% { transform: none; } 14% { transform: scale(1.1, .9); } 42% { transform: translateY(-38px) scale(.95, 1.06); } 70% { transform: translateY(0) scale(1.08, .93); } 82% { transform: scale(.98, 1.02); } }
@keyframes bb-wiggle { from { transform: rotate(-2deg); } to { transform: rotate(2.5deg) translateY(-2px); } }
@keyframes bb-bounce { from { transform: none; } to { transform: translateY(-5px) scale(.98, 1.03); } }
@keyframes bb-roll { 0%, 8% { transform: translateX(-56px) rotate(0); } 42%, 58% { transform: translateX(56px) rotate(360deg); } 92%, 100% { transform: translateX(-56px) rotate(0); } }
@keyframes bb-pace { 0% { transform: translateX(44px); } 42%, 49.9% { transform: translateX(-44px); } 50% { transform: translateX(-44px) scaleX(-1); } 92%, 99.9% { transform: translateX(44px) scaleX(-1); } 100% { transform: translateX(44px); } } /* 끝에서 잠깐 킁킁 멈췄다가 휙 돌아섬 */

/* 마을 봉봉 (scene.js JW.bonbonRoam): data-bb = 지금 하는 일, 동작 그림(.bb-pic)은 앉은 리그 자리에 겹쳐 놓고 하나만 보인다 */
.crew .walker.bb-live .step { position: relative; animation: none; }
.bb-live .bb-pic { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; max-width: none; translate: -50% 0; visibility: hidden; pointer-events: none; transform-origin: 50% 100%; }
.bb-live .bb-pic.on { visibility: visible; }
.bb-live[data-pic] .slot { visibility: hidden; }
.bb-live[data-bb="sniff"] .bb-sniff { animation: bb-nose .36s ease-in-out infinite alternate; transform-origin: 20% 100%; }
.bb-live[data-bb="snuffle"] .bb-sniff { animation: bb-nose .16s ease-in-out infinite alternate; transform-origin: 20% 100%; }
.bb-live[data-bb="bow"] .bb-bow { animation: bb-wiggle .34s ease-in-out infinite alternate; transform-origin: 22% 100%; }
.bb-live[data-bb="wag"] .bb-wag { animation: bb-bounce .5s ease-in-out infinite alternate; }
.bb-live[data-bb="hop"] .bb-hop { animation: bb-hop .9s cubic-bezier(.3, 0, .5, 1); }
.bb-live[data-bb="sit"] svg #head { animation: bb-tilt 3s ease-in-out; }
@keyframes bb-nose { from { transform: none; } to { transform: rotate(2.5deg) translateY(1px); } }
@keyframes bb-tilt { 0%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(-14deg); } 58%, 85% { transform: rotate(10deg); } }
.bb-sfx { position: absolute; left: -14px; bottom: 34%; font-style: normal; font-size: 11px; font-weight: 800; color: var(--ink); opacity: 0; pointer-events: none; white-space: nowrap; }
.bb-right .bb-sfx { left: auto; right: -14px; }
.bb-live[data-bb="snuffle"] .bb-sfx { animation: bb-sfx .5s ease-out infinite; }
@keyframes bb-sfx { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: .85; } 100% { opacity: 0; transform: translateY(-8px); } }
.parent-q .pq-label { font-size: 15px; font-weight: 800; opacity: .8; }
.candle-btn { min-height: 72px; font-size: 20px; background: var(--night); color: var(--cream); border: 3px solid var(--gold); }
.candle-btn.lit { background: var(--gold); color: var(--ink); }

.promise-card {
  position: relative; width: min(320px, 100%); aspect-ratio: 3 / 4; border: 0; padding: 0; cursor: pointer;
  background: none; perspective: 1000px;
}
.pc-face {
  position: absolute; inset: 0; border-radius: var(--r-card); padding: 24px; display: grid; align-content: center; gap: 12px;
  backface-visibility: hidden; transition: transform .6s; text-align: center;
}
.pc-front { background: var(--advent-dark); color: var(--cream); border: 6px solid var(--gold); } /* 보라 바탕 위에서도 카드 모양이 보이게 */
.pc-back { background: var(--cream); color: var(--ink); transform: rotateY(180deg); border: 6px solid var(--gold); }
.promise-card.flipped .pc-front { transform: rotateY(-180deg); }
.promise-card.flipped .pc-back { transform: rotateY(0); }
.pc-label { font-size: 15px; font-weight: 800; }
.pc-text { font-size: 20px; font-weight: 700; line-height: 1.5; }
.pc-ref { margin: 6px 0 0; font-size: 15px; font-weight: 600; opacity: .75; }
.pc-head { font-size: 22px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: .25em; }
.pc-head-ic { width: 1.25em; height: 1.25em; flex: none; object-fit: contain; }
.pc-hint { font-size: 15px; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .promise-card.flipped .pc-front { visibility: hidden; } }

.riddle { display: grid; justify-items: center; gap: 8px; padding: 16px; border-radius: var(--r-card); background: var(--lock); color: var(--ink); font-weight: 800; }
.riddle .riddle-shadow { width: 120px; max-height: none; filter: brightness(0) opacity(.35); } /* 이야기 화면 .scene{width:100%} 보다 세게 (11/9 아이패드: 그림자가 칸을 다 채워 수수께끼 글이 밀려남) */
.riddle-door { width: 80px; height: 100px; border-radius: 40px 40px 8px 8px; background: var(--lock-dark); filter: none; }

/* 놀이 시작 화면 (play.js) */
.play-start { display: grid; gap: 20px; justify-items: center; padding: 24px 0; text-align: center; }
.play-title { font-size: 28px; font-weight: 900; line-height: 1.3; }
.play-start .scene, .play-start .ph--scene { max-width: 420px; }


/* 휴대폰을 눕혔을 때 '휴대폰을 세워 주세요' (결정 ①, Daniel 2026-10-16 "추천대로 진행해줘": 개장 전에는 안내로 막는다).
   높이 500px 이하·폭 1000px 이하(휴대폰) + 가로가 더 김 + 손가락 기기에서만. 가로 배치가 있는 화면(만들기 게임)은 html 이나 body 에 data-landscape-ok 를 붙여 예외.
   그림은 다다 + 웃는 휴대폰을 돌리는 손(ui.js 가 그림). 소리 없음. 바로 세우면 사라지고 하던 화면이 그대로 있다 */
.jw-rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) and (pointer: coarse) {
  html:not([data-landscape-ok]) body:not([data-landscape-ok]) > .jw-rotate {
    position: fixed; inset: 0; z-index: 2147483000; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 12px 24px;
    background: var(--sky) radial-gradient(circle at 50% 110%, var(--field) 0 34%, transparent 34.5%); color: var(--ink); text-align: center;
  }
  html:not([data-landscape-ok]) body:not([data-landscape-ok]):has(> .jw-rotate) { overflow: hidden; }
}
.rot-art { display: flex; align-items: flex-end; justify-content: center; gap: 28px; height: min(52vh, 200px); }
.rot-dada { height: 100%; width: auto; animation: rot-hop 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
.rot-phone { height: 88%; width: auto; overflow: visible; }
.rot-phone .rp-turn { transform-box: view-box; transform-origin: 50% 54%; animation: rot-turn 2.4s cubic-bezier(.5, 0, .3, 1) infinite; }
.rot-phone .rp-arrow { animation: rot-fade 2.4s ease-in-out infinite; }
.rot-text { font-size: clamp(24px, 7vh, 34px); font-weight: 900; line-height: 1.25; }
.rot-sub { font-size: 16px; font-weight: 700; opacity: .8; }
@keyframes rot-turn { 0%, 18% { transform: rotate(-90deg); } 52%, 88% { transform: rotate(0); } 100% { transform: rotate(-90deg); } }
@keyframes rot-fade { 0%, 12% { opacity: 1; } 40%, 100% { opacity: 0; } }
@keyframes rot-hop { 0%, 55%, 100% { transform: none; } 65% { transform: scale(1.06, .94); } 78% { transform: translateY(-14px) scale(.97, 1.04); } }

/* 아이패드·아이폰에서 그림판(canvas)·그림을 길게 누르면 '복사하기·찾아보기' 창이 뜨지 않게 (Daniel 10/21 사진관에서 다다를 길게 눌러 옮길 때) */
canvas, img { -webkit-touch-callout: none; }
canvas { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
/* 길게 누를 때 단추 속 글자(버그 신고 단추 등)가 선택되며 '복사하기' 창이 뜨지 않게 — 단추·떠 있는 부품은 글자 선택 끔 (10/21 아이패드) */
button, .jw-bug, .jw-bug *, .topbar, .topbar * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 길게 누르면 아이패드·아이폰이 링크 미리보기('열기·새 탭에서 열기·링크 복사') 창이나 글자 선택 창을 띄우던 것 — 건물·카드·단추가 링크라서
   (Daniel 10/22 "실제 터치를 했을 때 지난번처럼 팝업이 뜨진 않는지", 실기기 첫 화면에서 링크 8개가 열려 있었음) → 아이 사이트 전체에서 끄고 글 쓰는 칸만 예외 */
html { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
/* 게임 화면은 글자 선택 자체를 끔 (끌기·길게 누르기가 놀이라서) */
body:has(.vp-layout), body.vp { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ── 약속의 길 문 마지막 장면 (ui.js JW.finale, story.html·놀이 틀 함께). 그림·움직임은 4:3 무대(.pk-fin-stage) 기준 %,
   휴대폰처럼 칸이 세로로 길면 무대 양옆이 잘린다(그림 가운데 기준) ── */
.pk-finale { display: grid; gap: 12px; justify-items: center; max-width: 560px; width: 100%; margin: 0 auto; padding: 6px 0 24px; cursor: pointer; user-select: none; }
.pk-fin-scene { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: min(50svh, 420px); border-radius: var(--r-card); overflow: hidden;
  background: rgba(28, 37, 84, .18); box-shadow: 0 6px 0 rgba(28, 37, 84, .18); }
.pk-fin-stage { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 4 / 3; min-width: 100%; transform: translateX(-50%); }
.pk-fin-bg { width: 100%; height: 100%; object-fit: cover; display: block; animation: pk-fin-zoom 3.5s ease-out both; transition: filter 1.2s ease; }
.pk-fin-light { position: absolute; inset: -10%; pointer-events: none;
  background: radial-gradient(circle at 50% 28%, rgba(255, 240, 176, .55), rgba(255, 212, 101, .18) 44%, transparent 70%);
  animation: pk-fin-glow 2.2s ease-in-out infinite alternate; }
.pk-fin-mv { position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1; pointer-events: none; display: grid; place-items: center;
  filter: drop-shadow(0 4px 10px rgba(255, 236, 160, .65)); }
.pk-fin-mv img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pk-fin-mv.no-art { border-radius: 50%; background: radial-gradient(circle, #FFFBE6 0 18%, rgba(255, 228, 140, .85) 34%, rgba(255, 212, 101, 0) 70%); }
.pk-fin-mv--glow { animation: pk-fin-pulse 1.6s ease-in-out infinite alternate; }
.pk-fin-mv--hop { animation: pk-fin-hop 1.1s cubic-bezier(.3, 0, .5, 1) infinite; }
.pk-fin-mv--walk { animation: pk-fin-walk 2.4s ease-out both; }
.pk-fin-mv--float { animation: pk-fin-float 1.9s ease-in-out infinite alternate; }
.pk-fin-mv--rise { animation: pk-fin-rise 2.2s ease-out both; }
.pk-fin-mv--drop { animation: pk-fin-drop 1.4s cubic-bezier(.45, 0, .7, 1) both; }
.pk-fin-mv--pop { animation: pk-fin-pop 1.3s cubic-bezier(.2, .7, .3, 1) both; }
.pk-fin-mv--twinkle { animation: pk-fin-twinkle 1.2s ease-in-out both, pk-fin-pulse 1.4s ease-in-out 1.2s infinite alternate; }
.pk-fin-mv--grow { transform-origin: 50% 100%; animation: pk-fin-grow 1.6s cubic-bezier(.2, .8, .3, 1.2) both; }
.pk-fin-mv--fly { transition: left 1.8s cubic-bezier(.4, 0, .3, 1), top 1.8s cubic-bezier(.3, 0, .6, 1); animation: pk-fin-float 1.1s ease-in-out infinite alternate; }
.pk-fin-mv--rays { border-radius: 50%; background: repeating-conic-gradient(rgba(255, 238, 170, .75) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 6%, #000 22%, transparent 70%); mask: radial-gradient(circle, transparent 6%, #000 22%, transparent 70%);
  filter: none; transform: none; translate: -50% -50%; animation: pk-fin-rays 1.4s ease-out both, pk-fin-spin 18s linear infinite; }
/* 누를 곳: 반짝이는 고리 + 손가락 */
.pk-fin-tap { position: absolute; z-index: 2; width: 16%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  border: 4px solid #FFF6C8; box-shadow: 0 0 0 4px rgba(255, 212, 101, .55), 0 0 24px 8px rgba(255, 236, 160, .8); animation: pk-fin-ring 1.1s ease-in-out infinite; }
.pk-fin-finger { position: absolute; left: -60%; top: -60%; width: 220%; max-width: none; animation: pk-fin-poke 1.1s ease-in-out infinite; }
.pk-finale.is-nudge .pk-fin-ask { animation: pk-fin-nudge .7s ease-in-out; } /* 5초 동안 안 누르면 '톡' 글이 한 번 통통 */
@keyframes pk-fin-nudge { 30% { transform: scale(1.12); } 60% { transform: scale(.96); } }
.pk-fin-ask { margin: 0; font-size: clamp(18px, 4.6vw, 22px); font-weight: 900; text-align: center; color: var(--ink, #1C2554); }
body.advent .pk-fin-ask { color: var(--cream); }
/* 누르기 전 덮개 (누르면 걷힘) */
.pk-fin-stage::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.pk-fin-scene.is-dark .pk-fin-stage::after { opacity: 1; background: radial-gradient(circle at 50% 40%, rgba(16, 22, 60, .55), rgba(10, 14, 44, .88)); }
.pk-fin-scene.is-fog .pk-fin-stage::after { opacity: 1; background: linear-gradient(rgba(255, 255, 255, .72), rgba(240, 240, 248, .6)); }
.pk-fin-scene.is-rain .pk-fin-stage::after { opacity: 1; background: repeating-linear-gradient(105deg, rgba(220, 232, 255, .55) 0 2px, transparent 2px 14px), rgba(40, 52, 84, .62);
  background-size: 100% 60px, auto; animation: pk-fin-rain .5s linear infinite; }
.pk-fin-scene.is-grey .pk-fin-bg, .pk-fin-scene.is-rain .pk-fin-bg { filter: grayscale(1) brightness(.85); }
.pk-fin-scene.is-dark .pk-fin-bg { filter: saturate(.6); }
.pk-fin-scene.is-wait .pk-fin-light, .pk-finale.is-wait .pk-fin-light { opacity: 0; animation: none; }
.pk-fin-say { margin: 0; width: 100%; text-align: left; animation: pk-fin-in .4s ease-out both; }
.pk-fin-skip { margin: 0; font-size: 15px; font-weight: 800; opacity: .78; }
body.advent .pk-fin-skip { color: var(--cream); }
@media (max-width: 430px) {
  main.page:has(.pk-finale) { min-height: calc(100svh - 64px); display: grid; align-items: center; }
  .pk-finale { gap: 10px; padding: 8px 0; }
  .pk-fin-scene { aspect-ratio: auto; height: min(56svh, 500px); max-height: none; }
}
@keyframes pk-fin-zoom { 0% { transform: scale(1); } 100% { transform: scale(1.05); } }
@keyframes pk-fin-glow { 0% { opacity: .45; transform: scale(.94); } 100% { opacity: .95; transform: scale(1.06); } }
@keyframes pk-fin-pulse { 0% { transform: translate(-50%, -50%) scale(.9); filter: brightness(1) drop-shadow(0 0 8px rgba(255, 236, 160, .6)); }
  100% { transform: translate(-50%, -50%) scale(1.14); filter: brightness(1.22) drop-shadow(0 0 16px rgba(255, 224, 120, .95)); } }
@keyframes pk-fin-hop { 0%, 100% { transform: translate(-50%, -50%); } 35% { transform: translate(-50%, calc(-50% - 16px)) scale(.96, 1.05) rotate(-4deg); }
  65% { transform: translate(-50%, calc(-50% - 8px)) rotate(4deg); } }
@keyframes pk-fin-walk { 0% { opacity: 0; transform: translate(calc(-50% - 44px), -50%) scale(.88); }
  30% { opacity: 1; transform: translate(calc(-50% - 20px), calc(-50% - 6px)); }
  65% { transform: translate(calc(-50% - 6px), -50%); } 100% { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes pk-fin-float { 0% { transform: translate(-50%, calc(-50% + 5px)) rotate(-3deg); } 100% { transform: translate(-50%, calc(-50% - 7px)) rotate(3deg); } }
@keyframes pk-fin-rise { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 28px)) scale(.75); }
  50% { opacity: 1; transform: translate(-50%, calc(-50% - 4px)) scale(1.06); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes pk-fin-drop { 0% { opacity: 0; transform: translate(-50%, -420%) rotate(-20deg); } 15% { opacity: 1; }
  80% { transform: translate(-50%, -40%) rotate(8deg); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } }
@keyframes pk-fin-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--px, 0%)), calc(-50% + var(--py, 0%))) scale(1); } }
@keyframes pk-fin-twinkle { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-40deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes pk-fin-grow { 0% { opacity: 0; transform: translate(-50%, -100%) scale(0); } 100% { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@keyframes pk-fin-rays { 0% { opacity: 0; scale: .3; } 100% { opacity: 1; scale: 1; } }
@keyframes pk-fin-spin { to { rotate: 360deg; } }
@keyframes pk-fin-rain { to { background-position: -16px 60px, 0 0; } }
@keyframes pk-fin-ring { 0%, 100% { scale: .92; } 50% { scale: 1.08; } }
@keyframes pk-fin-poke { 0%, 100% { translate: 6px 8px; } 50% { translate: 0 0; } }
@keyframes pk-fin-in { from { opacity: 0; translate: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .pk-fin-bg, .pk-fin-light, .pk-fin-mv, .pk-fin-tap, .pk-fin-finger, .pk-fin-say, .pk-fin-stage::after { animation: none !important; transition: none !important; } }
/* 넓은 화면(PC·패드 가로, 패드 세로)은 마지막 장면을 화면 높이에 맞춰 크게 (11/9 아이패드 검수: 폭 40% 로 위에만 작게 놓이고 아래가 비었음) */
@media (min-width: 760px) and (min-height: 700px) {
  .pk-finale { max-width: min(1000px, calc((100svh - 250px) * 4 / 3)); }
  .pk-fin-scene { max-height: none; }
}
/* 약속의 길 문에서 온 게임의 '약속 카드 받기' (ui.js JW.doorBack): 끝 화면 길이와 상관없이 늘 화면 아래 가운데 (11/9 아이패드 검수: 첫 화면 밖으로 밀려 안 보였음) */
.door-back { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; min-width: 220px; box-shadow: 0 6px 0 var(--gold-dark, #D9952A), 0 10px 24px rgba(0, 0, 0, .25); }
body:has(.door-back) { padding-bottom: 96px; }
