:root {
  --gold: #E9B942; --gold-light: #F7D979; --sky: #BCD6DF; --grass: #8B9472;
  --paper: #EDE2CD; --wood: #705443; --accent: #B96743;
  --ink: #3a2f28; --ink-soft: #6b5a4e;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --radius: 14px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #BCD6DF; color: var(--ink); overscroll-behavior: none; }
body { position: fixed; inset: 0; width: 100%; height: 100dvh; user-select: none; -webkit-user-select: none; touch-action: none; --kb: 0px; }
.panel, .panel *, .chat, .chat *, .overlay, .overlay *, .photo-modal, .paint-head, .paint-head * { touch-action: auto; }
.panel-body, .chat-log, .look-picker { touch-action: pan-y; }
.panel input, .panel textarea, .chat input, .entry-card input, .entry-card textarea { user-select: text; -webkit-user-select: text; }
button, input { font: inherit; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
/* (8판 11번) 감상 모드 엽서틀 미리보기: 게임 화면과 같은 크기·같은 픽셀 비율로 그려 저장 이미지와 위치·비율이 같음 */
.photo-frame-preview { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
body.frame-on .view-ui { bottom: max(calc(var(--frame-mb, 0px) + 8px), calc(18px + var(--sab))); } /* 엽서 틀 미리보기의 아래 여백 글자를 버튼이 가리지 않게 */
.hidden { display: none !important; }
.mobile-only { display: none; }
body.is-touch .mobile-only { display: inline-flex; }
body.is-touch .desktop-only { display: none; }

/* ---- 공통 버튼 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(112,84,67,.25);
  background: rgba(255,251,243,.92); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 15px;
  box-shadow: 0 2px 10px rgba(60,40,20,.08); transition: transform .08s, background .15s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--gold); border-color: #c9962a; color: #3a2a10; }
.btn.primary:hover { background: #f0c655; }
.btn.ghost { background: rgba(255,251,243,.6); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 18px; width: 100%; }
.btn.action { min-height: 48px; padding: 0 22px; font-size: 16px; background: rgba(255,251,243,.95); border-color: var(--accent); }
.btn.active { background: var(--gold); border-color: #c9962a; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(112,84,67,.2); background: rgba(255,251,243,.9);
  cursor: pointer; font-size: 19px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(60,40,20,.1);
}
.icon-btn.tiny { width: 28px; height: 28px; font-size: 13px; box-shadow: none; }

/* ---- 오버레이 ---- */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); z-index: 30; overflow: auto; touch-action: pan-y; }
/* 카드가 화면보다 길 때 위쪽이 잘리지 않게: 가운데 정렬은 margin:auto 로, 넘치면 오버레이 자체가 스크롤 */
#entry.overlay { align-items: flex-start; }
.entry-card {
  width: min(440px, 100%); margin: auto; background: rgba(237,226,205,.94); backdrop-filter: blur(8px); border-radius: 22px; padding: 26px 24px;
  box-shadow: 0 16px 50px rgba(50,35,15,.25); border: 1px solid rgba(255,255,255,.5);
}
.entry-head { margin: 0; }
.entry-grid { display: flex; flex-direction: column; gap: 10px; }
.entry-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.entry-side { min-width: 0; }
/* 추천 스타일 썸네일 한 줄 (첫 화면): 작은 아이콘 + 짧은 이름 */
.look-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.look-card.mini { width: auto; min-height: 54px; padding: 5px 2px; gap: 2px; }
.look-card.mini .ic { font-size: 20px; line-height: 1; }
.look-card.mini .lb { font-size: 11px; }
.entry-eyebrow { margin: 0; font-size: 13px; letter-spacing: .08em; color: var(--ink-soft); }
.entry-title { margin: 4px 0 6px; font-size: 38px; letter-spacing: -.02em; color: #4a371f; }
.entry-tagline { margin: 0 0 10px; font-size: 16px; color: #6b4f2a; font-weight: 600; }
.entry-desc { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
/* (11판 SEO) H1 '단종의 길 — 영월에서 만나는 단종 메타버스': 큰 제목 아래 줄에 부제 크기로 (예전 부제 자리) */
.entry-title-sub { display: block; margin-top: 4px; font-size: 16px; font-weight: 600; letter-spacing: 0; color: #6b4f2a; }
/* (11판 SEO) 게임 소개: 접힌 상태로 입장 버튼 아래에 한 줄. 펼치면 그림·장소·체험·이용 방법 */
.entry-about { margin-top: 14px; border-top: 1px solid rgba(112,84,67,.2); padding-top: 10px; }
.entry-about > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #6b4f2a; list-style: none; border-radius: 10px; padding: 0 6px; }
.entry-about > summary::-webkit-details-marker { display: none; }
.entry-about > summary::before { content: '▸'; font-size: 13px; transition: transform .15s; }
.entry-about[open] > summary::before { transform: rotate(90deg); }
.entry-about > summary:hover { background: rgba(255,253,248,.6); }
.entry-about > summary:focus-visible { outline: 3px solid #8C3B2E; outline-offset: 2px; }
.about-body { padding: 4px 4px 2px; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.about-body h2 { margin: 14px 0 4px; font-size: 14.5px; color: #4a371f; }
.about-body p { margin: 0 0 6px; }
.about-shot { margin: 6px 0 4px; }
.about-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #e3d8c0; }
.about-shot figcaption { margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.about-places { margin: 0; }
.about-places dt { margin-top: 6px; font-weight: 700; color: #4a371f; }
.about-places dd { margin: 0 0 2px; }
.about-how { margin: 0; padding-left: 18px; }
.about-how li { margin: 2px 0; }
.about-how b { margin-right: 4px; color: #4a371f; }
.about-start { margin: 12px 0 4px !important; }
.about-start .btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; text-decoration: none; }
.field span, .look-row span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field-row { display: flex; gap: 8px; min-width: 0; }
.field-row input { flex: 1 1 0; width: 100%; min-width: 0; box-sizing: border-box; min-height: 46px; border-radius: 12px; border: 1px solid rgba(112,84,67,.3); padding: 0 14px; font-size: 16px; background: #fffdf8; color: var(--ink); }
.look-block { margin: 14px 0; }
.look-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.look-head > span { font-size: 13px; color: var(--ink-soft); }
.look-head small { font-size: 11px; color: #9a8a76; }
.look-btns { display: flex; gap: 6px; }
.look-preview { position: relative; width: 100%; height: 200px; border-radius: 16px; background: linear-gradient(180deg, #dfe9ee 0%, #e9e2cf 70%, #d9ccb0 100%); overflow: hidden; touch-action: none; cursor: grab; }
.look-preview:active { cursor: grabbing; }
.look-canvas { width: 100% !important; height: 100% !important; display: block; }
/* PC 에서 세로가 낮은 창(노트북 768~900px): 미리보기·여백만 줄여 한 화면에 들어가게 (레이아웃은 기존 그대로). 기본 규칙 뒤에 두어야 적용됨 */
@media (min-width: 821px) and (max-height: 900px) and (pointer: fine) {
  .entry-card { padding: 20px 22px; }
  .entry-title { font-size: 32px; margin-bottom: 4px; }
  .entry-tagline { margin-bottom: 6px; }
  .entry-desc { margin-bottom: 10px; }
  .look-block { margin: 8px 0; }
  .look-preview { height: clamp(120px, 17dvh, 200px); }
}
.look-picker { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 0 0; touch-action: pan-y; }
.look-group-title { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.look-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.look-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; min-height: 64px; padding: 6px 4px; border-radius: 12px; border: 2px solid rgba(112,84,67,.22); background: #fffdf8; color: var(--ink); font-size: 11px; line-height: 1.2; cursor: pointer; }
.look-card .sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.look-card .lb { text-align: center; word-break: keep-all; }
.look-card .chk { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: #705443; color: #fff; font-size: 12px; line-height: 20px; text-align: center; display: none; }
.look-card.sel { border-color: #705443; box-shadow: 0 0 0 2px rgba(112,84,67,.25); background: #fff5df; }
.look-card.sel .chk { display: block; }
.icon-btn.active { background: #705443; color: #fff; box-shadow: 0 0 0 2px rgba(112,84,67,.35); }
.cam-hint { position: absolute; left: 50%; top: calc(64px + var(--sat)); transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(50,35,15,.6); color: #fff3d6; font-size: 12.5px; pointer-events: none; z-index: 12; transition: opacity .3s; }
.cam-hint.hidden { opacity: 0; }
#enter-btn { position: relative; overflow: hidden; margin-top: 4px; }
#enter-btn .enter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,.22); transition: width .25s ease-out; pointer-events: none; }
#enter-btn #enter-label { position: relative; }
#enter-btn.loading { opacity: .85; }
#enter-btn.retry { background: #a0564a; border-color: #a0564a; }
.entry-conn { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 12px; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.entry-conn .dot { flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #c9b89a; }
.entry-conn.online .dot { background: #6fa36b; }
.entry-conn.offline .dot { background: #d08a3c; }
.entry-conn.offline { color: #8a5a2a; }
.bar { height: 8px; background: rgba(112,84,67,.15); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .25s; }

/* ---- HUD ---- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; }
.hud > * { pointer-events: none; }
.hud button, .hud input, .hud .chat, .hud .joystick, .hud .chip { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; padding: calc(10px + var(--sat)) calc(10px + var(--sar)) 0 calc(10px + var(--sal)); gap: 8px; }
.hud-left, .hud-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(255,251,243,.88); font-size: 13px; box-shadow: 0 2px 8px rgba(60,40,20,.1); }
.chip.stats b { font-weight: 700; }
.chip.stats span { display: inline-flex; gap: 4px; }
.chip.conn .dot { width: 9px; height: 9px; border-radius: 50%; background: #c9b58f; }
.chip.conn.online .dot { background: #5fa868; }
.chip.conn.offline .dot { background: #d08a4a; }
.chip.conn.connecting .dot { background: #e2c25a; animation: pulse 1s infinite; }
.chip.conn.reconnecting .dot { background: #e0973f; animation: pulse .6s infinite; }
.chat.offline .chat-form input { background: #efe6d6; color: #8a7867; }
.chat.offline .chat-form button { opacity: .55; }
@keyframes pulse { 50% { opacity: .3; } }
.chip.zone { background: rgba(60,45,30,.55); color: #fff7e6; }
.hint { align-self: center; background: rgba(60,45,30,.55); color: #fff7e6; padding: 8px 14px; border-radius: 999px; font-size: 13px; max-width: 90%; text-align: center; }
.hud-bottom { position: relative; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); gap: 10px; min-height: 160px; }
.actions { position: absolute; left: 50%; bottom: calc(76px + var(--sab)); /* 개인 행동 줄(하단 중앙) 위 */ transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.actions .btn { pointer-events: auto; }
/* 개인 행동(책 보기·점프·큰 잎 들기): 화면 하단 중앙 고정. 조이스틱(왼쪽)·돋보기/대화 토글(오른쪽) 사이 */
.personal { position: absolute; left: 50%; bottom: calc(12px + var(--sab)); transform: translateX(-50%); display: flex; gap: 8px; z-index: 11; pointer-events: none; }
.personal .pbtn { pointer-events: auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 62px; height: 50px; padding: 0; border-radius: 16px; border: 1px solid rgba(112,84,67,.25); background: rgba(255,251,243,.92); color: var(--ink); cursor: pointer; box-shadow: 0 2px 10px rgba(60,40,20,.08); touch-action: manipulation; font-weight: 600; transition: transform .08s, background .15s; -webkit-user-select: none; user-select: none; }
.personal .pbtn .ic { font-size: 18px; line-height: 1; }
.personal .pbtn .lb { font-size: 10.5px; line-height: 1.1; white-space: nowrap; }
.personal .pbtn:hover { background: #fff; }
.personal .pbtn:active { transform: scale(.96); }
.personal .pbtn[aria-pressed="true"] { background: var(--gold); border-color: #c9962a; }
.personal .pbtn:disabled { opacity: .5; cursor: default; }
/* 모바일: 조이스틱(왼쪽 12+128px)과 돋보기(오른쪽 12+48px) 사이 빈 칸의 가운데에 둠 (겹침 없음) */
body.is-touch .personal { left: calc(150px + var(--sal)); right: calc(68px + var(--sar)); transform: none; justify-content: center; gap: 6px; }
/* 모바일 표시 크기 = 기존의 80% (52×48 → 42×38, 아이콘 18→14.4, 글자 10.5→8.4, 모서리 16→13). 터치 영역은 ::after 로 가로 48·세로 44px 확보:
   테두리 바깥 기준 좌우 3px 씩 = 버튼 간격 6px 과 정확히 맞닿아 이웃 버튼과 겹치지 않음 (::after 는 테두리 안쪽 기준이라 inset 에 테두리 1px 포함) */
body.is-touch .personal .pbtn { position: relative; width: 42px; height: 38px; gap: 1.5px; border-radius: 13px; }
body.is-touch .personal .pbtn::after { content: ''; position: absolute; inset: -4px; }
body.is-touch .personal .pbtn .ic { font-size: 14.4px; }
body.is-touch .personal .pbtn .lb { font-size: 8.4px; }
@media (max-width: 399px) { body.is-touch .personal { gap: 5px; } body.is-touch .personal .pbtn { width: 35px; height: 35px; border-radius: 50%; } body.is-touch .personal .pbtn::after { inset: -5.5px -3.5px; } /* 35×35 → 터치 40×44, 간격 5px 과 맞닿음 */ body.is-touch .personal .pbtn .lb { display: none; } body.is-touch .personal .pbtn .ic { font-size: 16px; } }
/* 모바일 모닥불 착석 중: 개인 행동 줄(책·점프·큰 잎)과 안내 배너를 display:none 으로 숨김 → 터치 영역도 남지 않음. 일어나면 클래스만 빠져 그대로 복원 */
body.is-touch.at-campfire .personal, body.is-touch.at-campfire .promo-banner { display: none !important; }
/* (11판 5번 검증) 휴대폰 망향탑·노산대 감상 중에는 아래쪽 감상 카드와 겹치므로 배너를 잠시 숨김 (감상을 끝내면 다시 보임, 닫은 상태와 별개) */
body.is-touch.vista-mode .promo-banner { display: none !important; }
/* (11판 2차 검증) 태블릿·휴대폰에서 물수제비 막대가 배너를 덮어 가림 → 물수제비를 하는 동안만 배너를 숨김 */
body.is-touch:has(#skip-ui:not(.hidden)) .promo-banner { display: none !important; }
body.is-touch.at-campfire .actions { gap: 6px; }
body.is-touch.at-campfire .actions .btn.action { min-height: 44px; padding: 0 16px; font-size: 15px; }
body.is-touch.at-campfire .actions .btn.small { padding: 0 12px; }
body.is-touch.at-campfire .hint { padding: 6px 12px; font-size: 12.5px; }
@media (max-height: 460px) { body.is-touch .personal { left: calc(126px + var(--sal)); right: calc(64px + var(--sar)); } }
.held-actions { display: flex; gap: 8px; }

/* 조이스틱 (왼쪽 아래 고정; 주변 36px 까지 터치 시작 허용은 input.js) */
.joystick { width: 128px; height: 128px; border-radius: 50%; background: rgba(255,251,243,.25); border: 2px solid rgba(255,251,243,.5); position: relative; touch-action: none; align-items: center; justify-content: center; flex: none; }
.joystick .stick { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,251,243,.85); box-shadow: 0 2px 8px rgba(0,0,0,.2); position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); }
body.is-touch .joystick { display: flex; }
/* 카메라 확대·축소 버튼 (오른쪽 아래, 조이스틱·상호작용 버튼·채팅과 겹치지 않는 세로 열) */
.zoom-ctrl { position: absolute; right: calc(12px + var(--sar)); bottom: calc(12px + var(--sab)); flex-direction: column; gap: 10px; z-index: 11; }
body.is-touch .zoom-ctrl { display: flex; }
.zoom-btn { position: relative; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid rgba(112,84,67,.25); background: rgba(255,251,243,.92); color: #4a371f; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(60,40,20,.12); touch-action: none; user-select: none; -webkit-user-select: none; pointer-events: auto; cursor: pointer; }
/* 돋보기 이모지 + 오른쪽 아래 작은 +/− 배지 (이모지가 없어도 배지와 접근성 이름으로 구분) */
.zoom-btn .zoom-emoji { font-size: 22px; line-height: 1; pointer-events: none; position: relative; left: -3px; top: -1px; }
.zoom-btn .zoom-sign { position: absolute; right: 5px; bottom: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #3a2a10; font-size: 15px; line-height: 18px; font-weight: 800; text-align: center; box-shadow: 0 0 0 2px rgba(255,251,243,.95); pointer-events: none; font-family: "Segoe UI", Roboto, Arial, sans-serif; }
.zoom-btn .zoom-sign.minus { background: #d9b57a; line-height: 17px; }
.zoom-btn.pressed, .zoom-btn:active { background: var(--gold); border-color: #c9962a; transform: scale(.96); }
.zoom-btn.pressed .zoom-sign, .zoom-btn:active .zoom-sign { background: #fff6dc; }
/* 지면 탭 위치 표시 (화면 좌표, 0.6초) */
.tap-ring { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 2px solid rgba(255,243,196,.95); box-shadow: 0 0 0 2px rgba(112,84,67,.25), 0 0 10px rgba(255,243,196,.6); pointer-events: none; z-index: 9; opacity: 0; }
.tap-ring.bad { border-color: rgba(220,120,90,.95); }
.tap-ring.play { animation: tapring .6s ease-out forwards; }
@keyframes tapring { 0% { transform: scale(.35); opacity: 1; } 70% { opacity: .8; } 100% { transform: scale(1.1); opacity: 0; } }
/* 모바일: 상호작용 버튼은 조이스틱·확대 버튼 띠 위쪽 가운데 (가로로 겹치지 않음), 글자가 길면 줄임 */
body.is-touch .actions { bottom: calc(156px + var(--sab)); max-width: min(72vw, 320px); }
body.is-touch .actions .btn { max-width: min(72vw, 320px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-touch .held-actions { flex-wrap: wrap; justify-content: center; }

/* 채팅 */
.chat { width: min(340px, 42vw); max-height: 44vh; display: flex; flex-direction: column; background: rgba(255,251,243,.86); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(60,40,20,.14); overflow: hidden; backdrop-filter: blur(6px); }
.chat.collapsed .chat-log, .chat.collapsed .chat-form { display: none; }
.chat.collapsed { width: auto; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 13px; font-weight: 700; color: var(--ink-soft); border-bottom: 1px solid rgba(112,84,67,.12); }
.chat-log { list-style: none; margin: 0; padding: 8px 10px; overflow-y: auto; flex: 1; font-size: 13.5px; line-height: 1.45; min-height: 90px; overscroll-behavior: contain; touch-action: pan-y; }
.chat-log li { margin: 2px 0; word-break: break-word; }
.chat-log li b { color: #7a5a2c; margin-right: 4px; cursor: pointer; }
.chat-log li.sys { color: #8a7867; font-style: italic; font-size: 12.5px; }
.chat-log li.me b { color: #4b6b3c; }
.chat-form { display: flex; gap: 6px; padding: 6px; border-top: 1px solid rgba(112,84,67,.12); }
.chat-form input { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid rgba(112,84,67,.25); padding: 0 10px; font-size: 16px; background: #fffdf8; min-width: 0; }

/* 대화창 펼치기(+) 버튼: 펼쳐진 상태·PC 에서는 숨김 */
.chat-expand { display: none; }
/* 모바일: 채팅을 하단 시트로 (키보드 높이 --kb 만큼 위로) */
body.is-touch .chat { position: absolute; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(8px + var(--sab) + var(--kb, 0px)); width: auto; max-height: 48dvh; display: none; z-index: 12; }
body.is-touch .chat.open { display: flex; animation: chatIn .18s ease-out; transition: bottom .18s ease-out, max-height .18s ease-out; }
@keyframes chatIn { from { opacity: 0; } to { opacity: 1; } }
body.is-touch .chat.switching { transition: none !important; } /* 토글 직후 한 프레임: bottom 전환 없이 바로 제자리 */
@media (prefers-reduced-motion: reduce) { body.is-touch .chat.open { animation: none; transition: none; } .tap-ring.play { animation-duration: .01s; } }
/* 접힘: 머리줄·본문·입력을 모두 숨기고 같은 자리(돋보기 버튼 위)에 48px 둥근 + 버튼만. 상자 자체는 크기가 없어 투명 영역이 터치를 가로막지 않음 */
body.is-touch .chat.collapsed { display: block; left: auto; right: calc(12px + var(--sar)); bottom: calc(var(--sab) + min(229px, 48dvh) - 42px); /* 펼친 시트(높이 min(229px,48dvh)) 오른쪽 위 토글(top 2px, 48px)과 같은 자리 */ width: 48px; height: 48px; max-height: none; background: none; box-shadow: none; backdrop-filter: none; border-radius: 50%; overflow: visible; pointer-events: none; }
body.is-touch .chat.collapsed .chat-head { display: none; }
body.is-touch .chat.collapsed .chat-expand { display: inline-flex; pointer-events: auto; }
.chat-expand { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(112,84,67,.25); background: rgba(255,251,243,.92); color: #4a371f; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(60,40,20,.12); cursor: pointer; touch-action: manipulation; padding: 0; }
.chat-expand .plus { font-size: 24px; line-height: 1; font-weight: 700; position: relative; top: -1px; }
.chat-expand .plus::before { content: '💬'; font-size: 13px; position: absolute; left: -17px; top: 5px; opacity: .85; }
.chat-expand .unread { position: absolute; top: 4px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: #d94646; border: 2px solid rgba(255,251,243,.95); }
.chat-expand:active { background: var(--gold); border-color: #c9962a; }
body.is-touch .chat .icon-btn.tiny { display: none; } /* 모바일은 떠 있는 토글(.chat-expand) 하나만 */
body.is-touch .chat.open:not(.collapsed) .chat-head { min-height: 52px; padding-right: 60px; box-sizing: border-box; }
body.is-touch .chat.open:not(.collapsed) .chat-expand { display: inline-flex; position: absolute; right: 4px; top: 2px; width: 48px; height: 48px; z-index: 2; }
body.is-touch .chat.open:not(.collapsed) .chat-expand .plus::before { content: none; }
body.is-touch .chat.open:not(.collapsed) { overflow: visible; height: min(229px, 48dvh); max-height: none; } /* 시트 높이 고정: 메시지가 쌓여도 토글 자리가 움직이지 않음(목록은 안에서 스크롤) */
body.is-touch .chat.open:not(.collapsed) .chat-log { flex: 1 1 auto; min-height: 0; }
body.is-touch.kbd-open .chat.open:not(.collapsed) { height: min(229px, 40dvh); }
body.is-touch .chat-form input { min-height: 44px; }
body.is-touch .chat-form .btn.small { min-height: 44px; padding: 0 14px; }
body.kbd-open .chat { max-height: 40dvh; }
body.is-touch .hud-bottom { min-height: 190px; }
/* 모바일 상단: 상태 칩·아이콘 버튼을 약 20~25% 작게(시각 크기), 터치 영역은 ::after 로 44px 유지. 오른쪽 그룹은 안전 영역 기준 우측 정렬 */
body.is-touch .hud-top { padding: calc(8px + var(--sat)) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); gap: 6px; }
body.is-touch .hud-left { gap: 6px; max-width: calc(100% - 128px); }
body.is-touch .hud-right { gap: 6px; justify-content: flex-end; max-width: 120px; row-gap: 8px; }
body.is-touch .chip { min-height: 29px; padding: 0 9px; font-size: 11.5px; gap: 6px; }
body.is-touch .chip.stats { padding: 0 8px; }
body.is-touch .chip.stats span { gap: 3px; }
body.is-touch .chip.stats .coin-ic { width: 13px; height: 13px; vertical-align: -2px; }
body.is-touch .chip.conn .dot { width: 8px; height: 8px; }
body.is-touch .hud-right .icon-btn { width: 35px; height: 35px; font-size: 15px; position: relative; }
body.is-touch .hud-right .icon-btn::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; } /* 44×44 터치 영역 (gap 6px + 5px 확장: 서로 겹치지 않음) */
body.is-touch .chip.zone { min-height: 26px; font-size: 11px; }
/* 모바일 터치 영역: 작은 보조 버튼도 최소 36~44px */
body.is-touch .gb-list .ops button { min-height: 36px; padding: 0 12px; font-size: 13px; }
body.is-touch .tab { min-height: 36px; padding: 6px 14px; }
body.is-touch .btn.small { min-height: 40px; }
body.is-touch .qty button { width: 44px; height: 44px; }
body.is-touch .qty input { min-height: 44px; }
body.is-touch .swatch { width: 44px; height: 44px; }
body.is-touch .gallery .g-item .ops button { min-height: 36px; }

/* 감상 모드 */
body.view-mode .hud, body.view-mode .nameplate { display: none !important; }
.view-exit { position: absolute; right: calc(12px + var(--sar)); bottom: calc(14px + var(--sab)); z-index: 20; }

/* ---- 패널 ---- */
.panel-root { position: absolute; inset: 0; z-index: 25; background: rgba(40,30,20,.28); display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); touch-action: none; }
.panel { width: min(520px, 100%); max-width: 100%; max-height: 100%; background: var(--paper); border-radius: 20px; box-shadow: 0 18px 50px rgba(40,25,10,.3); display: flex; flex-direction: column; overflow: hidden; touch-action: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 10px 18px; border-bottom: 1px solid rgba(112,84,67,.14); flex: none; }
.panel-head h3 { margin: 0; font-size: 18px; color: #4a371f; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .icon-btn { flex: none; }
.panel-body { padding: 14px 18px 18px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; font-size: 14px; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; -webkit-overflow-scrolling: touch; min-height: 0; }
.panel-body img, .panel-body canvas, .panel-body input, .panel-body textarea, .panel-body select { max-width: 100%; }
/* 모바일: 하단 시트. 안전 영역·키보드 높이(--kb)를 피하고, 내용이 길면 본문만 스크롤. 마지막 버튼이 가려지지 않게 아래 여백 */
body.is-touch .panel-root { align-items: flex-end; padding: calc(8px + var(--sat)) 0 0; padding-bottom: var(--kb, 0px); }
body.is-touch .panel { width: 100%; border-radius: 20px 20px 0 0; max-height: min(88dvh, calc(100dvh - var(--sat) - 8px)); }
body.is-touch .panel-body { padding: 12px 14px calc(22px + var(--sab)); font-size: 15px; }
body.is-touch .panel-head { padding: 10px 10px 8px 16px; }
body.kbd-open .panel { max-height: calc(100dvh - var(--kb, 0px) - var(--sat) - 8px); }
@media (max-height: 460px) { body.is-touch .panel { max-height: calc(100dvh - var(--sat) - 4px); } body.is-touch .panel-root { padding-top: calc(4px + var(--sat)); } body.is-touch .panel-body { padding-bottom: calc(14px + var(--sab)); } }
.panel-body h4 { margin: 14px 0 6px; font-size: 14px; color: var(--ink-soft); }
.panel-body p { margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
.menu-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,251,243,.7); border-radius: 12px; margin: 8px 0; }
.menu-item .name { font-weight: 700; }
.menu-item .desc { font-size: 12.5px; color: var(--ink-soft); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(112,84,67,.25); background: #fffdf8; font-size: 18px; cursor: pointer; }
.qty input { width: 64px; min-height: 40px; text-align: center; border-radius: 10px; border: 1px solid rgba(112,84,67,.25); font-size: 16px; }
.swatch-row { display: flex; gap: 8px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.active { border-color: #4a371f; }
.gb-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.gb-list li { background: rgba(255,251,243,.75); border-radius: 12px; padding: 10px 12px; }
.gb-list .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.gb-list .body { white-space: pre-wrap; word-break: break-word; }
.gb-list .ops { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.gb-list .ops button { font-size: 12px; min-height: 28px; padding: 0 8px; }
textarea.gb-input { width: 100%; min-height: 72px; border-radius: 12px; border: 1px solid rgba(112,84,67,.25); padding: 10px; font-size: 15px; resize: vertical; background: #fffdf8; }
.range { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.range input { flex: 1; min-width: 100px; }
.progress { height: 12px; background: rgba(112,84,67,.15); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #e07a3a, var(--gold)); transition: width .2s; }
.muted { color: var(--ink-soft); font-size: 12.5px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery img { width: 100%; border-radius: 8px; background: #fff; border: 1px solid rgba(112,84,67,.2); }
.gallery .g-item { display: flex; flex-direction: column; gap: 4px; }
.gallery .g-item .ops { display: flex; gap: 4px; }
.gallery .g-item .ops button { flex: 1; font-size: 11px; min-height: 28px; padding: 0 4px; }
.ctx-menu { position: absolute; z-index: 40; background: #fffdf8; border-radius: 12px; box-shadow: 0 8px 30px rgba(40,25,10,.25); padding: 6px; display: flex; flex-direction: column; min-width: 140px; }
.ctx-menu button { border: 0; background: none; padding: 10px 12px; text-align: left; cursor: pointer; border-radius: 8px; font-size: 14px; }
.ctx-menu button:hover { background: rgba(233,185,66,.25); }

/* ---- 그림 그리기 ---- */
.paint { position: absolute; inset: 0; z-index: 28; background: #e7dcc6; display: flex; flex-direction: column; padding-top: var(--sat); padding-bottom: var(--sab); }
.paint-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; background: rgba(255,251,243,.9); border-bottom: 1px solid rgba(112,84,67,.14); }
.paint-modes { display: flex; gap: 6px; }
.paint-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; max-width: 320px; }
.swatches .swatch { width: 28px; height: 28px; }
body.is-touch .swatches .swatch { width: 32px; height: 32px; }
.paint-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.paint-stage canvas { position: absolute; background: #fff; box-shadow: 0 6px 30px rgba(50,35,15,.25); touch-action: none; }
#paint-overlay { background: transparent; box-shadow: none; pointer-events: none; }

/* ---- 토스트 ---- */
.toasts { position: absolute; top: calc(64px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 35; pointer-events: none; align-items: center; width: 100%; }
.toast.squeezed { display: none; } /* (9판 3차) 아래 버튼까지 내려올 자리가 없을 때 잠시 숨김 */
.toast { background: rgba(60,45,30,.82); color: #fff7e6; padding: 10px 16px; border-radius: 999px; font-size: 14px; animation: toast .25s ease-out; max-width: 92%; text-align: center; }
.toast.good { background: rgba(80,120,70,.9); }
.toast.bad { background: rgba(160,70,50,.9); }
body.is-touch .toasts, body.is-touch .cam-hint { top: calc(98px + var(--sat)); } /* 모바일: 오른쪽 버튼 두 줄(8~86px) 아래에서 시작해 겹치지 않게 */
@keyframes toast { from { opacity: 0; transform: translateY(-8px); } }

/* 말풍선·이름표 (CSS2D 대체: DOM 라벨) */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.nameplate { position: absolute; transform: translate(-50%, -100%); font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; text-align: center; }
.nameplate .bubble { display: inline-block; background: rgba(255,251,243,.95); color: var(--ink); padding: 6px 10px; border-radius: 12px; font-size: 13px; max-width: 200px; white-space: normal; word-break: break-word; margin-bottom: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.15); text-shadow: none; }
.nameplate .bubble::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: rgba(255,251,243,.95); margin-top: 0; }
.nameplate .name { display: block; }
.nameplate.npc .name { color: #fff3d6; opacity: .95; }
.view-ui { position: absolute; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); display: flex; gap: 10px; z-index: 25; }
.view-ui.hidden { display: none; }
.photo-modal { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(30,22,12,.55); padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); }
.photo-modal.hidden { display: none; }
.photo-card { background: rgba(237,226,205,.97); border-radius: 18px; padding: 12px; max-width: min(92vw, 900px); max-height: 100%; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 50px rgba(50,35,15,.3); }
.photo-card img { max-width: 100%; max-height: calc(100dvh - 140px); border-radius: 12px; object-fit: contain; background: #000; }
.photo-ops { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.site-links a { color: #6b4f2a; font-weight: 600; text-decoration: underline; }
.donate { margin-top: 10px; padding: 14px 14px 12px; border-radius: 14px; background: linear-gradient(180deg, #fff6e3, #f5e6c8); border: 1px solid rgba(185,103,67,.25); }
.donate h4 { margin: 0 0 6px; }
.donate p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: #5b4630; }
.donate .acct { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13.5px; margin-bottom: 10px; }
.donate .acct b { color: #4a371f; }
.donate .acct-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.donate .acct-row input { flex: 1; min-width: 140px; min-height: 38px; border-radius: 10px; border: 1px solid rgba(112,84,67,.3); padding: 0 10px; font-size: 15px; letter-spacing: .04em; background: #fffdf8; color: var(--ink); }
.dialog-line { font-size: 15px; line-height: 1.6; padding: 12px 14px; border-radius: 14px; background: #fffbf3; border: 1px solid rgba(112,84,67,.18); margin-bottom: 10px; }
.dialog-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.nameplate.me .name { color: #ffe9a8; }

/* 넓은 화면: 입장 카드를 왼쪽에 두어 오른쪽으로 은행나무 전경이 보이게 */
@media (min-width: 960px) {
  #entry.overlay { justify-content: flex-start; padding-left: 7vw; }
}

/* 작은 화면 세로 */
@media (max-width: 480px) {
  .entry-card { padding: 20px 18px; }
  .look-preview { height: 168px; }
  .look-picker { max-height: 220px; }
  .look-card { width: 58px; }
  .entry-title { font-size: 32px; }
  .hint { font-size: 12px; }
  .paint-tools .btn { padding: 0 9px; font-size: 12px; }
}
/* 모바일 입장 화면: 키보드가 닫힌 상태에서 닉네임·스타일·입장 버튼이 한 화면(360×640 포함)에 들어오게.
   transform 축소나 overflow:hidden 으로 자르지 않고 글자·간격·미리보기 높이를 실제 화면 높이(dvh)에 맞춰 줄임. 접근성 글자 확대·아주 낮은 화면은 overlay 스크롤 허용 */
@media (max-width: 820px) and (pointer: coarse), (max-height: 760px) and (max-width: 820px) {
  .overlay { padding: calc(10px + var(--sat)) 12px calc(10px + var(--sab)); align-items: flex-start; }
  .entry-card { padding: 14px 14px 12px; border-radius: 18px; width: min(460px, 100%); margin: auto 0; }
  .entry-eyebrow { font-size: 11px; letter-spacing: .06em; }
  .entry-title { font-size: 26px; margin: 2px 0 2px; }
  .entry-title-sub { font-size: 13px; margin-top: 2px; }
  .entry-about { margin-top: 10px; padding-top: 6px; }
  .about-body { font-size: 13px; }
  .entry-tagline { font-size: 13px; margin: 0 0 6px; }
  .entry-desc { font-size: 12px; line-height: 1.45; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .field span, .look-head > span { font-size: 12px; margin-bottom: 4px; }
  .field-row input { min-height: 42px; font-size: 16px; padding: 0 12px; border-radius: 10px; }
  .field-row .btn.ghost { min-height: 42px; padding: 0 12px; }
  .look-block { margin: 0; }
  .look-head { margin-bottom: 6px; }
  .look-head .btn.small { min-height: 34px; padding: 0 10px; font-size: 12.5px; }
  .look-preview { height: clamp(96px, 17.6dvh, 152px); border-radius: 14px; } /* 20% 축소 */
  .look-picker { max-height: min(34dvh, 260px); margin-top: 8px; }
  .btn.big#enter-btn { min-height: 46px; font-size: 16px; }
  .loading { margin-top: 8px; }
  .loading p { margin: 6px 0 0; font-size: 12px; }
  .entry-conn { margin: 0 0 8px; font-size: 11.5px; line-height: 1.4; }
  .entry-foot { display: none; }
}
/* 아주 낮은 세로 화면(예: 360×640, 키보드 열림): 설명을 숨기고 미리보기를 더 줄임 */
@media (max-height: 660px) and (max-width: 820px) {
  .entry-desc { display: none; }
  .look-preview { height: clamp(88px, 16dvh, 120px); }
  .entry-tagline { display: none; }
  .entry-tagline.entry-subtitle { display: block; } /* 단종의 길: 부제는 낮은 화면에서도 유지 */
  .entry-conn { font-size: 11px; }
}
/* 가로 모드(낮은 높이·넓은 폭): 미리보기를 왼쪽, 닉네임·스타일·버튼을 오른쪽 */
@media (max-height: 520px) and (min-width: 560px) {
  .overlay { align-items: center; }
  .entry-card { width: min(680px, 100%); padding: 10px 14px; }
  .entry-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .entry-eyebrow { display: none; }
  .entry-title { font-size: 22px; margin: 0; }
  .entry-tagline { display: block; font-size: 12px; margin: 0; }
  .entry-desc { display: none; }
  .entry-grid { flex-direction: row; align-items: stretch; gap: 12px; margin-top: 6px; }
  .entry-side { flex: 0 0 38%; }
  .look-preview { height: 100%; min-height: 120px; max-height: 176px; }
  .entry-main { flex: 1; gap: 6px; }
  .look-picker { max-height: 120px; }
  .btn.big#enter-btn { min-height: 42px; font-size: 15px; }
  .entry-conn { margin: 0 0 4px; }
  .entry-foot { display: none; }
}
/* 가로 모드 낮은 높이 */
@media (max-height: 460px) {
  .entry-card { padding: 14px 18px; }
  .look-picker { max-height: 120px; }
  .entry-desc { display: none; }
  .entry-foot { display: none; }
  .hud-bottom { min-height: 120px; }
  body.is-touch .hud-bottom { min-height: 140px; }
  .joystick { width: 104px; height: 104px; }
  .zoom-btn { width: 44px; height: 44px; }
  .zoom-btn .zoom-emoji { font-size: 20px; }
  .zoom-btn .zoom-sign { width: 16px; height: 16px; font-size: 13px; line-height: 16px; right: 4px; bottom: 4px; }
  .zoom-ctrl { gap: 8px; }
  body.is-touch .actions { bottom: calc(118px + var(--sab)); }
  body.is-touch .chat.collapsed { bottom: calc(var(--sab) + min(229px, 48dvh) - 40px); width: 44px; height: 44px; }
  body.is-touch .chat-expand { width: 44px; height: 44px; }
  body.is-touch .chat.open:not(.collapsed) .chat-expand { width: 44px; height: 44px; right: 4px; top: 4px; } /* 접힌 + 버튼(right 12px) 과 같은 x */
  .chat { max-height: 60vh; }
  .hud-top { padding-top: calc(6px + var(--sat)); }
  .icon-btn { width: 44px; height: 44px; }
}

/* 가방 탭 · 가을 보물 */
.tabs { display: flex; gap: 6px; margin: 2px 0 10px; border-bottom: 1px solid rgba(112,84,67,.18); padding-bottom: 8px; flex-wrap: wrap; }
.tab { border: 1px solid rgba(112,84,67,.25); background: #fffdf8; color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.tab.sel { background: #705443; color: #fff; border-color: #705443; }
.progress { height: 8px; border-radius: 999px; background: rgba(112,84,67,.15); overflow: hidden; margin: 6px 0 10px; }
.progress .bar { height: 100%; background: linear-gradient(90deg, #e9b942, #d47a2a); border-radius: 999px; transition: width .3s; }
.treasure-row .ticon { font-size: 26px; width: 36px; text-align: center; flex: none; }
.treasure-row .grow { flex: 1; min-width: 0; }
.treasure-row.unknown { opacity: .75; }
.treasure-row.unknown .ticon { filter: grayscale(1) contrast(.3); }
#btn-photo-frame.on { background: #fff5df; border-color: #705443; }

/* 스타일 선택 카드 */
.look-card.style { width: 76px; min-height: 72px; }
.look-card.style.wide { width: calc(50% - 10px); min-height: 60px; }
.look-card .ic { font-size: 22px; line-height: 1; }
.look-card .sub { font-size: 10px; color: #9a8a76; text-align: center; word-break: keep-all; }
.look-card.dim { opacity: .45; }
.look-colors { margin-top: 2px; }
.look-colors summary { cursor: pointer; font-size: 12.5px; color: var(--ink-soft); padding: 6px 0; }
.look-colors .look-group { margin-top: 8px; }
.look-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
@media (max-width: 480px) { .look-card.style { width: 68px; } }
@media (max-width: 480px) and (min-height: 761px) and (pointer: fine) { .look-picker { max-height: 300px; } }
/* '자세히 고르기' 를 연 동안(모바일): 미리보기를 낮추고 선택 목록은 내부 스크롤 → 입장 버튼이 화면 안에 남음 */
@media (max-width: 820px) and (pointer: coarse), (max-height: 760px) and (max-width: 820px) {
  .entry-card.picking .look-preview { height: clamp(84px, 14dvh, 120px); }
  .entry-card.picking .look-presets { display: none; }
  .entry-card.picking .look-picker { max-height: min(30dvh, 230px); }
  .entry-card.picking .entry-desc, .entry-card.picking .entry-tagline { display: none; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .entry-card { padding: 8px 14px 6px; }
  .look-preview { max-height: 196px; }
  .entry-conn, .loading { margin-top: 2px; }
  .loading p { margin: 4px 0 0; font-size: 12px; }
  .entry-card.picking .look-picker { max-height: 110px; }
  .entry-card.picking .look-presets { display: none; }
}

.nameplate .badge { display: inline-block; font-size: 10px; line-height: 14px; background: rgba(112,84,67,.92); color: #fff; border-radius: 8px; padding: 0 6px; margin-right: 4px; vertical-align: 1px; text-shadow: none; }

/* 보리 안내 대화: 페이지 제목 · ‹ › 화살표 (터치 영역 44px) */
.dialog-topic { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 6px 2px; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dialog-nav { display: flex; align-items: center; gap: 6px; }
.dialog-arrow.icon-btn.tiny { width: 44px; height: 44px; font-size: 24px; line-height: 1; color: #4a371f; background: rgba(255,251,243,.95); border: 1px solid rgba(112,84,67,.25); box-shadow: none; }
.dialog-arrow.icon-btn.tiny span { position: relative; top: -2px; }
.dialog-arrow:active { background: #f1e3c6; }
/* 설정: 사이트 링크 한 줄 (좁으면 이 줄 안에서만 가로 스크롤) */
.site-row { display: flex; align-items: center; gap: 2px 6px; flex-wrap: wrap; white-space: nowrap; font-size: 14px; margin: 4px 0 2px; padding: 2px 0; } /* (11판 7번) 세 항목: 좁으면 줄을 바꿈 (예전 한 줄 가로 스크롤은 세 번째 항목이 화면 밖에 숨어 버림) */
.site-row::-webkit-scrollbar { display: none; }
.site-link { color: #6b4f2a; font-weight: 600; text-decoration: none; white-space: nowrap; padding: 7px 8px; border-radius: 10px; min-height: 36px; display: inline-flex; align-items: center; transition: background .15s; }
.site-link:hover { background: rgba(185,103,67,.12); text-decoration: underline; text-underline-offset: 3px; }
.site-link:active { background: rgba(185,103,67,.22); }
.site-sep { color: #b09a80; flex: none; }
.site-pin { font-size: 14px; flex: none; margin-left: 2px; }
@media (max-width: 480px) { .site-row { font-size: 13px; gap: 4px; } .site-link { padding: 7px 6px; } }
/* 안내도 */
.panel.map-panel { width: min(720px, 100%); }
.map-wrap { display: flex; gap: 14px; align-items: flex-start; }
.map-canvas-box { position: relative; flex: none; border-radius: 14px; overflow: hidden; border: 1px solid rgba(112,84,67,.25); box-shadow: inset 0 0 0 3px #f6ead0, inset 0 0 0 4px rgba(112,84,67,.2); max-width: 100%; }
.map-canvas { display: block; touch-action: none; max-width: 100%; }
.map-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(112,84,67,.3); background: rgba(255,251,243,.95); color: #4a371f; font-size: 20px; line-height: 1; cursor: pointer; }
body.is-touch .map-zoom button { width: 44px; height: 44px; }
.map-hint { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; color: #7a5f3e; background: rgba(255,251,243,.85); padding: 3px 8px; border-radius: 8px; pointer-events: none; }
body.is-touch .map-canvas-box { margin: 0 auto; max-width: 100%; }
body.is-touch .map-canvas { max-width: 100%; height: auto; }
.map-legend { flex: 1; min-width: 140px; font-size: 13px; line-height: 1.5; }
.map-legend-item { padding: 3px 0; }
.map-note { margin-top: 8px; }
.map-tip { position: absolute; transform: translate(-50%, -100%); background: rgba(255,251,243,.97); color: #4a371f; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); pointer-events: none; white-space: nowrap; }
.map-tip.hidden { display: none; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.map-portal { color: #6b4f2a; font-size: 13px; font-weight: 600; text-decoration: underline; padding: 8px 12px; margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; background: rgba(233,185,66,.18); }
body.is-touch .map-wrap { flex-direction: column; }
body.is-touch .map-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; width: 100%; }
body.is-touch .map-legend-item { min-height: 28px; }
body.is-touch .map-note { grid-column: 1 / -1; }

/* 가을 코인 아이콘 (SVG, 글자 크기에 맞춰 기준선 정렬) */
.coin-ic { width: 1.15em; height: 1.15em; vertical-align: -0.22em; display: inline-block; flex: none; }
.coin-ic.sm { width: 1em; height: 1em; vertical-align: -0.16em; }
.chip.stats .coin-ic { width: 16px; height: 16px; vertical-align: -3px; }
.coin-amount { display: inline-flex; align-items: center; gap: 4px; }
.coin-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.toast .coin-ic { vertical-align: -0.2em; }
.btn .coin-ic { margin-right: 2px; }
/* 설정: 긴 링크·이메일 줄바꿈 */
.site-links a, .donate p, .feedback-lead { overflow-wrap: anywhere; }

/* 설정: 의견 보내기 카드 (아이보리 배경·갈색 글자·둥근 모서리, 후원 카드와 같은 결) */
.feedback { padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, #fff9ec, #f7ecd6); border: 1px solid rgba(112,84,67,.18); }
.feedback-lead { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: #6b5440; }
.mail-row { display: flex; align-items: center; gap: 8px; }
.mail-row .mail-input { flex: 1; min-width: 0; min-height: 42px; border-radius: 12px; border: 1px solid rgba(112,84,67,.28); background: #fffdf8; color: #4a371f; font-size: 15px; font-weight: 600; letter-spacing: .01em; padding: 0 12px; cursor: pointer; text-overflow: ellipsis; transition: background .15s, border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.mail-row .mail-input:hover { background: #fff6e2; border-color: rgba(112,84,67,.45); }
.mail-row .mail-input:active, .mail-row .mail-input:focus { outline: none; background: #fbefd6; border-color: #a97c55; box-shadow: 0 0 0 3px rgba(169,124,85,.18); }
.copy-btn { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid rgba(112,84,67,.28); background: #fffdf8; color: #705443; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, transform .1s, border-color .15s; }
.copy-btn:hover { background: #fff6e2; border-color: rgba(112,84,67,.45); }
.copy-btn:active { background: #f1e3c6; transform: scale(.96); }
.feedback-hint { margin: 6px 0 0; font-size: 12.5px; color: #8a7867; min-height: 0; }
.feedback-hint:empty { display: none; }
@media (max-width: 480px) { .mail-row .mail-input { font-size: 14px; padding: 0 10px; } }
.donate .bank-line { white-space: nowrap; font-size: 14px; font-weight: 700; color: #4a371f; margin: 0 0 8px; }

/* 방명록: 신고 상태·사유 선택 */
.gb-list li .ops { display: flex; gap: 6px; align-items: center; }
.gb-list li .reported { font-size: 12px; color: #8a7867; }
.gb-warn { font-size: 12.5px; color: #a0564a; margin: 4px 0 0; }
.gb-warn:empty { display: none; }
.report-box { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #fff6e2; border: 1px solid rgba(185,103,67,.25); font-size: 13.5px; }
.report-box .reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 6px 0 8px; }
.report-box label { display: flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.report-box .row { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- 안내 배너 (PC: 우측 하단 반투명 / 모바일: 조이스틱·행동 버튼·돋보기 사이 하단 여백, 안전 영역 반영) ---- */
.promo-banner { position: fixed; right: calc(16px + var(--sar)); bottom: calc(16px + var(--sab)); z-index: 9; display: flex; align-items: center; gap: 0; padding: 0 28px 0 0; border-radius: 12px; background: rgba(255,251,243,.72); border: 1px solid rgba(112,84,67,.2); box-shadow: 0 2px 10px rgba(60,40,20,.08); color: var(--ink); font-size: 12.5px; line-height: 1.3; backdrop-filter: blur(4px); max-width: min(360px, calc(100vw - 32px)); }
.promo-banner.hidden { display: none; }
.promo-banner .promo-text { margin: 0; }
.promo-banner .promo-link { display: block; padding: 7px 4px 7px 11px; color: #8a5a2c; font-weight: 700; white-space: nowrap; text-decoration: none; border-radius: 12px 0 0 12px; touch-action: manipulation; }
.promo-banner .promo-link:hover { text-decoration: underline; }
.promo-banner .promo-close { position: absolute; right: 1px; top: 50%; margin-top: -13px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 18px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.promo-banner .promo-close:hover { background: rgba(112,84,67,.1); }
/* 모바일: 조이스틱·돋보기 사이 칸 안에서 내용 너비만큼 가운데 정렬 (짧아진 문구에 맞게 폭 축소) */
body.is-touch .promo-banner { left: calc(150px + var(--sal)); right: calc(68px + var(--sar)); bottom: calc(60px + var(--sab)); /* 축소된 행동 버튼 줄 위 약 10px (기존 간격 유지) */ width: fit-content; max-width: none; margin: 0 auto; padding: 0 26px 0 0; font-size: 11px; }
body.is-touch .promo-banner .promo-link { padding: 7px 3px 7px 9px; }
body.is-touch .promo-banner .promo-close { width: 26px; height: 26px; right: 0; }
@media (max-height: 460px) { body.is-touch .promo-banner { left: calc(126px + var(--sal)); right: calc(64px + var(--sar)); } }

/* ==================================================================
   단종의 길 테마 (2026-11-14): 옅은 한지색 바탕 · 먹색 글씨 · 절제된 가는 테두리
   위의 은행나무 아래 스타일을 덮어씀. 작은 본문은 읽기 쉬운 고딕을 유지하고, 제목·장소 이름만 명조.
   ================================================================== */
:root {
  --paper: #F4EEDF; --hanji: rgba(246,241,229,.95); --hanji-soft: rgba(246,241,229,.88);
  --ink: #26221f; --ink-soft: #5b544c; --line: rgba(38,34,31,.2);
  --gold: #B8935A; --gold-light: #D9C08F; --accent: #8C3B2E; --wood: #4a3426;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", "바탕", serif;
}
html, body { background: #C9D6D2; }
.btn { background: var(--hanji); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 4px rgba(30,25,20,.08); }
.btn:hover { background: #fbf8f0; }
.btn.primary { background: #2f2a26; border-color: #2f2a26; color: #f6f0e2; }
.btn.primary:hover { background: #3d3732; }
.btn.ghost { background: rgba(246,241,229,.7); }
.btn.action { background: var(--hanji); border-color: rgba(38,34,31,.45); border-radius: 10px; }
.btn.active { background: #2f2a26; border-color: #2f2a26; color: #f6f0e2; }
.icon-btn { background: var(--hanji-soft); border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(30,25,20,.1); }
.icon-btn.active { background: #2f2a26; color: #f6f0e2; box-shadow: none; }
.entry-card {
  background: linear-gradient(rgba(246,241,229,.95), rgba(242,236,222,.95)), repeating-linear-gradient(17deg, rgba(150,130,100,.05) 0 2px, transparent 2px 7px);
  border-radius: 14px; border: 1px solid rgba(38,34,31,.16); box-shadow: 0 12px 40px rgba(30,25,20,.22);
}
.entry-eyebrow { color: var(--ink-soft); letter-spacing: .3em; }
.entry-title { font-family: var(--serif); font-weight: 700; color: var(--ink); letter-spacing: .04em; }
.entry-tagline { font-family: var(--serif); color: #4a4038; font-weight: 600; }
.entry-desc { color: var(--ink-soft); }
.look-card { border-color: rgba(38,34,31,.12); border-radius: 10px; background: rgba(255,253,248,.7); }
.look-card.sel { border-color: #2f2a26; box-shadow: 0 0 0 2px rgba(38,34,31,.15); background: #fffdf6; }
.look-card .chk { background: #2f2a26; }
.chip { background: var(--hanji-soft); border: 1px solid rgba(38,34,31,.12); box-shadow: 0 1px 4px rgba(30,25,20,.08); color: var(--ink); }
.chip.zone { font-family: var(--serif); font-weight: 600; }
.chat { background: rgba(246,241,229,.88); border: 1px solid rgba(38,34,31,.12); border-radius: 12px; }
.panel { background: var(--paper); border-radius: 14px; border: 1px solid rgba(38,34,31,.16); }
.personal .pbtn { background: var(--hanji); border: 1px solid var(--line); border-radius: 12px; }
.personal .pbtn[aria-pressed="true"] { background: #2f2a26; border-color: #2f2a26; color: #f6f0e2; }
.toast { background: rgba(38,34,31,.85); color: #f6f0e2; border-radius: 10px; }
.toast.good { background: rgba(58,78,52,.9); }
.nameplate .bubble { background: rgba(250,246,236,.96); border: 1px solid rgba(38,34,31,.14); }
.nameplate .bubble::after { border-top-color: rgba(250,246,236,.96); }
.nameplate .badge { background: rgba(38,34,31,.82); }
.nameplate.npc .name { color: #f6f0e2; }
.zoom-btn .zoom-sign { background: #2f2a26; color: #f6f0e2; box-shadow: 0 0 0 2px rgba(246,241,229,.95); }
/* 장소 진입 표시 — (8판 2번) 가로로 펼친 두루마리: 한지색 바탕 · 먹색 글씨 · 양끝 나무 축(굴대)과 축머리. 장소 판정·노출 시간(3.1초)은 그대로
   위치: 화면 높이의 24% (여정 표시줄 아래). 표시줄이 그보다 길면(낮은 가로 화면) main.js showPlace 가 표시줄 바로 아래로 내림. 낮은 화면에서는 조금 작게 */
.place-banner { position: absolute; left: 50%; top: calc(24% + var(--sat)); transform: translateX(-50%); z-index: 12; pointer-events: none; text-align: center; color: #2a221c; opacity: 0;
  padding: 7px 30px 9px; min-width: 150px; max-width: calc(100vw - 72px); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(120,92,60,.10), rgba(120,92,60,0) 22%, rgba(120,92,60,0) 78%, rgba(120,92,60,.12)), linear-gradient(90deg, #ece0c2, #f6eedb 18%, #f8f1df 50%, #f4ead5 82%, #e9dcbc);
  border-top: 1px solid rgba(110,84,58,.55); border-bottom: 1px solid rgba(110,84,58,.55); box-shadow: 0 6px 16px rgba(30,22,14,.22); }
.place-banner::before, .place-banner::after { content: ''; position: absolute; top: -9px; bottom: -9px; width: 11px; border-radius: 5px;
  background: linear-gradient(90deg, #3a271a, #6b4a30 45%, #4a3222); box-shadow: 0 2px 4px rgba(20,14,8,.35); }
.place-banner::before { left: -6px; } .place-banner::after { right: -6px; }
.place-banner .pb-sub { display: block; font-size: 11px; letter-spacing: .5em; color: #6a5440; margin-bottom: 1px; padding-left: .5em; }
.place-banner .pb-name { display: block; font-family: var(--serif); font-size: clamp(24px, 4.4vw, 38px); font-weight: 700; letter-spacing: .2em; padding: 0 0 1px .2em; line-height: 1.2; white-space: nowrap; }
.place-banner .pb-name::after { content: ''; display: block; width: 46%; margin: 4px auto 0; border-top: 1px solid rgba(42,34,28,.45); } /* 먹선 한 줄 */
.place-banner.show { animation: place-in 3.1s ease-in-out forwards; }
@keyframes place-in { 0% { opacity: 0; transform: translate(-50%, 6px); } 14% { opacity: 1; transform: translate(-50%, 0); } 76% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .place-banner.show { animation: none; opacity: 1; } }
@media (max-height: 460px) { .place-banner { padding: 5px 24px 6px; } .place-banner .pb-name { font-size: 22px; } .place-banner .pb-sub { font-size: 10px; } .place-banner::before, .place-banner::after { top: -7px; bottom: -7px; width: 9px; } }
.look-card .hb-sw { display: inline-flex; flex-direction: column; align-items: center; gap: 0; }
.look-card .hb-sw i { display: block; width: 26px; height: 9px; border-radius: 4px 4px 1px 1px; border: 1px solid rgba(38,34,31,.25); }
.look-card .hb-sw i.chima { width: 30px; height: 13px; margin-top: -1px; border-radius: 1px 1px 9px 9px; }
.look-card .hb-sw i.baji { width: 24px; height: 13px; margin-top: -1px; border-radius: 1px; clip-path: polygon(0 0, 100% 0, 100% 100%, 58% 100%, 50% 35%, 42% 100%, 0 100%); }

/* ==================================================================
   기획 2판 (2026-11-14): 상단 여정 표시줄 · 장소 이동 · 안내도
   한지색 바탕 · 먹색 글씨 · 짙은 목재색 선 · 주홍(단종 표식·강조)은 절제해서. 장소 이름만 명조, 작은 글씨는 고딕
   ================================================================== */
:root { --vermilion: #b8432f; --vermilion-soft: rgba(184,67,47,.12); --wood-line: #5a4232; }
.journey { position: absolute; left: 50%; transform: translateX(-50%); top: calc(10px + var(--sat)); z-index: 6; pointer-events: auto;
  width: min(456px, calc(100vw - 520px)); min-width: 340px; padding: 6px 10px 6px; border-radius: 12px;
  background: linear-gradient(rgba(246,241,229,.94), rgba(242,236,222,.92)); border: 1px solid rgba(38,34,31,.18);
  box-shadow: 0 2px 10px rgba(30,25,20,.12), inset 0 0 0 3px rgba(246,241,229,.6), inset 0 0 0 4px rgba(90,66,50,.14); -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.journey .jr-track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 14px 0 0; list-style: none; }
.journey .jr-track::before { content: ''; position: absolute; left: 10%; right: 10%; top: 22px; height: 2px; background: repeating-linear-gradient(90deg, var(--wood-line) 0 6px, transparent 6px 10px); opacity: .55; }
.journey li { display: flex; justify-content: center; }
.journey .jr-stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 44px; min-height: 40px; padding: 0 2px 2px; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.journey .jr-dot { width: 12px; height: 12px; border-radius: 50%; background: #f6f1e5; border: 2px solid var(--wood-line); box-sizing: border-box; }
.journey .jr-name { font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: .02em; white-space: nowrap; line-height: 1.15; }
.journey .jr-me { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); display: none; font-size: 10px; font-weight: 700; color: #f6f1e5; background: #2f2a26; border-radius: 6px; padding: 0 4px; line-height: 14px; }
.journey .jr-stop.me .jr-me { display: block; }
.journey .jr-stop.me .jr-dot { background: #2f2a26; border-color: #2f2a26; box-shadow: 0 0 0 3px rgba(38,34,31,.16); }
.journey .jr-stop.me .jr-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.journey .jr-stop:hover .jr-name, .journey .jr-stop:focus-visible .jr-name { color: var(--vermilion); }
.journey .jr-stop:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; border-radius: 8px; }
.journey .jr-dj { position: absolute; top: 8px; left: 10%; width: 0; height: 0; pointer-events: none; transition: left .5s linear; }
.journey .jr-dj i { position: absolute; left: -7px; top: 0; width: 14px; height: 14px; background: var(--vermilion); border: 2px solid #f6f1e5; transform: rotate(45deg); box-shadow: 0 1px 3px rgba(30,25,20,.3); }
.journey .jr-dj em { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; color: var(--vermilion); white-space: nowrap; line-height: 12px; text-shadow: 0 0 3px #f6f1e5, 0 0 3px #f6f1e5; }
.journey .jr-dj.away i { opacity: .45; }
.journey .jr-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; padding-top: 4px; border-top: 1px solid rgba(38,34,31,.12); }
.journey .jr-status { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.journey .jr-time { flex: none; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.journey .jr-time.moving { font-weight: 600; color: var(--ink-soft); }
@media (max-width: 560px) { .journey .jr-status { display: none; } .journey .jr-time { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; } } /* 좁은 세로 화면: 시간 칩을 먼저 보이게 (단종 행동 문구는 대화창·지도에서 봄) */
.journey .jr-foot .jr-status { flex: 1 1 auto; min-width: 0; }
.journey.busy { opacity: .7; }
.journey button:disabled { cursor: progress; }
/* 좁은 화면: 표시줄을 상단 버튼 줄 아래로, 거의 화면 폭으로 */
@media (max-width: 1040px) { .journey { top: calc(56px + var(--sat)); width: min(456px, calc(100vw - 16px)); min-width: 0; } }
body.is-touch .journey { top: calc(50px + var(--sat)); width: min(456px, calc(100vw - 16px - var(--sal) - var(--sar))); padding: 4px 6px 5px; }
body.is-touch .journey .jr-name { font-size: 12px; }
body.is-touch .journey .jr-stop { min-height: 40px; }
body.is-touch #zone-chip { display: none !important; } /* 장소는 여정 표시줄이 보여 줌 */
body.is-touch .hud-right { max-width: 170px; flex-wrap: nowrap; }
body.is-touch .hud-left { max-width: calc(100% - 176px); }
@media (max-width: 359px) { body.is-touch .journey .jr-name { font-size: 11px; letter-spacing: -.02em; } }
/* 가로 화면(낮은 높이): 표시줄을 위쪽 가운데 한 줄로 낮게 */
@media (max-height: 460px) { body.is-touch .journey { top: calc(6px + var(--sat)); width: min(416px, calc(100vw - 2 * 180px)); padding: 2px 6px 3px; } body.is-touch .journey .jr-track { padding-top: 11px; } body.is-touch .journey .jr-foot { margin-top: 1px; padding-top: 2px; } body.is-touch .journey .jr-status { font-size: 11px; } }
/* 안내도 */
.map-side { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.map-status { margin: 0; font-size: 13px; font-weight: 600; color: var(--vermilion); }
.map-go { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.map-go-btn { min-height: 40px; border-radius: 8px; border: 1px solid rgba(38,34,31,.2); background: rgba(255,253,248,.8); color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 14px; cursor: pointer; }
.map-go-btn:hover { border-color: var(--wood-line); }
.map-go-btn.dj { grid-column: 1 / -1; font-family: inherit; font-size: 13px; border-color: var(--vermilion); background: var(--vermilion-soft); color: var(--vermilion); }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.map-key { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.map-key::before { content: ''; width: 10px; height: 10px; display: inline-block; }
.map-key.me::before { border-radius: 50%; background: #26221f; box-shadow: 0 0 0 2px #f6f1e5, 0 0 0 3px rgba(38,34,31,.3); }
.map-key.dj::before { background: var(--vermilion); transform: rotate(45deg); }
.map-note { flex-basis: 100%; margin: 2px 0 0; }
.map-tip { pointer-events: auto; display: flex; align-items: center; gap: 8px; background: rgba(246,241,229,.98); color: var(--ink); font-family: var(--serif); border: 1px solid rgba(38,34,31,.2); }
.map-tip .btn { font-family: inherit; }
.map-portal { color: var(--wood-line); background: rgba(90,66,50,.08); margin-left: 0; }
.map-foot { justify-content: flex-start; }
body.is-touch .map-go { grid-template-columns: repeat(3, 1fr); }
body.is-touch .map-go-btn { font-size: 13px; }
.site-exile { margin: 8px 0 0; }
.site-exile a { color: var(--wood-line); font-weight: 600; }
.panel-head h3 { font-family: var(--serif); color: var(--ink); letter-spacing: .02em; }

/* ===========================================================
   기획 4판 UI (2026-11-15): 체험 진행 막대 · 물수제비 · 감정 표현 · 동행록 · 이야기 카드 · 방 · 청령포 도착 · 도입
   같은 한지·먹·목재·주홍 테마, 터치 영역 44px 이상
   =========================================================== */
.act-progress { position: absolute; left: 50%; bottom: calc(132px + var(--sab)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--hanji); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 10px rgba(30,25,20,.12); z-index: 12; pointer-events: auto; font-weight: 600; font-size: 14px; }
.act-progress .act-bar { width: 120px; height: 8px; border-radius: 4px; background: rgba(38,34,31,.12); overflow: hidden; }
.act-progress .act-bar i { display: block; height: 100%; width: 0; background: var(--vermilion); border-radius: 4px; }
.act-progress .act-cancel { min-height: 44px; }
.skip-ui { position: absolute; left: 50%; bottom: calc(132px + var(--sab)); transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); padding: 12px 14px; background: var(--hanji); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 12px rgba(30,25,20,.16); z-index: 12; pointer-events: auto; }
/* (11판 2차 검증) 좁은 PC 창(1024px 등)에서 가운데 물수제비 막대가 왼쪽 아래 대화창과 겹침 → 대화창 오른쪽으로 비켜 둠 (넓은 창은 그대로 가운데) */
/* (11판 2차) 물수제비 창 자리는 features/skip.js placeUI 가 정함 (PC 작은 창에서 대화창을 피함) */
.skip-ui .skip-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.skip-ui .skip-track { position: relative; height: 18px; border-radius: 9px; background: linear-gradient(90deg, rgba(38,34,31,.1), rgba(184,67,47,.18) 40%, rgba(184,67,47,.35) 50%, rgba(184,67,47,.18) 60%, rgba(38,34,31,.1)); margin-bottom: 10px; }
.skip-ui .skip-mark { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--vermilion); }
.skip-ui .skip-needle { position: absolute; top: -4px; width: 10px; height: 26px; margin-left: -5px; border-radius: 4px; background: #26221f; }
.skip-ui .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.skip-ui .skip-throw { min-height: 48px; flex: 1; }
.emote-pop { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--hanji); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 10px rgba(30,25,20,.14); pointer-events: auto; }
.emote-pop .ebtn { min-height: 44px; min-width: 64px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fbf8f0; color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.emote-pop .ebtn:active { transform: scale(.96); }
body.is-touch .emote-pop { bottom: 50px; }
.icon-btn.pulse { animation: jrpulse 1.2s ease-out 1; }
@keyframes jrpulse { 0% { box-shadow: 0 0 0 0 rgba(184,67,47,.55); } 100% { box-shadow: 0 0 0 14px rgba(184,67,47,0); } }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 10px 0; }
.stamp { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; background: #fbf8f0; }
.stamp .stamp-seal { width: 58px; height: 58px; margin: 0 auto 6px; border-radius: 10px; border: 2px dashed rgba(38,34,31,.25); display: flex; align-items: center; justify-content: center; font-family: "Nanum Myeongjo", "Noto Serif KR", serif; font-weight: 700; color: rgba(38,34,31,.35); font-size: 14px; }
.stamp.on .stamp-seal { border: 2px solid var(--vermilion); color: #fff8ee; background: var(--vermilion); transform: rotate(-4deg); }
.stamp .stamp-name { font-weight: 700; }
.stamp .stamp-sub { font-size: 12px; }
.jr-list { list-style: none; padding: 0; margin: 10px 0; }
.jr-list li { padding: 9px 4px; border-bottom: 1px solid rgba(38,34,31,.08); font-size: 14px; opacity: .65; }
.jr-list li.on { opacity: 1; }
.card-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.card-item { text-align: left; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fbf8f0; color: var(--ink); cursor: pointer; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-item.on { border-color: rgba(184,67,47,.4); }
.card-kind { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.card-kind.kind-fact { color: #2f5a3e; } .card-kind.kind-lore { color: #8a4b18; } .card-kind.kind-game { color: #4a4f63; }
.card-text { font-size: 15px; line-height: 1.7; margin: 10px 0; user-select: text; -webkit-user-select: text; }
.card-src { margin: 4px 0 12px; padding-left: 18px; font-size: 13px; }
.card-src a, .site-exile a { color: #2f4a6b; }
.room-code { font-weight: 700; background: rgba(38,34,31,.07); padding: 2px 8px; border-radius: 6px; user-select: text; -webkit-user-select: text; }
.code-input { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; font-size: 15px; flex: 1; min-width: 0; }
.room-list { list-style: none; padding: 0; margin: 6px 0 12px; }
.room-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(38,34,31,.08); font-size: 14px; }
.room-list .btn { min-height: 44px; }
.stay-btns { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.stay-btns .btn { min-height: 48px; }
.intro-text { font-size: 16px; line-height: 1.8; font-family: "Nanum Myeongjo", "Noto Serif KR", serif; margin: 6px 0 12px; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.intro-nav .btn { min-height: 44px; }
.muted.small, p.small { font-size: 12.5px; }
.panel .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.view-ui { flex-wrap: wrap; justify-content: center; }
.view-ui .btn { min-height: 44px; }
/* 움직임 줄이기 */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
@media (prefers-reduced-motion: reduce) { .icon-btn.pulse { animation: none; } }
/* 키보드 포커스 표시 */
.btn:focus-visible, .icon-btn:focus-visible, .pbtn:focus-visible, .ebtn:focus-visible, .card-item:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }

/* 4판 모바일 상단 (4차 검증에서 수정): 동행록·방 버튼은 왼쪽 상태 칩 옆, 오른쪽은 지도·시점·감상·설정 4개. 좁은 화면에서는 상태 칩을 '● n명' 으로 줄임 */
.conn-n { display: none; }
body.is-touch .hud-left .icon-btn { width: 35px; height: 35px; font-size: 15px; position: relative; flex: none; }
body.is-touch .hud-left .icon-btn::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
body.is-touch .hud-left { max-width: calc(100% - 170px); flex-wrap: nowrap; }
@media (max-width: 760px), (max-height: 460px) { body.is-touch .chip.conn #conn-text { display: none; } body.is-touch .chip.conn .conn-n { display: inline; } body.is-touch .chip.conn { padding: 0 8px; } }
@media (max-width: 359px) { body.is-touch .chip.conn .conn-n { display: none; } body.is-touch .chip.conn { padding: 0 9px; } } /* 아주 좁은 화면: 점만 (인원은 👥 창) */
/* 터치 영역 44px 이 서로 겹치지 않게: 35px 버튼 + 간격 9px = 중심 간격 44px, ::after 4.5px 확장 */
body.is-touch .hud-left, body.is-touch .hud-right { gap: 9px; }
body.is-touch .hud-left .icon-btn::after, body.is-touch .hud-right .icon-btn::after { inset: -5.5px; } /* 테두리 안쪽 기준 33px + 11px = 44px */
body.is-touch .hud-right { max-width: 175px; }
body.is-touch .hud-left { max-width: calc(100% - 184px); }
body.is-touch .personal { gap: 9px !important; }
body.is-touch .personal .pbtn { flex: none; }
body.is-touch .personal .pbtn::after { inset: -5.5px !important; }
body.is-touch .journey .jr-stop { min-height: 44px; }
body.is-touch .skip-ui .btn, body.is-touch #skip-ui button { min-height: 44px; }
@media (max-height: 460px) { body.is-touch .chat.collapsed { bottom: calc(var(--sab) + min(229px, 48dvh) - 28px); } body.is-touch .journey { width: min(416px, calc(100vw - 2 * 190px)); } }
body.is-touch .emote-pop .ebtn { min-width: 58px; padding: 0 8px; font-size: 12.5px; }
@media (max-height: 460px) { /* 가로 화면: 한 줄짜리 낮은 창(막대 + 던지기 + 그만하기) → 물 위 장면을 덜 가림. 자리는 features/skip.js placeUI 가 정함 */
  .skip-ui { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; row-gap: 2px; padding: 6px 10px; }
  .skip-ui .skip-title { grid-column: 1 / -1; margin-bottom: 0; font-size: 12px; } .skip-ui .skip-track { margin-bottom: 0; } .skip-ui .row { gap: 6px; } .skip-ui .skip-throw { min-height: 40px; flex: none; padding: 0 14px; } }
/* (6판 7번) 물수제비 중: 이동 버튼 대신 조작 창만 — 개인 행동·상호작용 버튼·휴대폰 대화 접힘 단추를 잠시 숨김 (끝나면 그대로 돌아옴) */
body.skipping .personal, body.skipping #btn-interact, body.skipping #held-actions { visibility: hidden; }
body.skipping.is-touch .chat { visibility: hidden; }
body.skipping .joystick { opacity: 0.35; }
body.skipping .scroll-layer { visibility: hidden; } /* 두루마리 표식·카드가 물 위 장면을 가리지 않게 */
@media (max-width: 359px) { body.is-touch .personal { left: calc(130px + var(--sal)); right: calc(66px + var(--sar)); } } /* 320px 화면: 확대·축소 버튼과 터치 영역이 겹치지 않게 */
@media (max-height: 460px) { body.is-touch .journey .jr-foot { margin-top: 5px; } body.is-touch .journey { left: calc(150px + var(--sal)); right: calc(186px + var(--sar)); transform: none; width: auto; max-width: 416px; margin: 0 auto; } }
@media (max-height: 460px) and (max-width: 680px) { body.is-touch .journey { padding: 2px 4px 3px; } body.is-touch .journey .jr-name { font-size: 10.5px; letter-spacing: -.05em; } body.is-touch .journey .jr-stop { padding: 0; } } /* 좁은 가로 화면(568px): 다섯 장소 이름이 표시줄 안에 들어가게 */
/* 13개 항목 3번: 옷차림 미리보기의 앞·옆·뒤 버튼, 머리 모양 설명 */
.look-views { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; z-index: 2; } /* 오른쪽 위 구석: 가운데 선 사람(옷자락·다리)을 가리지 않게 */
.look-views .look-view { position: relative; min-height: 32px; min-width: 40px; padding: 0 8px; font-size: 13px; background: rgba(251,248,240,.92); }
.look-views .look-view::after { content: ''; position: absolute; inset: -6px -2px; } /* 누르는 영역은 44px 높이 */
.look-views .look-view[aria-pressed="true"] { background: #2f2a26; color: #f6f0e2; border-color: #2f2a26; }
.look-note { margin: 4px 2px 0; line-height: 1.45; }
/* 13개 항목 2번: 이름 입력 — [다른 이름] 버튼과 안내 */
.name-btn { min-width: 84px; white-space: nowrap; font-size: 14px; }
.name-hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; }

/* ---- (13개 항목 5번) 두루마리 안내: 장면 속 표식 · 지금 할 일 막대 · 가야 할 곳 표식 ---- */
.scroll-layer { position: absolute; inset: 0; pointer-events: none; }
.scroll-mark { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.scroll-mark > * { pointer-events: auto; }
.scroll-mark .sm-card { display: none; }
.scroll-mark.near .sm-card { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 6px)); display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px 10px; min-width: 132px; background: linear-gradient(180deg, #f7f0dd, #efe3c6); color: var(--ink); border-radius: 6px;
  border-top: 5px solid #3d2a1d; border-bottom: 5px solid #3d2a1d; box-shadow: 0 6px 18px rgba(20,15,10,.28); }
.scroll-mark .sm-kind { font-size: 12px; color: var(--ink-soft); letter-spacing: .08em; }
.scroll-mark .sm-name { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.scroll-mark .sm-btn { min-height: 44px; min-width: 112px; padding: 0 16px; border-radius: 8px; border: 1px solid #6e2a20; background: #8C3B2E; color: #fbf4e6;
  font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 2px 6px rgba(80,25,15,.25); }
.scroll-mark .sm-btn:active { transform: scale(.97); }
/* (11판 추가 2) 10판의 '눌러서 체험' 표(.sm-hint)는 없앰 — 두루마리를 직접 눌러 상자를 엶 (features/scrolls.js pickScreen) */
.scroll-mark .sm-close { position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid #3d2a1d; background: #f7f0dd; color: #3d2a1d;
  font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(20,15,10,.25); }
.scroll-mark .sm-close:hover { background: #efe3c6; }
.scroll-mark .sm-close:focus-visible { outline: 3px solid #8C3B2E; outline-offset: 1px; }
body.is-touch .scroll-mark .sm-close { width: 36px; height: 36px; top: -15px; right: -15px; font-size: 16px; }
/* (10판 3차) 터치 대상 44px 이상(기획 4절): 보이는 크기는 그대로 두고 누르는 자리만 둘레 4px 넓힘 */
body.is-touch .scroll-mark .sm-close::after { content: ''; position: absolute; inset: -4px; border-radius: 999px; }
/* (10판 3차) 빈 자리가 좁은 화면(휴대폰 가로 등)에서 누른 상자: 이름·단추·✕ 만 */
.scroll-mark.near.compact .sm-kind, .scroll-mark.near.compact .sm-meta, .scroll-mark.near.compact .sm-one { display: none; }
/* 작은 상자도 들어갈 자리가 없으면 표를 그대로 두고 '아래 단추로 시작' (같은 행동이 화면 아래 상호작용 단추에 있음) */
.scroll-mark .sm-hint-n { display: none; }
.scroll-mark.noroom .sm-hint-t { display: none; }
.scroll-mark.noroom .sm-hint-n { display: inline; }
.dock-prompt .sm-close { display: none; }
.flow-bar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 122px); z-index: 7; display: flex; align-items: center; gap: 10px;
  max-width: min(94vw, 560px); padding: 6px 8px 6px 12px; background: var(--hanji); border: 1px solid var(--line); border-radius: 10px;
  border-left: 5px solid #3d2a1d; border-right: 5px solid #3d2a1d; box-shadow: 0 4px 14px rgba(20,15,10,.18); pointer-events: auto; }
.flow-bar .fb-text { display: flex; flex-direction: column; min-width: 0; }
.flow-bar .fb-name { font-family: var(--serif); font-size: 13px; color: var(--accent); }
.flow-bar .fb-step { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; word-break: keep-all; }
.flow-bar .fb-stop { min-height: 44px; flex: none; }
.flow-target { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.flow-target > * { pointer-events: auto; }
.flow-target .ft-ring { position: absolute; left: 0; top: 0; width: 38px; height: 38px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid #8C3B2E;
  box-shadow: 0 0 0 3px rgba(251,244,230,.7); animation: ftPulse 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes ftPulse { 0%, 100% { transform: translate(-50%, -50%) scale(.85); opacity: .95; } 50% { transform: translate(-50%, -50%) scale(1.15); opacity: .6; } }
.flow-target .ft-where { position: absolute; left: 0; top: 0; transform: translate(-50%, -48px); white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: 15px;
  padding: 2px 10px; border-radius: 6px; background: rgba(38,34,31,.82); color: #fbf4e6; pointer-events: none; }
.flow-target .ft-where:empty { display: none; }
.flow-target .ft-btns { position: absolute; left: 0; top: 0; transform: translate(-50%, 28px); display: none; gap: 6px; }
.flow-target.near .ft-btns { display: flex; }
.flow-target .ft-btn { min-height: 48px; min-width: 128px; padding: 0 18px; border-radius: 10px; border: 1px solid #6e2a20; background: #8C3B2E; color: #fbf4e6; font-weight: 700; font-size: 17px; cursor: pointer; box-shadow: 0 3px 10px rgba(80,25,15,.3); }
.flow-target .ft-alt { min-height: 48px; }
.flow-target .ft-arrow { display: none; }
.flow-target.edge .ft-ring { width: 30px; height: 30px; animation: none; background: rgba(140,59,46,.85); }
.flow-target.edge .ft-arrow { display: block; position: absolute; left: 0; top: 0; width: 0; height: 0; margin: -8px 0 0 -8px; border: 8px solid transparent; border-left: 12px solid #fbf4e6; transform-origin: 8px 8px; pointer-events: none; }
.flow-target.edge .ft-where { transform: translate(-50%, -42px); font-size: 13px; }
.flow-target.edge .ft-btns { display: none; }
body.is-touch .flow-bar { top: calc(var(--sat) + 116px); }
@media (max-width: 560px) { .flow-bar .fb-step { font-size: 14px; } .flow-bar { gap: 6px; } }
.flow-target.dock .ft-ring, .flow-target.dock .ft-where { display: none; }
/* ---- (13개 항목 12번) 청령포 방명록 ---- */
.gb-panel .gb-intro { font-family: var(--serif); margin: 0 0 6px; line-height: 1.5; }
.gb-panel .gb-notice { margin: 0 0 10px; padding: 6px 10px; border-left: 4px solid var(--accent); background: rgba(140,59,46,.07); font-size: 14px; font-weight: 600; color: var(--ink); }
.gb-panel .gb-input { width: 100%; min-height: 72px; font-size: 16px; }
.gb-panel .gb-list li .meta b { font-family: var(--serif); }
.gb-panel .gb-time { color: var(--ink-soft); font-size: 13px; }
.flow-target .ft-btns { white-space: nowrap; }
.flow-target .ft-btn, .flow-target .ft-alt, .scroll-mark .sm-btn { white-space: nowrap; }
.flow-target .ft-alt { min-width: 104px; padding: 0 14px; font-size: 15px; }
body.is-touch .flow-target .ft-btns { flex-direction: column; align-items: center; }
.flow-bar { width: max-content; } /* 가운데 정렬(left 50%)에서 폭이 절반으로 줄어 줄바꿈이 많아지지 않게 */
body.is-touch .flow-bar .fb-stop { min-height: 44px; } /* 터치 화면의 작은 버튼 규칙(40px)보다 우선: [그만하기]도 44px */
/* 낮은 가로 화면(휴대폰 가로): 흐름 막대를 왼쪽 위 빈 칸(위 버튼 아래·조이스틱 위)에 세로로 → 가운데 상호작용 버튼·행동 버튼을 가리지 않음 (13개 항목 5번) */
.flow-bar.compact { left: calc(var(--sal, 0px) + 8px); top: calc(var(--sat, 0px) + 54px); transform: none; width: auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 8px; }
.flow-bar.compact .fb-icon { display: none; }
.flow-bar.compact .fb-name { font-size: 12px; }
.flow-bar.compact .fb-step { font-size: 13px; line-height: 1.35; }
body.is-touch .flow-bar.compact { top: calc(var(--sat, 0px) + 54px); }

/* (2026-11-16) 그림 완성 감상: 그림판 위에 잠깐 크게 보여 주고 저장·다운로드·계속 그리기 */
.paint-preview { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); background: rgba(40, 30, 20, .55); }
.paint-preview img { max-width: min(92vw, 900px); max-height: 62vh; width: auto; height: auto; border: 6px solid #fbf6ea; box-shadow: 0 8px 30px rgba(0,0,0,.35); background: #fff; }
.paint-preview p { color: #fbf6ea; margin: 0; text-align: center; max-width: 560px; }
.paint-preview .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#paint-fill.active, #paint-eraser.active { background: #4a371f; color: #fbf6ea; }
.jr-paint { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.jr-paint img { width: 120px; height: 90px; object-fit: cover; border: 3px solid #fbf6ea; box-shadow: 0 2px 8px rgba(0,0,0,.2); background: #fff; }
/* 이야기·출처 분류 (2026-11-16): 사료 기록 · 지역 전승 · 경관·유산 · 창작 체험 */
.card-kind.kind-record { color: #2f5a3e; } .card-kind.kind-heritage { color: #2f4f6a; } .card-kind.kind-creation { color: #4a4f63; }
.card-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.card-item .card-kind { margin-left: 6px; }
.card-one { font-weight: 700; margin: 6px 0; }
.card-meta { font-size: 13px; margin: 4px 0; }
.card-src li { margin: 6px 0; line-height: 1.35; }
/* (11판 마무리) 위쪽 여정 표시줄의 [일정] 단추·장소별 시각 펼침(.jr-more · .jr-sched · .js-*)과 '곁에 있음' 표시(.jr-join.near)는 없앰 */
/* (2026-11-16 RT) 두루마리 카드: 분류·시간·한 줄 뜻·[시작하기][이야기·출처] */
.scroll-mark .sm-meta { display: flex; gap: 6px; align-items: center; font-style: normal; }
.scroll-mark .sm-meta i { font-style: normal; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; background: rgba(38,34,31,.08); color: var(--ink-soft); white-space: nowrap; }
.scroll-mark .sm-meta .sm-cat.kind-creation { background: #efe6d4; color: #6b5536; }
.scroll-mark .sm-meta .sm-cat.kind-heritage { background: #e3ecdf; color: #3d5a36; }
.scroll-mark .sm-meta .sm-cat.kind-record { background: #f3dfd9; color: #7a2e22; }
.scroll-mark .sm-meta .sm-cat.kind-lore { background: #e6e0ef; color: #4e3e6b; }
.scroll-mark .sm-one { max-width: 230px; font-size: 12px; line-height: 1.45; color: var(--ink); text-align: center; }
.scroll-mark .sm-btns { display: flex; gap: 6px; align-items: center; }
.scroll-mark .sm-story { min-height: 44px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; flex: none; }
.scroll-mark.near .sm-card { width: 240px; box-sizing: border-box; }
@media (max-width: 560px) { .scroll-mark.near .sm-card { width: 216px; } .scroll-mark .sm-btn { min-width: 96px; } }
@media (max-width: 560px) { .scroll-mark .sm-one { max-width: 200px; font-size: 11.5px; } }
/* (11판 추가 1) 처음 들어왔을 때 짧은 안내 카드(.first-guide)는 없앰 — 캐릭터 생성 뒤 안내 창 없이 바로 입장 */
/* (2026-11-16 RL) 말풍선: 눌리지 않음(뒤의 땅·버튼 조작을 막지 않음), 위쪽 표시줄과 겹치면 숨김 */
.nameplate .bubble { pointer-events: none; }
.nameplate.under-hud .bubble { visibility: hidden; }
/* (7판 검증 t10) 휴대폰: [취소]는 최소 너비 44px */
.act-progress .act-cancel { min-width: 44px; }
/* (7판 검증 t10 2차) 휴대폰에서 '.btn.small' 40px 규칙이 [취소] 44px 를 덮어써 40px 였음 → 더 구체적인 규칙으로 44px */
body.is-touch .act-progress .act-cancel { min-height: 44px; }
/* 낮은 가로 화면(높이 293~460px): 체험 진행 막대가 위쪽 여정 표시줄을 덮었음 → 아래 단추·안내 띠 위(96px)로 내림 */
@media (max-height: 460px) { body.is-touch .act-progress { bottom: calc(96px + var(--sab)); } }
/* (9판 11번) 설정 → 음악 정보: 곡 제목 한 줄 + 출처 목록 (긴 주소도 칸 안에서 줄바꿈) */
.music-info-title { font-family: var(--serif); font-weight: 700; margin: 4px 0 2px; }
ul.music-info { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--ink); }
ul.music-info li { margin: 2px 0; overflow-wrap: anywhere; word-break: keep-all; }
ul.music-info a { color: var(--accent, #8C3B2E); text-decoration: underline; }
/* (11판 6번) 음악 정보: 출처 한 줄 (링크 2개: 이용허락·원문) */
.music-credit { margin: 4px 0 6px; font-size: 13px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; word-break: keep-all; }
.music-credit a { color: var(--accent, #8C3B2E); text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 2px 0; }
/* (9판 10번) 진행 중 행동 패널 하나 (예전 흐름 막대 자리): [이름·지금 단계·진행 막대·짧은 결과] [그만하기] / 아랫줄: 이 단계의 행동 단추(고르기 포함)
   격자: 긴 문장은 가운데 칸 안에서 줄바꿈, 단추가 많으면 아랫줄에서 줄바꿈 → 세로·가로 휴대폰에서 화면 밖으로 잘리지 않음. 글자 크기를 키워도 칸이 함께 늘어남 */
.flow-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon text stop" "acts acts acts"; align-items: center; column-gap: 10px; row-gap: 6px; }
.flow-bar .fb-icon { grid-area: icon; }
.flow-bar .fb-text { grid-area: text; }
.flow-bar .fb-stop { grid-area: stop; }
.flow-bar .fb-acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.flow-bar .fb-acts:empty { display: none; }
.flow-bar .fb-acts .btn { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.flow-bar .fb-acts .btn.primary { background: #8C3B2E; border-color: #6e2a20; color: #fbf4e6; }
.flow-bar .fb-prog { display: block; height: 6px; border-radius: 3px; background: rgba(38,34,31,.12); overflow: hidden; margin-top: 5px; max-width: 260px; }
.flow-bar .fb-prog i { display: block; height: 100%; width: 0; background: #8C3B2E; border-radius: 3px; transition: width .12s linear; }
.flow-bar .fb-note { display: block; font-size: 12.5px; line-height: 1.4; color: #3d5a36; margin-top: 3px; word-break: keep-all; }
.flow-bar .fb-prog.hidden, .flow-bar .fb-note.hidden { display: none; }
.flow-bar.compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "acts" "stop"; }
.flow-bar.compact .fb-acts { justify-content: stretch; }
.flow-bar.compact .fb-acts .btn { flex: 1 1 auto; min-height: 40px; padding: 0 10px; font-size: 14px; }
/* (9판 3차) 낮은 가로 화면: 행동 단추와 [그만하기]를 두 칸 격자로 (예: 평안·위로 / 그리움·그만하기) → 왼쪽 세로 패널이 조이스틱까지 내려오지 않음 */
.flow-bar.compact .fb-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.flow-bar.compact .fb-acts .btn { min-width: 0; padding: 0 2px; font-size: 13px; letter-spacing: -0.02em; }
.flow-bar.compact .fb-acts .fb-stop { min-height: 40px; flex: none; grid-area: auto; } /* 바깥 격자의 'stop' 칸 이름을 쓰지 않음 */
@media (max-width: 400px) { .flow-bar .fb-acts .btn { padding: 0 12px; font-size: 14px; } }
/* 가야 할 곳 표식은 고리·자리 이름만 (행동 단추는 행동 패널에) */
.flow-target .ft-btns { display: none !important; }
/* (9판 7번) 잔교 끝 '배 타기' 안내: 두루마리 카드와 같은 모양, 상태 문구는 짧게 */
.dock-prompt .sm-card { width: 236px; box-sizing: border-box; }
.dock-prompt .dp-status { max-width: 212px; font-size: 12.5px; line-height: 1.45; text-align: center; color: var(--ink); }
@media (max-width: 560px) { .dock-prompt .sm-card { width: 214px; } .dock-prompt .dp-status { font-size: 12px; } }
/* (9판 9번) 전망 감상: 아래 가운데 작은 두루마리 카드 (조이스틱·아래 단추는 감상 동안 숨김 → 겹치지 않음) */
body.vista-mode .hud, body.vista-mode .nameplate, body.vista-mode #btn-interact, body.vista-mode #joystick { display: none !important; }
.vista-ui { position: absolute; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); z-index: 25; width: min(92vw, 460px); pointer-events: auto; }
.vista-ui.hidden { display: none; }
.vista-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px 9px; background: linear-gradient(180deg, rgba(247,240,221,.96), rgba(239,227,198,.96)); color: var(--ink);
  border-radius: 6px; border-top: 5px solid #3d2a1d; border-bottom: 5px solid #3d2a1d; box-shadow: 0 6px 18px rgba(20,15,10,.28); text-align: center; }
.vista-kind { font-size: 11.5px; color: var(--ink-soft); letter-spacing: .06em; }
.vista-name { font-family: var(--serif); font-size: 18px; letter-spacing: .06em; }
.vista-line { margin: 0; font-size: 13px; line-height: 1.5; word-break: keep-all; }
.vista-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 2px; }
.vista-btns .btn { min-height: 44px; padding: 0 14px; }
.vista-btns .btn.primary { background: #8C3B2E; border-color: #6e2a20; color: #fbf4e6; }
.vista-hint { margin: 0; font-size: 11.5px; color: var(--ink-soft); }
@media (max-height: 460px) { .vista-line { font-size: 12px; } .vista-hint { display: none; } .vista-card { padding: 6px 10px 7px; } }
/* (9판 5번) 물수제비 막대 구역: 가운데(진할수록 멀리) · 양 끝 '퐁'(물가에 작게 빠짐) — 서버 규칙 q<0.2 와 같은 자리(막대 양 끝 13.6%) */
.skip-ui .skip-track { background: linear-gradient(90deg, rgba(90,110,120,.28) 0 13.6%, rgba(38,34,31,.08) 13.6% 30%, rgba(184,67,47,.22) 38%, rgba(184,67,47,.42) 50%, rgba(184,67,47,.22) 62%, rgba(38,34,31,.08) 70% 86.4%, rgba(90,110,120,.28) 86.4% 100%); }
.skip-ui .skip-zone { position: absolute; top: 0; bottom: 0; width: 13.6%; display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: #4b5a61; letter-spacing: .05em; pointer-events: none; }
.skip-ui .skip-zone.l { left: 0; } .skip-ui .skip-zone.r { right: 0; }

/* ==================================================================
   (11판 4번) 단종 위치 창: 다섯 장소 게이지 (11판 마무리: 옆의 작은 단추 '단종 곁으로'·'일정'을 모두 없애고, 그만큼 표시줄 폭을 줄임 — PC 540 → 456px,
   휴대폰 가로 최대 470 → 416px. 화면 폭이 좁으면 게이지가 남는 폭을 모두 씀)
   - 게이지 아래 상세 줄(상태 문구·시간 칩)은 없앰. 시간은 단종 마름모 위 짧은 카운트다운(출발/도착/재출발)으로 게이지 안에
   - 줄 구성(위→아래): 카운트다운(16px) · 나(장소 단추 위쪽 15px, 단추 안이라 누르는 자리도 넓어짐) · 점·선 · 장소 이름
   - 단순 배율(transform: scale) 축소가 아니라 여백·단추 높이를 줄여 실제 크기를 줄임 → 누르는 위치가 어긋나지 않음
   ================================================================== */
#journey { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 0; align-items: center; padding: 5px 8px; }
#journey .jr-gauge { min-width: 0; position: relative; }
#journey .jr-track { padding: 16px 0 0; }
#journey .jr-track::before { top: 37px; }                       /* 점 가운데 = 16 + 15 + 6 */
#journey .jr-stop { gap: 3px; min-height: 0; padding: 15px 1px 1px; }
#journey .jr-me { top: 1px; line-height: 13px; font-size: 9.5px; padding: 0 4px; }
#journey .jr-name { font-size: 13px; }
#journey .jr-dj { top: 0; }
#journey .jr-dj i { top: 30.5px; left: -6.5px; width: 13px; height: 13px; }
#journey .jr-dj .jr-cd { position: absolute; left: 0; top: 0; transform: translateX(-50%); display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; padding: 0 5px; border-radius: 7px; background: rgba(246,241,229,.9); line-height: 15px; box-shadow: 0 0 0 1px rgba(184,67,47,.18); }
#journey .jr-dj .jr-cd em { position: static; transform: none; font-style: normal; font-size: 10px; font-weight: 700; color: var(--vermilion); line-height: 15px; text-shadow: none; }
#journey .jr-dj .jr-cd b { font-size: 12px; font-weight: 800; color: var(--vermilion); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
#journey .jr-dj.moving .jr-cd b, #journey .jr-dj.prep .jr-cd b { font-weight: 700; color: #8f3524; }
/* 휴대폰: 장소 단추·작은 단추 모두 누르는 자리 44px 이상 (보이는 크기는 작게, ::after 로 넓힘) */
body.is-touch #journey { padding: 4px 6px; column-gap: 0; }
body.is-touch #journey .jr-stop { min-height: 44px; }
body.is-touch #journey .jr-name { font-size: 12px; letter-spacing: -.01em; }
@media (max-width: 380px) { body.is-touch #journey .jr-name { font-size: 11.5px; letter-spacing: -.03em; } }
@media (max-width: 359px) { body.is-touch #journey .jr-name { font-size: 11px; letter-spacing: -.04em; } body.is-touch #journey .jr-dj .jr-cd em { display: none; } }
@media (max-width: 560px) { #journey .jr-dj .jr-cd em { display: none; } }   /* 좁은 화면: 카운트다운만 (마름모 색·풍선 도움말로 단종) */
@media (max-height: 460px) {
  body.is-touch #journey { padding: 3px 6px; }
  body.is-touch #journey .jr-track { padding-top: 14px; }
  body.is-touch #journey .jr-track::before { top: 35px; }
  body.is-touch #journey .jr-dj i { top: 28.5px; }
  body.is-touch #journey .jr-dj .jr-cd { line-height: 14px; }
}

/* ==================================================================
   (11판 4번) 기능 안내창(두루마리 상자 · 잔교 배 타기 안내) 약 25% 축소
   - 여백·장식(위 '두루마리' 표제, 테 두께)·단추 높이를 먼저 줄이고, 글자는 크게 줄이지 않음(이름 16px · 설명 12px · 단추 14.5px)
   - 실제 상자 크기를 줄임(transform: scale 을 쓰지 않음 → 누르는 위치가 어긋나지 않음). 휴대폰 단추는 보이는 크기 38px + 둘레를 넓혀 누르는 자리 44px
   ================================================================== */
body .scroll-mark.near .sm-card { width: 216px; padding: 7px 10px 8px; gap: 3px; border-top-width: 4px; border-bottom-width: 4px; }
body .scroll-mark:not(.dock-prompt) .sm-kind { display: none; }                      /* 장식 표제 '두루마리' (상자가 두루마리 모양이라 겹치는 말) */
body .scroll-mark .sm-name { font-size: 16px; line-height: 1.2; }
body .scroll-mark .sm-meta i { font-size: 11px; padding: 0 6px; }
body .scroll-mark .sm-one { max-width: 196px; font-size: 12px; line-height: 1.4; }
body .scroll-mark .sm-btns { gap: 5px; }
body .scroll-mark .sm-btn { position: relative; min-height: 36px; min-width: 92px; padding: 0 12px; font-size: 14.5px; }
body .scroll-mark .sm-story { position: relative; min-height: 36px; padding: 0 8px; font-size: 12px; }
body .scroll-mark .sm-close { width: 26px; height: 26px; top: -11px; right: -11px; font-size: 13px; }
body .scroll-mark.dock-prompt .sm-card { width: 204px; }
body .scroll-mark.dock-prompt .sm-kind { font-size: 11px; }
body .scroll-mark .dp-status { max-width: 186px; font-size: 12px; }
@media (max-width: 560px) { body .scroll-mark.near .sm-card { width: 200px; } body .scroll-mark .sm-one { max-width: 182px; font-size: 11.5px; } body .scroll-mark .sm-btn { min-width: 84px; } body .scroll-mark.dock-prompt .sm-card { width: 188px; } body .scroll-mark .dp-status { max-width: 170px; font-size: 11.5px; } }
body.is-touch .scroll-mark .sm-btn, body.is-touch .scroll-mark .sm-story { min-height: 38px; }
body.is-touch .scroll-mark .sm-btn::after, body.is-touch .scroll-mark .sm-story::after { content: ''; position: absolute; left: -2px; right: -2px; top: -3px; bottom: -3px; }
body.is-touch .scroll-mark .sm-close { width: 32px; height: 32px; top: -13px; right: -13px; font-size: 15px; }
body.is-touch .scroll-mark .sm-close::after { inset: -6px; }
