/* 같이 걷는 숲 — igan.kr 라벤더 파스텔 톤 */
:root {
  --lav-50: #F4F1FA; --lav-100: #EAE4F5; --lav-200: #DCD3F0; --lav-600: #574C86; --lav-900: #332B52;
  --text: #37324A; --text-sub: #6B647F;
  --panel: rgba(255, 255, 255, .86);
  --border: #E4DDF0;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "맑은 고딕", sans-serif;
  --vvh: 100dvh;   /* JS 가 visualViewport 높이로 덮어씀 */
  --vvt: 0px;      /* 키보드 때 iOS 가 밀어 올린 만큼 */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #F3EEF9; }
body { font-family: var(--font); color: var(--text); word-break: keep-all; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }

/* 카톡 인앱 등: 실제로 보이는 높이(visualViewport)에 맞춤. 기본은 100dvh */
#app { position: fixed; left: 0; right: 0; top: var(--vvt); height: 100%; height: var(--vvh); overflow: hidden; }
#scene { position: absolute; inset: 0; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#scene canvas { display: block; width: 100% !important; height: 100% !important; outline: none; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; padding: 7px 13px 6px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--text-sub); }
.brand-sub .brand-home { margin-left: 2px; }
.brand-title { font-size: 16px; font-weight: 700; color: var(--lav-900); letter-spacing: -.02em; }
.brand-home { font-size: 12px; color: var(--lav-600); text-decoration: none; }
.brand-home:hover { text-decoration: underline; }
.tools { display: flex; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 44px; height: 44px; padding: 0 11px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--lav-900);
  cursor: pointer;
}
.tool svg { width: 20px; height: 20px; fill: var(--lav-600); stroke: var(--lav-600); }
.tool:hover { background: #fff; }
.tool:focus-visible, .brand-home:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
#soundBtn .snd-on { display: none; }
#soundBtn[aria-pressed="true"] .snd-on { display: inline; }
#soundBtn[aria-pressed="true"] .snd-off { display: none; }

.hint, .toast {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 4;
  margin: 0; padding: 8px 16px; border-radius: 999px;
  background: rgba(51, 43, 82, .78); color: #fff; font-size: 14px; white-space: nowrap;
  pointer-events: none; transition: opacity .6s;
}
.hint { top: calc(92px + env(safe-area-inset-top)); }    /* 3-6b: 왼쪽 위 이름 상자(약 80px) 아래로 */
.toast { top: calc(132px + env(safe-area-inset-top)); }
.hint.is-fading, .toast.is-fading { opacity: 0; }

.overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(239, 232, 248, .55);
}
.overlay[hidden] { display: none; }
/* 입장 화면 — 뒤 캔버스의 3D 캐릭터가 보이도록 위는 비우고 아래 카드만 */
.entry { position: absolute; inset: 0; z-index: 10; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.entry[hidden] { display: none; }
.entry-head { text-align: center; padding-top: 44px; }
.entry-title { margin: 0; font-size: 28px; font-weight: 800; color: var(--lav-900); letter-spacing: -.02em; line-height: 1.25; }
.entry-sub { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--lav-600); letter-spacing: .02em; }
.pick-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--lav-900); }
.pick-label span { font-size: 12px; font-weight: 500; color: var(--text-sub); }
.entry-card { pointer-events: auto; width: 100%; max-width: 420px; margin: 0 auto; padding: 16px 16px 14px; background: rgba(255,255,255,.94); border-radius: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--lav-50); border-radius: 14px; margin-bottom: 14px; }
.seg-btn { height: 44px; font: inherit; font-size: 16px; font-weight: 700; color: var(--text-sub); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.seg-btn[aria-checked="true"] { background: #fff; color: var(--lav-900); box-shadow: 0 0 0 2px var(--lav-600) inset; }
.name-label { display: block; font-size: 14px; font-weight: 700; color: var(--lav-900); margin: 0 0 6px; }
.name-label span { font-weight: 500; color: var(--text-sub); }
.name-input { width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--text);   /* 16px: iOS 확대 방지 */
  background: #fff; border: 1.5px solid var(--lav-200); border-radius: 12px; }
.name-input::placeholder { color: #8C85A0; }
.name-input:focus { outline: none; border-color: var(--lav-600); }
.name-input[aria-invalid="true"] { border-color: #A0567A; }
.name-msg { min-height: 20px; margin: 6px 2px 8px; font-size: 13px; line-height: 1.5; color: #8E3F64; }
.enter-btn { width: 100%; height: 50px; font: inherit; font-size: 17px; font-weight: 700; color: #fff; background: var(--lav-600); border: 0; border-radius: 999px; cursor: pointer; }
.enter-btn:hover { background: #4A4074; }
.seg-btn:focus-visible, .enter-btn:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
#app.is-picking .tools, #app.is-picking .hint, #app.is-picking .brand-title, #app.is-picking .brand-sub-text { display: none; }
/* ---------- 소원 나무·리본 (3-2) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wish-btn { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 24px; font: inherit; font-size: 17px; font-weight: 700;
  color: #fff; background: var(--lav-600); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 6px 18px rgba(51,43,82,.25); }
.wish-btn[hidden] { display: none; }   /* display:inline-flex 가 hidden 속성을 이기지 않게 */
.wish-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wish-btn[aria-disabled="true"] { background: #8C85A0; }
.wish-btn:focus-visible { outline: 3px solid var(--lav-200); outline-offset: 2px; }
#app.is-picking .wish-btn { display: none; }
/* 아래에서 올라오는 카드 — #app 이 visualViewport 에 맞춰져 있어 키보드 위에 붙는다 */
.sheet-wrap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.sheet-wrap[hidden] { display: none; }
.sheet-wrap .sheet { pointer-events: auto; position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: 16px; background: rgba(255,255,255,.96); border-radius: 18px; text-align: left; box-shadow: 0 8px 28px rgba(51,43,82,.18); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.sheet-title { margin: 0; font-size: 18px; color: var(--lav-900); }
.sheet-title:focus { outline: none; }
.sheet-count { font-size: 13px; color: var(--text-sub); }
.sheet-input { width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1.5px solid var(--lav-200); border-radius: 12px; }
.sheet-input:focus { outline: none; border-color: var(--lav-600); }
.sheet-input[aria-invalid="true"] { border-color: #A0567A; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 0; margin: 12px 0 0; padding: 0; }
.swatch-legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--text-sub); }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-dot { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--lav-200); }
.sw input:checked + .sw-dot { box-shadow: 0 0 0 3px var(--lav-600); }
.sw input:focus-visible + .sw-dot { outline: 2px solid var(--lav-600); outline-offset: 3px; }
.sheet-msg { min-height: 20px; margin: 8px 2px; font-size: 13px; line-height: 1.5; color: #8E3F64; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn-main { display: flex; align-items: center; justify-content: center; height: 48px; font: inherit; font-size: 16px; font-weight: 700; color: #fff; background: var(--lav-600); border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; }
.btn-main:disabled { opacity: .6; cursor: wait; }
.btn-ghost { height: 48px; font: inherit; font-size: 15px; font-weight: 600; color: var(--lav-600); background: var(--lav-50); border: 0; border-radius: 999px; cursor: pointer; }
.btn-main:focus-visible, .btn-ghost:focus-visible, .cheer:focus-visible, .nav-btn:focus-visible, .view-close:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
.view-card { border-top: 6px solid var(--rc, var(--lav-200)); }
#ribbonView[data-color="lavender"] { --rc: #C3B4EA; } #ribbonView[data-color="pink"] { --rc: #F4BCD3; } #ribbonView[data-color="sky"] { --rc: #AFD3F2; }
#ribbonView[data-color="mint"] { --rc: #B9E3B5; } #ribbonView[data-color="butter"] { --rc: #F6DC92; }
.view-meta { margin: 0 32px 6px 0; font-size: 13px; color: var(--text-sub); }
.view-text { margin: 0 0 14px; font-size: 18px; line-height: 1.6; color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }
.view-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cheer { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; font: inherit; font-size: 15px; font-weight: 600; color: #8E3F64; background: #FBEEF3; border: 0; border-radius: 999px; cursor: pointer; }
.cheer svg { width: 20px; height: 20px; fill: none; stroke: #C2638C; stroke-width: 1.8; }
.cheer[aria-pressed="true"] svg { fill: #E58BB0; stroke: #C2638C; }
.view-nav { display: flex; align-items: center; gap: 4px; }
.nav-btn { width: 44px; height: 44px; font: inherit; font-size: 24px; line-height: 1; color: var(--lav-600); background: var(--lav-50); border: 0; border-radius: 50%; cursor: pointer; }
.view-pos { min-width: 52px; text-align: center; font-size: 12px; color: var(--text-sub); }
.view-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; font-size: 24px; color: var(--text-sub); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.care .sheet { border-top: 6px solid #E2D3F6; }
.care-lead { margin: 8px 0 10px; font-size: 15px; line-height: 1.65; color: var(--text); }
.care-list { margin: 0 0 14px; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text); }
.care-urgent { margin: 12px 0 10px; font-size: 14px; color: var(--lav-900); text-align: center; }
.care-close { width: 100%; }

/* ---------- 부기의 상담소 (3-3b 동굴 · 3-3c 찻집) ---------- */
/* 3-3d: 들어가기·이야기하기·나가기 모두 사이트 라벤더, 한 줄 */
.cabin-btn, .talk-btn, .exit-btn, .fire-btn, .board-btn { background: var(--lav-600); white-space: nowrap; }
.fire-btn.is-sitting { background: #fff; color: var(--lav-600); box-shadow: 0 6px 18px rgba(51,43,82,.18), inset 0 0 0 2px var(--lav-200); }
.fire-btn.is-sitting svg { stroke: var(--lav-600); }
.tea-only { display: none; }
#app.in-tea .tea-only { display: inline-flex; }
#app.in-tea #soundBtn { display: none; }
/* 이야기 창: 사불사 법당 frame-modal 과 같은 틀 (가운데 창, 뒤는 어둡게, 휴대폰은 화면 가득) */
.talk-modal { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(40, 32, 26, .55); padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.talk-modal[hidden] { display: none; }
.talk-sheet { box-sizing: border-box; width: 100%; max-width: 880px; height: min(86%, 940px); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; background: rgba(255,255,255,.97); }
.talk-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--border); min-height: 48px; }
.talk-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--lav-900); letter-spacing: .04em; white-space: nowrap; }
.talk-close { margin-left: auto; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--lav-900); display: grid; place-items: center; cursor: pointer; }
.talk-close:hover { background: var(--lav-50); }
.talk-close:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
.talk-body { position: relative; flex: 1; min-height: 0; }
.talk-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #FCFBFD; opacity: 0; transition: opacity .25s; }
.talk-body iframe.is-ready { opacity: 1; }
.talk-loading { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--lav-900); font-size: 15px; }
.talk-loading[hidden] { display: none; }
@media (max-width: 640px) { .talk-modal { padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px calc(env(safe-area-inset-bottom, 0px) + 8px); } .talk-sheet { height: 100%; border-radius: 14px; } }
/* 숲 ↔ 찻집 전환 */
.fade { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: #2E2620; opacity: 0; transition: opacity .3s; pointer-events: none; }
.fade.is-on { opacity: 1; pointer-events: auto; }
.fade[hidden] { display: none; }
.fade p { margin: 0; color: #FBEFD9; font-size: 16px; letter-spacing: .04em; }

/* 휴대폰에서 이름을 치는 중(html.kb): 제목·캐릭터 고르기를 접고, 입력칸+버튼 카드만 키보드 바로 위에.
   #app 은 visualViewport 에 맞춰져 있으므로 카드의 바닥 = 키보드 윗선 */
html.kb .entry { justify-content: flex-end; padding-bottom: 8px; }
html.kb .entry-head, html.kb .pick-label, html.kb .seg, html.kb .top, html.kb .wish-btn { display: none; }
html.kb .sheet-wrap { padding-bottom: 8px; }
html.kb .entry-card { padding-top: 12px; }
/* visualViewport 를 못 쓰는 오래된 인앱: 화면이 낮아지면(키보드) 제목을 접음 */
@media (max-height: 460px) { .entry-head { display: none; } .entry { justify-content: flex-end; } }

.loading { background: linear-gradient(#EFE8F8, #FFF7EA); }
.loading-box { text-align: center; color: var(--lav-900); font-size: 16px; }
.loading-box p { margin: 14px 0 0; }
.spinner { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--lav-200); border-top-color: var(--lav-600); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

@media (max-width: 360px) {
  .tool-label { display: none; }
  .brand-title { font-size: 15px; }
}

/* 알림판 공지 창 (3-4c) — 소원볼 보기 창과 같은 톤 */
.notice-card { border-top: 6px solid var(--lav-200); display: flex; flex-direction: column; max-height: min(70vh, 560px); max-height: min(calc(var(--vvh) - 24px - env(safe-area-inset-bottom)), 70vh, 560px); }
.notice-card .sheet-head { margin-right: 36px; }
.notice-state { margin: 4px 2px 12px; font-size: 15px; color: var(--text-sub); }
.notice-state[hidden] { display: none; }
.notice-list { list-style: none; margin: 0 -4px 12px; padding: 0 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.notice-list:empty { display: none; }
.notice-list:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; border-radius: 8px; }
.notice-item { padding: 12px 0; border-bottom: 1px solid var(--lav-50); }
.notice-item:first-child { padding-top: 2px; }
.notice-item:last-child { border-bottom: 0; }
.notice-title { margin: 0; font-size: 16px; line-height: 1.45; color: var(--lav-900); word-break: keep-all; overflow-wrap: anywhere; }
.notice-date { display: block; margin-top: 2px; font-size: 12px; color: var(--text-sub); }
.notice-body { margin: 8px 0 0; font-size: 15px; line-height: 1.65; color: var(--text); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.notice-done { width: 100%; flex: none; }

/* 알림판 운영자 (3-4d): 글쓰기·내리기·사진 */
.notice-img-btn { display: block; width: 100%; margin: 10px 0 0; padding: 0; background: var(--lav-50); border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.notice-img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; }
.notice-img-btn:focus-visible, .notice-del:focus-visible, .notice-logout:focus-visible, .notice-file-btn:focus-visible, .notice-preview-del:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
.notice-del { margin-top: 8px; min-height: 36px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; color: #8E3F64; background: #FBF0F5; border: 0; border-radius: 999px; cursor: pointer; }
.notice-del:disabled { opacity: .6; cursor: wait; }
.notice-admin { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; flex: none; }
.notice-admin[hidden] { display: none; }
.notice-write { flex: 1 1 auto; height: 44px; }
.notice-logout { flex: none; min-height: 44px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--text-sub); background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.notice-label { display: block; margin: 0 2px 6px; font-size: 14px; font-weight: 600; color: var(--lav-900); }
.notice-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.notice-row .notice-label { margin-bottom: 6px; }
.notice-form-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; margin: 0 -4px; padding: 0 4px 2px; }
.notice-textarea { height: auto; min-height: 112px; padding: 10px 14px; line-height: 1.6; resize: vertical; }
.notice-photo-pick { margin-top: 12px; }
.notice-file-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; }
.notice-preview { position: relative; margin-top: 8px; background: var(--lav-50); border-radius: 12px; overflow: hidden; }
.notice-preview[hidden] { display: none; }
.notice-preview img { display: block; width: 100%; max-height: 200px; object-fit: contain; }
.notice-preview-del { position: absolute; right: 8px; bottom: 8px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: rgba(51,43,82,.78); border: 0; border-radius: 999px; cursor: pointer; }
.notice-hint { margin: 8px 2px 0; font-size: 12px; line-height: 1.55; color: var(--text-sub); }
.notice-card > .sheet-msg, .notice-card > .sheet-actions { flex: none; }
.notice-photo { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(28,24,44,.88); cursor: zoom-out; }
.notice-photo[hidden] { display: none; }
.notice-photo img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.notice-photo-close { top: calc(8px + env(safe-area-inset-top)); color: #fff; background: rgba(255,255,255,.14); }

/* 알림판 상세 넘겨보기 (3-4e) */
.notice-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; flex: none; }
.notice-nav[hidden] { display: none; }
.notice-nav-btn { min-height: 40px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--lav-600); background: var(--lav-50); border: 0; border-radius: 999px; cursor: pointer; }
.notice-nav-btn:disabled { opacity: .4; cursor: default; }
.notice-nav-btn:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
.notice-pos { font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* ---------- 실시간 (3-5): 친구 수·이름표·말풍선·대화 ---------- */
.live-count { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--text-sub); }
.live-count[hidden] { display: none; }
.live-count b { color: var(--lav-900); font-weight: 700; }
#app.is-picking .live-count { display: none; }
.entry-note { margin: 10px 2px 0; font-size: 12px; line-height: 1.5; color: var(--text-sub); text-align: center; }
.people-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.people-layer[hidden] { display: none; }
#app.is-picking .people-layer { display: none; }
.ptag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform; }
.pname { pointer-events: auto; max-width: 120px; padding: 2px 8px; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--lav-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255,255,255,.82); border: 0; border-radius: 999px; box-shadow: 0 1px 4px rgba(51,43,82,.14); cursor: pointer; }
.pname:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 1px; }
.ptag.is-npc .pname { color: #4C6B45; background: rgba(240,250,236,.9); }
.ptag.is-me .pname { pointer-events: none; color: #7A5410; background: rgba(255,240,196,.95); box-shadow: 0 0 0 1.5px #E8C46A inset; }
.pbubble { max-width: 200px; padding: 7px 11px; font-size: 13.5px; line-height: 1.45; color: var(--text); background: #fff; border-radius: 14px; box-shadow: 0 3px 12px rgba(51,43,82,.18);
  word-break: keep-all; overflow-wrap: anywhere; text-align: center; position: relative; transition: opacity .7s; }
.pbubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: #fff; transform: rotate(45deg); }
.pbubble[hidden] { display: none; }
.pbubble.fade { opacity: 0; }
.ptag.is-npc .pbubble { background: #F6FBF3; } .ptag.is-npc .pbubble::after { background: #F6FBF3; }
#app.is-picking .chat-bar { display: none; }
.chat-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 11; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
.chat-bar[hidden] { display: none; }
.chat-row { display: flex; align-items: center; gap: 6px; max-width: 520px; margin: 0 auto; padding: 6px; background: rgba(255,255,255,.96); border-radius: 999px; box-shadow: 0 6px 20px rgba(51,43,82,.18); }
.chat-input { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--text); background: transparent; border: 0; }
.chat-input:focus { outline: none; }
.chat-count { flex: none; font-size: 11px; color: var(--text-sub); }
.chat-send { flex: none; height: 40px; padding: 0 16px; font: inherit; font-size: 15px; font-weight: 700; color: #fff; background: var(--lav-600); border: 0; border-radius: 999px; cursor: pointer; }
.chat-close { flex: none; width: 36px; height: 40px; font-size: 22px; color: var(--text-sub); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.chat-send:focus-visible, .chat-close:focus-visible, .tag-menu-btn:focus-visible, .tag-menu-close:focus-visible { outline: 2px solid var(--lav-600); outline-offset: 2px; }
.chat-msg { max-width: 520px; min-height: 0; margin: 4px auto 0; padding: 0 14px; font-size: 12.5px; color: #8E3F64; text-align: left; }
.chat-msg:empty { display: none; }
#app.chat-open .wish-btn { bottom: calc(84px + env(safe-area-inset-bottom)); }
.tag-menu { position: absolute; z-index: 14; min-width: 190px; max-width: 260px; padding: 12px 12px 10px; background: rgba(255,255,255,.97); border-radius: 14px; box-shadow: 0 8px 24px rgba(51,43,82,.2); }
.tag-menu[hidden] { display: none; }
.tag-menu-name { margin: 0 28px 2px 2px; font-size: 15px; font-weight: 700; color: var(--lav-900); word-break: keep-all; }
.tag-menu-note { margin: 0 2px 6px; font-size: 12px; color: #4C6B45; }
.tag-menu-note[hidden] { display: none; }
.tag-menu-btn { display: block; width: 100%; min-height: 40px; margin-top: 6px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--lav-600); background: var(--lav-50); border: 0; border-radius: 999px; cursor: pointer; }
.tag-menu-close { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; font-size: 20px; color: var(--text-sub); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.notice-settings { flex: none; height: 44px; padding: 0 14px; }
.settings-live { margin: 0 2px 8px; font-size: 13px; color: var(--text-sub); }
.settings-live:empty { display: none; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--lav-50); font-size: 15px; font-weight: 600; color: var(--lav-900); }
.settings-row small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-sub); }
.settings-num { flex: none; width: 76px; text-align: center; }
.sheet-msg.ok { color: var(--lav-600); }
/* 3-5b: 소원볼 익명 체크·입장 목도리 색 */
.anon-row { display: inline-flex; align-items: center; gap: 8px; margin: 12px 2px 0; min-height: 32px; font-size: 14px; color: var(--text); cursor: pointer; }
.anon-row[hidden] { display: none; }
.anon-row input { width: 18px; height: 18px; accent-color: var(--lav-600); }
.scarf-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; margin: 2px 0 10px; padding: 0; }
.scarf-pick legend { float: left; width: 100%; margin-bottom: 6px; }
.scarf-pick .sw-dot { width: 30px; height: 30px; }
html.kb .scarf-pick { display: none; }
/* 3-6b: 접속자 한 줄, 나가기 확인, 안내가 이름 상자와 안 겹치게 */
.live-count { white-space: nowrap; margin-top: 2px; }
.tool.arm { background: #F7E6EE; }
.tool.arm svg { stroke: #8E3F64; fill: none; }
#exitBtn svg { fill: none; }
/* 3-6c 인사하기 */
.tag-menu-btn[hidden] { display: none; }
.tag-menu-wave { color: #fff; background: var(--lav-600); }
.ptag.waving .pname { animation: wavePulse 1s ease-in-out 3; box-shadow: 0 0 0 3px #F4C76A; }
@keyframes wavePulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .ptag.waving .pname { animation: none; } }
