: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; }
.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); }
.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; }
body.is-touch .personal .pbtn { width: 52px; height: 48px; }
@media (max-width: 399px) { body.is-touch .personal { gap: 5px; } body.is-touch .personal .pbtn { width: 44px; height: 44px; border-radius: 50%; } body.is-touch .personal .pbtn .lb { display: none; } body.is-touch .personal .pbtn .ic { font-size: 20px; } }
@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 { 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-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-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: 6px; flex-wrap: nowrap; white-space: nowrap; font-size: 14px; margin: 4px 0 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0; }
.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: 10px; padding: 8px 34px 8px 12px; 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; color: var(--ink-soft); }
.promo-banner .promo-link { color: #8a5a2c; font-weight: 700; white-space: nowrap; text-decoration: none; }
.promo-banner .promo-link:hover { text-decoration: underline; }
.promo-banner .promo-close { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; 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(66px + var(--sab)); flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 24px 6px 9px; font-size: 10.5px; max-width: none; word-break: keep-all; }
body.is-touch .promo-banner .promo-close { width: 26px; height: 26px; right: 0; top: 0; }
@media (max-height: 460px) { body.is-touch .promo-banner { left: calc(126px + var(--sal)); right: calc(64px + var(--sar)); } }
